Title: [164616] trunk
Revision
164616
Author
[email protected]
Date
2014-02-24 16:29:28 -0800 (Mon, 24 Feb 2014)

Log Message

AX: AccessibilityObject::findMatchingObjects should never include 'this' in results.
https://bugs.webkit.org/show_bug.cgi?id=129243

Reviewed by Chris Fleizach.

Source/WebCore:

Fix removes the container object from the search results when searching backwards. This
makes backwards & forwards search results consistent with each other.

Test: platform/mac/accessibility/search-predicate-container-not-included.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::findMatchingObjects):

LayoutTests:

Added test to ensure that the container you are searching in can never be a search result.

* platform/mac/accessibility/search-predicate-container-not-included-expected.txt: Added.
* platform/mac/accessibility/search-predicate-container-not-included.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (164615 => 164616)


--- trunk/LayoutTests/ChangeLog	2014-02-25 00:08:50 UTC (rev 164615)
+++ trunk/LayoutTests/ChangeLog	2014-02-25 00:29:28 UTC (rev 164616)
@@ -1,5 +1,17 @@
 2014-02-24  Samuel White  <[email protected]>
 
+        AX: AccessibilityObject::findMatchingObjects should never include 'this' in results.
+        https://bugs.webkit.org/show_bug.cgi?id=129243
+
+        Reviewed by Chris Fleizach.
+
+        Added test to ensure that the container you are searching in can never be a search result.
+
+        * platform/mac/accessibility/search-predicate-container-not-included-expected.txt: Added.
+        * platform/mac/accessibility/search-predicate-container-not-included.html: Added.
+
+2014-02-24  Samuel White  <[email protected]>
+
         AX: findMatchingObjects backwards start position inconsistent with forwards start position when startObject == nullptr.
         https://bugs.webkit.org/show_bug.cgi?id=129266
 

Added: trunk/LayoutTests/platform/mac/accessibility/search-predicate-container-not-included-expected.txt (0 => 164616)


--- trunk/LayoutTests/platform/mac/accessibility/search-predicate-container-not-included-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/search-predicate-container-not-included-expected.txt	2014-02-25 00:29:28 UTC (rev 164616)
@@ -0,0 +1,11 @@
+This tests that the search predicate container is not included in the search results.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS backwardResultCount is 0
+PASS forwardResultCount is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/mac/accessibility/search-predicate-container-not-included.html (0 => 164616)


--- trunk/LayoutTests/platform/mac/accessibility/search-predicate-container-not-included.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/search-predicate-container-not-included.html	2014-02-25 00:29:28 UTC (rev 164616)
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<title>Search Predicate Container Not Included</title>
+</head>
+<body>
+
+<ul id="container"><li id="start">item</li></ul>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+    description("This tests that the search predicate container is not included in the search results.");
+    
+    if (window.accessibilityController) {
+        var containerElement = accessibilityController.accessibleElementById("container");
+        var startElement = accessibilityController.accessibleElementById("start");
+        
+        var backwardResultCount = containerElement.uiElementCountForSearchPredicate(startElement, false, "AXListSearchKey", "", false);
+        var forwardResultCount = containerElement.uiElementCountForSearchPredicate(startElement, true, "AXListSearchKey", "", false);
+        // The search predicate container should not be found.
+        shouldBe("backwardResultCount", "0");
+        shouldBe("forwardResultCount", "0");
+        
+        // Hide superfluous text.
+        document.getElementById("container").style.display = "none";
+    }
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (164615 => 164616)


--- trunk/Source/WebCore/ChangeLog	2014-02-25 00:08:50 UTC (rev 164615)
+++ trunk/Source/WebCore/ChangeLog	2014-02-25 00:29:28 UTC (rev 164616)
@@ -1,5 +1,20 @@
 2014-02-24  Samuel White  <[email protected]>
 
+        AX: AccessibilityObject::findMatchingObjects should never include 'this' in results.
+        https://bugs.webkit.org/show_bug.cgi?id=129243
+
+        Reviewed by Chris Fleizach.
+
+        Fix removes the container object from the search results when searching backwards. This
+        makes backwards & forwards search results consistent with each other.
+
+        Test: platform/mac/accessibility/search-predicate-container-not-included.html
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::findMatchingObjects):
+
+2014-02-24  Samuel White  <[email protected]>
+
         AX: findMatchingObjects backwards start position inconsistent with forwards start position when startObject == nullptr.
         https://bugs.webkit.org/show_bug.cgi?id=129266
 

Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (164615 => 164616)


--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2014-02-25 00:08:50 UTC (rev 164615)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2014-02-25 00:29:28 UTC (rev 164616)
@@ -509,7 +509,7 @@
             break;
 
         // When moving backwards, the parent object needs to be checked, because technically it's "before" the starting element.
-        if (!isForward && objectMatchesSearchCriteriaWithResultLimit(startObject, criteria, results))
+        if (!isForward && startObject != this && objectMatchesSearchCriteriaWithResultLimit(startObject, criteria, results))
             break;
 
         previousObject = startObject;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to