Bug 98379

Summary: [GTK] accessibility/textarea-selected-text-range.html is failing
Product: WebKit Reporter: Zan Dobersek <zan>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: apinheiro, cfleizach, dmazzoni, jdiggs, mario, pnormand, webkit.review.bot
Priority: P2 Keywords: Gtk, LayoutTestFailure
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 98347    
Attachments:
Description Flags
Fixes the bug none

Description Zan Dobersek 2012-10-04 00:46:30 PDT
accessibility/textarea-selected-text-range.html is failing on all GTK platforms.
http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=%40ToT%20-%20webkit.org&tests=accessibility%2Ftextarea-selected-text-range.html
Comment 1 Joanmarie Diggs 2012-10-16 11:12:16 PDT
This one is failing because we need to implement our DRT's AccessibilityUIElement::selectedTextRange()

Putting this one on Piñeiro's plate.
Comment 2 Alejandro Piñeiro 2012-12-10 03:27:30 PST
(In reply to comment #1)
> This one is failing because we need to implement our DRT's AccessibilityUIElement::selectedTextRange()

After a quick look, this test is also using AccessibilityUIElement::setSelectedTextRange(), so I will implement both.

> 
> Putting this one on Piñeiro's plate.

Using WebkitGTK hackfest to catch it.
Comment 3 Alejandro Piñeiro 2012-12-12 11:36:47 PST
Created attachment 179091 [details]
Fixes the bug

In the end it was not only implement those DRT methods. Some of the ATK implementation methods were failing for the case of text areas (so making remove this test from the failure list more important). So in a short this bug:
  * Fixes ATK implementation case for text area
  * Update the atk unit test, in order to include text areas
  * Implement the DRT methods pointed by Joanie at comment 1
  * Remove the test from the failure list at TestExpectations
Comment 4 Build Bot 2012-12-12 14:43:06 PST
Comment on attachment 179091 [details]
Fixes the bug

Attachment 179091 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/15304147

New failing tests:
fast/frames/sandboxed-iframe-attribute-parsing.html
Comment 5 Alejandro Piñeiro 2012-12-13 02:43:27 PST
(In reply to comment #4)
> (From update of attachment 179091 [details])
> Attachment 179091 [details] did not pass mac-ews (mac):
> Output: http://queues.webkit.org/results/15304147
> 
> New failing tests:
> fast/frames/sandboxed-iframe-attribute-parsing.html

This is strange, because on my patch I didn't change anything related to WebCore accessibility. All my changes were related to the gtk port, and in the same way, the test failing is not related at all with selection.

Chris what do you think about this? Can be a false positive? Meanwhile I will set the commit-queue again to '?'.

Btw, Chris if you finally come here to give your opinion, could you review the patch? Thanks
Comment 6 Philippe Normand 2013-04-12 12:28:53 PDT
Chris, would you have time to review this patch?
Comment 7 chris fleizach 2013-04-12 12:38:57 PDT
Comment on attachment 179091 [details]
Fixes the bug

View in context: https://bugs.webkit.org/attachment.cgi?id=179091&action=review

> LayoutTests/ChangeLog:8
> +        * platform/gtk/TestExpectations: Removed textare-selected-text-range.html failure expectation.

missing "a" at the end of text area in
"textare-selected"

> Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp:510
> +    // siblings (e.g. multiline text) or text markers (e.g. list item's bullet)

I would rewrite this as

"The text content for TextAreas is already flattened so the startOffset is the same as the selectionStart.
Other elements must handle other sibling nodes and text markers."

> Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:806
> +    // WebKit atk implementation only supports one selection

use a period at the end of comments.
ATK should probably be capitalized

does anything support more than one selection? maybe the comment is not necessary

> Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:821
> +    atk_text_set_selection(ATK_TEXT(m_element), 0, location, location+length);

space before and after +
Comment 8 chris fleizach 2013-04-17 11:19:30 PDT
(In reply to comment #7)
> (From update of attachment 179091 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=179091&action=review
> 
> > LayoutTests/ChangeLog:8
> > +        * platform/gtk/TestExpectations: Removed textare-selected-text-range.html failure expectation.
> 
> missing "a" at the end of text area in
> "textare-selected"
> 
> > Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp:510
> > +    // siblings (e.g. multiline text) or text markers (e.g. list item's bullet)
> 
> I would rewrite this as
> 
> "The text content for TextAreas is already flattened so the startOffset is the same as the selectionStart.
> Other elements must handle other sibling nodes and text markers."
> 
> > Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:806
> > +    // WebKit atk implementation only supports one selection
> 
> use a period at the end of comments.
> ATK should probably be capitalized
> 
> does anything support more than one selection? maybe the comment is not necessary
> 
> > Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:821
> > +    atk_text_set_selection(ATK_TEXT(m_element), 0, location, location+length);
> 
> space before and after +
otherwise things seem ok
Comment 9 Mario Sanchez Prada 2013-10-21 02:03:53 PDT
Comment on attachment 179091 [details]
Fixes the bug

Clearing r? so it does not appear in webkit.org/pending-review.

API, do you want to give it another try? If that's the case, bear in mind that getSelectionOffsetsForObject() has changed recently, so this original patch won't apply cleanly.
Comment 10 Alejandro Piñeiro 2013-10-21 03:46:14 PDT
(In reply to comment #9)
> (From update of attachment 179091 [details])
> Clearing r? so it does not appear in webkit.org/pending-review.
> 
> API, do you want to give it another try? If that's the case, bear in mind that getSelectionOffsetsForObject() has changed recently, so this original patch won't apply cleanly.

Well, I also need to update the patch due Chris's review. In any case thanks for the update. FWIW, probably I would not be able to work on this until next webkitgtk hackfest, and seems a good bug to start with.
Comment 11 Mario Sanchez Prada 2013-11-01 04:46:46 PDT
(In reply to comment #10)
> (In reply to comment #9)
> > (From update of attachment 179091 [details] [details])
> > Clearing r? so it does not appear in webkit.org/pending-review.
> > 
> > API, do you want to give it another try? If that's the case, bear in mind that getSelectionOffsetsForObject() has changed recently, so this original patch won't apply cleanly.
> 
> Well, I also need to update the patch due Chris's review. In any case thanks 
> for the update. FWIW, probably I would not be able to work on this until next 
> webkitgtk hackfest, and seems a good bug to start with.

It seems that in the end all we needed to fix this at this point was to provide the implementation for DRT and WKTR, which has been done as part of bug 112016.

So resolving.

*** This bug has been marked as a duplicate of bug 112016 ***