Bug 115491 - Add "VisibleOnly" key to search predicate
Summary: Add "VisibleOnly" key to search predicate
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.8
: P2 Normal
Assignee: Greg Hughes
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-01 15:38 PDT by Greg Hughes
Modified: 2013-06-04 12:22 PDT (History)
16 users (show)

See Also:


Attachments
Patch 13623364.1 (45.08 KB, patch)
2013-05-01 15:59 PDT, Greg Hughes
eflews.bot: commit-queue-
Details | Formatted Diff | Diff
patch 13623364.2 (47.58 KB, patch)
2013-05-01 17:17 PDT, Greg Hughes
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-05 for mac-mountainlion (537.27 KB, application/zip)
2013-05-02 01:25 PDT, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-04 for mac-mountainlion (491.75 KB, application/zip)
2013-05-02 02:24 PDT, Build Bot
no flags Details
13623364.3 patch v3 (51.22 KB, patch)
2013-05-13 13:29 PDT, Greg Hughes
eflews.bot: owner-
Details | Formatted Diff | Diff
Patch v4 (51.22 KB, patch)
2013-05-13 13:33 PDT, Greg Hughes
webkit-ews: owner-
Details | Formatted Diff | Diff
Patch v5, now with layout tests (51.18 KB, patch)
2013-05-14 15:30 PDT, Greg Hughes
no flags Details | Formatted Diff | Diff
Patch v 5.1 (51.18 KB, application/octet-stream)
2013-05-17 12:52 PDT, Greg Hughes
no flags Details
Patch v 5.2 (51.18 KB, patch)
2013-05-17 12:53 PDT, Greg Hughes
no flags Details | Formatted Diff | Diff
Patch v6 (51.19 KB, application/octet-stream)
2013-05-22 15:08 PDT, Greg Hughes
no flags Details
Patch v6.1 (51.19 KB, patch)
2013-05-22 15:08 PDT, Greg Hughes
no flags Details | Formatted Diff | Diff
Patch v7 (51.19 KB, patch)
2013-05-22 15:17 PDT, Greg Hughes
no flags Details | Formatted Diff | Diff
Patch v8 (51.19 KB, patch)
2013-05-28 11:57 PDT, Greg Hughes
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Hughes 2013-05-01 15:38:52 PDT
For assistive products it would be much more effecient if the search predicate accepted a "visibleOnly" key with a boolean so that the search was limited to items that were scrolled into view.

Without this, clients need to constantly ask for the "next" object checking if it is visible. On large pages this can mean tens of thoughts of isVisible requests.
Comment 1 Greg Hughes 2013-05-01 15:55:24 PDT
<rdar://13623364>
Comment 2 Greg Hughes 2013-05-01 15:59:13 PDT
Created attachment 200247 [details]
Patch 13623364.1
Comment 3 Greg Hughes 2013-05-01 16:07:27 PDT
Found a problem with my first patch, working on another
Comment 4 EFL EWS Bot 2013-05-01 16:08:07 PDT
Comment on attachment 200247 [details]
Patch 13623364.1

Attachment 200247 [details] did not pass efl-ews (efl):
Output: http://webkit-queues.appspot.com/results/377118
Comment 5 EFL EWS Bot 2013-05-01 16:09:46 PDT
Comment on attachment 200247 [details]
Patch 13623364.1

Attachment 200247 [details] did not pass efl-wk2-ews (efl-wk2):
Output: http://webkit-queues.appspot.com/results/370127
Comment 6 Build Bot 2013-05-01 16:32:09 PDT
Comment on attachment 200247 [details]
Patch 13623364.1

Attachment 200247 [details] did not pass win-ews (win):
Output: http://webkit-queues.appspot.com/results/353157
Comment 7 Greg Hughes 2013-05-01 17:17:27 PDT
Created attachment 200257 [details]
patch 13623364.2
Comment 8 Build Bot 2013-05-02 01:25:32 PDT
Comment on attachment 200257 [details]
patch 13623364.2

Attachment 200257 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/392060

New failing tests:
platform/mac/accessibility/search-when-element-starts-in-table.html
platform/mac/accessibility/attributed-string-includes-highlighting.html
platform/mac/accessibility/search-predicate.html
Comment 9 Build Bot 2013-05-02 01:25:34 PDT
Created attachment 200303 [details]
Archive of layout-test-results from webkit-ews-05 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-05  Port: mac-mountainlion  Platform: Mac OS X 10.8.2
Comment 10 Build Bot 2013-05-02 02:24:15 PDT
Comment on attachment 200257 [details]
patch 13623364.2

Attachment 200257 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/360108

New failing tests:
platform/mac/accessibility/search-when-element-starts-in-table.html
platform/mac/accessibility/attributed-string-includes-highlighting.html
platform/mac/accessibility/search-predicate.html
Comment 11 Build Bot 2013-05-02 02:24:17 PDT
Created attachment 200305 [details]
Archive of layout-test-results from webkit-ews-04 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-04  Port: mac-mountainlion  Platform: Mac OS X 10.8.2
Comment 12 Greg Hughes 2013-05-13 13:29:41 PDT
Created attachment 201625 [details]
13623364.3 patch v3
Comment 13 EFL EWS Bot 2013-05-13 13:33:52 PDT
Comment on attachment 201625 [details]
13623364.3 patch v3

Attachment 201625 [details] did not pass efl-wk2-ews (efl-wk2):
Output: http://webkit-queues.appspot.com/results/451895
Comment 14 Greg Hughes 2013-05-13 13:33:59 PDT
Created attachment 201627 [details]
Patch v4
Comment 15 Early Warning System Bot 2013-05-13 13:43:04 PDT
Comment on attachment 201627 [details]
Patch v4

Attachment 201627 [details] did not pass qt-ews (qt):
Output: http://webkit-queues.appspot.com/results/464389
Comment 16 EFL EWS Bot 2013-05-13 13:43:44 PDT
Comment on attachment 201627 [details]
Patch v4

Attachment 201627 [details] did not pass efl-wk2-ews (efl-wk2):
Output: http://webkit-queues.appspot.com/results/375883
Comment 17 EFL EWS Bot 2013-05-13 13:45:10 PDT
Comment on attachment 201627 [details]
Patch v4

Attachment 201627 [details] did not pass efl-ews (efl):
Output: http://webkit-queues.appspot.com/results/346896
Comment 18 Early Warning System Bot 2013-05-13 13:45:44 PDT
Comment on attachment 201627 [details]
Patch v4

Attachment 201627 [details] did not pass qt-wk2-ews (qt-wk2):
Output: http://webkit-queues.appspot.com/results/466353
Comment 19 Build Bot 2013-05-13 14:11:32 PDT
Comment on attachment 201627 [details]
Patch v4

Attachment 201627 [details] did not pass win-ews (win):
Output: http://webkit-queues.appspot.com/results/427960
Comment 20 Build Bot 2013-05-13 14:12:51 PDT
Comment on attachment 201627 [details]
Patch v4

Attachment 201627 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/464390
Comment 21 kov's GTK+ EWS bot 2013-05-13 14:29:40 PDT
Comment on attachment 201627 [details]
Patch v4

Attachment 201627 [details] did not pass gtk-ews (gtk):
Output: http://webkit-queues.appspot.com/results/460837
Comment 22 Build Bot 2013-05-13 17:58:10 PDT
Comment on attachment 201627 [details]
Patch v4

Attachment 201627 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/471001
Comment 23 Greg Hughes 2013-05-14 15:30:46 PDT
Created attachment 201766 [details]
Patch v5, now with layout tests
Comment 24 Greg Hughes 2013-05-17 12:52:33 PDT
Created attachment 202136 [details]
Patch v 5.1
Comment 25 Greg Hughes 2013-05-17 12:53:07 PDT
Created attachment 202137 [details]
Patch v 5.2
Comment 26 chris fleizach 2013-05-20 23:46:15 PDT
Comment on attachment 202137 [details]
Patch v 5.2

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

in the isOnscreen() method I think you can iterate through the parent objects just once and check whether the bounds of the object are within each parent

> Source/WebCore/accessibility/AccessibilityObject.cpp:1733
> +    // Search up the parent chain and create a vector of all scrollable parent objects

Comments should explain why you need to do this (instead of explaining what you're doing)

> Source/WebCore/accessibility/AccessibilityObject.cpp:1738
> +    for (AccessibilityObject* parentObject = this->parentObject(); parentObject; parentObject = parentObject->parentObject()) {

i think you can start the for loop with this, so that you don't have to append this before hand

> Source/WebCore/accessibility/AccessibilityObject.cpp:1743
> +    objects.reverse();

you should iterate from count -> 0 instead of incurring the cost to reverse

> Source/WebCore/accessibility/AccessibilityObject.cpp:1746
> +    // visible bounds of the outer object

comments should end in a period

> Source/WebCore/accessibility/AccessibilityObject.cpp:1752
> +        const IntRect innerRect = pixelSnappedIntRect(inner->isAccessibilityScrollView() ? inner->parentObject()->boundingBoxRect() : inner->boundingBoxRect());

is there a need for using pixelSnappedIntRect?

> Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm:921
> +        [parameter setObject:[NSNumber numberWithBool:true] forKey:@"AXVisibleOnly"];    

you should use YES instead of true here

> Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:931
> +        [parameter setObject:[NSNumber numberWithBool:true] forKey:@"AXVisibleOnly"];    

you should use YES instead of true
Comment 27 Greg Hughes 2013-05-22 13:54:41 PDT
(In reply to comment #26)
> (From update of attachment 202137 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=202137&action=review
> 
> in the isOnscreen() method I think you can iterate through the parent objects just once and check whether the bounds of the object are within each parent

No, because in each check you need to check the current scroll view to the next scroll view, that is why the first loop goes through to find all of the scroll views. The code is much more readable this way rather than in one look try to do both tasks.

> 
> > Source/WebCore/accessibility/AccessibilityObject.cpp:1733
> > +    // Search up the parent chain and create a vector of all scrollable parent objects
> 
> Comments should explain why you need to do this (instead of explaining what you're doing)

OK

> 
> > Source/WebCore/accessibility/AccessibilityObject.cpp:1738
> > +    for (AccessibilityObject* parentObject = this->parentObject(); parentObject; parentObject = parentObject->parentObject()) {
> 
> i think you can start the for loop with this, so that you don't have to append this before hand

No, because we need “this", and then every scrollable view in our stack of objects, that is why “this” is added first to the stack. I will clarify in the comment.

> 
> > Source/WebCore/accessibility/AccessibilityObject.cpp:1743
> > +    objects.reverse();
> 
> you should iterate from count -> 0 instead of incurring the cost to reverse
Ok

> 
> > Source/WebCore/accessibility/AccessibilityObject.cpp:1746
> > +    // visible bounds of the outer object
> 
> comments should end in a period

OK

> 
> > Source/WebCore/accessibility/AccessibilityObject.cpp:1752
> > +        const IntRect innerRect = pixelSnappedIntRect(inner->isAccessibilityScrollView() ? inner->parentObject()->boundingBoxRect() : inner->boundingBoxRect());
> 
> is there a need for using pixelSnappedIntRect?

Yes, because we want to know if it is onscreen so we have to snap to pixels

> 
> > Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm:921
> > +        [parameter setObject:[NSNumber numberWithBool:true] forKey:@"AXVisibleOnly"];    
> 
> you should use YES instead of true here
OK

> 
> > Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:931
> > +        [parameter setObject:[NSNumber numberWithBool:true] forKey:@"AXVisibleOnly"];    
> 
> you should use YES instead of true
OK
Comment 28 Greg Hughes 2013-05-22 15:08:11 PDT
Created attachment 202625 [details]
Patch v6
Comment 29 Greg Hughes 2013-05-22 15:08:34 PDT
Created attachment 202626 [details]
Patch v6.1
Comment 30 WebKit Commit Bot 2013-05-22 15:12:44 PDT
Attachment 202626 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/platform/mac/accessibility/attributed-string-includes-highlighting.html', u'LayoutTests/platform/mac/accessibility/search-predicate-expected.txt', u'LayoutTests/platform/mac/accessibility/search-predicate.html', u'LayoutTests/platform/mac/accessibility/search-when-element-starts-in-table.html', u'Source/WebCore/ChangeLog', u'Source/WebCore/accessibility/AccessibilityObject.cpp', u'Source/WebCore/accessibility/AccessibilityObject.h', u'Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm', u'Tools/ChangeLog', u'Tools/DumpRenderTree/AccessibilityUIElement.cpp', u'Tools/DumpRenderTree/AccessibilityUIElement.h', u'Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp', u'Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm', u'Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm', u'Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp', u'Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp', u'Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h', u'Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl', u'Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp', u'Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm']" exit_code: 1
Source/WebCore/accessibility/AccessibilityObject.cpp:1740:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 1 in 21 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 31 Greg Hughes 2013-05-22 15:17:33 PDT
Created attachment 202628 [details]
Patch v7
Comment 32 chris fleizach 2013-05-22 17:45:59 PDT
Comment on attachment 202628 [details]
Patch v7

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

> Source/WebCore/accessibility/AccessibilityObject.cpp:1733
> +    // To figure out if the element is onscreen, we start by boulding of a stack starting with the

boulding -> building ( i presume)
Comment 33 Greg Hughes 2013-05-28 11:57:28 PDT
Created attachment 203073 [details]
Patch v8
Comment 34 WebKit Commit Bot 2013-06-04 12:21:55 PDT
Comment on attachment 203073 [details]
Patch v8

Clearing flags on attachment: 203073

Committed r151179: <http://trac.webkit.org/changeset/151179>
Comment 35 WebKit Commit Bot 2013-06-04 12:22:00 PDT
All reviewed patches have been landed.  Closing bug.