<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[199030] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/199030">199030</a></dd>
<dt>Author</dt> <dd>d_russell@apple.com</dd>
<dt>Date</dt> <dd>2016-04-04 16:17:59 -0700 (Mon, 04 Apr 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>AX: new lines in content editable elements don't notify accessibility
https://bugs.webkit.org/show_bug.cgi?id=153361
Reviewed by Ryosuke Niwa.
Relocate accessibility edit notification logic into higher level logic.
Typing notifications relocated into TypingCommand.
Cut & Paste notifications relocated into Editor.
Undo relocated into EditCommandComposition.
Tests: accessibility/mac/value-change/value-change-user-info-contenteditable.html
accessibility/mac/value-change/value-change-user-info-textarea.html
accessibility/mac/value-change/value-change-user-info-textfield.html
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXObjectCache.cpp:
(WebCore::AccessibilityReplacedText::AccessibilityReplacedText):
(WebCore::AccessibilityReplacedText::postTextStateChangeNotification):
(WebCore::AXObjectCache::postTextStateChangeNotification):
(WebCore::AXObjectCache::postTextReplacementNotification):
* accessibility/AXObjectCache.h:
(WebCore::VisiblePositionIndexRange::isNull):
(WebCore::AccessibilityReplacedText::AccessibilityReplacedText):
(WebCore::AccessibilityReplacedText::replacedRange):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::listMarkerTextForNodeAndPosition):
(WebCore::AccessibilityObject::stringForVisiblePositionRange):
* accessibility/AccessibilityObject.h:
(WebCore::VisiblePositionRange::VisiblePositionRange):
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::postTextStateChangePlatformNotification):
(WebCore::AXObjectCache::postTextReplacementPlatformNotification):
* editing/AppendNodeCommand.cpp:
(WebCore::AppendNodeCommand::doApply): Deleted.
(WebCore::AppendNodeCommand::doUnapply): Deleted.
* editing/CompositeEditCommand.cpp:
(WebCore::AccessibilityUndoReplacedText::indexForVisiblePosition):
(WebCore::AccessibilityUndoReplacedText::confgureTextToBeDeletedByUnapplyIndexesWithEditCommandEndingSelection):
(WebCore::AccessibilityUndoReplacedText::confgureTextToBeDeletedByUnapplyStartIndexWithEditCommandStartingSelection):
(WebCore::AccessibilityUndoReplacedText::setTextInsertedByUnapplyRange):
(WebCore::AccessibilityUndoReplacedText::captureTextToBeDeletedByUnapply):
(WebCore::AccessibilityUndoReplacedText::captureTextToBeDeletedByReapply):
(WebCore::stringForVisiblePositionIndexRange):
(WebCore::AccessibilityUndoReplacedText::textInsertedByUnapply):
(WebCore::AccessibilityUndoReplacedText::textInsertedByReapply):
(WebCore::postTextStateChangeNotification):
(WebCore::AccessibilityUndoReplacedText::postTextStateChangeNotificationForUnapply):
(WebCore::AccessibilityUndoReplacedText::postTextStateChangeNotificationForReapply):
(WebCore::EditCommandComposition::EditCommandComposition):
(WebCore::EditCommandComposition::unapply):
(WebCore::EditCommandComposition::reapply):
(WebCore::EditCommandComposition::setStartingSelection):
(WebCore::EditCommandComposition::setEndingSelection):
(WebCore::EditCommandComposition::setTextInsertedByUnapplyRange):
(WebCore::CompositeEditCommand::removeNode):
(WebCore::CompositeEditCommand::replaceTextInNode):
(WebCore::deleteSelectionEditingActionForEditingAction):
(WebCore::CompositeEditCommand::deleteSelection):
(WebCore::CompositeEditCommand::applyStyle): Deleted.
(WebCore::CompositeEditCommand::updatePositionForNodeRemovalPreservingChildren): Deleted.
(WebCore::CompositeEditCommand::inputText): Deleted.
* editing/CompositeEditCommand.h:
(WebCore::AccessibilityUndoReplacedText::AccessibilityUndoReplacedText):
* editing/DeleteFromTextNodeCommand.cpp:
(WebCore::DeleteFromTextNodeCommand::doApply): Deleted.
(WebCore::DeleteFromTextNodeCommand::getNodesInCommand): Deleted.
* editing/DeleteFromTextNodeCommand.h:
* editing/DictationCommand.cpp:
(WebCore::DictationCommand::doApply):
* editing/EditCommand.cpp:
(WebCore::EditCommand::postTextStateChangeNotification):
(WebCore::SimpleEditCommand::SimpleEditCommand): Deleted.
(WebCore::SimpleEditCommand::doReapply): Deleted.
(WebCore::SimpleEditCommand::addNodeAndDescendants): Deleted.
* editing/EditCommand.h:
* editing/EditingAllInOne.cpp:
* editing/Editor.cpp:
(WebCore::Editor::replaceSelectionWithFragment):
(WebCore::Editor::appliedEditing):
(WebCore::Editor::unappliedEditing):
(WebCore::Editor::postTextStateChangeNotificationForCut):
(WebCore::Editor::performCutOrCopy):
(WebCore::Editor::changeSelectionAfterCommand):
(WebCore::dispatchEditableContentChangedEvents): Deleted.
(WebCore::Editor::addTextToKillRing): Deleted.
* editing/Editor.h:
* editing/InsertIntoTextNodeCommand.cpp:
(WebCore::InsertIntoTextNodeCommand::doApply): Deleted.
(WebCore::InsertIntoTextNodeCommand::getNodesInCommand): Deleted.
* editing/InsertNodeBeforeCommand.cpp:
(WebCore::InsertNodeBeforeCommand::doApply): Deleted.
(WebCore::InsertNodeBeforeCommand::doUnapply): Deleted.
(WebCore::InsertNodeBeforeCommand::getNodesInCommand): Deleted.
* editing/RemoveNodeCommand.cpp:
(WebCore::RemoveNodeCommand::RemoveNodeCommand):
* editing/RemoveNodeCommand.h:
(WebCore::RemoveNodeCommand::create):
* editing/ReplaceDeleteFromTextNodeCommand.cpp: Removed.
* editing/ReplaceDeleteFromTextNodeCommand.h: Removed.
* editing/ReplaceInsertIntoTextNodeCommand.cpp: Removed.
* editing/ReplaceInsertIntoTextNodeCommand.h: Removed.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::doApply):
(WebCore::ReplaceSelectionCommand::completeHTMLReplacement):
(WebCore::ReplaceSelectionCommand::performTrivialReplace):
* editing/ReplaceSelectionCommand.h:
(WebCore::ReplaceSelectionCommand::visibleSelectionForInsertedText):
* editing/TextInsertionBaseCommand.cpp:
(WebCore::TextInsertionBaseCommand::TextInsertionBaseCommand):
* editing/TextInsertionBaseCommand.h:
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::TypingCommand):
(WebCore::TypingCommand::insertText):
(WebCore::TypingCommand::insertLineBreak):
(WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
(WebCore::TypingCommand::insertParagraphSeparator):
(WebCore::TypingCommand::postTextStateChangeNotificationForDeletion):
(WebCore::TypingCommand::doApply):
(WebCore::TypingCommand::insertTextAndNotifyAccessibility):
(WebCore::TypingCommand::insertLineBreakAndNotifyAccessibility):
(WebCore::TypingCommand::insertParagraphSeparatorAndNotifyAccessibility):
(WebCore::TypingCommand::insertParagraphSeparatorInQuotedContentAndNotifyAccessibility):
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):
* editing/TypingCommand.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsaccessibilitymacselectionvaluechangesforariatextboxexpectedtxt">trunk/LayoutTests/accessibility/mac/selection-value-changes-for-aria-textbox-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAXObjectCachecpp">trunk/Source/WebCore/accessibility/AXObjectCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAXObjectCacheh">trunk/Source/WebCore/accessibility/AXObjectCache.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjecth">trunk/Source/WebCore/accessibility/AccessibilityObject.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilitymacAXObjectCacheMacmm">trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm</a></li>
<li><a href="#trunkSourceWebCoreeditingAppendNodeCommandcpp">trunk/Source/WebCore/editing/AppendNodeCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingCompositeEditCommandcpp">trunk/Source/WebCore/editing/CompositeEditCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingCompositeEditCommandh">trunk/Source/WebCore/editing/CompositeEditCommand.h</a></li>
<li><a href="#trunkSourceWebCoreeditingDeleteFromTextNodeCommandcpp">trunk/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingDeleteFromTextNodeCommandh">trunk/Source/WebCore/editing/DeleteFromTextNodeCommand.h</a></li>
<li><a href="#trunkSourceWebCoreeditingDictationCommandcpp">trunk/Source/WebCore/editing/DictationCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditCommandcpp">trunk/Source/WebCore/editing/EditCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditCommandh">trunk/Source/WebCore/editing/EditCommand.h</a></li>
<li><a href="#trunkSourceWebCoreeditingEditingAllInOnecpp">trunk/Source/WebCore/editing/EditingAllInOne.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorcpp">trunk/Source/WebCore/editing/Editor.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorh">trunk/Source/WebCore/editing/Editor.h</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertIntoTextNodeCommandcpp">trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertNodeBeforeCommandcpp">trunk/Source/WebCore/editing/InsertNodeBeforeCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingRemoveNodeCommandcpp">trunk/Source/WebCore/editing/RemoveNodeCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingRemoveNodeCommandh">trunk/Source/WebCore/editing/RemoveNodeCommand.h</a></li>
<li><a href="#trunkSourceWebCoreeditingReplaceSelectionCommandcpp">trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingReplaceSelectionCommandh">trunk/Source/WebCore/editing/ReplaceSelectionCommand.h</a></li>
<li><a href="#trunkSourceWebCoreeditingTextInsertionBaseCommandcpp">trunk/Source/WebCore/editing/TextInsertionBaseCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingTextInsertionBaseCommandh">trunk/Source/WebCore/editing/TextInsertionBaseCommand.h</a></li>
<li><a href="#trunkSourceWebCoreeditingTypingCommandcpp">trunk/Source/WebCore/editing/TypingCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingTypingCommandh">trunk/Source/WebCore/editing/TypingCommand.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/accessibility/mac/value-change/</li>
<li><a href="#trunkLayoutTestsaccessibilitymacvaluechangevaluechangehelpersjs">trunk/LayoutTests/accessibility/mac/value-change/value-change-helpers.js</a></li>
<li><a href="#trunkLayoutTestsaccessibilitymacvaluechangevaluechangeuserinfocontenteditableexpectedtxt">trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilitymacvaluechangevaluechangeuserinfocontenteditablehtml">trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable.html</a></li>
<li><a href="#trunkLayoutTestsaccessibilitymacvaluechangevaluechangeuserinfotextareaexpectedtxt">trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textarea-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilitymacvaluechangevaluechangeuserinfotextareahtml">trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textarea.html</a></li>
<li><a href="#trunkLayoutTestsaccessibilitymacvaluechangevaluechangeuserinfotextfieldexpectedtxt">trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textfield-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilitymacvaluechangevaluechangeuserinfotextfieldhtml">trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textfield.html</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsaccessibilitymacvaluechangeuserinfoexpectedtxt">trunk/LayoutTests/accessibility/mac/value-change-userinfo-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilitymacvaluechangeuserinfohtml">trunk/LayoutTests/accessibility/mac/value-change-userinfo.html</a></li>
<li><a href="#trunkSourceWebCoreeditingReplaceDeleteFromTextNodeCommandcpp">trunk/Source/WebCore/editing/ReplaceDeleteFromTextNodeCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingReplaceDeleteFromTextNodeCommandh">trunk/Source/WebCore/editing/ReplaceDeleteFromTextNodeCommand.h</a></li>
<li><a href="#trunkSourceWebCoreeditingReplaceInsertIntoTextNodeCommandcpp">trunk/Source/WebCore/editing/ReplaceInsertIntoTextNodeCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingReplaceInsertIntoTextNodeCommandh">trunk/Source/WebCore/editing/ReplaceInsertIntoTextNodeCommand.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/LayoutTests/ChangeLog        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2016-04-04 Doug Russell <d_russell@apple.com>
+
+ AX: new lines in content editable elements don't notify accessibility
+ https://bugs.webkit.org/show_bug.cgi?id=153361
+
+ Reviewed by Ryosuke Niwa.
+
+ Relocate accessibility edit notification logic into higher level logic.
+ Typing notifications relocated into TypingCommand.
+ Cut & Paste notifications relocated into Editor.
+ Undo relocated into EditCommandComposition.
+
+ * accessibility/mac/selection-value-changes-for-aria-textbox-expected.txt:
+ * accessibility/mac/value-change-userinfo-expected.txt: Removed.
+ * accessibility/mac/value-change-userinfo.html: Removed.
+ * accessibility/mac/value-change/value-change-helpers.js: Added.
+ (stringForEditType):
+ (bump):
+ (shouldBeInsert):
+ (shouldBeTyping):
+ (shouldBeDelete):
+ (shouldBeCut):
+ (shouldBePaste):
+ (shouldBeReplace):
+ (shouldBePasteReplace):
+ (shouldBeTypingReplace):
+ (shouldBeInsertReplace):
+ * accessibility/mac/value-change/value-change-user-info-contenteditable-expected.txt: Added.
+ * accessibility/mac/value-change/value-change-user-info-contenteditable.html: Added.
+ * accessibility/mac/value-change/value-change-user-info-textarea-expected.txt: Added.
+ * accessibility/mac/value-change/value-change-user-info-textarea.html: Added.
+ * accessibility/mac/value-change/value-change-user-info-textfield-expected.txt: Added.
+ * accessibility/mac/value-change/value-change-user-info-textfield.html: Added.
+
</ins><span class="cx"> 2016-04-04 Dean Jackson <dino@apple.com>
</span><span class="cx">
</span><span class="cx"> Add color-gamut media query support
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymacselectionvaluechangesforariatextboxexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/mac/selection-value-changes-for-aria-textbox-expected.txt (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/selection-value-changes-for-aria-textbox-expected.txt        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/LayoutTests/accessibility/mac/selection-value-changes-for-aria-textbox-expected.txt        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -11,5 +11,6 @@
</span><span class="cx"> Successfully received AXSelectedTextChanged
</span><span class="cx"> Successfully received AXSelectedTextChanged
</span><span class="cx"> Successfully received AXSelectedTextChanged
</span><ins>+Successfully received AXSelectedTextChanged
</ins><span class="cx"> Successfully received AXValueChanged
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymacvaluechangevaluechangehelpersjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/mac/value-change/value-change-helpers.js (0 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/value-change/value-change-helpers.js         (rev 0)
+++ trunk/LayoutTests/accessibility/mac/value-change/value-change-helpers.js        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -0,0 +1,88 @@
</span><ins>+var AXTextStateChangeTypeEdit = 1;
+
+var AXTextEditTypeDelete = 1;
+var AXTextEditTypeInsert = AXTextEditTypeDelete + 1;
+var AXTextEditTypeTyping = AXTextEditTypeInsert + 1;
+var AXTextEditTypeDictation = AXTextEditTypeTyping + 1;
+var AXTextEditTypeCut = AXTextEditTypeDictation + 1
+var AXTextEditTypePaste = AXTextEditTypeCut + 1;
+
+function stringForEditType(editType) {
+ if (editType == AXTextEditTypeDelete) {
+ return "Delete";
+ } else if (editType == AXTextEditTypeInsert) {
+ return "Insert";
+ } else if (editType == AXTextEditTypeTyping) {
+ return "Typing";
+ } else if (editType == AXTextEditTypeDictation) {
+ return "Dictation";
+ } else if (editType == AXTextEditTypeCut) {
+ return "Cut";
+ } else if (editType == AXTextEditTypePaste) {
+ return "Paste";
+ }
+ return "Unknown";
+}
+
+function bump(value) {
+ resultIndex++;
+ expectedValues[resultIndex] = value
+}
+
+function shouldBeInsert(value) {
+ bump(value);
+ shouldBe("actualChangeTypes[resultIndex]", "AXTextStateChangeTypeEdit");
+ shouldBe("actualChangeValues[resultIndex]", "expectedValues[resultIndex]");
+ shouldBe("actualEditTypes[resultIndex]", "\"Insert\"");
+}
+
+function shouldBeTyping(value) {
+ bump(value);
+ shouldBe("actualChangeTypes[resultIndex]", "AXTextStateChangeTypeEdit");
+ shouldBe("actualChangeValues[resultIndex]", "expectedValues[resultIndex]");
+ shouldBe("actualEditTypes[resultIndex]", "\"Typing\"");
+}
+
+function shouldBeDelete(value) {
+ bump(value);
+ shouldBe("actualChangeTypes[resultIndex]", "AXTextStateChangeTypeEdit");
+ shouldBe("actualChangeValues[resultIndex]", "expectedValues[resultIndex]");
+ shouldBe("actualEditTypes[resultIndex]", "\"Delete\"");
+}
+
+function shouldBeCut(value) {
+ bump(value);
+ shouldBe("actualChangeTypes[resultIndex]", "AXTextStateChangeTypeEdit");
+ shouldBe("actualChangeValues[resultIndex]", "expectedValues[resultIndex]");
+ shouldBe("actualEditTypes[resultIndex]", "\"Cut\"");
+}
+
+function shouldBePaste(value) {
+ bump(value);
+ shouldBe("actualChangeTypes[resultIndex]", "AXTextStateChangeTypeEdit");
+ shouldBe("actualChangeValues[resultIndex]", "expectedValues[resultIndex]");
+ shouldBe("actualEditTypes[resultIndex]", "\"Paste\"");
+}
+
+function shouldBeReplace(deletedValue, insertedValue) {
+ bump([deletedValue, insertedValue]);
+ shouldBe("actualChangeTypes[resultIndex]", "AXTextStateChangeTypeEdit");
+ shouldBe("actualChangeValues[resultIndex][0]", "expectedValues[resultIndex][0]");
+ shouldBe("actualEditTypes[resultIndex][0]", "\"Delete\"");
+ shouldBe("actualChangeValues[resultIndex][1]", "expectedValues[resultIndex][1]");
+}
+
+function shouldBePasteReplace(deletedValue, insertedValue) {
+ shouldBeReplace(deletedValue, insertedValue);
+ shouldBe("actualEditTypes[resultIndex][1]", "\"Paste\"");
+}
+
+function shouldBeTypingReplace(deletedValue, insertedValue) {
+ shouldBeReplace(deletedValue, insertedValue);
+ shouldBe("actualEditTypes[resultIndex][1]", "\"Typing\"");
+}
+
+function shouldBeInsertReplace(deletedValue, insertedValue) {
+ shouldBeReplace(deletedValue, insertedValue);
+ shouldBe("actualEditTypes[resultIndex][1]", "\"Insert\"");
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymacvaluechangevaluechangeuserinfocontenteditableexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable-expected.txt (0 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable-expected.txt         (rev 0)
+++ trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable-expected.txt        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+223
+This tests value change notifications user info data.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS addedNotification is true
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex] is expectedValues[resultIndex]
+PASS actualEditTypes[resultIndex] is "Typing"
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex] is expectedValues[resultIndex]
+PASS actualEditTypes[resultIndex] is "Delete"
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex] is expectedValues[resultIndex]
+PASS actualEditTypes[resultIndex] is "Typing"
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex] is expectedValues[resultIndex]
+PASS actualEditTypes[resultIndex] is "Delete"
+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 "Typing"
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex] is expectedValues[resultIndex]
+PASS actualEditTypes[resultIndex] is "Cut"
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex] is expectedValues[resultIndex]
+PASS actualEditTypes[resultIndex] is "Paste"
+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 "Paste"
+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 "Typing"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymacvaluechangevaluechangeuserinfocontenteditablehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable.html (0 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable.html         (rev 0)
+++ trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable.html        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -0,0 +1,102 @@
</span><ins>+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+ <script src="../../../resources/js-test-pre.js"></script>
+ <script src="../../../editing/editing.js"></script>
+ <script src="value-change-helpers.js"></script>
+</head>
+<body id="body">
+
+ <div role="textbox" id="textbox" contenteditable=true>123</div>
+
+ <p id="description"></p>
+ <div id="console"></div>
+ <div id="notifications"></div>
+
+ <script>
+
+ description("This tests value change notifications user info data.");
+
+ var webArea = 0;
+ var count = 0;
+
+ var resultIndex = -1;
+
+ var actualChangeTypes = [];
+ var actualChangeValues = [];
+ var actualEditTypes = [];
+
+ var expectedValues = [];
+
+ function notificationCallback(notification, userInfo) {
+ if (notification == "AXValueChanged") {
+
+ actualChangeTypes[count] = userInfo["AXTextStateChangeType"];
+ var changes = userInfo["AXTextChangeValues"];
+ if (changes && changes.length == 1) {
+ var change = changes[0];
+ actualChangeValues[count] = change["AXTextChangeValue"];
+ actualEditTypes[count] = stringForEditType(change["AXTextEditType"])
+ } else if (changes && changes.length == 2) {
+ var change1 = changes[0];
+ var change2 = changes[1];
+ actualChangeValues[count] = [change1["AXTextChangeValue"], change2["AXTextChangeValue"]];
+ actualEditTypes[count] = [stringForEditType(change1["AXTextEditType"]), stringForEditType(change2["AXTextEditType"])];
+ }
+
+ count++;
+ if (count == 9) {
+
+ shouldBeTyping("1");
+ shouldBeDelete("1");
+ shouldBeTyping("\n");
+ shouldBeDelete("\n");
+ shouldBeTypingReplace("1", "2");
+ shouldBeCut("2");
+ shouldBePaste("2");
+ shouldBePasteReplace("3", "2");
+ shouldBeTypingReplace("2", "3");
+
+ webArea.removeNotificationListener();
+ window.testRunner.notifyDone();
+ }
+ }
+ }
+
+ if (window.accessibilityController) {
+ window.testRunner.waitUntilDone();
+
+ accessibilityController.enableEnhancedAccessibility(true);
+
+ webArea = accessibilityController.rootElement.childAtIndex(0);
+ var addedNotification = webArea.addNotificationListener(notificationCallback);
+ shouldBe("addedNotification", "true");
+
+ var textbox = document.getElementById("textbox");
+ textbox.focus();
+
+ eventSender.keyDown("1");
+ deleteCommand();
+
+ eventSender.keyDown("\n");
+ deleteCommand();
+
+ execExtendSelectionRightByCharacterCommand();
+ eventSender.keyDown("2");
+
+ execExtendSelectionRightByCharacterCommand();
+ cutCommand();
+
+ pasteCommand();
+
+ execExtendSelectionRightByCharacterCommand();
+ pasteCommand();
+
+ execExtendSelectionLeftByCharacterCommand();
+ eventSender.keyDown("3");
+ }
+ </script>
+
+ <script src="../../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymacvaluechangevaluechangeuserinfotextareaexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textarea-expected.txt (0 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textarea-expected.txt         (rev 0)
+++ trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textarea-expected.txt        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+
+This tests value change notifications user info data.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS addedNotification is true
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex] is expectedValues[resultIndex]
+PASS actualEditTypes[resultIndex] is "Typing"
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex] is expectedValues[resultIndex]
+PASS actualEditTypes[resultIndex] is "Delete"
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex] is expectedValues[resultIndex]
+PASS actualEditTypes[resultIndex] is "Typing"
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex] is expectedValues[resultIndex]
+PASS actualEditTypes[resultIndex] is "Delete"
+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 "Typing"
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex] is expectedValues[resultIndex]
+PASS actualEditTypes[resultIndex] is "Cut"
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex] is expectedValues[resultIndex]
+PASS actualEditTypes[resultIndex] is "Paste"
+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 "Paste"
+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 "Typing"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymacvaluechangevaluechangeuserinfotextareahtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textarea.html (0 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textarea.html         (rev 0)
+++ trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textarea.html        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -0,0 +1,104 @@
</span><ins>+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+ <script src="../../../resources/js-test-pre.js"></script>
+ <script src="../../../editing/editing.js"></script>
+ <script src="value-change-helpers.js"></script>
+</head>
+<body id="body">
+
+ <textarea id="textbox">456</textarea>
+
+ <p id="description"></p>
+ <div id="console"></div>
+ <div id="notifications"></div>
+
+ <script>
+
+ description("This tests value change notifications user info data.");
+
+ var webArea = 0;
+ var count = 0;
+
+ var resultIndex = -1;
+
+ var actualChangeTypes = [];
+ var actualChangeValues = [];
+ var actualEditTypes = [];
+
+ var expectedValues = [];
+
+ function notificationCallback(notification, userInfo) {
+ if (notification == "AXValueChanged") {
+
+ actualChangeTypes[count] = userInfo["AXTextStateChangeType"];
+ var changes = userInfo["AXTextChangeValues"];
+ if (changes && changes.length == 1) {
+ var change = changes[0];
+ actualChangeValues[count] = change["AXTextChangeValue"];
+ actualEditTypes[count] = stringForEditType(change["AXTextEditType"])
+ } else if (changes && changes.length == 2) {
+ var change1 = changes[0];
+ var change2 = changes[1];
+ actualChangeValues[count] = [change1["AXTextChangeValue"], change2["AXTextChangeValue"]];
+ actualEditTypes[count] = [stringForEditType(change1["AXTextEditType"]), stringForEditType(change2["AXTextEditType"])];
+ }
+
+ count++;
+
+ var expectedCount = 9;
+ if (count == expectedCount) {
+
+ shouldBeTyping("3");
+ shouldBeDelete("3");
+ shouldBeTyping("\n");
+ shouldBeDelete("\n");
+ shouldBeTypingReplace("4", "5");
+ shouldBeCut("5");
+ shouldBePaste("5");
+ shouldBePasteReplace("6", "5");
+ shouldBeTypingReplace("5", "6");
+
+ webArea.removeNotificationListener();
+ window.testRunner.notifyDone();
+ }
+ }
+ }
+
+ if (window.accessibilityController) {
+ window.testRunner.waitUntilDone();
+
+ accessibilityController.enableEnhancedAccessibility(true);
+
+ webArea = accessibilityController.rootElement.childAtIndex(0);
+ var addedNotification = webArea.addNotificationListener(notificationCallback);
+ shouldBe("addedNotification", "true");
+
+ var textbox = document.getElementById("textbox");
+ textbox.focus();
+
+ eventSender.keyDown("3");
+ deleteCommand();
+
+ eventSender.keyDown("\n");
+ deleteCommand();
+
+ execExtendSelectionRightByCharacterCommand();
+ eventSender.keyDown("5");
+
+ execExtendSelectionRightByCharacterCommand();
+ cutCommand();
+
+ pasteCommand();
+
+ execExtendSelectionRightByCharacterCommand();
+ pasteCommand();
+
+ execExtendSelectionLeftByCharacterCommand();
+ eventSender.keyDown("6");
+ }
+ </script>
+
+ <script src="../../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymacvaluechangevaluechangeuserinfotextfieldexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textfield-expected.txt (0 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textfield-expected.txt         (rev 0)
+++ trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textfield-expected.txt        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+
+This tests value change notifications user info data.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS addedNotification is true
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex] is expectedValues[resultIndex]
+PASS actualEditTypes[resultIndex] is "Typing"
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex] is expectedValues[resultIndex]
+PASS actualEditTypes[resultIndex] is "Delete"
+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 "Typing"
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex] is expectedValues[resultIndex]
+PASS actualEditTypes[resultIndex] is "Cut"
+PASS actualChangeTypes[resultIndex] is AXTextStateChangeTypeEdit
+PASS actualChangeValues[resultIndex] is expectedValues[resultIndex]
+PASS actualEditTypes[resultIndex] is "Paste"
+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 "Paste"
+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 "Typing"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymacvaluechangevaluechangeuserinfotextfieldhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textfield.html (0 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textfield.html         (rev 0)
+++ trunk/LayoutTests/accessibility/mac/value-change/value-change-user-info-textfield.html        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -0,0 +1,100 @@
</span><ins>+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+ <script src="../../../resources/js-test-pre.js"></script>
+ <script src="../../../editing/editing.js"></script>
+ <script src="value-change-helpers.js"></script>
+</head>
+<body id="body">
+
+ <input type="text" id="textbox" value="789"></input>
+
+ <p id="description"></p>
+ <div id="console"></div>
+ <div id="notifications"></div>
+
+ <script>
+
+ description("This tests value change notifications user info data.");
+
+ var webArea = 0;
+ var count = 0;
+
+ var resultIndex = -1;
+
+ var actualChangeTypes = [];
+ var actualChangeValues = [];
+ var actualEditTypes = [];
+
+ var expectedValues = [];
+
+ function notificationCallback(notification, userInfo) {
+ if (notification == "AXValueChanged") {
+
+ actualChangeTypes[count] = userInfo["AXTextStateChangeType"];
+ var changes = userInfo["AXTextChangeValues"];
+ if (changes && changes.length == 1) {
+ var change = changes[0];
+ actualChangeValues[count] = change["AXTextChangeValue"];
+ actualEditTypes[count] = stringForEditType(change["AXTextEditType"])
+ } else if (changes && changes.length == 2) {
+ var change1 = changes[0];
+ var change2 = changes[1];
+ actualChangeValues[count] = [change1["AXTextChangeValue"], change2["AXTextChangeValue"]];
+ actualEditTypes[count] = [stringForEditType(change1["AXTextEditType"]), stringForEditType(change2["AXTextEditType"])];
+ }
+
+ count++;
+
+ var expectedCount = 7;
+ if (count == expectedCount) {
+
+ shouldBeTyping("6");
+ shouldBeDelete("6");
+ shouldBeTypingReplace("7", "8");
+ shouldBeCut("8");
+ shouldBePaste("8");
+ shouldBePasteReplace("9", "8");
+ shouldBeTypingReplace("8", "9");
+
+ webArea.removeNotificationListener();
+ window.testRunner.notifyDone();
+ }
+ }
+ }
+
+ if (window.accessibilityController) {
+ window.testRunner.waitUntilDone();
+
+ accessibilityController.enableEnhancedAccessibility(true);
+
+ webArea = accessibilityController.rootElement.childAtIndex(0);
+ var addedNotification = webArea.addNotificationListener(notificationCallback);
+ shouldBe("addedNotification", "true");
+
+ var textbox = document.getElementById("textbox");
+ textbox.focus();
+ execMoveSelectionLeftByCharacterCommand();
+
+ eventSender.keyDown("6");
+ deleteCommand();
+
+ execExtendSelectionRightByCharacterCommand();
+ eventSender.keyDown("8");
+
+ execExtendSelectionRightByCharacterCommand();
+ cutCommand();
+
+ pasteCommand();
+
+ execExtendSelectionRightByCharacterCommand();
+ pasteCommand();
+
+ execExtendSelectionLeftByCharacterCommand();
+ eventSender.keyDown("9");
+ }
+ </script>
+
+ <script src="../../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymacvaluechangeuserinfoexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/accessibility/mac/value-change-userinfo-expected.txt (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/value-change-userinfo-expected.txt        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/LayoutTests/accessibility/mac/value-change-userinfo-expected.txt        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -1,29 +0,0 @@
</span><del>-0234567890
-This tests value change notifications user info data.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS addedNotification is true
-PASS results[resultIndex]["AXTextStateChangeType"] is AXTextStateChangeTypeEdit
-PASS results[resultIndex]["AXTextChangeValues"][0]["AXTextChangeValue"] is "0"
-PASS results[resultIndex]["AXTextChangeValues"][0]["AXTextEditType"] is AXTextEditTypeCut
-PASS results[resultIndex]["AXTextStateChangeType"] is AXTextStateChangeTypeEdit
-PASS results[resultIndex]["AXTextChangeValues"][0]["AXTextChangeValue"] is "1"
-PASS results[resultIndex]["AXTextChangeValues"][0]["AXTextEditType"] is AXTextEditTypeDelete
-PASS results[resultIndex]["AXTextStateChangeType"] is AXTextStateChangeTypeEdit
-PASS results[resultIndex]["AXTextChangeValues"][0]["AXTextChangeValue"] is "0"
-PASS results[resultIndex]["AXTextChangeValues"][0]["AXTextEditType"] is AXTextEditTypePaste
-PASS results[resultIndex]["AXTextStateChangeType"] is AXTextStateChangeTypeEdit
-PASS results[resultIndex]["AXTextChangeValues"][0]["AXTextChangeValue"] is "234567890"
-PASS results[resultIndex]["AXTextChangeValues"][0]["AXTextEditType"] is AXTextEditTypePaste
-PASS results[resultIndex]["AXTextStateChangeType"] is AXTextStateChangeTypeEdit
-PASS results[resultIndex]["AXTextChangeValues"][0]["AXTextChangeValue"] is "1"
-PASS results[resultIndex]["AXTextChangeValues"][0]["AXTextEditType"] is AXTextEditTypeTyping
-PASS results[resultIndex]["AXTextStateChangeType"] is AXTextStateChangeTypeEdit
-PASS results[resultIndex]["AXTextChangeValues"][0]["AXTextChangeValue"] is "1"
-PASS results[resultIndex]["AXTextChangeValues"][0]["AXTextEditType"] is AXTextEditTypeDelete
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymacvaluechangeuserinfohtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/accessibility/mac/value-change-userinfo.html (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/value-change-userinfo.html        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/LayoutTests/accessibility/mac/value-change-userinfo.html        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -1,97 +0,0 @@
</span><del>-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
- <script src="../../resources/js-test-pre.js"></script>
- <script src="../../editing/editing.js"></script>
-</head>
-<body id="body">
-
- <div role="textbox" tabindex=0 id="textbox" contenteditable=true>01234567890</div>
-
- <p id="description"></p>
- <div id="console"></div>
- <div id="notifications"></div>
-
- <script>
-
- description("This tests value change notifications user info data.");
-
- var AXTextStateChangeTypeEdit = 1;
-
- var AXTextEditTypeDelete = 1;
- var AXTextEditTypeInsert = AXTextEditTypeDelete + 1;
- var AXTextEditTypeTyping = AXTextEditTypeInsert + 1;
- var AXTextEditTypeDictation = AXTextEditTypeTyping + 1;
- var AXTextEditTypeCut = AXTextEditTypeDictation + 1
- var AXTextEditTypePaste = AXTextEditTypeCut + 1;
-
- var webArea = 0;
- var count = 0;
- var results = [];
- var resultIndex = 0;
- function notificationCallback(notification, userInfo) {
- if (notification == "AXValueChanged") {
- count++;
- results.push(userInfo);
- if (count == 6) {
-
- shouldBe("results[resultIndex][\"AXTextStateChangeType\"]", "AXTextStateChangeTypeEdit");
- shouldBe("results[resultIndex][\"AXTextChangeValues\"][0][\"AXTextChangeValue\"]", "\"0\"");
- shouldBe("results[resultIndex][\"AXTextChangeValues\"][0][\"AXTextEditType\"]", "AXTextEditTypeCut");
-
- resultIndex++;
- shouldBe("results[resultIndex][\"AXTextStateChangeType\"]", "AXTextStateChangeTypeEdit");
- shouldBe("results[resultIndex][\"AXTextChangeValues\"][0][\"AXTextChangeValue\"]", "\"1\"");
- shouldBe("results[resultIndex][\"AXTextChangeValues\"][0][\"AXTextEditType\"]", "AXTextEditTypeDelete");
-
- resultIndex++;
- shouldBe("results[resultIndex][\"AXTextStateChangeType\"]", "AXTextStateChangeTypeEdit");
- shouldBe("results[resultIndex][\"AXTextChangeValues\"][0][\"AXTextChangeValue\"]", "\"0\"");
- shouldBe("results[resultIndex][\"AXTextChangeValues\"][0][\"AXTextEditType\"]", "AXTextEditTypePaste");
-
- resultIndex++;
- shouldBe("results[resultIndex][\"AXTextStateChangeType\"]", "AXTextStateChangeTypeEdit");
- shouldBe("results[resultIndex][\"AXTextChangeValues\"][0][\"AXTextChangeValue\"]", "\"234567890\"");
- shouldBe("results[resultIndex][\"AXTextChangeValues\"][0][\"AXTextEditType\"]", "AXTextEditTypePaste");
-
- resultIndex++;
- shouldBe("results[resultIndex][\"AXTextStateChangeType\"]", "AXTextStateChangeTypeEdit");
- shouldBe("results[resultIndex][\"AXTextChangeValues\"][0][\"AXTextChangeValue\"]", "\"1\"");
- shouldBe("results[resultIndex][\"AXTextChangeValues\"][0][\"AXTextEditType\"]", "AXTextEditTypeTyping");
-
- resultIndex++;
- shouldBe("results[resultIndex][\"AXTextStateChangeType\"]", "AXTextStateChangeTypeEdit");
- shouldBe("results[resultIndex][\"AXTextChangeValues\"][0][\"AXTextChangeValue\"]", "\"1\"");
- shouldBe("results[resultIndex][\"AXTextChangeValues\"][0][\"AXTextEditType\"]", "AXTextEditTypeDelete");
-
- webArea.removeNotificationListener();
- window.testRunner.notifyDone();
- }
- }
- }
-
- if (window.accessibilityController) {
- window.testRunner.waitUntilDone();
-
- accessibilityController.enableEnhancedAccessibility(true);
-
- webArea = accessibilityController.rootElement.childAtIndex(0);
- var addedNotification = webArea.addNotificationListener(notificationCallback);
- shouldBe("addedNotification", "true");
-
- var textbox = document.getElementById("textbox");
- textbox.focus();
-
- execSetSelectionCommand(textbox, 0);
- execExtendSelectionRightByCharacterCommand();
- cutCommand();
- execExtendSelectionRightByCharacterCommand();
- pasteCommand();
- eventSender.keyDown("1");
- deleteCommand();
- }
- </script>
-
- <script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -1565,8 +1565,6 @@
</span><span class="cx"> editing/RemoveNodeCommand.cpp
</span><span class="cx"> editing/RemoveNodePreservingChildrenCommand.cpp
</span><span class="cx"> editing/RenderedPosition.cpp
</span><del>- editing/ReplaceDeleteFromTextNodeCommand.cpp
- editing/ReplaceInsertIntoTextNodeCommand.cpp
</del><span class="cx"> editing/ReplaceNodeWithSpanCommand.cpp
</span><span class="cx"> editing/ReplaceSelectionCommand.cpp
</span><span class="cx"> editing/SetNodeAttributeCommand.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/ChangeLog        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -1,3 +1,132 @@
</span><ins>+2016-04-04 Doug Russell <d_russell@apple.com>
+
+ AX: new lines in content editable elements don't notify accessibility
+ https://bugs.webkit.org/show_bug.cgi?id=153361
+
+ Reviewed by Ryosuke Niwa.
+
+ Relocate accessibility edit notification logic into higher level logic.
+ Typing notifications relocated into TypingCommand.
+ Cut & Paste notifications relocated into Editor.
+ Undo relocated into EditCommandComposition.
+
+ Tests: accessibility/mac/value-change/value-change-user-info-contenteditable.html
+ accessibility/mac/value-change/value-change-user-info-textarea.html
+ accessibility/mac/value-change/value-change-user-info-textfield.html
+
+ * CMakeLists.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * accessibility/AXObjectCache.cpp:
+ (WebCore::AccessibilityReplacedText::AccessibilityReplacedText):
+ (WebCore::AccessibilityReplacedText::postTextStateChangeNotification):
+ (WebCore::AXObjectCache::postTextStateChangeNotification):
+ (WebCore::AXObjectCache::postTextReplacementNotification):
+ * accessibility/AXObjectCache.h:
+ (WebCore::VisiblePositionIndexRange::isNull):
+ (WebCore::AccessibilityReplacedText::AccessibilityReplacedText):
+ (WebCore::AccessibilityReplacedText::replacedRange):
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::AccessibilityObject::listMarkerTextForNodeAndPosition):
+ (WebCore::AccessibilityObject::stringForVisiblePositionRange):
+ * accessibility/AccessibilityObject.h:
+ (WebCore::VisiblePositionRange::VisiblePositionRange):
+ * accessibility/mac/AXObjectCacheMac.mm:
+ (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
+ (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
+ * editing/AppendNodeCommand.cpp:
+ (WebCore::AppendNodeCommand::doApply): Deleted.
+ (WebCore::AppendNodeCommand::doUnapply): Deleted.
+ * editing/CompositeEditCommand.cpp:
+ (WebCore::AccessibilityUndoReplacedText::indexForVisiblePosition):
+ (WebCore::AccessibilityUndoReplacedText::confgureTextToBeDeletedByUnapplyIndexesWithEditCommandEndingSelection):
+ (WebCore::AccessibilityUndoReplacedText::confgureTextToBeDeletedByUnapplyStartIndexWithEditCommandStartingSelection):
+ (WebCore::AccessibilityUndoReplacedText::setTextInsertedByUnapplyRange):
+ (WebCore::AccessibilityUndoReplacedText::captureTextToBeDeletedByUnapply):
+ (WebCore::AccessibilityUndoReplacedText::captureTextToBeDeletedByReapply):
+ (WebCore::stringForVisiblePositionIndexRange):
+ (WebCore::AccessibilityUndoReplacedText::textInsertedByUnapply):
+ (WebCore::AccessibilityUndoReplacedText::textInsertedByReapply):
+ (WebCore::postTextStateChangeNotification):
+ (WebCore::AccessibilityUndoReplacedText::postTextStateChangeNotificationForUnapply):
+ (WebCore::AccessibilityUndoReplacedText::postTextStateChangeNotificationForReapply):
+ (WebCore::EditCommandComposition::EditCommandComposition):
+ (WebCore::EditCommandComposition::unapply):
+ (WebCore::EditCommandComposition::reapply):
+ (WebCore::EditCommandComposition::setStartingSelection):
+ (WebCore::EditCommandComposition::setEndingSelection):
+ (WebCore::EditCommandComposition::setTextInsertedByUnapplyRange):
+ (WebCore::CompositeEditCommand::removeNode):
+ (WebCore::CompositeEditCommand::replaceTextInNode):
+ (WebCore::deleteSelectionEditingActionForEditingAction):
+ (WebCore::CompositeEditCommand::deleteSelection):
+ (WebCore::CompositeEditCommand::applyStyle): Deleted.
+ (WebCore::CompositeEditCommand::updatePositionForNodeRemovalPreservingChildren): Deleted.
+ (WebCore::CompositeEditCommand::inputText): Deleted.
+ * editing/CompositeEditCommand.h:
+ (WebCore::AccessibilityUndoReplacedText::AccessibilityUndoReplacedText):
+ * editing/DeleteFromTextNodeCommand.cpp:
+ (WebCore::DeleteFromTextNodeCommand::doApply): Deleted.
+ (WebCore::DeleteFromTextNodeCommand::getNodesInCommand): Deleted.
+ * editing/DeleteFromTextNodeCommand.h:
+ * editing/DictationCommand.cpp:
+ (WebCore::DictationCommand::doApply):
+ * editing/EditCommand.cpp:
+ (WebCore::EditCommand::postTextStateChangeNotification):
+ (WebCore::SimpleEditCommand::SimpleEditCommand): Deleted.
+ (WebCore::SimpleEditCommand::doReapply): Deleted.
+ (WebCore::SimpleEditCommand::addNodeAndDescendants): Deleted.
+ * editing/EditCommand.h:
+ * editing/EditingAllInOne.cpp:
+ * editing/Editor.cpp:
+ (WebCore::Editor::replaceSelectionWithFragment):
+ (WebCore::Editor::appliedEditing):
+ (WebCore::Editor::unappliedEditing):
+ (WebCore::Editor::postTextStateChangeNotificationForCut):
+ (WebCore::Editor::performCutOrCopy):
+ (WebCore::Editor::changeSelectionAfterCommand):
+ (WebCore::dispatchEditableContentChangedEvents): Deleted.
+ (WebCore::Editor::addTextToKillRing): Deleted.
+ * editing/Editor.h:
+ * editing/InsertIntoTextNodeCommand.cpp:
+ (WebCore::InsertIntoTextNodeCommand::doApply): Deleted.
+ (WebCore::InsertIntoTextNodeCommand::getNodesInCommand): Deleted.
+ * editing/InsertNodeBeforeCommand.cpp:
+ (WebCore::InsertNodeBeforeCommand::doApply): Deleted.
+ (WebCore::InsertNodeBeforeCommand::doUnapply): Deleted.
+ (WebCore::InsertNodeBeforeCommand::getNodesInCommand): Deleted.
+ * editing/RemoveNodeCommand.cpp:
+ (WebCore::RemoveNodeCommand::RemoveNodeCommand):
+ * editing/RemoveNodeCommand.h:
+ (WebCore::RemoveNodeCommand::create):
+ * editing/ReplaceDeleteFromTextNodeCommand.cpp: Removed.
+ * editing/ReplaceDeleteFromTextNodeCommand.h: Removed.
+ * editing/ReplaceInsertIntoTextNodeCommand.cpp: Removed.
+ * editing/ReplaceInsertIntoTextNodeCommand.h: Removed.
+ * editing/ReplaceSelectionCommand.cpp:
+ (WebCore::ReplaceSelectionCommand::doApply):
+ (WebCore::ReplaceSelectionCommand::completeHTMLReplacement):
+ (WebCore::ReplaceSelectionCommand::performTrivialReplace):
+ * editing/ReplaceSelectionCommand.h:
+ (WebCore::ReplaceSelectionCommand::visibleSelectionForInsertedText):
+ * editing/TextInsertionBaseCommand.cpp:
+ (WebCore::TextInsertionBaseCommand::TextInsertionBaseCommand):
+ * editing/TextInsertionBaseCommand.h:
+ * editing/TypingCommand.cpp:
+ (WebCore::TypingCommand::TypingCommand):
+ (WebCore::TypingCommand::insertText):
+ (WebCore::TypingCommand::insertLineBreak):
+ (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
+ (WebCore::TypingCommand::insertParagraphSeparator):
+ (WebCore::TypingCommand::postTextStateChangeNotificationForDeletion):
+ (WebCore::TypingCommand::doApply):
+ (WebCore::TypingCommand::insertTextAndNotifyAccessibility):
+ (WebCore::TypingCommand::insertLineBreakAndNotifyAccessibility):
+ (WebCore::TypingCommand::insertParagraphSeparatorAndNotifyAccessibility):
+ (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContentAndNotifyAccessibility):
+ (WebCore::TypingCommand::deleteKeyPressed):
+ (WebCore::TypingCommand::forwardDeleteKeyPressed):
+ * editing/TypingCommand.h:
+
</ins><span class="cx"> 2016-04-04 Dean Jackson <dino@apple.com>
</span><span class="cx">
</span><span class="cx"> Add color-gamut media query support
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -6738,10 +6738,6 @@
</span><span class="cx">                 F52AD5E41534245F0059FBE6 /* EmptyClients.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F52AD5E31534245F0059FBE6 /* EmptyClients.cpp */; };
</span><span class="cx">                 F544F78815CFB2A800AF33A8 /* PlatformLocale.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F544F78615CFB2A800AF33A8 /* PlatformLocale.cpp */; };
</span><span class="cx">                 F544F78915CFB2A800AF33A8 /* PlatformLocale.h in Headers */ = {isa = PBXBuildFile; fileRef = F544F78715CFB2A800AF33A8 /* PlatformLocale.h */; };
</span><del>-                F5528DA51AC1033E000EF7AD /* ReplaceDeleteFromTextNodeCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = F5528DA31AC1033E000EF7AD /* ReplaceDeleteFromTextNodeCommand.h */; };
-                F5528DA61AC1033E000EF7AD /* ReplaceDeleteFromTextNodeCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5528DA41AC1033E000EF7AD /* ReplaceDeleteFromTextNodeCommand.cpp */; };
-                F5528DA91AC109DF000EF7AD /* ReplaceInsertIntoTextNodeCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5528DA71AC109DF000EF7AD /* ReplaceInsertIntoTextNodeCommand.cpp */; };
-                F5528DAA1AC109DF000EF7AD /* ReplaceInsertIntoTextNodeCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = F5528DA81AC109DF000EF7AD /* ReplaceInsertIntoTextNodeCommand.h */; };
</del><span class="cx">                 F55B3DAD1251F12D003EF269 /* BaseTextInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D791251F12D003EF269 /* BaseTextInputType.cpp */; };
</span><span class="cx">                 F55B3DAE1251F12D003EF269 /* BaseTextInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3D7A1251F12D003EF269 /* BaseTextInputType.h */; };
</span><span class="cx">                 F55B3DAF1251F12D003EF269 /* ButtonInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F55B3D7B1251F12D003EF269 /* ButtonInputType.cpp */; };
</span><span class="lines">@@ -14797,10 +14793,6 @@
</span><span class="cx">                 F52AD5E31534245F0059FBE6 /* EmptyClients.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EmptyClients.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 F544F78615CFB2A800AF33A8 /* PlatformLocale.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformLocale.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 F544F78715CFB2A800AF33A8 /* PlatformLocale.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformLocale.h; sourceTree = "<group>"; };
</span><del>-                F5528DA31AC1033E000EF7AD /* ReplaceDeleteFromTextNodeCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReplaceDeleteFromTextNodeCommand.h; sourceTree = "<group>"; };
-                F5528DA41AC1033E000EF7AD /* ReplaceDeleteFromTextNodeCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReplaceDeleteFromTextNodeCommand.cpp; sourceTree = "<group>"; };
-                F5528DA71AC109DF000EF7AD /* ReplaceInsertIntoTextNodeCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReplaceInsertIntoTextNodeCommand.cpp; sourceTree = "<group>"; };
-                F5528DA81AC109DF000EF7AD /* ReplaceInsertIntoTextNodeCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReplaceInsertIntoTextNodeCommand.h; sourceTree = "<group>"; };
</del><span class="cx">                 F55B3D791251F12D003EF269 /* BaseTextInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseTextInputType.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 F55B3D7A1251F12D003EF269 /* BaseTextInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseTextInputType.h; sourceTree = "<group>"; };
</span><span class="cx">                 F55B3D7B1251F12D003EF269 /* ButtonInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ButtonInputType.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -18889,10 +18881,6 @@
</span><span class="cx">                                 93309DB8099E64910056E581 /* RemoveNodePreservingChildrenCommand.h */,
</span><span class="cx">                                 9B32CDA813DF7FA900F34D13 /* RenderedPosition.cpp */,
</span><span class="cx">                                 9B32CDA713DF7FA900F34D13 /* RenderedPosition.h */,
</span><del>-                                F5528DA41AC1033E000EF7AD /* ReplaceDeleteFromTextNodeCommand.cpp */,
-                                F5528DA31AC1033E000EF7AD /* ReplaceDeleteFromTextNodeCommand.h */,
-                                F5528DA71AC109DF000EF7AD /* ReplaceInsertIntoTextNodeCommand.cpp */,
-                                F5528DA81AC109DF000EF7AD /* ReplaceInsertIntoTextNodeCommand.h */,
</del><span class="cx">                                 A89CCC500F44E98100B5DA10 /* ReplaceNodeWithSpanCommand.cpp */,
</span><span class="cx">                                 A89CCC510F44E98100B5DA10 /* ReplaceNodeWithSpanCommand.h */,
</span><span class="cx">                                 93309DBA099E64910056E581 /* ReplaceSelectionCommand.cpp */,
</span><span class="lines">@@ -27658,8 +27646,6 @@
</span><span class="cx">                                 BCEA4868097D93020094C9E4 /* RenderView.h in Headers */,
</span><span class="cx">                                 BE20507E18A458C20080647E /* RenderVTTCue.h in Headers */,
</span><span class="cx">                                 A871DFE40A15376B00B12A68 /* RenderWidget.h in Headers */,
</span><del>-                                F5528DA51AC1033E000EF7AD /* ReplaceDeleteFromTextNodeCommand.h in Headers */,
-                                F5528DAA1AC109DF000EF7AD /* ReplaceInsertIntoTextNodeCommand.h in Headers */,
</del><span class="cx">                                 A89CCC530F44E98100B5DA10 /* ReplaceNodeWithSpanCommand.h in Headers */,
</span><span class="cx">                                 93309E0A099E64920056E581 /* ReplaceSelectionCommand.h in Headers */,
</span><span class="cx">                                 99CC0B5418BE9849006CEBCC /* ReplayController.h in Headers */,
</span><span class="lines">@@ -31282,8 +31268,6 @@
</span><span class="cx">                                 BCEA4867097D93020094C9E4 /* RenderView.cpp in Sources */,
</span><span class="cx">                                 BE20507D18A458BF0080647E /* RenderVTTCue.cpp in Sources */,
</span><span class="cx">                                 A871DFE50A15376B00B12A68 /* RenderWidget.cpp in Sources */,
</span><del>-                                F5528DA61AC1033E000EF7AD /* ReplaceDeleteFromTextNodeCommand.cpp in Sources */,
-                                F5528DA91AC109DF000EF7AD /* ReplaceInsertIntoTextNodeCommand.cpp in Sources */,
</del><span class="cx">                                 A89CCC520F44E98100B5DA10 /* ReplaceNodeWithSpanCommand.cpp in Sources */,
</span><span class="cx">                                 93309E09099E64920056E581 /* ReplaceSelectionCommand.cpp in Sources */,
</span><span class="cx">                                 99CC0B5318BE9849006CEBCC /* ReplayController.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAXObjectCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -119,7 +119,31 @@
</span><span class="cx"> m_idMapping.set(id, attributes);
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>-
</del><ins>+
+AccessibilityReplacedText::AccessibilityReplacedText(const VisibleSelection& selection)
+{
+ if (AXObjectCache::accessibilityEnabled() && selection.isRange()) {
+ m_replacedText = AccessibilityObject::stringForVisiblePositionRange(selection);
+ m_replacedRange.startIndex.value = indexForVisiblePosition(selection.start(), m_replacedRange.startIndex.scope);
+ m_replacedRange.endIndex.value = indexForVisiblePosition(selection.end(), m_replacedRange.endIndex.scope);
+ }
+}
+
+void AccessibilityReplacedText::postTextStateChangeNotification(AXObjectCache* cache, AXTextEditType type, const String& text, const VisibleSelection& selection)
+{
+ if (!cache)
+ return;
+ if (!AXObjectCache::accessibilityEnabled())
+ return;
+
+ VisiblePosition position = selection.start();
+ Node* node = highestEditableRoot(position.deepEquivalent(), HasEditableAXRole);
+ if (m_replacedText.length())
+ cache->postTextReplacementNotification(node, AXTextEditTypeDelete, m_replacedText, type, text, position);
+ else
+ cache->postTextStateChangeNotification(node, type, text, position);
+}
+
</ins><span class="cx"> bool AXObjectCache::gAccessibilityEnabled = false;
</span><span class="cx"> bool AXObjectCache::gAccessibilityEnhancedUserInterfaceEnabled = false;
</span><span class="cx">
</span><span class="lines">@@ -1197,7 +1221,8 @@
</span><span class="cx"> {
</span><span class="cx"> if (!node)
</span><span class="cx"> return;
</span><del>- ASSERT(type != AXTextEditTypeUnknown);
</del><ins>+ if (type == AXTextEditTypeUnknown)
+ return;
</ins><span class="cx">
</span><span class="cx"> stopCachingComputedObjectAttributes();
</span><span class="cx">
</span><span class="lines">@@ -1219,8 +1244,10 @@
</span><span class="cx"> {
</span><span class="cx"> if (!node)
</span><span class="cx"> return;
</span><del>- ASSERT(deletionType == AXTextEditTypeDelete);
- ASSERT(insertionType == AXTextEditTypeInsert || insertionType == AXTextEditTypeTyping || insertionType == AXTextEditTypeDictation || insertionType == AXTextEditTypePaste);
</del><ins>+ if (deletionType != AXTextEditTypeDelete)
+ return;
+ if (!(insertionType == AXTextEditTypeInsert || insertionType == AXTextEditTypeTyping || insertionType == AXTextEditTypeDictation || insertionType == AXTextEditTypePaste))
+ return;
</ins><span class="cx">
</span><span class="cx"> stopCachingComputedObjectAttributes();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAXObjectCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AXObjectCache.h (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AXObjectCache.h        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.h        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -97,6 +97,28 @@
</span><span class="cx"> HashMap<AXID, CachedAXObjectAttributes> m_idMapping;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+struct VisiblePositionIndex {
+ int value = -1;
+ RefPtr<ContainerNode> scope;
+};
+
+struct VisiblePositionIndexRange {
+ VisiblePositionIndex startIndex;
+ VisiblePositionIndex endIndex;
+ bool isNull() const { return startIndex.value == -1 || endIndex.value == -1; }
+};
+
+class AccessibilityReplacedText {
+public:
+ AccessibilityReplacedText() { }
+ AccessibilityReplacedText(const VisibleSelection&);
+ void postTextStateChangeNotification(AXObjectCache*, AXTextEditType, const String&, const VisibleSelection&);
+ const VisiblePositionIndexRange& replacedRange() { return m_replacedRange; }
+protected:
+ String m_replacedText;
+ VisiblePositionIndexRange m_replacedRange;
+};
+
</ins><span class="cx"> #if !PLATFORM(COCOA)
</span><span class="cx"> enum AXTextChange { AXTextInserted, AXTextDeleted, AXTextAttributesChanged };
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -1258,7 +1258,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Returns the text associated with a list marker if this node is contained within a list item.
</span><del>-String AccessibilityObject::listMarkerTextForNodeAndPosition(Node* node, const VisiblePosition& visiblePositionStart) const
</del><ins>+String AccessibilityObject::listMarkerTextForNodeAndPosition(Node* node, const VisiblePosition& visiblePositionStart)
</ins><span class="cx"> {
</span><span class="cx"> // If the range does not contain the start of the line, the list marker text should not be included.
</span><span class="cx"> if (!isStartOfLine(visiblePositionStart))
</span><span class="lines">@@ -1305,7 +1305,7 @@
</span><span class="cx"> return builder.toString();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-String AccessibilityObject::stringForVisiblePositionRange(const VisiblePositionRange& visiblePositionRange) const
</del><ins>+String AccessibilityObject::stringForVisiblePositionRange(const VisiblePositionRange& visiblePositionRange)
</ins><span class="cx"> {
</span><span class="cx"> if (visiblePositionRange.isNull())
</span><span class="cx"> return String();
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.h        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -394,6 +394,11 @@
</span><span class="cx"> , end(e)
</span><span class="cx"> { }
</span><span class="cx">
</span><ins>+ VisiblePositionRange(const VisibleSelection& selection)
+ : start(selection.start())
+ , end(selection.end())
+ { }
+
</ins><span class="cx"> bool isNull() const { return start.isNull() || end.isNull(); }
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -843,7 +848,7 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<Range> rangeForPlainTextRange(const PlainTextRange&) const;
</span><span class="cx">
</span><del>- String stringForVisiblePositionRange(const VisiblePositionRange&) const;
</del><ins>+ static String stringForVisiblePositionRange(const VisiblePositionRange&);
</ins><span class="cx"> String stringForRange(RefPtr<Range>) const;
</span><span class="cx"> virtual IntRect boundsForVisiblePositionRange(const VisiblePositionRange&) const { return IntRect(); }
</span><span class="cx"> virtual IntRect boundsForRange(const RefPtr<Range>) const { return IntRect(); }
</span><span class="lines">@@ -881,7 +886,7 @@
</span><span class="cx"> virtual String doAXStringForRange(const PlainTextRange&) const { return String(); }
</span><span class="cx"> virtual IntRect doAXBoundsForRange(const PlainTextRange&) const { return IntRect(); }
</span><span class="cx"> virtual IntRect doAXBoundsForRangeUsingCharacterOffset(const PlainTextRange&) const { return IntRect(); }
</span><del>- String listMarkerTextForNodeAndPosition(Node*, const VisiblePosition&) const;
</del><ins>+ static String listMarkerTextForNodeAndPosition(Node*, const VisiblePosition&);
</ins><span class="cx">
</span><span class="cx"> unsigned doAXLineForIndex(unsigned);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilitymacAXObjectCacheMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -398,7 +398,8 @@
</span><span class="cx"> [userInfo setObject:wrapper forKey:NSAccessibilityTextChangeElement];
</span><span class="cx">
</span><span class="cx"> AXPostNotificationWithUserInfo(rootWebArea()->wrapper(), NSAccessibilitySelectedTextChangedNotification, userInfo);
</span><del>- AXPostNotificationWithUserInfo(object->wrapper(), NSAccessibilitySelectedTextChangedNotification, userInfo);
</del><ins>+ if (rootWebArea()->wrapper() != object->wrapper())
+ AXPostNotificationWithUserInfo(object->wrapper(), NSAccessibilitySelectedTextChangedNotification, userInfo);
</ins><span class="cx">
</span><span class="cx"> [userInfo release];
</span><span class="cx"> }
</span><span class="lines">@@ -455,7 +456,8 @@
</span><span class="cx"> [userInfo setObject:wrapper forKey:NSAccessibilityTextChangeElement];
</span><span class="cx">
</span><span class="cx"> AXPostNotificationWithUserInfo(rootWebArea()->wrapper(), NSAccessibilityValueChangedNotification, userInfo);
</span><del>- AXPostNotificationWithUserInfo(object->wrapper(), NSAccessibilityValueChangedNotification, userInfo);
</del><ins>+ if (rootWebArea()->wrapper() != object->wrapper())
+ AXPostNotificationWithUserInfo(object->wrapper(), NSAccessibilityValueChangedNotification, userInfo);
</ins><span class="cx">
</span><span class="cx"> [userInfo release];
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingAppendNodeCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/AppendNodeCommand.cpp (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/AppendNodeCommand.cpp        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/AppendNodeCommand.cpp        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -46,31 +46,12 @@
</span><span class="cx"> ASSERT(m_parent->hasEditableStyle() || !m_parent->renderer());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void sendAXTextChangedIgnoringLineBreaks(Node* node, AXTextEditType type)
-{
- if (!node)
- return;
-
- String text = node->nodeValue();
- // Don't consider linebreaks in this command
- if (text == "\n")
- return;
-
- if (AXObjectCache* cache = node->document().existingAXObjectCache()) {
- Position position = is<Text>(node) ? Position(downcast<Text>(node), 0) : createLegacyEditingPosition(node, 0);
- cache->postTextStateChangeNotification(node, type, text, VisiblePosition(position));
- }
-}
-
</del><span class="cx"> void AppendNodeCommand::doApply()
</span><span class="cx"> {
</span><span class="cx"> if (!m_parent->hasEditableStyle() && m_parent->renderer())
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> m_parent->appendChild(m_node.copyRef(), IGNORE_EXCEPTION);
</span><del>-
- if (shouldPostAccessibilityNotification())
- sendAXTextChangedIgnoringLineBreaks(m_node.ptr(), applyEditType());
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void AppendNodeCommand::doUnapply()
</span><span class="lines">@@ -78,10 +59,6 @@
</span><span class="cx"> if (!m_parent->hasEditableStyle())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- // Need to notify this before actually deleting the text
- if (shouldPostAccessibilityNotification())
- sendAXTextChangedIgnoringLineBreaks(m_node.ptr(), unapplyEditType());
-
</del><span class="cx"> m_node->remove(IGNORE_EXCEPTION);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingCompositeEditCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/CompositeEditCommand.cpp (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "CompositeEditCommand.h"
</span><span class="cx">
</span><ins>+#include "AXObjectCache.h"
</ins><span class="cx"> #include "AppendNodeCommand.h"
</span><span class="cx"> #include "ApplyStyleCommand.h"
</span><span class="cx"> #include "BreakBlockquoteCommand.h"
</span><span class="lines">@@ -59,8 +60,6 @@
</span><span class="cx"> #include "RenderBlockFlow.h"
</span><span class="cx"> #include "RenderText.h"
</span><span class="cx"> #include "RenderedDocumentMarker.h"
</span><del>-#include "ReplaceDeleteFromTextNodeCommand.h"
-#include "ReplaceInsertIntoTextNodeCommand.h"
</del><span class="cx"> #include "ReplaceNodeWithSpanCommand.h"
</span><span class="cx"> #include "ReplaceSelectionCommand.h"
</span><span class="cx"> #include "ScopedEventQueue.h"
</span><span class="lines">@@ -79,6 +78,119 @@
</span><span class="cx">
</span><span class="cx"> using namespace HTMLNames;
</span><span class="cx">
</span><ins>+int AccessibilityUndoReplacedText::indexForVisiblePosition(const VisiblePosition& position, RefPtr<ContainerNode>& scope) const
+{
+ if (position.deepEquivalent().isNull())
+ return -1;
+ return WebCore::indexForVisiblePosition(position, scope);
+}
+
+void AccessibilityUndoReplacedText::confgureTextToBeDeletedByUnapplyIndexesWithEditCommandEndingSelection(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);
+}
+
+void AccessibilityUndoReplacedText::confgureTextToBeDeletedByUnapplyStartIndexWithEditCommandStartingSelection(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);
+}
+
+void AccessibilityUndoReplacedText::setTextInsertedByUnapplyRange(const VisiblePositionIndexRange& range)
+{
+ m_textInsertedByUnapplyRange = range;
+}
+
+void AccessibilityUndoReplacedText::captureTextToBeDeletedByUnapply()
+{
+ if (!AXObjectCache::accessibilityEnabled())
+ return;
+ m_replacedText = textInsertedByReapply();
+}
+
+void AccessibilityUndoReplacedText::captureTextToBeDeletedByReapply()
+{
+ if (!AXObjectCache::accessibilityEnabled())
+ return;
+ m_replacedText = textInsertedByUnapply();
+}
+
+static String stringForVisiblePositionIndexRange(const VisiblePositionIndexRange& range)
+{
+ if (range.isNull())
+ return String();
+ VisiblePosition start = visiblePositionForIndex(range.startIndex.value, range.startIndex.scope.get());
+ VisiblePosition end = visiblePositionForIndex(range.endIndex.value, range.endIndex.scope.get());
+ return AccessibilityObject::stringForVisiblePositionRange(VisiblePositionRange(start, end));
+}
+
+String AccessibilityUndoReplacedText::textInsertedByUnapply()
+{
+ if (!AXObjectCache::accessibilityEnabled())
+ return String();
+ return stringForVisiblePositionIndexRange(m_textInsertedByUnapplyRange);
+}
+
+String AccessibilityUndoReplacedText::textInsertedByReapply()
+{
+ if (!AXObjectCache::accessibilityEnabled())
+ return String();
+ return stringForVisiblePositionIndexRange(m_textDeletedByUnapplyRange);
+}
+
+static void postTextStateChangeNotification(AXObjectCache* cache, const VisiblePosition& position, const String& deletedText, const String& insertedText)
+{
+ ASSERT(cache);
+ Node* node = highestEditableRoot(position.deepEquivalent(), HasEditableAXRole);
+ if (!node)
+ return;
+ if (insertedText.length() && deletedText.length())
+ cache->postTextReplacementNotification(node, AXTextEditTypeDelete, insertedText, AXTextEditTypeInsert, deletedText, position);
+ else if (deletedText.length())
+ cache->postTextStateChangeNotification(node, AXTextEditTypeInsert, deletedText, position);
+ else if (insertedText.length())
+ cache->postTextStateChangeNotification(node, AXTextEditTypeDelete, insertedText, position);
+}
+
+void AccessibilityUndoReplacedText::postTextStateChangeNotificationForUnapply(AXObjectCache* cache)
+{
+ if (!cache)
+ return;
+ if (!AXObjectCache::accessibilityEnabled())
+ return;
+ if (m_textInsertedByUnapplyRange.isNull())
+ return;
+ VisiblePosition position = visiblePositionForIndex(m_textInsertedByUnapplyRange.endIndex.value, m_textInsertedByUnapplyRange.endIndex.scope.get());
+ if (position.isNull())
+ return;
+ postTextStateChangeNotification(cache, position, textInsertedByUnapply(), m_replacedText);
+ m_replacedText = String();
+}
+
+void AccessibilityUndoReplacedText::postTextStateChangeNotificationForReapply(AXObjectCache* cache)
+{
+ if (!cache)
+ return;
+ if (!AXObjectCache::accessibilityEnabled())
+ return;
+ if (m_textDeletedByUnapplyRange.isNull())
+ return;
+ VisiblePosition position = visiblePositionForIndex(m_textDeletedByUnapplyRange.startIndex.value, m_textDeletedByUnapplyRange.startIndex.scope.get());
+ if (position.isNull())
+ return;
+ postTextStateChangeNotification(cache, position, m_replacedText, textInsertedByReapply());
+ m_replacedText = String();
+}
+
</ins><span class="cx"> Ref<EditCommandComposition> EditCommandComposition::create(Document& document,
</span><span class="cx"> const VisibleSelection& startingSelection, const VisibleSelection& endingSelection, EditAction editAction)
</span><span class="cx"> {
</span><span class="lines">@@ -93,6 +205,7 @@
</span><span class="cx"> , m_endingRootEditableElement(endingSelection.rootEditableElement())
</span><span class="cx"> , m_editAction(editAction)
</span><span class="cx"> {
</span><ins>+ m_replacedText.confgureTextToBeDeletedByUnapplyStartIndexWithEditCommandStartingSelection(startingSelection);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void EditCommandComposition::unapply()
</span><span class="lines">@@ -101,6 +214,8 @@
</span><span class="cx"> RefPtr<Frame> frame = m_document->frame();
</span><span class="cx"> ASSERT(frame);
</span><span class="cx">
</span><ins>+ m_replacedText.captureTextToBeDeletedByUnapply();
+
</ins><span class="cx"> // Changes to the document may have been made since the last editing operation that require a layout, as in <rdar://problem/5658603>.
</span><span class="cx"> // Low level operations, like RemoveNodeCommand, don't require a layout because the high level operations that use them perform one
</span><span class="cx"> // if one is necessary (like for the creation of VisiblePositions).
</span><span class="lines">@@ -119,6 +234,9 @@
</span><span class="cx"> m_commands[i - 1]->doUnapply();
</span><span class="cx">
</span><span class="cx"> frame->editor().unappliedEditing(this);
</span><ins>+
+ if (AXObjectCache::accessibilityEnabled())
+ m_replacedText.postTextStateChangeNotificationForUnapply(m_document->existingAXObjectCache());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void EditCommandComposition::reapply()
</span><span class="lines">@@ -127,6 +245,8 @@
</span><span class="cx"> RefPtr<Frame> frame = m_document->frame();
</span><span class="cx"> ASSERT(frame);
</span><span class="cx">
</span><ins>+ m_replacedText.captureTextToBeDeletedByReapply();
+
</ins><span class="cx"> // Changes to the document may have been made since the last editing operation that require a layout, as in <rdar://problem/5658603>.
</span><span class="cx"> // Low level operations, like RemoveNodeCommand, don't require a layout because the high level operations that use them perform one
</span><span class="cx"> // if one is necessary (like for the creation of VisiblePositions).
</span><span class="lines">@@ -136,6 +256,9 @@
</span><span class="cx"> command->doReapply();
</span><span class="cx">
</span><span class="cx"> frame->editor().reappliedEditing(this);
</span><ins>+
+ if (AXObjectCache::accessibilityEnabled())
+ m_replacedText.postTextStateChangeNotificationForReapply(m_document->existingAXObjectCache());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void EditCommandComposition::append(SimpleEditCommand* command)
</span><span class="lines">@@ -147,14 +270,21 @@
</span><span class="cx"> {
</span><span class="cx"> m_startingSelection = selection;
</span><span class="cx"> m_startingRootEditableElement = selection.rootEditableElement();
</span><ins>+ m_replacedText.confgureTextToBeDeletedByUnapplyStartIndexWithEditCommandStartingSelection(selection);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void EditCommandComposition::setEndingSelection(const VisibleSelection& selection)
</span><span class="cx"> {
</span><span class="cx"> m_endingSelection = selection;
</span><span class="cx"> m_endingRootEditableElement = selection.rootEditableElement();
</span><ins>+ m_replacedText.confgureTextToBeDeletedByUnapplyIndexesWithEditCommandEndingSelection(selection);
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+void EditCommandComposition::setTextInsertedByUnapplyRange(const VisiblePositionIndexRange& range)
+{
+ m_replacedText.setTextInsertedByUnapplyRange(range);
+}
+
</ins><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> void EditCommandComposition::getNodesInCommand(HashSet<Node*>& nodes)
</span><span class="cx"> {
</span><span class="lines">@@ -163,24 +293,6 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-AXTextEditType EditCommandComposition::unapplyEditType() const
-{
- switch (editingAction()) {
- case EditActionCut:
- case EditActionDelete:
- return AXTextEditTypeInsert;
- case EditActionDictation:
- case EditActionInsert:
- case EditActionPaste:
- case EditActionTyping:
- return AXTextEditTypeDelete;
- // Include default case for unhandled EditAction cases.
- default:
- break;
- }
- return AXTextEditTypeUnknown;
-}
-
</del><span class="cx"> void applyCommand(PassRefPtr<CompositeEditCommand> command)
</span><span class="cx"> {
</span><span class="cx"> command->apply();
</span><span class="lines">@@ -414,7 +526,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (!node || !node->nonShadowBoundaryParentNode())
</span><span class="cx"> return;
</span><del>- applyCommandToComposite(RemoveNodeCommand::create(*node, shouldAssumeContentIsAlwaysEditable));
</del><ins>+ applyCommandToComposite(RemoveNodeCommand::create(*node, shouldAssumeContentIsAlwaysEditable, editingAction()));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void CompositeEditCommand::removeNodePreservingChildren(PassRefPtr<Node> node, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable)
</span><span class="lines">@@ -558,10 +670,9 @@
</span><span class="cx"> void CompositeEditCommand::replaceTextInNode(PassRefPtr<Text> prpNode, unsigned offset, unsigned count, const String& replacementText)
</span><span class="cx"> {
</span><span class="cx"> RefPtr<Text> node(prpNode);
</span><del>- RefPtr<DeleteFromTextNodeCommand> deleteCommand = ReplaceDeleteFromTextNodeCommand::create(WTFMove(node), offset, count);
- applyCommandToComposite(deleteCommand);
</del><ins>+ applyCommandToComposite(DeleteFromTextNodeCommand::create(WTFMove(node), offset, count));
</ins><span class="cx"> if (!replacementText.isEmpty())
</span><del>- applyCommandToComposite(ReplaceInsertIntoTextNodeCommand::create(WTFMove(node), offset, replacementText, deleteCommand->deletedText(), editingAction()));
</del><ins>+ applyCommandToComposite(InsertIntoTextNodeCommand::create(WTFMove(node), offset, replacementText, editingAction()));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Position CompositeEditCommand::replaceSelectedTextInNode(const String& text)
</span><span class="lines">@@ -638,10 +749,20 @@
</span><span class="cx"> insertNodeAt(node, positionOutsideTabSpan(pos));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static EditAction deleteSelectionEditingActionForEditingAction(EditAction editingAction)
+{
+ switch (editingAction) {
+ case EditActionCut:
+ return EditActionCut;
+ default:
+ return EditActionDelete;
+ }
+}
+
</ins><span class="cx"> void CompositeEditCommand::deleteSelection(bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool sanitizeMarkup)
</span><span class="cx"> {
</span><span class="cx"> if (endingSelection().isRange())
</span><del>- applyCommandToComposite(DeleteSelectionCommand::create(document(), smartDelete, mergeBlocksAfterDelete, replace, expandForSpecialElements, sanitizeMarkup));
</del><ins>+ applyCommandToComposite(DeleteSelectionCommand::create(document(), smartDelete, mergeBlocksAfterDelete, replace, expandForSpecialElements, sanitizeMarkup, deleteSelectionEditingActionForEditingAction(editingAction())));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void CompositeEditCommand::deleteSelection(const VisibleSelection &selection, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool sanitizeMarkup)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingCompositeEditCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/CompositeEditCommand.h (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/CompositeEditCommand.h        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/CompositeEditCommand.h        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #ifndef CompositeEditCommand_h
</span><span class="cx"> #define CompositeEditCommand_h
</span><span class="cx">
</span><ins>+#include "AXObjectCache.h"
</ins><span class="cx"> #include "EditCommand.h"
</span><span class="cx"> #include "CSSPropertyNames.h"
</span><span class="cx"> #include "UndoStep.h"
</span><span class="lines">@@ -38,9 +39,32 @@
</span><span class="cx"> class StyledElement;
</span><span class="cx"> class Text;
</span><span class="cx">
</span><ins>+class AccessibilityUndoReplacedText {
+public:
+ AccessibilityUndoReplacedText() { }
+ void confgureTextToBeDeletedByUnapplyStartIndexWithEditCommandStartingSelection(const VisibleSelection&);
+ void confgureTextToBeDeletedByUnapplyIndexesWithEditCommandEndingSelection(const VisibleSelection&);
+ void setTextInsertedByUnapplyRange(const VisiblePositionIndexRange&);
+
+ void captureTextToBeDeletedByUnapply();
+ void captureTextToBeDeletedByReapply();
+
+ void postTextStateChangeNotificationForUnapply(AXObjectCache*);
+ void postTextStateChangeNotificationForReapply(AXObjectCache*);
+
+private:
+ int indexForVisiblePosition(const VisiblePosition&, RefPtr<ContainerNode>&) const;
+ String textInsertedByUnapply();
+ String textInsertedByReapply();
+
+ String m_replacedText;
+ VisiblePositionIndexRange m_textDeletedByUnapplyRange;
+ VisiblePositionIndexRange m_textInsertedByUnapplyRange;
+};
+
</ins><span class="cx"> class EditCommandComposition : public UndoStep {
</span><span class="cx"> public:
</span><del>- static Ref<EditCommandComposition> create(Document&, const VisibleSelection&, const VisibleSelection&, EditAction);
</del><ins>+ static Ref<EditCommandComposition> create(Document&, const VisibleSelection& startingSelection, const VisibleSelection& endingSelection, EditAction);
</ins><span class="cx">
</span><span class="cx"> void unapply() override;
</span><span class="cx"> void reapply() override;
</span><span class="lines">@@ -54,13 +78,12 @@
</span><span class="cx"> void setEndingSelection(const VisibleSelection&);
</span><span class="cx"> Element* startingRootEditableElement() const { return m_startingRootEditableElement.get(); }
</span><span class="cx"> Element* endingRootEditableElement() const { return m_endingRootEditableElement.get(); }
</span><ins>+ void setTextInsertedByUnapplyRange(const VisiblePositionIndexRange&);
</ins><span class="cx">
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> virtual void getNodesInCommand(HashSet<Node*>&);
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- AXTextEditType unapplyEditType() const;
-
</del><span class="cx"> private:
</span><span class="cx"> EditCommandComposition(Document&, const VisibleSelection& startingSelection, const VisibleSelection& endingSelection, EditAction);
</span><span class="cx">
</span><span class="lines">@@ -70,6 +93,7 @@
</span><span class="cx"> Vector<RefPtr<SimpleEditCommand>> m_commands;
</span><span class="cx"> RefPtr<Element> m_startingRootEditableElement;
</span><span class="cx"> RefPtr<Element> m_endingRootEditableElement;
</span><ins>+ AccessibilityUndoReplacedText m_replacedText;
</ins><span class="cx"> EditAction m_editAction;
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingDeleteFromTextNodeCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -55,10 +55,6 @@
</span><span class="cx"> m_text = m_node->substringData(m_offset, m_count, ec);
</span><span class="cx"> if (ec)
</span><span class="cx"> return;
</span><del>-
- // Need to notify this before actually deleting the text
- if (shouldPostAccessibilityNotification())
- notifyAccessibilityForTextChange(m_node.get(), applyEditType(), m_text, VisiblePosition(Position(m_node, m_offset)));
</del><span class="cx">
</span><span class="cx"> m_node->deleteData(m_offset, m_count, ec);
</span><span class="cx"> }
</span><span class="lines">@@ -71,9 +67,6 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> m_node->insertData(m_offset, m_text, IGNORE_EXCEPTION);
</span><del>-
- if (shouldPostAccessibilityNotification())
- notifyAccessibilityForTextChange(m_node.get(), unapplyEditType(), m_text, VisiblePosition(Position(m_node, m_offset)));
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #ifndef NDEBUG
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingDeleteFromTextNodeCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/DeleteFromTextNodeCommand.h (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/DeleteFromTextNodeCommand.h        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/DeleteFromTextNodeCommand.h        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -39,8 +39,6 @@
</span><span class="cx"> return adoptRef(*new DeleteFromTextNodeCommand(WTFMove(node), offset, count, editingAction));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- const String& deletedText();
-
</del><span class="cx"> protected:
</span><span class="cx"> DeleteFromTextNodeCommand(RefPtr<Text>&&, unsigned offset, unsigned count, EditAction);
</span><span class="cx">
</span><span class="lines">@@ -58,11 +56,6 @@
</span><span class="cx"> String m_text;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-inline const String& DeleteFromTextNodeCommand::deletedText()
-{
- return m_text;
-}
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // DeleteFromTextNodeCommand_h
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingDictationCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/DictationCommand.cpp (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/DictationCommand.cpp        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/DictationCommand.cpp        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -108,6 +108,7 @@
</span><span class="cx"> {
</span><span class="cx"> DictationCommandLineOperation operation(this);
</span><span class="cx"> forEachLineInString(m_textToInsert, operation);
</span><ins>+ postTextStateChangeNotification(AXTextEditTypeDictation, m_textToInsert);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void DictationCommand::insertTextRunWithoutNewlines(size_t lineStart, size_t lineLength)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditCommand.cpp (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditCommand.cpp        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/EditCommand.cpp        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -112,82 +112,26 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-AXTextEditType EditCommand::applyEditType() const
</del><ins>+void EditCommand::postTextStateChangeNotification(AXTextEditType type, const String& text)
</ins><span class="cx"> {
</span><del>- switch (editingAction()) {
- case EditActionCut:
- return AXTextEditTypeCut;
- case EditActionDelete:
- return AXTextEditTypeDelete;
- case EditActionDictation:
- return AXTextEditTypeDictation;
- case EditActionInsert:
- return AXTextEditTypeInsert;
- case EditActionPaste:
- return AXTextEditTypePaste;
- case EditActionTyping:
- return AXTextEditTypeTyping;
- case EditActionSetColor:
- case EditActionSetBackgroundColor:
- case EditActionTurnOffKerning:
- case EditActionTightenKerning:
- case EditActionLoosenKerning:
- case EditActionUseStandardKerning:
- case EditActionTurnOffLigatures:
- case EditActionUseStandardLigatures:
- case EditActionUseAllLigatures:
- case EditActionRaiseBaseline:
- case EditActionLowerBaseline:
- case EditActionSetTraditionalCharacterShape:
- case EditActionSetFont:
- case EditActionChangeAttributes:
- case EditActionAlignLeft:
- case EditActionAlignRight:
- case EditActionCenter:
- case EditActionJustify:
- case EditActionSetWritingDirection:
- case EditActionSubscript:
- case EditActionSuperscript:
- case EditActionUnderline:
- case EditActionOutline:
- case EditActionUnscript:
- case EditActionBold:
- case EditActionItalics:
- case EditActionFormatBlock:
- case EditActionIndent:
- case EditActionOutdent:
- return AXTextEditTypeAttributesChange;
- // Include default case for unhandled EditAction cases.
- default:
- break;
- }
- return AXTextEditTypeUnknown;
</del><ins>+ if (!AXObjectCache::accessibilityEnabled())
+ return;
+ postTextStateChangeNotification(type, text, frame().selection().selection().start());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-AXTextEditType EditCommand::unapplyEditType() const
</del><ins>+void EditCommand::postTextStateChangeNotification(AXTextEditType type, const String& text, const VisiblePosition& position)
</ins><span class="cx"> {
</span><del>- switch (applyEditType()) {
- case AXTextEditTypeUnknown:
- return AXTextEditTypeUnknown;
- case AXTextEditTypeDelete:
- case AXTextEditTypeCut:
- return AXTextEditTypeInsert;
- case AXTextEditTypeInsert:
- case AXTextEditTypeTyping:
- case AXTextEditTypeDictation:
- case AXTextEditTypePaste:
- return AXTextEditTypeDelete;
- case AXTextEditTypeAttributesChange:
- return AXTextEditTypeAttributesChange;
- }
- return AXTextEditTypeUnknown;
</del><ins>+ if (!AXObjectCache::accessibilityEnabled())
+ return;
+ if (!text.length())
+ return;
+ AXObjectCache* cache = document().existingAXObjectCache();
+ if (!cache)
+ return;
+ Node* node = highestEditableRoot(position.deepEquivalent(), HasEditableAXRole);
+ cache->postTextStateChangeNotification(node, type, text, position);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-bool EditCommand::shouldPostAccessibilityNotification() const
-{
- return AXObjectCache::accessibilityEnabled() && editingAction() != EditActionUnspecified;
-}
-
</del><span class="cx"> SimpleEditCommand::SimpleEditCommand(Document& document, EditAction editingAction)
</span><span class="cx"> : EditCommand(document, editingAction)
</span><span class="cx"> {
</span><span class="lines">@@ -206,14 +150,4 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-void SimpleEditCommand::notifyAccessibilityForTextChange(Node* node, AXTextEditType type, const String& text, const VisiblePosition& position)
-{
- if (!AXObjectCache::accessibilityEnabled())
- return;
- AXObjectCache* cache = document().existingAXObjectCache();
- if (!cache)
- return;
- cache->postTextStateChangeNotification(node, type, text, position);
-}
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditCommand.h (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditCommand.h        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/EditCommand.h        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -60,11 +60,6 @@
</span><span class="cx">
</span><span class="cx"> virtual void doApply() = 0;
</span><span class="cx">
</span><del>- AXTextEditType applyEditType() const;
- AXTextEditType unapplyEditType() const;
-
- bool shouldPostAccessibilityNotification() const;
-
</del><span class="cx"> protected:
</span><span class="cx"> explicit EditCommand(Document&, EditAction = EditActionUnspecified);
</span><span class="cx"> EditCommand(Document&, const VisibleSelection&, const VisibleSelection&);
</span><span class="lines">@@ -75,6 +70,9 @@
</span><span class="cx"> void setStartingSelection(const VisibleSelection&);
</span><span class="cx"> WEBCORE_EXPORT void setEndingSelection(const VisibleSelection&);
</span><span class="cx">
</span><ins>+ void postTextStateChangeNotification(AXTextEditType, const String&);
+ void postTextStateChangeNotification(AXTextEditType, const String&, const VisiblePosition&);
+
</ins><span class="cx"> private:
</span><span class="cx"> Ref<Document> m_document;
</span><span class="cx"> VisibleSelection m_startingSelection;
</span><span class="lines">@@ -104,8 +102,6 @@
</span><span class="cx"> void addNodeAndDescendants(Node*, HashSet<Node*>&);
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- virtual void notifyAccessibilityForTextChange(Node*, AXTextEditType, const String&, const VisiblePosition&);
-
</del><span class="cx"> private:
</span><span class="cx"> bool isSimpleEditCommand() const override { return true; }
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditingAllInOnecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditingAllInOne.cpp (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditingAllInOne.cpp        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/EditingAllInOne.cpp        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -59,8 +59,6 @@
</span><span class="cx"> #include <RemoveNodeCommand.cpp>
</span><span class="cx"> #include <RemoveNodePreservingChildrenCommand.cpp>
</span><span class="cx"> #include <RenderedPosition.cpp>
</span><del>-#include <ReplaceDeleteFromTextNodeCommand.cpp>
-#include <ReplaceInsertIntoTextNodeCommand.cpp>
</del><span class="cx"> #include <ReplaceNodeWithSpanCommand.cpp>
</span><span class="cx"> #include <ReplaceSelectionCommand.cpp>
</span><span class="cx"> #include <SetNodeAttributeCommand.cpp>
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.cpp (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.cpp        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/Editor.cpp        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -525,6 +525,10 @@
</span><span class="cx"> if (selection.isNone() || !selection.isContentEditable() || !fragment)
</span><span class="cx"> return;
</span><span class="cx">
</span><ins>+ AccessibilityReplacedText replacedText;
+ if (AXObjectCache::accessibilityEnabled() && editingAction == EditActionPaste)
+ replacedText = AccessibilityReplacedText(selection);
+
</ins><span class="cx"> ReplaceSelectionCommand::CommandOptions options = ReplaceSelectionCommand::PreventNesting | ReplaceSelectionCommand::SanitizeFragment;
</span><span class="cx"> if (selectReplacement)
</span><span class="cx"> options |= ReplaceSelectionCommand::SelectReplacement;
</span><span class="lines">@@ -535,12 +539,23 @@
</span><span class="cx"> if (mailBlockquoteHandling == MailBlockquoteHandling::IgnoreBlockquote)
</span><span class="cx"> options |= ReplaceSelectionCommand::IgnoreMailBlockquote;
</span><span class="cx">
</span><del>- applyCommand(ReplaceSelectionCommand::create(document(), fragment, options, editingAction));
</del><ins>+ RefPtr<ReplaceSelectionCommand> command = ReplaceSelectionCommand::create(document(), fragment, options, editingAction);
+ applyCommand(command);
</ins><span class="cx"> revealSelectionAfterEditingOperation();
</span><span class="cx">
</span><span class="cx"> selection = m_frame.selection().selection();
</span><del>- if (selection.isInPasswordField() || !isContinuousSpellCheckingEnabled())
</del><ins>+ if (selection.isInPasswordField())
</ins><span class="cx"> return;
</span><ins>+
+ 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());
+ }
+
+ if (!isContinuousSpellCheckingEnabled())
+ return;
+
</ins><span class="cx"> Node* nodeToCheck = selection.rootEditableElement();
</span><span class="cx"> if (!nodeToCheck)
</span><span class="cx"> return;
</span><span class="lines">@@ -1030,7 +1045,7 @@
</span><span class="cx"> // Don't clear the typing style with this selection change. We do those things elsewhere if necessary.
</span><span class="cx"> FrameSelection::SetSelectionOptions options = cmd->isDictationCommand() ? FrameSelection::DictationTriggered : 0;
</span><span class="cx">
</span><del>- changeSelectionAfterCommand(newSelection, options, cmd->applyEditType());
</del><ins>+ changeSelectionAfterCommand(newSelection, options);
</ins><span class="cx"> dispatchEditableContentChangedEvents(composition->startingRootEditableElement(), composition->endingRootEditableElement());
</span><span class="cx">
</span><span class="cx"> updateEditorUINowIfScheduled();
</span><span class="lines">@@ -1061,7 +1076,7 @@
</span><span class="cx"> notifyTextFromControls(cmd->startingRootEditableElement(), cmd->endingRootEditableElement());
</span><span class="cx">
</span><span class="cx"> VisibleSelection newSelection(cmd->startingSelection());
</span><del>- changeSelectionAfterCommand(newSelection, FrameSelection::defaultSetSelectionOptions(), cmd->unapplyEditType());
</del><ins>+ changeSelectionAfterCommand(newSelection, FrameSelection::defaultSetSelectionOptions());
</ins><span class="cx"> dispatchEditableContentChangedEvents(cmd->startingRootEditableElement(), cmd->endingRootEditableElement());
</span><span class="cx">
</span><span class="cx"> updateEditorUINowIfScheduled();
</span><span class="lines">@@ -1266,6 +1281,18 @@
</span><span class="cx"> performCutOrCopy(CopyAction);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void Editor::postTextStateChangeNotificationForCut(const String& text, const VisibleSelection& selection)
+{
+ if (!AXObjectCache::accessibilityEnabled())
+ return;
+ if (!text.length())
+ return;
+ AXObjectCache* cache = document().existingAXObjectCache();
+ if (!cache)
+ return;
+ cache->postTextStateChangeNotification(selection.start().anchorNode(), AXTextEditTypeCut, text, selection.start());
+}
+
</ins><span class="cx"> void Editor::performCutOrCopy(EditorActionSpecifier action)
</span><span class="cx"> {
</span><span class="cx"> RefPtr<Range> selection = selectedRange();
</span><span class="lines">@@ -1301,8 +1328,14 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> didWriteSelectionToPasteboard();
</span><del>- if (action == CutAction)
</del><ins>+ if (action == CutAction) {
+ String text;
+ if (AXObjectCache::accessibilityEnabled())
+ text = AccessibilityObject::stringForVisiblePositionRange(m_frame.selection().selection());
</ins><span class="cx"> deleteSelectionWithSmartDelete(canSmartCopyOrDelete(), EditActionCut);
</span><ins>+ if (AXObjectCache::accessibilityEnabled())
+ postTextStateChangeNotificationForCut(text, m_frame.selection().selection());
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Editor::paste()
</span><span class="lines">@@ -2895,7 +2928,7 @@
</span><span class="cx"> m_alternativeTextController->dismiss(ReasonForDismissingAlternativeTextIgnored);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void Editor::changeSelectionAfterCommand(const VisibleSelection& newSelection, FrameSelection::SetSelectionOptions options, AXTextStateChangeIntent intent)
</del><ins>+void Editor::changeSelectionAfterCommand(const VisibleSelection& newSelection, FrameSelection::SetSelectionOptions options)
</ins><span class="cx"> {
</span><span class="cx"> // If the new selection is orphaned, then don't update the selection.
</span><span class="cx"> if (newSelection.start().isOrphan() || newSelection.end().isOrphan())
</span><span class="lines">@@ -2907,7 +2940,7 @@
</span><span class="cx"> // See <rdar://problem/5729315> Some shouldChangeSelectedDOMRange contain Ranges for selections that are no longer valid
</span><span class="cx"> bool selectionDidNotChangeDOMPosition = newSelection == m_frame.selection().selection();
</span><span class="cx"> if (selectionDidNotChangeDOMPosition || m_frame.selection().shouldChangeSelection(newSelection))
</span><del>- m_frame.selection().setSelection(newSelection, options, intent);
</del><ins>+ m_frame.selection().setSelection(newSelection, options);
</ins><span class="cx">
</span><span class="cx"> // Some editing operations change the selection visually without affecting its position within the DOM.
</span><span class="cx"> // For example when you press return in the following (the caret is marked by ^):
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.h (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.h        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/Editor.h        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -482,7 +482,7 @@
</span><span class="cx"> enum SetCompositionMode { ConfirmComposition, CancelComposition };
</span><span class="cx"> void setComposition(const String&, SetCompositionMode);
</span><span class="cx">
</span><del>- void changeSelectionAfterCommand(const VisibleSelection& newSelection, FrameSelection::SetSelectionOptions, AXTextStateChangeIntent = AXTextStateChangeIntent());
</del><ins>+ void changeSelectionAfterCommand(const VisibleSelection& newSelection, FrameSelection::SetSelectionOptions);
</ins><span class="cx">
</span><span class="cx"> enum EditorActionSpecifier { CutAction, CopyAction };
</span><span class="cx"> void performCutOrCopy(EditorActionSpecifier);
</span><span class="lines">@@ -501,6 +501,8 @@
</span><span class="cx"> void fillInUserVisibleForm(PasteboardURL&);
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+ void postTextStateChangeNotificationForCut(const String&, const VisibleSelection&);
+
</ins><span class="cx"> Frame& m_frame;
</span><span class="cx"> RefPtr<CompositeEditCommand> m_lastEditCommand;
</span><span class="cx"> RefPtr<Text> m_compositionNode;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertIntoTextNodeCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -64,9 +64,6 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> m_node->insertData(m_offset, m_text, IGNORE_EXCEPTION);
</span><del>-
- if (shouldPostAccessibilityNotification())
- notifyAccessibilityForTextChange(m_node.get(), applyEditType(), m_text, VisiblePosition(Position(m_node, m_offset)));
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="lines">@@ -81,10 +78,6 @@
</span><span class="cx"> {
</span><span class="cx"> if (!m_node->hasEditableStyle())
</span><span class="cx"> return;
</span><del>-
- // Need to notify this before actually deleting the text
- if (shouldPostAccessibilityNotification())
- notifyAccessibilityForTextChange(m_node.get(), unapplyEditType(), m_text, VisiblePosition(Position(m_node, m_offset)));
</del><span class="cx">
</span><span class="cx"> m_node->deleteData(m_offset, m_text.length(), IGNORE_EXCEPTION);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertNodeBeforeCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertNodeBeforeCommand.cpp (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertNodeBeforeCommand.cpp        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/InsertNodeBeforeCommand.cpp        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -56,11 +56,6 @@
</span><span class="cx"> ASSERT(isEditableNode(*parent));
</span><span class="cx">
</span><span class="cx"> parent->insertBefore(*m_insertChild, m_refChild.get(), IGNORE_EXCEPTION);
</span><del>-
- if (shouldPostAccessibilityNotification()) {
- Position position = is<Text>(m_insertChild.get()) ? Position(downcast<Text>(m_insertChild.get()), 0) : createLegacyEditingPosition(m_insertChild.get(), 0);
- notifyAccessibilityForTextChange(m_insertChild.get(), applyEditType(), m_insertChild->nodeValue(), VisiblePosition(position));
- }
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InsertNodeBeforeCommand::doUnapply()
</span><span class="lines">@@ -68,12 +63,6 @@
</span><span class="cx"> if (!isEditableNode(*m_insertChild))
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- // Need to notify this before actually deleting the text
- if (shouldPostAccessibilityNotification()) {
- Position position = is<Text>(m_insertChild.get()) ? Position(downcast<Text>(m_insertChild.get()), 0) : createLegacyEditingPosition(m_insertChild.get(), 0);
- notifyAccessibilityForTextChange(m_insertChild.get(), unapplyEditType(), m_insertChild->nodeValue(), VisiblePosition(position));
- }
-
</del><span class="cx"> m_insertChild->remove(IGNORE_EXCEPTION);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingRemoveNodeCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/RemoveNodeCommand.cpp (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/RemoveNodeCommand.cpp        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/RemoveNodeCommand.cpp        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -34,8 +34,8 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-RemoveNodeCommand::RemoveNodeCommand(Ref<Node>&& node, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable)
- : SimpleEditCommand(node->document())
</del><ins>+RemoveNodeCommand::RemoveNodeCommand(Ref<Node>&& node, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable, EditAction editingAction)
+ : SimpleEditCommand(node->document(), editingAction)
</ins><span class="cx"> , m_node(WTFMove(node))
</span><span class="cx"> , m_shouldAssumeContentIsAlwaysEditable(shouldAssumeContentIsAlwaysEditable)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingRemoveNodeCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/RemoveNodeCommand.h (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/RemoveNodeCommand.h        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/RemoveNodeCommand.h        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -32,13 +32,13 @@
</span><span class="cx">
</span><span class="cx"> class RemoveNodeCommand : public SimpleEditCommand {
</span><span class="cx"> public:
</span><del>- static Ref<RemoveNodeCommand> create(Ref<Node>&& node, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable)
</del><ins>+ static Ref<RemoveNodeCommand> create(Ref<Node>&& node, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable, EditAction editingAction = EditActionUnspecified)
</ins><span class="cx"> {
</span><del>- return adoptRef(*new RemoveNodeCommand(WTFMove(node), shouldAssumeContentIsAlwaysEditable));
</del><ins>+ return adoptRef(*new RemoveNodeCommand(WTFMove(node), shouldAssumeContentIsAlwaysEditable, editingAction));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- RemoveNodeCommand(Ref<Node>&&, ShouldAssumeContentIsAlwaysEditable);
</del><ins>+ RemoveNodeCommand(Ref<Node>&&, ShouldAssumeContentIsAlwaysEditable, EditAction);
</ins><span class="cx">
</span><span class="cx"> void doApply() override;
</span><span class="cx"> void doUnapply() override;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceDeleteFromTextNodeCommandcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/editing/ReplaceDeleteFromTextNodeCommand.cpp (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceDeleteFromTextNodeCommand.cpp        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/ReplaceDeleteFromTextNodeCommand.cpp        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -1,42 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "ReplaceDeleteFromTextNodeCommand.h"
-
-#include "Text.h"
-
-namespace WebCore {
-
-ReplaceDeleteFromTextNodeCommand::ReplaceDeleteFromTextNodeCommand(RefPtr<Text>&& text, unsigned offset, unsigned count)
- : DeleteFromTextNodeCommand(WTFMove(text), offset, count, EditActionDelete)
-{
-}
-
-void ReplaceDeleteFromTextNodeCommand::notifyAccessibilityForTextChange(Node*, AXTextEditType, const String&, const VisiblePosition&)
-{
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceDeleteFromTextNodeCommandh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/editing/ReplaceDeleteFromTextNodeCommand.h (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceDeleteFromTextNodeCommand.h        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/ReplaceDeleteFromTextNodeCommand.h        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -1,47 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ReplaceDeleteFromTextNodeCommand_h
-#define ReplaceDeleteFromTextNodeCommand_h
-
-#include "DeleteFromTextNodeCommand.h"
-
-namespace WebCore {
-
-class ReplaceDeleteFromTextNodeCommand final : public DeleteFromTextNodeCommand {
-public:
- static Ref<ReplaceDeleteFromTextNodeCommand> create(RefPtr<Text>&& text, unsigned offset, unsigned count)
- {
- return adoptRef(*new ReplaceDeleteFromTextNodeCommand(WTFMove(text), offset, count));
- }
-
-private:
- ReplaceDeleteFromTextNodeCommand(RefPtr<Text>&&, unsigned, unsigned);
- void notifyAccessibilityForTextChange(Node*, AXTextEditType, const String&, const VisiblePosition&) override;
-};
-
-} // namespace WebCore
-
-#endif // ReplaceDeleteFromTextNodeCommand_h
</del></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceInsertIntoTextNodeCommandcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/editing/ReplaceInsertIntoTextNodeCommand.cpp (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceInsertIntoTextNodeCommand.cpp        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/ReplaceInsertIntoTextNodeCommand.cpp        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -1,65 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "ReplaceInsertIntoTextNodeCommand.h"
-
-#include "AXObjectCache.h"
-#include "Document.h"
-#include "Text.h"
-
-namespace WebCore {
-
-ReplaceInsertIntoTextNodeCommand::ReplaceInsertIntoTextNodeCommand(RefPtr<Text>&& node, unsigned offset, const String& text, const String& deletedText, EditAction editingAction)
- : InsertIntoTextNodeCommand(WTFMove(node), offset, text, editingAction)
- , m_deletedText(deletedText)
-{
-}
-
-void ReplaceInsertIntoTextNodeCommand::notifyAccessibilityForTextChange(Node* node, AXTextEditType type, const String& text, const VisiblePosition& position)
-{
- if (!shouldPostAccessibilityNotification())
- return;
- AXObjectCache* cache = document().existingAXObjectCache();
- if (!cache)
- return;
- switch (type) {
- case AXTextEditTypeAttributesChange:
- case AXTextEditTypeCut:
- case AXTextEditTypeUnknown:
- break;
- case AXTextEditTypeDelete:
- cache->postTextReplacementNotification(node, AXTextEditTypeDelete, text, AXTextEditTypeInsert, m_deletedText, position);
- break;
- case AXTextEditTypeDictation:
- case AXTextEditTypeInsert:
- case AXTextEditTypePaste:
- case AXTextEditTypeTyping:
- cache->postTextReplacementNotification(node, AXTextEditTypeDelete, m_deletedText, type, text, position);
- break;
- }
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceInsertIntoTextNodeCommandh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/editing/ReplaceInsertIntoTextNodeCommand.h (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceInsertIntoTextNodeCommand.h        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/ReplaceInsertIntoTextNodeCommand.h        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -1,49 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ReplaceInsertIntoTextNodeCommand_h
-#define ReplaceInsertIntoTextNodeCommand_h
-
-#include "InsertIntoTextNodeCommand.h"
-
-namespace WebCore {
-
-class ReplaceInsertIntoTextNodeCommand final : public InsertIntoTextNodeCommand {
-public:
- static Ref<ReplaceInsertIntoTextNodeCommand> create(RefPtr<Text>&& node, unsigned offset, const String& text, const String& deletedText, EditAction editingAction)
- {
- return adoptRef(*new ReplaceInsertIntoTextNodeCommand(WTFMove(node), offset, text, deletedText, editingAction));
- }
-
-private:
- ReplaceInsertIntoTextNodeCommand(RefPtr<Text>&&, unsigned, const String&, const String&, EditAction);
- void notifyAccessibilityForTextChange(Node*, AXTextEditType, const String&, const VisiblePosition&) override;
-
- String m_deletedText;
-};
-
-} // namespace WebCore
-
-#endif // ReplaceInsertIntoTextNodeCommand_h
</del></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceSelectionCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "ReplaceSelectionCommand.h"
</span><span class="cx">
</span><ins>+#include "AXObjectCache.h"
</ins><span class="cx"> #include "ApplyStyleCommand.h"
</span><span class="cx"> #include "BeforeTextInsertedEvent.h"
</span><span class="cx"> #include "BreakBlockquoteCommand.h"
</span><span class="lines">@@ -47,8 +48,6 @@
</span><span class="cx"> #include "RenderInline.h"
</span><span class="cx"> #include "RenderObject.h"
</span><span class="cx"> #include "RenderText.h"
</span><del>-#include "ReplaceDeleteFromTextNodeCommand.h"
-#include "ReplaceInsertIntoTextNodeCommand.h"
</del><span class="cx"> #include "SimplifyMarkupCommand.h"
</span><span class="cx"> #include "SmartReplace.h"
</span><span class="cx"> #include "StyleProperties.h"
</span><span class="lines">@@ -960,7 +959,8 @@
</span><span class="cx"> bool mergeBlocksAfterDelete = shouldHandleMailBlockquote || isEndOfParagraph(visibleEnd) || isStartOfBlock(visibleStart);
</span><span class="cx"> // FIXME: We should only expand to include fully selected special elements if we are copying a
</span><span class="cx"> // selection and pasting it on top of itself.
</span><del>- deleteSelection(false, mergeBlocksAfterDelete, true, false);
</del><ins>+ // FIXME: capturing the content of this delete would allow a replace accessibility notification instead of a simple insert
+ deleteSelection(false, mergeBlocksAfterDelete, true, false, true);
</ins><span class="cx"> visibleStart = endingSelection().visibleStart();
</span><span class="cx"> if (fragment.hasInterchangeNewlineAtStart()) {
</span><span class="cx"> if (isEndOfParagraph(visibleStart) && !isStartOfParagraph(visibleStart)) {
</span><span class="lines">@@ -1367,6 +1367,9 @@
</span><span class="cx"> else
</span><span class="cx"> return;
</span><span class="cx">
</span><ins>+ if (AXObjectCache::accessibilityEnabled() && editingAction() == EditActionPaste)
+ m_visibleSelectionForInsertedText = VisibleSelection(start, end);
+
</ins><span class="cx"> if (m_selectReplacement)
</span><span class="cx"> setEndingSelection(VisibleSelection(start, end, SEL_DEFAULT_AFFINITY, endingSelection().isDirectional()));
</span><span class="cx"> else
</span><span class="lines">@@ -1512,6 +1515,9 @@
</span><span class="cx">
</span><span class="cx"> VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, end);
</span><span class="cx">
</span><ins>+ if (AXObjectCache::accessibilityEnabled() && editingAction() == EditActionPaste)
+ m_visibleSelectionForInsertedText = VisibleSelection(start, end);
+
</ins><span class="cx"> setEndingSelection(selectionAfterReplace);
</span><span class="cx">
</span><span class="cx"> return true;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceSelectionCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ReplaceSelectionCommand.h (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceSelectionCommand.h        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/ReplaceSelectionCommand.h        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -53,6 +53,8 @@
</span><span class="cx"> return adoptRef(*new ReplaceSelectionCommand(document, WTFMove(fragment), options, editingAction));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ VisibleSelection visibleSelectionForInsertedText() const { return m_visibleSelectionForInsertedText; }
+
</ins><span class="cx"> private:
</span><span class="cx"> ReplaceSelectionCommand(Document&, RefPtr<DocumentFragment>&&, CommandOptions, EditAction);
</span><span class="cx">
</span><span class="lines">@@ -110,6 +112,7 @@
</span><span class="cx">
</span><span class="cx"> bool performTrivialReplace(const ReplacementFragment&);
</span><span class="cx">
</span><ins>+ VisibleSelection m_visibleSelectionForInsertedText;
</ins><span class="cx"> Position m_startOfInsertedContent;
</span><span class="cx"> Position m_endOfInsertedContent;
</span><span class="cx"> RefPtr<EditingStyle> m_insertionStyle;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTextInsertionBaseCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TextInsertionBaseCommand.cpp (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TextInsertionBaseCommand.cpp        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/TextInsertionBaseCommand.cpp        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -35,8 +35,8 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-TextInsertionBaseCommand::TextInsertionBaseCommand(Document& document)
- : CompositeEditCommand(document)
</del><ins>+TextInsertionBaseCommand::TextInsertionBaseCommand(Document& document, EditAction editingAction)
+ : CompositeEditCommand(document, editingAction)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTextInsertionBaseCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TextInsertionBaseCommand.h (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TextInsertionBaseCommand.h        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/TextInsertionBaseCommand.h        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx"> virtual ~TextInsertionBaseCommand() { };
</span><span class="cx">
</span><span class="cx"> protected:
</span><del>- explicit TextInsertionBaseCommand(Document&);
</del><ins>+ explicit TextInsertionBaseCommand(Document&, EditAction = EditActionUnspecified);
</ins><span class="cx"> static void applyTextInsertionCommand(Frame*, TextInsertionBaseCommand&, const VisibleSelection& selectionForInsertion, const VisibleSelection& endingSelection);
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTypingCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TypingCommand.cpp (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TypingCommand.cpp        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/TypingCommand.cpp        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "TypingCommand.h"
</span><span class="cx">
</span><ins>+#include "AXObjectCache.h"
</ins><span class="cx"> #include "BreakBlockquoteCommand.h"
</span><span class="cx"> #include "DeleteSelectionCommand.h"
</span><span class="cx"> #include "Document.h"
</span><span class="lines">@@ -75,7 +76,7 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> TypingCommand::TypingCommand(Document& document, ETypingCommand commandType, const String &textToInsert, Options options, TextGranularity granularity, TextCompositionType compositionType)
</span><del>- : TextInsertionBaseCommand(document)
</del><ins>+ : TextInsertionBaseCommand(document, EditActionTyping)
</ins><span class="cx"> , m_commandType(commandType)
</span><span class="cx"> , m_textToInsert(textToInsert)
</span><span class="cx"> , m_openForMoreTyping(true)
</span><span class="lines">@@ -182,7 +183,7 @@
</span><span class="cx"> lastTypingCommand->setCompositionType(compositionType);
</span><span class="cx"> lastTypingCommand->setShouldRetainAutocorrectionIndicator(options & RetainAutocorrectionIndicator);
</span><span class="cx"> lastTypingCommand->setShouldPreventSpellChecking(options & PreventSpellChecking);
</span><del>- lastTypingCommand->insertText(newText, options & SelectInsertedText);
</del><ins>+ lastTypingCommand->insertTextAndNotifyAccessibility(newText, options & SelectInsertedText);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -194,7 +195,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (RefPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(*document.frame())) {
</span><span class="cx"> lastTypingCommand->setShouldRetainAutocorrectionIndicator(options & RetainAutocorrectionIndicator);
</span><del>- lastTypingCommand->insertLineBreak();
</del><ins>+ lastTypingCommand->insertLineBreakAndNotifyAccessibility();
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -204,7 +205,7 @@
</span><span class="cx"> void TypingCommand::insertParagraphSeparatorInQuotedContent(Document& document)
</span><span class="cx"> {
</span><span class="cx"> if (RefPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(*document.frame())) {
</span><del>- lastTypingCommand->insertParagraphSeparatorInQuotedContent();
</del><ins>+ lastTypingCommand->insertParagraphSeparatorInQuotedContentAndNotifyAccessibility();
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -215,7 +216,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (RefPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(*document.frame())) {
</span><span class="cx"> lastTypingCommand->setShouldRetainAutocorrectionIndicator(options & RetainAutocorrectionIndicator);
</span><del>- lastTypingCommand->insertParagraphSeparator();
</del><ins>+ lastTypingCommand->insertParagraphSeparatorAndNotifyAccessibility();
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -247,6 +248,17 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+void TypingCommand::postTextStateChangeNotificationForDeletion(const VisibleSelection& selection)
+{
+ if (!AXObjectCache::accessibilityEnabled())
+ return;
+ postTextStateChangeNotification(AXTextEditTypeDelete, AccessibilityObject::stringForVisiblePositionRange(selection), selection.start());
+ VisiblePositionIndexRange range;
+ range.startIndex.value = indexForVisiblePosition(selection.start(), range.startIndex.scope);
+ range.endIndex.value = indexForVisiblePosition(selection.end(), range.endIndex.scope);
+ composition()->setTextInsertedByUnapplyRange(range);
+}
+
</ins><span class="cx"> void TypingCommand::doApply()
</span><span class="cx"> {
</span><span class="cx"> if (!endingSelection().isNonOrphanedCaretOrRange())
</span><span class="lines">@@ -267,27 +279,22 @@
</span><span class="cx"> forwardDeleteKeyPressed(m_granularity, m_shouldAddToKillRing);
</span><span class="cx"> return;
</span><span class="cx"> case InsertLineBreak:
</span><del>- insertLineBreak();
</del><ins>+ insertLineBreakAndNotifyAccessibility();
</ins><span class="cx"> return;
</span><span class="cx"> case InsertParagraphSeparator:
</span><del>- insertParagraphSeparator();
</del><ins>+ insertParagraphSeparatorAndNotifyAccessibility();
</ins><span class="cx"> return;
</span><span class="cx"> case InsertParagraphSeparatorInQuotedContent:
</span><del>- insertParagraphSeparatorInQuotedContent();
</del><ins>+ insertParagraphSeparatorInQuotedContentAndNotifyAccessibility();
</ins><span class="cx"> return;
</span><span class="cx"> case InsertText:
</span><del>- insertText(m_textToInsert, m_selectInsertedText);
</del><ins>+ insertTextAndNotifyAccessibility(m_textToInsert, m_selectInsertedText);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-EditAction TypingCommand::editingAction() const
-{
- return EditActionTyping;
-}
-
</del><span class="cx"> void TypingCommand::markMisspellingsAfterTyping(ETypingCommand commandType)
</span><span class="cx"> {
</span><span class="cx"> Frame& frame = this->frame();
</span><span class="lines">@@ -371,6 +378,14 @@
</span><span class="cx"> forEachLineInString(text, operation);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void TypingCommand::insertTextAndNotifyAccessibility(const String &text, bool selectInsertedText)
+{
+ AccessibilityReplacedText replacedText(frame().selection().selection());
+ insertText(text, selectInsertedText);
+ replacedText.postTextStateChangeNotification(document().existingAXObjectCache(), AXTextEditTypeTyping, text, frame().selection().selection());
+ composition()->setTextInsertedByUnapplyRange(replacedText.replacedRange());
+}
+
</ins><span class="cx"> void TypingCommand::insertTextRunWithoutNewlines(const String &text, bool selectInsertedText)
</span><span class="cx"> {
</span><span class="cx"> RefPtr<InsertTextCommand> command = InsertTextCommand::create(document(), text, selectInsertedText,
</span><span class="lines">@@ -390,6 +405,14 @@
</span><span class="cx"> typingAddedToOpenCommand(InsertLineBreak);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void TypingCommand::insertLineBreakAndNotifyAccessibility()
+{
+ AccessibilityReplacedText replacedText(frame().selection().selection());
+ insertLineBreak();
+ replacedText.postTextStateChangeNotification(document().existingAXObjectCache(), AXTextEditTypeTyping, "\n", frame().selection().selection());
+ composition()->setTextInsertedByUnapplyRange(replacedText.replacedRange());
+}
+
</ins><span class="cx"> void TypingCommand::insertParagraphSeparator()
</span><span class="cx"> {
</span><span class="cx"> if (!canAppendNewLineFeedToSelection(endingSelection()))
</span><span class="lines">@@ -399,6 +422,14 @@
</span><span class="cx"> typingAddedToOpenCommand(InsertParagraphSeparator);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void TypingCommand::insertParagraphSeparatorAndNotifyAccessibility()
+{
+ AccessibilityReplacedText replacedText(frame().selection().selection());
+ insertParagraphSeparator();
+ replacedText.postTextStateChangeNotification(document().existingAXObjectCache(), AXTextEditTypeTyping, "\n", frame().selection().selection());
+ composition()->setTextInsertedByUnapplyRange(replacedText.replacedRange());
+}
+
</ins><span class="cx"> void TypingCommand::insertParagraphSeparatorInQuotedContent()
</span><span class="cx"> {
</span><span class="cx"> // If the selection starts inside a table, just insert the paragraph separator normally
</span><span class="lines">@@ -412,6 +443,14 @@
</span><span class="cx"> typingAddedToOpenCommand(InsertParagraphSeparatorInQuotedContent);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void TypingCommand::insertParagraphSeparatorInQuotedContentAndNotifyAccessibility()
+{
+ AccessibilityReplacedText replacedText(frame().selection().selection());
+ insertParagraphSeparatorInQuotedContent();
+ replacedText.postTextStateChangeNotification(document().existingAXObjectCache(), AXTextEditTypeTyping, "\n", frame().selection().selection());
+ composition()->setTextInsertedByUnapplyRange(replacedText.replacedRange());
+}
+
</ins><span class="cx"> bool TypingCommand::makeEditableRootEmpty()
</span><span class="cx"> {
</span><span class="cx"> Element* root = endingSelection().rootEditableElement();
</span><span class="lines">@@ -532,6 +571,10 @@
</span><span class="cx">
</span><span class="cx"> if (shouldAddToKillRing)
</span><span class="cx"> frame.editor().addRangeToKillRing(*selectionToDelete.toNormalizedRange().get(), Editor::KillRingInsertionMode::PrependText);
</span><ins>+
+ // Post the accessibility notification before actually deleting the content while selectionToDelete is still valid
+ postTextStateChangeNotificationForDeletion(selectionToDelete);
+
</ins><span class="cx"> // Make undo select everything that has been deleted, unless an undo will undo more than just this deletion.
</span><span class="cx"> // FIXME: This behaves like TextEdit except for the case where you open with text insertion and then delete
</span><span class="cx"> // more text than you insert. In that case all of the text that was around originally should be selected.
</span><span class="lines">@@ -628,6 +671,9 @@
</span><span class="cx"> if (selectionToDelete.isCaret() || !frame.selection().shouldDeleteSelection(selectionToDelete))
</span><span class="cx"> return;
</span><span class="cx">
</span><ins>+ // Post the accessibility notification before actually deleting the content while selectionToDelete is still valid
+ postTextStateChangeNotificationForDeletion(selectionToDelete);
+
</ins><span class="cx"> if (shouldAddToKillRing)
</span><span class="cx"> frame.editor().addRangeToKillRing(*selectionToDelete.toNormalizedRange().get(), Editor::KillRingInsertionMode::AppendText);
</span><span class="cx"> // make undo select what was deleted
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTypingCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TypingCommand.h (199029 => 199030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TypingCommand.h        2016-04-04 22:54:31 UTC (rev 199029)
+++ trunk/Source/WebCore/editing/TypingCommand.h        2016-04-04 23:17:59 UTC (rev 199030)
</span><span class="lines">@@ -105,7 +105,6 @@
</span><span class="cx"> static RefPtr<TypingCommand> lastTypingCommandIfStillOpenForTyping(Frame&);
</span><span class="cx">
</span><span class="cx"> virtual void doApply();
</span><del>- virtual EditAction editingAction() const;
</del><span class="cx"> virtual bool isTypingCommand() const;
</span><span class="cx"> virtual bool preservesTypingStyle() const { return m_preservesTypingStyle; }
</span><span class="cx"> virtual bool shouldRetainAutocorrectionIndicator() const
</span><span class="lines">@@ -124,6 +123,12 @@
</span><span class="cx"> void typingAddedToOpenCommand(ETypingCommand);
</span><span class="cx"> bool makeEditableRootEmpty();
</span><span class="cx">
</span><ins>+ void postTextStateChangeNotificationForDeletion(const VisibleSelection&);
+ void insertTextAndNotifyAccessibility(const String &text, bool selectInsertedText);
+ void insertLineBreakAndNotifyAccessibility();
+ void insertParagraphSeparatorInQuotedContentAndNotifyAccessibility();
+ void insertParagraphSeparatorAndNotifyAccessibility();
+
</ins><span class="cx"> ETypingCommand m_commandType;
</span><span class="cx"> String m_textToInsert;
</span><span class="cx"> bool m_openForMoreTyping;
</span></span></pre>
</div>
</div>
</body>
</html>