Changeset 164321 in webkit
- Timestamp:
- Feb 18, 2014, 2:39:45 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r164316 r164321 1 2014-02-18 Samuel White <samuel_white@apple.com> 2 3 AX: Searching for "immediate descendants only" can return unexpected results. 4 https://bugs.webkit.org/show_bug.cgi?id=128986 5 6 Reviewed by Chris Fleizach. 7 8 Updated test and expectations to make sure the results match traditional "children" results when appropriate. 9 10 * platform/mac/accessibility/search-predicate-immediate-descendants-only-expected.txt: 11 * platform/mac/accessibility/search-predicate-immediate-descendants-only.html: 12 1 13 2014-02-18 Ryosuke Niwa <rniwa@webkit.org> 2 14 -
trunk/LayoutTests/platform/mac/accessibility/search-predicate-immediate-descendants-only-expected.txt
r164165 r164321 4 4 5 5 6 PASS allDescendantsCount is 6 7 PASS immediateDescendantsCount is 3 6 PASS allDescendantsCount is 25 7 PASS immediateDescendantsCount is 6 8 PASS immediateDescendantsCount is childrenCount 8 9 PASS successfullyParsed is true 9 10 -
trunk/LayoutTests/platform/mac/accessibility/search-predicate-immediate-descendants-only.html
r164165 r164321 8 8 9 9 <div id="container"> 10 < ul><li>immediate descendant</li><li><ul><li>distant descendant</li></ul></li></ul>11 < ul><li>immediate descendant</li><li><ul><li>distant descendant</li></ul></li></ul>12 <ul><li>i mmediate descendant</li><li><ul><li>distant descendant</li></ul></li></ul>10 <h1>heading<img src="resources/cake.png" alt="Cake"></h1> 11 <p>text <a href="#">link</a></p> 12 <ul><li>item</li><li><ul><li>subitem</li></ul></li></ul> 13 13 </div> 14 14 … … 24 24 25 25 // All descendants. 26 var allDescendantsCount = containerElement.uiElementCountForSearchPredicate(null, true, "AX ListSearchKey", "", false, false);27 shouldBe("allDescendantsCount", " 6");26 var allDescendantsCount = containerElement.uiElementCountForSearchPredicate(null, true, "AXAnyTypeSearchKey", "", false, false); 27 shouldBe("allDescendantsCount", "25"); 28 28 29 // Immediate descendants. 30 var immediateDescendantsCount = containerElement.uiElementCountForSearchPredicate(null, true, "AXListSearchKey", "", false, true); 31 shouldBe("immediateDescendantsCount", "3"); 29 // Immeditate descendants. 30 var immediateDescendantsCount = containerElement.uiElementCountForSearchPredicate(null, true, "AXAnyTypeSearchKey", "", false, true); 31 shouldBe("immediateDescendantsCount", "6"); 32 33 // The number of immediate descendants should be equal to the number of children (when using "AXAnyTypeSearchKey"). 34 var childrenCount = containerElement.childrenCount; 35 shouldBe("immediateDescendantsCount", "childrenCount"); 32 36 33 37 // Hide superfluous text. -
trunk/Source/WebCore/ChangeLog
r164320 r164321 1 2014-02-18 Samuel White <samuel_white@apple.com> 2 3 AX: Searching for "immediate descendants only" can return unexpected results. 4 https://bugs.webkit.org/show_bug.cgi?id=128986 5 6 Reviewed by Chris Fleizach. 7 8 Missed an application of the immediateDescendantsOnly flag during the initial implementation. We 9 need to make sure we don't decend into the startObject first if it is provided. This fix causes 10 the outer loop to 'skip' the first iteration so only siblings of the startObject are considered. 11 12 No new tests, updated existing search-predicate-immediate-descendants-only.html test to cover this case. 13 14 * accessibility/AccessibilityObject.cpp: 15 (WebCore::AccessibilityObject::findMatchingObjects): 16 1 17 2014-02-18 Ryosuke Niwa <rniwa@webkit.org> 2 18 -
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
r164165 r164321 490 490 // already behind/ahead of start element. 491 491 AccessibilityChildrenVector searchStack; 492 appendChildrenToArray(startObject, isForward, previousObject, searchStack); 492 if (!criteria->immediateDescendantsOnly || startObject == this) 493 appendChildrenToArray(startObject, isForward, previousObject, searchStack); 493 494 494 495 // This now does a DFS at the current level of the parent.
Note:
See TracChangeset
for help on using the changeset viewer.