Title: [200876] trunk
Revision
200876
Author
[email protected]
Date
2016-05-13 12:34:48 -0700 (Fri, 13 May 2016)

Log Message

AX: Regressions in undo/redo accessibility from Bug 153361
https://bugs.webkit.org/show_bug.cgi?id=157652

Reviewed by Darin Adler.

Use indexForVisiblePosition & visiblePositionForIndex to store selection data
so that AccessibilityUndoReplacedText can build valid selection ranges and
retrieve strings for AT notifications.

Source/WebCore:

Tests: accessibility/mac/value-change/value-change-user-info-contenteditable-expected.txt:
       accessibility/mac/value-change/value-change-user-info-contenteditable.html:
       accessibility/mac/value-change/value-change-user-info-textarea-expected.txt:
       accessibility/mac/value-change/value-change-user-info-textarea.html:
       accessibility/mac/value-change/value-change-user-info-textfield-expected.txt:
       accessibility/mac/value-change/value-change-user-info-textfield.html:

* accessibility/AXObjectCache.cpp:
(WebCore::AccessibilityReplacedText::AccessibilityReplacedText):
(WebCore::AXObjectCache::postTextStateChangeNotification):
(WebCore::AXObjectCache::postTextReplacementNotification):
* editing/CompositeEditCommand.cpp:
(WebCore::AccessibilityUndoReplacedText::configureRangeDeletedByReapplyWithEndingSelection):
(WebCore::AccessibilityUndoReplacedText::configureRangeDeletedByReapplyWithStartingSelection):
(WebCore::AccessibilityUndoReplacedText::setRangeDeletedByUnapply):
(WebCore::AccessibilityUndoReplacedText::captureTextForUnapply):
(WebCore::AccessibilityUndoReplacedText::captureTextForReapply):
(WebCore::AccessibilityUndoReplacedText::textDeletedByUnapply):
(WebCore::AccessibilityUndoReplacedText::textDeletedByReapply):
(WebCore::AccessibilityUndoReplacedText::postTextStateChangeNotificationForUnapply):
(WebCore::AccessibilityUndoReplacedText::postTextStateChangeNotificationForReapply):
(WebCore::EditCommandComposition::EditCommandComposition):
(WebCore::EditCommandComposition::unapply):
(WebCore::EditCommandComposition::reapply):
(WebCore::EditCommandComposition::setStartingSelection):
(WebCore::EditCommandComposition::setEndingSelection):
(WebCore::EditCommandComposition::setRangeDeletedByUnapply):
(WebCore::AccessibilityUndoReplacedText::confgureTextToBeDeletedByUnapplyIndexesWithEditCommandEndingSelection): Deleted.
(WebCore::AccessibilityUndoReplacedText::confgureTextToBeDeletedByUnapplyStartIndexWithEditCommandStartingSelection): Deleted.
(WebCore::AccessibilityUndoReplacedText::setTextInsertedByUnapplyRange): Deleted.
(WebCore::AccessibilityUndoReplacedText::captureTextToBeDeletedByUnapply): Deleted.
(WebCore::AccessibilityUndoReplacedText::captureTextToBeDeletedByReapply): Deleted.
(WebCore::AccessibilityUndoReplacedText::textInsertedByUnapply): Deleted.
(WebCore::AccessibilityUndoReplacedText::textInsertedByReapply): Deleted.
(WebCore::EditCommandComposition::setTextInsertedByUnapplyRange): Deleted.
* editing/CompositeEditCommand.h:
* editing/Editor.cpp:
(WebCore::Editor::replaceSelectionWithFragment):
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::postTextStateChangeNotificationForDeletion):
(WebCore::TypingCommand::insertTextAndNotifyAccessibility):
(WebCore::TypingCommand::insertLineBreakAndNotifyAccessibility):
(WebCore::TypingCommand::insertParagraphSeparatorAndNotifyAccessibility):
(WebCore::TypingCommand::insertParagraphSeparatorInQuotedContentAndNotifyAccessibility):

LayoutTests:

* accessibility/mac/value-change/value-change-user-info-contenteditable-expected.txt:
* accessibility/mac/value-change/value-change-user-info-contenteditable.html:
* accessibility/mac/value-change/value-change-user-info-textarea-expected.txt:
* accessibility/mac/value-change/value-change-user-info-textarea.html:
* accessibility/mac/value-change/value-change-user-info-textfield-expected.txt:
* accessibility/mac/value-change/value-change-user-info-textfield.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (200875 => 200876)


--- trunk/LayoutTests/ChangeLog	2016-05-13 19:19:01 UTC (rev 200875)
+++ trunk/LayoutTests/ChangeLog	2016-05-13 19:34:48 UTC (rev 200876)
@@ -1,3 +1,21 @@
+2016-05-13  Doug Russell  <[email protected]>
+
+        AX: Regressions in undo/redo accessibility from Bug 153361
+        https://bugs.webkit.org/show_bug.cgi?id=157652
+
+        Reviewed by Darin Adler.
+        
+        Use indexForVisiblePosition & visiblePositionForIndex to store selection data
+        so that AccessibilityUndoReplacedText can build valid selection ranges and
+        retrieve strings for AT notifications.
+
+        * accessibility/mac/value-change/value-change-user-info-contenteditable-expected.txt:
+        * accessibility/mac/value-change/value-change-user-info-contenteditable.html:
+        * accessibility/mac/value-change/value-change-user-info-textarea-expected.txt:
+        * accessibility/mac/value-change/value-change-user-info-textarea.html:
+        * accessibility/mac/value-change/value-change-user-info-textfield-expected.txt:
+        * accessibility/mac/value-change/value-change-user-info-textfield.html:
+
 2016-05-13  Nan Wang  <[email protected]>
 
         AX: Wrong CharacterOffset from an upstream VisiblePosition

Modified: trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable-expected.txt (200875 => 200876)


--- trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable-expected.txt	2016-05-13 19:19:01 UTC (rev 200875)
+++ trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable-expected.txt	2016-05-13 19:34:48 UTC (rev 200876)
@@ -38,6 +38,16 @@
 PASS actualEditTypes[resultIndex][0] is "Delete"
 PASS actualChangeValues[resultIndex][1] is expectedValues[resultIndex][1]
 PASS actualEditTypes[resultIndex][1] is "Typing"
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex][0] is expectedValues[resultIndex][0]
+PASS actualEditTypes[resultIndex][0] is "Delete"
+PASS actualChangeValues[resultIndex][1] is expectedValues[resultIndex][1]
+PASS actualEditTypes[resultIndex][1] is "Insert"
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex][0] is expectedValues[resultIndex][0]
+PASS actualEditTypes[resultIndex][0] is "Delete"
+PASS actualChangeValues[resultIndex][1] is expectedValues[resultIndex][1]
+PASS actualEditTypes[resultIndex][1] is "Insert"
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable.html (200875 => 200876)


--- trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable.html	2016-05-13 19:19:01 UTC (rev 200875)
+++ trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable.html	2016-05-13 19:34:48 UTC (rev 200876)
@@ -45,7 +45,7 @@
                 }
 
                 count++;
-                if (count == 9) {
+                if (count == 11) {
 
                     shouldBeTyping("1");
                     shouldBeDelete("1");
@@ -56,6 +56,8 @@
                     shouldBePaste("2");
                     shouldBePasteReplace("3", "2");
                     shouldBeTypingReplace("2", "3");
+                    shouldBeInsertReplace("3", "2");
+                    shouldBeInsertReplace("2", "3");
 
                     webArea.removeNotificationListener();
                     window.testRunner.notifyDone();
@@ -94,6 +96,10 @@
 
             execExtendSelectionLeftByCharacterCommand();
             eventSender.keyDown("3");
+
+            execUndoCommand();
+
+            execRedoCommand();
         }
     </script>
 

Modified: trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textarea-expected.txt (200875 => 200876)


--- trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textarea-expected.txt	2016-05-13 19:19:01 UTC (rev 200875)
+++ trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textarea-expected.txt	2016-05-13 19:34:48 UTC (rev 200876)
@@ -38,6 +38,16 @@
 PASS actualEditTypes[resultIndex][0] is "Delete"
 PASS actualChangeValues[resultIndex][1] is expectedValues[resultIndex][1]
 PASS actualEditTypes[resultIndex][1] is "Typing"
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex][0] is expectedValues[resultIndex][0]
+PASS actualEditTypes[resultIndex][0] is "Delete"
+PASS actualChangeValues[resultIndex][1] is expectedValues[resultIndex][1]
+PASS actualEditTypes[resultIndex][1] is "Insert"
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex][0] is expectedValues[resultIndex][0]
+PASS actualEditTypes[resultIndex][0] is "Delete"
+PASS actualChangeValues[resultIndex][1] is expectedValues[resultIndex][1]
+PASS actualEditTypes[resultIndex][1] is "Insert"
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textarea.html (200875 => 200876)


--- trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textarea.html	2016-05-13 19:19:01 UTC (rev 200875)
+++ trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textarea.html	2016-05-13 19:34:48 UTC (rev 200876)
@@ -46,7 +46,7 @@
 
                 count++;
 
-                var expectedCount = 9;
+                var expectedCount = 11;
                 if (count == expectedCount) {
 
                     shouldBeTyping("3");
@@ -58,6 +58,8 @@
                     shouldBePaste("5");
                     shouldBePasteReplace("6", "5");
                     shouldBeTypingReplace("5", "6");
+                    shouldBeInsertReplace("6", "5");
+                    shouldBeInsertReplace("5", "6");
 
                     webArea.removeNotificationListener();
                     window.testRunner.notifyDone();
@@ -96,6 +98,10 @@
 
             execExtendSelectionLeftByCharacterCommand();
             eventSender.keyDown("6");
+
+            execUndoCommand();
+
+            execRedoCommand();
         }
     </script>
 

Modified: trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textfield-expected.txt (200875 => 200876)


--- trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textfield-expected.txt	2016-05-13 19:19:01 UTC (rev 200875)
+++ trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textfield-expected.txt	2016-05-13 19:34:48 UTC (rev 200876)
@@ -32,6 +32,16 @@
 PASS actualEditTypes[resultIndex][0] is "Delete"
 PASS actualChangeValues[resultIndex][1] is expectedValues[resultIndex][1]
 PASS actualEditTypes[resultIndex][1] is "Typing"
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex][0] is expectedValues[resultIndex][0]
+PASS actualEditTypes[resultIndex][0] is "Delete"
+PASS actualChangeValues[resultIndex][1] is expectedValues[resultIndex][1]
+PASS actualEditTypes[resultIndex][1] is "Insert"
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex][0] is expectedValues[resultIndex][0]
+PASS actualEditTypes[resultIndex][0] is "Delete"
+PASS actualChangeValues[resultIndex][1] is expectedValues[resultIndex][1]
+PASS actualEditTypes[resultIndex][1] is "Insert"
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textfield.html (200875 => 200876)


--- trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textfield.html	2016-05-13 19:19:01 UTC (rev 200875)
+++ trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textfield.html	2016-05-13 19:34:48 UTC (rev 200876)
@@ -46,7 +46,7 @@
 
                 count++;
 
-                var expectedCount = 7;
+                var expectedCount = 9;
                 if (count == expectedCount) {
 
                     shouldBeTyping("6");
@@ -56,6 +56,8 @@
                     shouldBePaste("8");
                     shouldBePasteReplace("9", "8");
                     shouldBeTypingReplace("8", "9");
+                    shouldBeInsertReplace("9", "8");
+                    shouldBeInsertReplace("8", "9");
 
                     webArea.removeNotificationListener();
                     window.testRunner.notifyDone();
@@ -92,6 +94,10 @@
 
             execExtendSelectionLeftByCharacterCommand();
             eventSender.keyDown("9");
+
+            execUndoCommand();
+
+            execRedoCommand();
         }
     </script>
 

Modified: trunk/Source/WebCore/ChangeLog (200875 => 200876)


--- trunk/Source/WebCore/ChangeLog	2016-05-13 19:19:01 UTC (rev 200875)
+++ trunk/Source/WebCore/ChangeLog	2016-05-13 19:34:48 UTC (rev 200876)
@@ -1,3 +1,59 @@
+2016-05-13  Doug Russell  <[email protected]>
+
+        AX: Regressions in undo/redo accessibility from Bug 153361
+        https://bugs.webkit.org/show_bug.cgi?id=157652
+
+        Reviewed by Darin Adler.
+        
+        Use indexForVisiblePosition & visiblePositionForIndex to store selection data
+        so that AccessibilityUndoReplacedText can build valid selection ranges and
+        retrieve strings for AT notifications.
+
+        Tests: accessibility/mac/value-change/value-change-user-info-contenteditable-expected.txt:
+               accessibility/mac/value-change/value-change-user-info-contenteditable.html:
+               accessibility/mac/value-change/value-change-user-info-textarea-expected.txt:
+               accessibility/mac/value-change/value-change-user-info-textarea.html:
+               accessibility/mac/value-change/value-change-user-info-textfield-expected.txt:
+               accessibility/mac/value-change/value-change-user-info-textfield.html:
+
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::AccessibilityReplacedText::AccessibilityReplacedText):
+        (WebCore::AXObjectCache::postTextStateChangeNotification):
+        (WebCore::AXObjectCache::postTextReplacementNotification):
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::AccessibilityUndoReplacedText::configureRangeDeletedByReapplyWithEndingSelection):
+        (WebCore::AccessibilityUndoReplacedText::configureRangeDeletedByReapplyWithStartingSelection):
+        (WebCore::AccessibilityUndoReplacedText::setRangeDeletedByUnapply):
+        (WebCore::AccessibilityUndoReplacedText::captureTextForUnapply):
+        (WebCore::AccessibilityUndoReplacedText::captureTextForReapply):
+        (WebCore::AccessibilityUndoReplacedText::textDeletedByUnapply):
+        (WebCore::AccessibilityUndoReplacedText::textDeletedByReapply):
+        (WebCore::AccessibilityUndoReplacedText::postTextStateChangeNotificationForUnapply):
+        (WebCore::AccessibilityUndoReplacedText::postTextStateChangeNotificationForReapply):
+        (WebCore::EditCommandComposition::EditCommandComposition):
+        (WebCore::EditCommandComposition::unapply):
+        (WebCore::EditCommandComposition::reapply):
+        (WebCore::EditCommandComposition::setStartingSelection):
+        (WebCore::EditCommandComposition::setEndingSelection):
+        (WebCore::EditCommandComposition::setRangeDeletedByUnapply):
+        (WebCore::AccessibilityUndoReplacedText::confgureTextToBeDeletedByUnapplyIndexesWithEditCommandEndingSelection): Deleted.
+        (WebCore::AccessibilityUndoReplacedText::confgureTextToBeDeletedByUnapplyStartIndexWithEditCommandStartingSelection): Deleted.
+        (WebCore::AccessibilityUndoReplacedText::setTextInsertedByUnapplyRange): Deleted.
+        (WebCore::AccessibilityUndoReplacedText::captureTextToBeDeletedByUnapply): Deleted.
+        (WebCore::AccessibilityUndoReplacedText::captureTextToBeDeletedByReapply): Deleted.
+        (WebCore::AccessibilityUndoReplacedText::textInsertedByUnapply): Deleted.
+        (WebCore::AccessibilityUndoReplacedText::textInsertedByReapply): Deleted.
+        (WebCore::EditCommandComposition::setTextInsertedByUnapplyRange): Deleted.
+        * editing/CompositeEditCommand.h:
+        * editing/Editor.cpp:
+        (WebCore::Editor::replaceSelectionWithFragment):
+        * editing/TypingCommand.cpp:
+        (WebCore::TypingCommand::postTextStateChangeNotificationForDeletion):
+        (WebCore::TypingCommand::insertTextAndNotifyAccessibility):
+        (WebCore::TypingCommand::insertLineBreakAndNotifyAccessibility):
+        (WebCore::TypingCommand::insertParagraphSeparatorAndNotifyAccessibility):
+        (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContentAndNotifyAccessibility):
+
 2016-05-13  Chris Dumez  <[email protected]>
 
         Unreviewed, rolling out r200837.

Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (200875 => 200876)


--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp	2016-05-13 19:19:01 UTC (rev 200875)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp	2016-05-13 19:34:48 UTC (rev 200876)
@@ -124,10 +124,13 @@
 
 AccessibilityReplacedText::AccessibilityReplacedText(const VisibleSelection& selection)
 {
-    if (AXObjectCache::accessibilityEnabled() && selection.isRange()) {
-        m_replacedText = AccessibilityObject::stringForVisiblePositionRange(selection);
+    if (AXObjectCache::accessibilityEnabled()) {
         m_replacedRange.startIndex.value = indexForVisiblePosition(selection.start(), m_replacedRange.startIndex.scope);
-        m_replacedRange.endIndex.value = indexForVisiblePosition(selection.end(), m_replacedRange.endIndex.scope);
+        if (selection.isRange()) {
+            m_replacedText = AccessibilityObject::stringForVisiblePositionRange(selection);
+            m_replacedRange.endIndex.value = indexForVisiblePosition(selection.end(), m_replacedRange.endIndex.scope);
+        } else
+            m_replacedRange.endIndex = m_replacedRange.startIndex;
     }
 }
 

Modified: trunk/Source/WebCore/editing/CompositeEditCommand.cpp (200875 => 200876)


--- trunk/Source/WebCore/editing/CompositeEditCommand.cpp	2016-05-13 19:19:01 UTC (rev 200875)
+++ trunk/Source/WebCore/editing/CompositeEditCommand.cpp	2016-05-13 19:34:48 UTC (rev 200876)
@@ -85,43 +85,43 @@
     return WebCore::indexForVisiblePosition(position, scope);
 }
 
-void AccessibilityUndoReplacedText::confgureTextToBeDeletedByUnapplyIndexesWithEditCommandEndingSelection(const VisibleSelection& selection)
+void AccessibilityUndoReplacedText::configureRangeDeletedByReapplyWithEndingSelection(const VisibleSelection& selection)
 {
     if (!AXObjectCache::accessibilityEnabled())
         return;
-    if (selection.isRange() && m_textDeletedByUnapplyRange.startIndex.value == -1)
-        m_textDeletedByUnapplyRange.startIndex.value = indexForVisiblePosition(selection.start(), m_textDeletedByUnapplyRange.startIndex.scope);
-    if (m_textDeletedByUnapplyRange.endIndex.value == -1)
-        m_textDeletedByUnapplyRange.endIndex.value = indexForVisiblePosition(selection.start(), m_textDeletedByUnapplyRange.endIndex.scope);
+    if (selection.isNone())
+        return;
+    m_rangeDeletedByReapply.endIndex.value = indexForVisiblePosition(selection.end(), m_rangeDeletedByReapply.endIndex.scope);
 }
 
-void AccessibilityUndoReplacedText::confgureTextToBeDeletedByUnapplyStartIndexWithEditCommandStartingSelection(const VisibleSelection& selection)
+void AccessibilityUndoReplacedText::configureRangeDeletedByReapplyWithStartingSelection(const VisibleSelection& selection)
 {
     if (!AXObjectCache::accessibilityEnabled())
         return;
-    if (m_textDeletedByUnapplyRange.startIndex.value == -1)
-        m_textDeletedByUnapplyRange.startIndex.value = indexForVisiblePosition(selection.start(), m_textDeletedByUnapplyRange.startIndex.scope);
-    if (selection.isRange() && m_textDeletedByUnapplyRange.endIndex.value == -1)
-        m_textDeletedByUnapplyRange.endIndex.value = indexForVisiblePosition(selection.end(), m_textDeletedByUnapplyRange.endIndex.scope);
+    if (selection.isNone())
+        return;
+    if (m_rangeDeletedByReapply.startIndex.value == -1)
+        m_rangeDeletedByReapply.startIndex.value = indexForVisiblePosition(selection.start(), m_rangeDeletedByReapply.startIndex.scope);
 }
 
-void AccessibilityUndoReplacedText::setTextInsertedByUnapplyRange(const VisiblePositionIndexRange& range)
+void AccessibilityUndoReplacedText::setRangeDeletedByUnapply(const VisiblePositionIndexRange& range)
 {
-    m_textInsertedByUnapplyRange = range;
+    if (m_rangeDeletedByUnapply.isNull())
+        m_rangeDeletedByUnapply = range;
 }
 
-void AccessibilityUndoReplacedText::captureTextToBeDeletedByUnapply()
+void AccessibilityUndoReplacedText::captureTextForUnapply()
 {
     if (!AXObjectCache::accessibilityEnabled())
         return;
-    m_replacedText = textInsertedByReapply();
+    m_replacedText = textDeletedByReapply();
 }
 
-void AccessibilityUndoReplacedText::captureTextToBeDeletedByReapply()
+void AccessibilityUndoReplacedText::captureTextForReapply()
 {
     if (!AXObjectCache::accessibilityEnabled())
         return;
-    m_replacedText = textInsertedByUnapply();
+    m_replacedText = textDeletedByUnapply();
 }
 
 static String stringForVisiblePositionIndexRange(const VisiblePositionIndexRange& range)
@@ -133,18 +133,18 @@
     return AccessibilityObject::stringForVisiblePositionRange(VisiblePositionRange(start, end));
 }
 
-String AccessibilityUndoReplacedText::textInsertedByUnapply()
+String AccessibilityUndoReplacedText::textDeletedByUnapply()
 {
     if (!AXObjectCache::accessibilityEnabled())
         return String();
-    return stringForVisiblePositionIndexRange(m_textInsertedByUnapplyRange);
+    return stringForVisiblePositionIndexRange(m_rangeDeletedByUnapply);
 }
 
-String AccessibilityUndoReplacedText::textInsertedByReapply()
+String AccessibilityUndoReplacedText::textDeletedByReapply()
 {
     if (!AXObjectCache::accessibilityEnabled())
         return String();
-    return stringForVisiblePositionIndexRange(m_textDeletedByUnapplyRange);
+    return stringForVisiblePositionIndexRange(m_rangeDeletedByReapply);
 }
 
 static void postTextStateChangeNotification(AXObjectCache* cache, const VisiblePosition& position, const String& deletedText, const String& insertedText)
@@ -167,12 +167,12 @@
         return;
     if (!AXObjectCache::accessibilityEnabled())
         return;
-    if (m_textInsertedByUnapplyRange.isNull())
+    if (m_rangeDeletedByUnapply.isNull())
         return;
-    VisiblePosition position = visiblePositionForIndex(m_textInsertedByUnapplyRange.endIndex.value, m_textInsertedByUnapplyRange.endIndex.scope.get());
+    VisiblePosition position = visiblePositionForIndex(m_rangeDeletedByUnapply.endIndex.value, m_rangeDeletedByUnapply.endIndex.scope.get());
     if (position.isNull())
         return;
-    postTextStateChangeNotification(cache, position, textInsertedByUnapply(), m_replacedText);
+    postTextStateChangeNotification(cache, position, textDeletedByUnapply(), m_replacedText);
     m_replacedText = String();
 }
 
@@ -182,12 +182,12 @@
         return;
     if (!AXObjectCache::accessibilityEnabled())
         return;
-    if (m_textDeletedByUnapplyRange.isNull())
+    if (m_rangeDeletedByReapply.isNull())
         return;
-    VisiblePosition position = visiblePositionForIndex(m_textDeletedByUnapplyRange.startIndex.value, m_textDeletedByUnapplyRange.startIndex.scope.get());
+    VisiblePosition position = visiblePositionForIndex(m_rangeDeletedByReapply.startIndex.value, m_rangeDeletedByReapply.startIndex.scope.get());
     if (position.isNull())
         return;
-    postTextStateChangeNotification(cache, position, m_replacedText, textInsertedByReapply());
+    postTextStateChangeNotification(cache, position, textDeletedByReapply(), m_replacedText);
     m_replacedText = String();
 }
 
@@ -205,7 +205,7 @@
     , m_endingRootEditableElement(endingSelection.rootEditableElement())
     , m_editAction(editAction)
 {
-    m_replacedText.confgureTextToBeDeletedByUnapplyStartIndexWithEditCommandStartingSelection(startingSelection);
+    m_replacedText.configureRangeDeletedByReapplyWithStartingSelection(startingSelection);
 }
 
 void EditCommandComposition::unapply()
@@ -215,7 +215,7 @@
     if (!frame)
         return;
 
-    m_replacedText.captureTextToBeDeletedByUnapply();
+    m_replacedText.captureTextForUnapply();
 
     // Changes to the document may have been made since the last editing operation that require a layout, as in <rdar://problem/5658603>.
     // Low level operations, like RemoveNodeCommand, don't require a layout because the high level operations that use them perform one
@@ -247,7 +247,7 @@
     if (!frame)
         return;
 
-    m_replacedText.captureTextToBeDeletedByReapply();
+    m_replacedText.captureTextForReapply();
 
     // Changes to the document may have been made since the last editing operation that require a layout, as in <rdar://problem/5658603>.
     // Low level operations, like RemoveNodeCommand, don't require a layout because the high level operations that use them perform one
@@ -272,19 +272,19 @@
 {
     m_startingSelection = selection;
     m_startingRootEditableElement = selection.rootEditableElement();
-    m_replacedText.confgureTextToBeDeletedByUnapplyStartIndexWithEditCommandStartingSelection(selection);
+    m_replacedText.configureRangeDeletedByReapplyWithStartingSelection(selection);
 }
 
 void EditCommandComposition::setEndingSelection(const VisibleSelection& selection)
 {
     m_endingSelection = selection;
     m_endingRootEditableElement = selection.rootEditableElement();
-    m_replacedText.confgureTextToBeDeletedByUnapplyIndexesWithEditCommandEndingSelection(selection);
+    m_replacedText.configureRangeDeletedByReapplyWithEndingSelection(selection);
 }
 
-void EditCommandComposition::setTextInsertedByUnapplyRange(const VisiblePositionIndexRange& range)
+void EditCommandComposition::setRangeDeletedByUnapply(const VisiblePositionIndexRange& range)
 {
-    m_replacedText.setTextInsertedByUnapplyRange(range);
+    m_replacedText.setRangeDeletedByUnapply(range);
 }
 
 #ifndef NDEBUG

Modified: trunk/Source/WebCore/editing/CompositeEditCommand.h (200875 => 200876)


--- trunk/Source/WebCore/editing/CompositeEditCommand.h	2016-05-13 19:19:01 UTC (rev 200875)
+++ trunk/Source/WebCore/editing/CompositeEditCommand.h	2016-05-13 19:34:48 UTC (rev 200876)
@@ -42,24 +42,24 @@
 class AccessibilityUndoReplacedText {
 public:
     AccessibilityUndoReplacedText() { }
-    void confgureTextToBeDeletedByUnapplyStartIndexWithEditCommandStartingSelection(const VisibleSelection&);
-    void confgureTextToBeDeletedByUnapplyIndexesWithEditCommandEndingSelection(const VisibleSelection&);
-    void setTextInsertedByUnapplyRange(const VisiblePositionIndexRange&);
+    void configureRangeDeletedByReapplyWithStartingSelection(const VisibleSelection&);
+    void configureRangeDeletedByReapplyWithEndingSelection(const VisibleSelection&);
+    void setRangeDeletedByUnapply(const VisiblePositionIndexRange&);
 
-    void captureTextToBeDeletedByUnapply();
-    void captureTextToBeDeletedByReapply();
+    void captureTextForUnapply();
+    void captureTextForReapply();
 
     void postTextStateChangeNotificationForUnapply(AXObjectCache*);
     void postTextStateChangeNotificationForReapply(AXObjectCache*);
 
 private:
     int indexForVisiblePosition(const VisiblePosition&, RefPtr<ContainerNode>&) const;
-    String textInsertedByUnapply();
-    String textInsertedByReapply();
+    String textDeletedByUnapply();
+    String textDeletedByReapply();
 
     String m_replacedText;
-    VisiblePositionIndexRange m_textDeletedByUnapplyRange;
-    VisiblePositionIndexRange m_textInsertedByUnapplyRange;
+    VisiblePositionIndexRange m_rangeDeletedByUnapply;
+    VisiblePositionIndexRange m_rangeDeletedByReapply;
 };
 
 class EditCommandComposition : public UndoStep {
@@ -78,7 +78,7 @@
     void setEndingSelection(const VisibleSelection&);
     Element* startingRootEditableElement() const { return m_startingRootEditableElement.get(); }
     Element* endingRootEditableElement() const { return m_endingRootEditableElement.get(); }
-    void setTextInsertedByUnapplyRange(const VisiblePositionIndexRange&);
+    void setRangeDeletedByUnapply(const VisiblePositionIndexRange&);
 
 #ifndef NDEBUG
     virtual void getNodesInCommand(HashSet<Node*>&);

Modified: trunk/Source/WebCore/editing/Editor.cpp (200875 => 200876)


--- trunk/Source/WebCore/editing/Editor.cpp	2016-05-13 19:19:01 UTC (rev 200875)
+++ trunk/Source/WebCore/editing/Editor.cpp	2016-05-13 19:34:48 UTC (rev 200876)
@@ -550,7 +550,7 @@
     if (AXObjectCache::accessibilityEnabled() && editingAction == EditActionPaste) {
         String text = AccessibilityObject::stringForVisiblePositionRange(command->visibleSelectionForInsertedText());
         replacedText.postTextStateChangeNotification(document().existingAXObjectCache(), AXTextEditTypePaste, text, m_frame.selection().selection());
-        command->composition()->setTextInsertedByUnapplyRange(replacedText.replacedRange());
+        command->composition()->setRangeDeletedByUnapply(replacedText.replacedRange());
     }
 
     if (!isContinuousSpellCheckingEnabled())

Modified: trunk/Source/WebCore/editing/TypingCommand.cpp (200875 => 200876)


--- trunk/Source/WebCore/editing/TypingCommand.cpp	2016-05-13 19:19:01 UTC (rev 200875)
+++ trunk/Source/WebCore/editing/TypingCommand.cpp	2016-05-13 19:34:48 UTC (rev 200876)
@@ -256,7 +256,7 @@
     VisiblePositionIndexRange range;
     range.startIndex.value = indexForVisiblePosition(selection.start(), range.startIndex.scope);
     range.endIndex.value = indexForVisiblePosition(selection.end(), range.endIndex.scope);
-    composition()->setTextInsertedByUnapplyRange(range);
+    composition()->setRangeDeletedByUnapply(range);
 }
 
 void TypingCommand::doApply()
@@ -383,7 +383,7 @@
     AccessibilityReplacedText replacedText(frame().selection().selection());
     insertText(text, selectInsertedText);
     replacedText.postTextStateChangeNotification(document().existingAXObjectCache(), AXTextEditTypeTyping, text, frame().selection().selection());
-    composition()->setTextInsertedByUnapplyRange(replacedText.replacedRange());
+    composition()->setRangeDeletedByUnapply(replacedText.replacedRange());
 }
 
 void TypingCommand::insertTextRunWithoutNewlines(const String &text, bool selectInsertedText)
@@ -410,7 +410,7 @@
     AccessibilityReplacedText replacedText(frame().selection().selection());
     insertLineBreak();
     replacedText.postTextStateChangeNotification(document().existingAXObjectCache(), AXTextEditTypeTyping, "\n", frame().selection().selection());
-    composition()->setTextInsertedByUnapplyRange(replacedText.replacedRange());
+    composition()->setRangeDeletedByUnapply(replacedText.replacedRange());
 }
 
 void TypingCommand::insertParagraphSeparator()
@@ -427,7 +427,7 @@
     AccessibilityReplacedText replacedText(frame().selection().selection());
     insertParagraphSeparator();
     replacedText.postTextStateChangeNotification(document().existingAXObjectCache(), AXTextEditTypeTyping, "\n", frame().selection().selection());
-    composition()->setTextInsertedByUnapplyRange(replacedText.replacedRange());
+    composition()->setRangeDeletedByUnapply(replacedText.replacedRange());
 }
 
 void TypingCommand::insertParagraphSeparatorInQuotedContent()
@@ -448,7 +448,7 @@
     AccessibilityReplacedText replacedText(frame().selection().selection());
     insertParagraphSeparatorInQuotedContent();
     replacedText.postTextStateChangeNotification(document().existingAXObjectCache(), AXTextEditTypeTyping, "\n", frame().selection().selection());
-    composition()->setTextInsertedByUnapplyRange(replacedText.replacedRange());
+    composition()->setRangeDeletedByUnapply(replacedText.replacedRange());
 }
 
 bool TypingCommand::makeEditableRootEmpty()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to