Title: [172095] branches/safari-600.1-branch

Diff

Modified: branches/safari-600.1-branch/LayoutTests/ChangeLog (172094 => 172095)


--- branches/safari-600.1-branch/LayoutTests/ChangeLog	2014-08-05 22:32:58 UTC (rev 172094)
+++ branches/safari-600.1-branch/LayoutTests/ChangeLog	2014-08-05 22:41:34 UTC (rev 172095)
@@ -1,5 +1,19 @@
 2014-08-05  Lucas Forschler  <lforsch...@apple.com>
 
+        Merge r172028
+
+    2014-08-05  Chris Fleizach  <cfleiz...@apple.com>
+
+            AX: Select text activity should return replaced text instead of previously selected text
+            https://bugs.webkit.org/show_bug.cgi?id=135595
+
+            Reviewed by Mario Sanchez Prada.
+
+            * platform/mac/accessibility/select-text-expected.txt:
+            * platform/mac/accessibility/select-text.html:
+
+2014-08-05  Lucas Forschler  <lforsch...@apple.com>
+
         Merge r171892
 
     2014-07-31  Beth Dakin  <bda...@apple.com>

Modified: branches/safari-600.1-branch/LayoutTests/platform/mac/accessibility/select-text-expected.txt (172094 => 172095)


--- branches/safari-600.1-branch/LayoutTests/platform/mac/accessibility/select-text-expected.txt	2014-08-05 22:32:58 UTC (rev 172094)
+++ branches/safari-600.1-branch/LayoutTests/platform/mac/accessibility/select-text-expected.txt	2014-08-05 22:41:34 UTC (rev 172095)
@@ -17,15 +17,15 @@
 PASS selection is 'dog'
 PASS result is 'fox'
 PASS selection is 'fox'
-PASS result is 'quick'
+PASS result is 'slow'
 PASS selection is 'slow'
-PASS result is 'fox'
+PASS result is 'cat'
 PASS selection is 'cat'
+PASS result is 'Brown'
+PASS selection is 'Brown'
 PASS result is 'brown'
-PASS selection is 'Brown'
-PASS result is 'Brown'
 PASS selection is 'brown'
-PASS result is 'brown'
+PASS result is 'BROWN'
 PASS selection is 'BROWN'
 PASS successfullyParsed is true
 

Modified: branches/safari-600.1-branch/LayoutTests/platform/mac/accessibility/select-text.html (172094 => 172095)


--- branches/safari-600.1-branch/LayoutTests/platform/mac/accessibility/select-text.html	2014-08-05 22:32:58 UTC (rev 172094)
+++ branches/safari-600.1-branch/LayoutTests/platform/mac/accessibility/select-text.html	2014-08-05 22:41:34 UTC (rev 172095)
@@ -78,35 +78,35 @@
         // Select and replace text closest to selection (single search string).
         selectElementText(target);
         result = text.selectTextWithCriteria("AXSelectTextAmbiguityResolutionClosestToSelection", "quick", "slow");
-        shouldBe("result", "'quick'");
+        shouldBe("result", "'slow'");
         selection = selectedText();
         shouldBe("selection", "'slow'");
         
         // Select and replace text closest to selection (multiple search strings).
         selectElementText(target);
         result = text.selectTextWithCriteria("AXSelectTextAmbiguityResolutionClosestToSelection", ["dog", "fox"], "cat");
-        shouldBe("result", "'fox'");
+        shouldBe("result", "'cat'");
         selection = selectedText();
         shouldBe("selection", "'cat'");
 
         // Select brown and capitalize it.
         selectElementText(target);
         result = text.selectTextWithCriteria("AXSelectTextAmbiguityResolutionClosestToSelection", "brown", null, "AXSelectTextActivityFindAndCapitalize");
-        shouldBe("result", "'brown'");
+        shouldBe("result", "'Brown'");
         selection = selectedText();
         shouldBe("selection", "'Brown'");
 
         // Select Brown and lowercase it.
         selectElementText(target);
         result = text.selectTextWithCriteria("AXSelectTextAmbiguityResolutionClosestToSelection", "Brown", null, "AXSelectTextActivityFindAndLowercase");
-        shouldBe("result", "'Brown'");
+        shouldBe("result", "'brown'");
         selection = selectedText();
         shouldBe("selection", "'brown'");
 
         // Select brown and uppercase it.
         selectElementText(target);
         result = text.selectTextWithCriteria("AXSelectTextAmbiguityResolutionClosestToSelection", "brown", null, "AXSelectTextActivityFindAndUppercase");
-        shouldBe("result", "'brown'");
+        shouldBe("result", "'BROWN'");
         selection = selectedText();
         shouldBe("selection", "'BROWN'");
 

Modified: branches/safari-600.1-branch/Source/WebCore/ChangeLog (172094 => 172095)


--- branches/safari-600.1-branch/Source/WebCore/ChangeLog	2014-08-05 22:32:58 UTC (rev 172094)
+++ branches/safari-600.1-branch/Source/WebCore/ChangeLog	2014-08-05 22:41:34 UTC (rev 172095)
@@ -1,5 +1,23 @@
 2014-08-05  Lucas Forschler  <lforsch...@apple.com>
 
+        Merge r172028
+
+    2014-08-05  Chris Fleizach  <cfleiz...@apple.com>
+
+            AX: Select text activity should return replaced text instead of previously selected text
+            https://bugs.webkit.org/show_bug.cgi?id=135595
+
+            Reviewed by Mario Sanchez Prada.
+
+            When the select activity API is used to replace text, the replacement string should be returned instead of the old selected text.
+
+            Updated existing test: platform/mac/accessibility/select-text.html
+
+            * accessibility/AccessibilityObject.cpp:
+            (WebCore::AccessibilityObject::selectText):
+
+2014-08-05  Lucas Forschler  <lforsch...@apple.com>
+
         Merge r172026
 
     2014-08-04  Jer Noble  <jer.no...@apple.com>

Modified: branches/safari-600.1-branch/Source/WebCore/accessibility/AccessibilityObject.cpp (172094 => 172095)


--- branches/safari-600.1-branch/Source/WebCore/accessibility/AccessibilityObject.cpp	2014-08-05 22:32:58 UTC (rev 172094)
+++ branches/safari-600.1-branch/Source/WebCore/accessibility/AccessibilityObject.cpp	2014-08-05 22:41:34 UTC (rev 172095)
@@ -654,8 +654,13 @@
                 break;
             }
             
-            if (replaceSelection)
+            // A bit obvious, but worth noting the API contract for this method is that we should
+            // return the replacement string when replacing, but the selected string if not.
+            if (replaceSelection) {
                 frame->editor().replaceSelectionWithText(replacementString, true, true);
+                return replacementString;
+            }
+            
             return closestString;
         }
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to