<!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>[183368] 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/183368">183368</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-04-26 15:17:11 -0700 (Sun, 26 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>AX: richer text change notifications (142719)
https://bugs.webkit.org/show_bug.cgi?id=142719

Patch by Doug Russell &lt;d_russell@apple.com&gt; on 2015-04-26
Reviewed by Darin Adler.

Richer accessibility value change notifications. Introduce AXTextEditType,
postTextStateChangeNotification and postTextReplacementNotification to give assistive
tech apps more reliable context for responding to changes in web content. Also implement
a mechanism to post value changes in password form fields in coalesced ticks to thwart
analyzing the cadence of changes.

Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent,
and an overload of postTextReplacementNotification to give assistive tech apps more
reliable context for responding to changes in web content selection. Also block posting
selection changes on password fields.

Source/WebCore:

Tests: platform/mac/accessibility/input-replacevalue-userinfo.html
       platform/mac/accessibility/selection-change-userinfo.html
       platform/mac/accessibility/value-change-userinfo.html

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::AXObjectCache):
(WebCore::AXObjectCache::notificationPostTimerFired):
(WebCore::AXObjectCache::passwordNotificationPostTimerFired):
(WebCore::AXObjectCache::showIntent):
(WebCore::AXObjectCache::setTextSelectionIntent):
(WebCore::isPasswordFieldOrContainedByPasswordField):
(WebCore::AXObjectCache::postTextStateChangeNotification):
(WebCore::AXObjectCache::postTextReplacementNotification):
(WebCore::AXObjectCache::enqueuePasswordValueChangeNotification):
(WebCore::AXObjectCache::rootWebArea):
(WebCore::AXObjectCache::textChangeForEditType):
(WebCore::AXObjectCache::selectedChildrenChanged): Deleted.
(WebCore::AXObjectCache::frameLoadingEventNotification): Deleted.
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::postTextStateChangeNotification):
(WebCore::AXObjectCache::postTextReplacementNotification):
(WebCore::AXObjectCache::postTextStateChangePlatformNotification):
(WebCore::AXObjectCache::postTextReplacementPlatformNotification):
(WebCore::AXObjectCache::textChangeForEditType):
(WebCore::AXObjectCache::nodeTextChangePlatformNotification):
(WebCore::AXObjectCache::computedObjectAttributeCache): Deleted.
(WebCore::AXObjectCache::getOrCreate): Deleted.
(WebCore::AXObjectCache::attachWrapper): Deleted.
* accessibility/AXTextStateChangeIntent.h: Added.
(WebCore::AXTextStateChangeIntent::AXTextStateChangeIntent):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::passwordFieldOrContainingPasswordField):
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isContainedByPasswordField):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::passwordFieldOrContainingPasswordField):
(WebCore::AccessibilityObject::isPasswordField): Deleted.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::setSelectedTextRange):
(WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
* accessibility/AccessibilityScrollView.h:
* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::nodeTextChangePlatformNotification):
* accessibility/ios/AXObjectCacheIOS.mm:
(WebCore::AXObjectCache::postTextStateChangePlatformNotification):
(WebCore::AXObjectCache::postTextReplacementPlatformNotification):
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::setShouldRepostNotificationsForTests):
(WebCore::AXPostNotificationWithUserInfo):
(WebCore::AXObjectCache::postPlatformNotification):
(WebCore::AXObjectCache::postTextStateChangePlatformNotification):
(WebCore::textReplacementChangeDictionary):
(WebCore::AXObjectCache::postTextReplacementPlatformNotification):
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(+[WebAccessibilityObjectWrapperBase accessibilitySetShouldRepostNotifications:]):
(-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:]):
(arrayRemovingNonJSONTypes):
(dictionaryRemovingNonJSONTypes):
(-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:userInfo:]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(textMarkerRangeFromVisiblePositions):
(-[WebAccessibilityObjectWrapper textMarkerRangeFromVisiblePositions:endPosition:]):
* editing/AppendNodeCommand.cpp:
(WebCore::AppendNodeCommand::AppendNodeCommand):
(WebCore::sendAXTextChangedIgnoringLineBreaks):
(WebCore::AppendNodeCommand::doApply):
(WebCore::AppendNodeCommand::doUnapply):
* editing/AppendNodeCommand.h:
(WebCore::AppendNodeCommand::create):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::ApplyStyleCommand):
(WebCore::ApplyStyleCommand::applyBlockStyle): Deleted.
* editing/ApplyStyleCommand.h:
* editing/CompositeEditCommand.cpp:
(WebCore::EditCommandComposition::unapplyEditType):
(WebCore::CompositeEditCommand::CompositeEditCommand):
(WebCore::CompositeEditCommand::apply):
(WebCore::CompositeEditCommand::insertParagraphSeparator):
(WebCore::CompositeEditCommand::insertNodeBefore):
(WebCore::CompositeEditCommand::appendNode):
(WebCore::CompositeEditCommand::removeNodePreservingChildren):
(WebCore::CompositeEditCommand::insertTextIntoNode):
(WebCore::CompositeEditCommand::deleteTextFromNode):
(WebCore::CompositeEditCommand::replaceTextInNode):
(WebCore::CompositeEditCommand::moveParagraphs):
(WebCore::EditCommandComposition::getNodesInCommand): Deleted.
(WebCore::CompositeEditCommand::applyStyle): Deleted.
(WebCore::CompositeEditCommand::insertLineBreak): Deleted.
(WebCore::CompositeEditCommand::insertNodeAt): Deleted.
(WebCore::CompositeEditCommand::removeChildrenInRange): Deleted.
(WebCore::CompositeEditCommand::inputText): Deleted.
* editing/CompositeEditCommand.h:
* editing/DeleteFromTextNodeCommand.cpp:
(WebCore::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand):
(WebCore::DeleteFromTextNodeCommand::doApply):
(WebCore::DeleteFromTextNodeCommand::doUnapply):
* editing/DeleteFromTextNodeCommand.h:
(WebCore::DeleteFromTextNodeCommand::create):
(WebCore::DeleteFromTextNodeCommand::deletedText):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::DeleteSelectionCommand):
(WebCore::DeleteSelectionCommand::preservesTypingStyle): Deleted.
* editing/DeleteSelectionCommand.h:
(WebCore::DeleteSelectionCommand::create):
* editing/DictationCommand.cpp:
(WebCore::DictationCommand::insertTextRunWithoutNewlines):
(WebCore::DictationCommand::insertParagraphSeparator):
* editing/EditAction.h:
* editing/EditCommand.cpp:
(WebCore::EditCommand::EditCommand):
(WebCore::EditCommand::editingAction):
(WebCore::EditCommand::applyEditType):
(WebCore::EditCommand::unapplyEditType):
(WebCore::SimpleEditCommand::SimpleEditCommand):
(WebCore::SimpleEditCommand::notifyAccessibilityForTextChange):
(WebCore::EditCommand::setParent): Deleted.
* editing/EditCommand.h:
* editing/EditingAllInOne.cpp:
* editing/Editor.cpp:
(WebCore::Editor::handleTextEvent):
(WebCore::Editor::deleteSelectionWithSmartDelete):
(WebCore::Editor::replaceSelectionWithFragment):
(WebCore::Editor::replaceSelectionWithText):
(WebCore::Editor::appliedEditing):
(WebCore::Editor::unappliedEditing):
(WebCore::Editor::performCutOrCopy):
(WebCore::Editor::markMisspellingsAfterTypingToWord):
(WebCore::Editor::changeBackToReplacedString):
(WebCore::Editor::transpose):
(WebCore::Editor::changeSelectionAfterCommand):
* editing/Editor.h:
* editing/EditorCommand.cpp:
(WebCore::executeInsertFragment):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::moveTo):
(WebCore::FrameSelection::moveWithoutValidationTo):
(WebCore::FrameSelection::setSelectionByMouseIfDifferent):
(WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
(WebCore::FrameSelection::setSelection):
(WebCore::FrameSelection::updateAndRevealSelection):
(WebCore::isBoundary):
(WebCore::FrameSelection::textSelectionIntent):
(WebCore::FrameSelection::modify):
(WebCore::FrameSelection::selectAll):
(WebCore::FrameSelection::wordSelectionContainingCaretSelection):
(WebCore::FrameSelection::modifyMovingBackward): Deleted.
(WebCore::FrameSelection::selectFrameElementInParentIfFullySelected): Deleted.
(WebCore::FrameSelection::selectionAtWordStart): Deleted.
* editing/FrameSelection.h:
(WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
(WebCore::FrameSelection::selection): Deleted.
* editing/InsertIntoTextNodeCommand.cpp:
(WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand):
(WebCore::InsertIntoTextNodeCommand::doApply):
(WebCore::InsertIntoTextNodeCommand::doUnapply):
* editing/InsertIntoTextNodeCommand.h:
(WebCore::InsertIntoTextNodeCommand::create):
(WebCore::InsertIntoTextNodeCommand::insertedText):
* editing/InsertNodeBeforeCommand.cpp:
(WebCore::InsertNodeBeforeCommand::InsertNodeBeforeCommand):
(WebCore::InsertNodeBeforeCommand::doApply):
(WebCore::InsertNodeBeforeCommand::doUnapply):
* editing/InsertNodeBeforeCommand.h:
(WebCore::InsertNodeBeforeCommand::create):
* editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand):
* editing/InsertParagraphSeparatorCommand.h:
(WebCore::InsertParagraphSeparatorCommand::create):
* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::InsertTextCommand):
* editing/InsertTextCommand.h:
(WebCore::InsertTextCommand::create):
(WebCore::InsertTextCommand::createWithMarkerSupplier):
* editing/MoveSelectionCommand.cpp:
(WebCore::MoveSelectionCommand::doApply):
* editing/RemoveNodePreservingChildrenCommand.cpp:
(WebCore::RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand):
* editing/RemoveNodePreservingChildrenCommand.h:
(WebCore::RemoveNodePreservingChildrenCommand::create):
* editing/ReplaceDeleteFromTextNodeCommand.cpp: Copied from Source/WebCore/editing/AppendNodeCommand.h.
(WebCore::ReplaceDeleteFromTextNodeCommand::ReplaceDeleteFromTextNodeCommand):
(WebCore::ReplaceDeleteFromTextNodeCommand::notifyAccessibilityForTextChange):
* editing/ReplaceDeleteFromTextNodeCommand.h: Copied from Source/WebCore/editing/AppendNodeCommand.h.
* editing/ReplaceInsertIntoTextNodeCommand.cpp: Added.
(WebCore::ReplaceInsertIntoTextNodeCommand::ReplaceInsertIntoTextNodeCommand):
(WebCore::ReplaceInsertIntoTextNodeCommand::notifyAccessibilityForTextChange):
* editing/ReplaceInsertIntoTextNodeCommand.h: Copied from Source/WebCore/editing/RemoveNodePreservingChildrenCommand.h.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
(WebCore::ReplaceSelectionCommand::InsertedNodes::didReplaceNode): Deleted.
(WebCore::ReplaceSelectionCommand::insertAsListItems): Deleted.
* editing/ReplaceSelectionCommand.h:
(WebCore::ReplaceSelectionCommand::create):
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::insertTextRunWithoutNewlines):
(WebCore::TypingCommand::insertParagraphSeparator):
* editing/atk/FrameSelectionAtk.cpp:
(WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
* editing/ios/DictationCommandIOS.cpp:
(WebCore::DictationCommandIOS::DictationCommandIOS):
* editing/ios/DictationCommandIOS.h:
* editing/mac/FrameSelectionMac.mm:
(WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setInnerTextValue):
* page/DragController.cpp:
(WebCore::DragController::concludeEditDrag):
* page/EventHandler.cpp:
(WebCore::setInitialKeyboardSelection):
* page/FocusController.cpp:
(WebCore::FocusController::advanceFocusInDocumentOrder):

Source/WebKit/mac:

* WebCoreSupport/WebEditorClient.mm:
(undoNameForEditAction):

Source/WebKit2:

* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::nameForEditAction):

Tools:

* DumpRenderTree/mac/AccessibilityNotificationHandler.h:
* DumpRenderTree/mac/AccessibilityNotificationHandler.mm:
(-[AccessibilityNotificationHandler stopObserving]):
(-[AccessibilityNotificationHandler _notificationReceived:]):
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::removeNotificationListener):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm:
(-[AccessibilityNotificationHandler _notificationReceived:]):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::removeNotificationListener):

LayoutTests:

* platform/mac/accessibility/input-replacevalue-userinfo-expected.txt: Added.
* platform/mac/accessibility/input-replacevalue-userinfo.html: Added.
* platform/mac/accessibility/selection-change-userinfo-expected.txt: Added.
* platform/mac/accessibility/selection-change-userinfo.html: Added.
* platform/mac/accessibility/value-change-userinfo-expected.txt: Added.
* platform/mac/accessibility/value-change-userinfo.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacTestExpectations">trunk/LayoutTests/platform/mac/TestExpectations</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="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</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="#trunkSourceWebCoreaccessibilityAccessibilityNodeObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityNodeObjecth">trunk/Source/WebCore/accessibility/AccessibilityNodeObject.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="#trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityScrollViewh">trunk/Source/WebCore/accessibility/AccessibilityScrollView.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityatkAXObjectCacheAtkcpp">trunk/Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityiosAXObjectCacheIOSmm">trunk/Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreaccessibilitymacAXObjectCacheMacmm">trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm</a></li>
<li><a href="#trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperBaseh">trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperBasemm">trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm</a></li>
<li><a href="#trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperMach">trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperMacmm">trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm</a></li>
<li><a href="#trunkSourceWebCoreeditingAppendNodeCommandcpp">trunk/Source/WebCore/editing/AppendNodeCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingAppendNodeCommandh">trunk/Source/WebCore/editing/AppendNodeCommand.h</a></li>
<li><a href="#trunkSourceWebCoreeditingApplyStyleCommandcpp">trunk/Source/WebCore/editing/ApplyStyleCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingApplyStyleCommandh">trunk/Source/WebCore/editing/ApplyStyleCommand.h</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="#trunkSourceWebCoreeditingDeleteSelectionCommandcpp">trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingDeleteSelectionCommandh">trunk/Source/WebCore/editing/DeleteSelectionCommand.h</a></li>
<li><a href="#trunkSourceWebCoreeditingDictationCommandcpp">trunk/Source/WebCore/editing/DictationCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditActionh">trunk/Source/WebCore/editing/EditAction.h</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="#trunkSourceWebCoreeditingEditorCommandcpp">trunk/Source/WebCore/editing/EditorCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingFrameSelectioncpp">trunk/Source/WebCore/editing/FrameSelection.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingFrameSelectionh">trunk/Source/WebCore/editing/FrameSelection.h</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertIntoTextNodeCommandcpp">trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertIntoTextNodeCommandh">trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.h</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertNodeBeforeCommandcpp">trunk/Source/WebCore/editing/InsertNodeBeforeCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertNodeBeforeCommandh">trunk/Source/WebCore/editing/InsertNodeBeforeCommand.h</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertParagraphSeparatorCommandcpp">trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertParagraphSeparatorCommandh">trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.h</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertTextCommandcpp">trunk/Source/WebCore/editing/InsertTextCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertTextCommandh">trunk/Source/WebCore/editing/InsertTextCommand.h</a></li>
<li><a href="#trunkSourceWebCoreeditingMoveSelectionCommandcpp">trunk/Source/WebCore/editing/MoveSelectionCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingRemoveNodePreservingChildrenCommandcpp">trunk/Source/WebCore/editing/RemoveNodePreservingChildrenCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingRemoveNodePreservingChildrenCommandh">trunk/Source/WebCore/editing/RemoveNodePreservingChildrenCommand.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="#trunkSourceWebCoreeditingTypingCommandcpp">trunk/Source/WebCore/editing/TypingCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingatkFrameSelectionAtkcpp">trunk/Source/WebCore/editing/atk/FrameSelectionAtk.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingiosDictationCommandIOScpp">trunk/Source/WebCore/editing/ios/DictationCommandIOS.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingiosDictationCommandIOSh">trunk/Source/WebCore/editing/ios/DictationCommandIOS.h</a></li>
<li><a href="#trunkSourceWebCoreeditingmacFrameSelectionMacmm">trunk/Source/WebCore/editing/mac/FrameSelectionMac.mm</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTextFormControlElementcpp">trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDragControllercpp">trunk/Source/WebCore/page/DragController.cpp</a></li>
<li><a href="#trunkSourceWebCorepageEventHandlercpp">trunk/Source/WebCore/page/EventHandler.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFocusControllercpp">trunk/Source/WebCore/page/FocusController.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebEditorClientmm">trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebEditCommandProxycpp">trunk/Source/WebKit2/UIProcess/WebEditCommandProxy.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreemacAccessibilityNotificationHandlerh">trunk/Tools/DumpRenderTree/mac/AccessibilityNotificationHandler.h</a></li>
<li><a href="#trunkToolsDumpRenderTreemacAccessibilityNotificationHandlermm">trunk/Tools/DumpRenderTree/mac/AccessibilityNotificationHandler.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreemacAccessibilityUIElementMacmm">trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityNotificationHandlermm">trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityUIElementMacmm">trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsplatformmacaccessibilityinputreplacevalueuserinfoexpectedtxt">trunk/LayoutTests/platform/mac/accessibility/input-replacevalue-userinfo-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacaccessibilityinputreplacevalueuserinfohtml">trunk/LayoutTests/platform/mac/accessibility/input-replacevalue-userinfo.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacaccessibilityselectionchangeuserinfoexpectedtxt">trunk/LayoutTests/platform/mac/accessibility/selection-change-userinfo-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacaccessibilityselectionchangeuserinfohtml">trunk/LayoutTests/platform/mac/accessibility/selection-change-userinfo.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacaccessibilityvaluechangeuserinfoexpectedtxt">trunk/LayoutTests/platform/mac/accessibility/value-change-userinfo-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacaccessibilityvaluechangeuserinfohtml">trunk/LayoutTests/platform/mac/accessibility/value-change-userinfo.html</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAXTextStateChangeIntenth">trunk/Source/WebCore/accessibility/AXTextStateChangeIntent.h</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 (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/LayoutTests/ChangeLog        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2015-04-26  Doug Russell  &lt;d_russell@apple.com&gt;
+
+        AX: richer text change notifications (142719)
+        https://bugs.webkit.org/show_bug.cgi?id=142719
+
+        Reviewed by Darin Adler.
+
+        Richer accessibility value change notifications. Introduce AXTextEditType,
+        postTextStateChangeNotification and postTextReplacementNotification to give assistive
+        tech apps more reliable context for responding to changes in web content. Also implement
+        a mechanism to post value changes in password form fields in coalesced ticks to thwart
+        analyzing the cadence of changes.
+
+        Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent,
+        and an overload of postTextReplacementNotification to give assistive tech apps more
+        reliable context for responding to changes in web content selection. Also block posting
+        selection changes on password fields.
+
+        * platform/mac/accessibility/input-replacevalue-userinfo-expected.txt: Added.
+        * platform/mac/accessibility/input-replacevalue-userinfo.html: Added.
+        * platform/mac/accessibility/selection-change-userinfo-expected.txt: Added.
+        * platform/mac/accessibility/selection-change-userinfo.html: Added.
+        * platform/mac/accessibility/value-change-userinfo-expected.txt: Added.
+        * platform/mac/accessibility/value-change-userinfo.html: Added.
+
</ins><span class="cx"> 2015-04-26  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r176751): line-height ignored in &lt;button&gt; elements
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/TestExpectations (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/TestExpectations        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/LayoutTests/platform/mac/TestExpectations        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -1263,3 +1263,6 @@
</span><span class="cx"> # OS X 10.10.3+ has the necessary glyphs.
</span><span class="cx"> webkit.org/b/142548 [ Yosemite+ ] editing/selection/extend-by-character-007.html [ Pass ]
</span><span class="cx"> webkit.org/b/141661 [ Yosemite+ ] fast/text/emoji.html [ Pass ]
</span><ins>+
+# Timing out on Yosemite &amp; Mavericks WK1 release sometimes
+webkit.org/b/142719 platform/mac/accessibility/select-text.html [ Pass Timeout ]
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacaccessibilityinputreplacevalueuserinfoexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/accessibility/input-replacevalue-userinfo-expected.txt (0 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/accessibility/input-replacevalue-userinfo-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/input-replacevalue-userinfo-expected.txt        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+  
+This tests value change notifications user info data when replacing the contents of an input field.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS addedNotification is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeEdit
+PASS results[resultIndex][&quot;AXTextChangeValues&quot;][0][&quot;AXTextChangeValue&quot;] is &quot;0&quot;
+PASS results[resultIndex][&quot;AXTextChangeValues&quot;][0][&quot;AXTextEditType&quot;] is AXTextEditTypeDelete
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeEdit
+PASS results[resultIndex][&quot;AXTextChangeValues&quot;][1][&quot;AXTextChangeValue&quot;] is &quot;1&quot;
+PASS results[resultIndex][&quot;AXTextChangeValues&quot;][1][&quot;AXTextEditType&quot;] is AXTextEditTypeInsert
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeEdit
+PASS results[resultIndex][&quot;AXTextChangeValues&quot;][0][&quot;AXTextChangeValue&quot;] is &quot; &quot;
+PASS results[resultIndex][&quot;AXTextChangeValues&quot;][0][&quot;AXTextEditType&quot;] is AXTextEditTypeInsert
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacaccessibilityinputreplacevalueuserinfohtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/accessibility/input-replacevalue-userinfo.html (0 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/accessibility/input-replacevalue-userinfo.html                                (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/input-replacevalue-userinfo.html        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -0,0 +1,83 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;../../../editing/editing.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body id=&quot;body&quot;&gt;
+
+    &lt;input type=&quot;password&quot; id=&quot;securevaluetest&quot;&gt;
+
+    &lt;input type=&quot;text&quot; id=&quot;valuetest&quot;&gt;
+
+    &lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+    &lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;notifications&quot;&gt;&lt;/div&gt;
+
+    &lt;script&gt;
+
+        description(&quot;This tests value change notifications user info data when replacing the contents of an input field.&quot;);
+
+        var AXTextStateChangeTypeEdit = 1;
+
+        var AXTextEditTypeDelete = 1;
+        var AXTextEditTypeInsert = AXTextEditTypeDelete + 1;
+
+        var webArea = 0;
+        var count = 0;
+        var results = [];
+        var resultIndex = 0;
+        function notificationCallback(notification, userInfo) {
+            if (notification == &quot;AXValueChanged&quot;) {
+                count++;
+                results.push(userInfo);
+                if (count == 2) {
+
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeEdit&quot;);
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextChangeValues\&quot;][0][\&quot;AXTextChangeValue\&quot;]&quot;, &quot;\&quot;0\&quot;&quot;);
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextChangeValues\&quot;][0][\&quot;AXTextEditType\&quot;]&quot;, &quot;AXTextEditTypeDelete&quot;);
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeEdit&quot;);
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextChangeValues\&quot;][1][\&quot;AXTextChangeValue\&quot;]&quot;, &quot;\&quot;1\&quot;&quot;);
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextChangeValues\&quot;][1][\&quot;AXTextEditType\&quot;]&quot;, &quot;AXTextEditTypeInsert&quot;);
+
+                    // Password notifications will be insert only and the value string will be whitespace
+                    resultIndex++;
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeEdit&quot;);
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextChangeValues\&quot;][0][\&quot;AXTextChangeValue\&quot;]&quot;, &quot;\&quot; \&quot;&quot;);
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextChangeValues\&quot;][0][\&quot;AXTextEditType\&quot;]&quot;, &quot;AXTextEditTypeInsert&quot;);
+
+                    webArea.removeNotificationListener();
+                    window.testRunner.notifyDone();
+                }
+            }
+        }
+
+        function setvalue() {
+            document.getElementById(&quot;valuetest&quot;).value = &quot;1&quot;;
+        }
+
+        function setsecurevalue() {
+            document.getElementById(&quot;securevaluetest&quot;).value = &quot;1&quot;;
+        }
+
+        document.getElementById(&quot;valuetest&quot;).value = &quot;0&quot;;
+        document.getElementById(&quot;securevaluetest&quot;).value = &quot;0&quot;;
+
+        if (window.accessibilityController) {
+             window.testRunner.waitUntilDone();
+
+            accessibilityController.enableEnhancedAccessibility(true);
+
+            webArea = accessibilityController.rootElement.childAtIndex(0);
+            var addedNotification = webArea.addNotificationListener(notificationCallback);
+            shouldBe(&quot;addedNotification&quot;, &quot;true&quot;);
+
+            setvalue();
+
+            setsecurevalue();
+        }
+    &lt;/script&gt;
+
+    &lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacaccessibilityselectionchangeuserinfoexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/accessibility/selection-change-userinfo-expected.txt (0 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/accessibility/selection-change-userinfo-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/selection-change-userinfo-expected.txt        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -0,0 +1,95 @@
</span><ins>+one two three. four five six.
+
+seven eight nine.
+
+This tests selection change notifications user info data.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS addedNotification is true
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionMove
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularityCharacter
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionNext
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionMove
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularityCharacter
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionPrevious
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionMove
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularityWord
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionNext
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionMove
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularityWord
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionPrevious
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionMove
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularitySentence
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionNext
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionMove
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularitySentence
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionPrevious
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionMove
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularityLine
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionNext
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionMove
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularityLine
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionPrevious
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionMove
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularityParagraph
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionNext
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionMove
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularityParagraph
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionPrevious
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionMove
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularityLine
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionEnd
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionMove
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularityLine
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionBeginning
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionMove
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularitySentence
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionEnd
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionMove
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularitySentence
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionBeginning
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionMove
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularityParagraph
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionEnd
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionMove
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularityParagraph
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionBeginning
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionMove
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularityDocument
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionEnd
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionMove
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularityDocument
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionBeginning
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionExtend
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularityCharacter
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionNext
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionExtend
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularityWord
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionNext
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionExtend
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularitySentence
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionNext
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionExtend
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularityLine
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionNext
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionExtend
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularityParagraph
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionNext
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionExtend
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularityLine
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionEnd
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionExtend
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularitySentence
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionEnd
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionExtend
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularityParagraph
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionEnd
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeSelectionExtend
+PASS results[resultIndex][&quot;AXTextSelectionGranularity&quot;] is AXTextSelectionGranularityDocument
+PASS results[resultIndex][&quot;AXTextSelectionDirection&quot;] is AXTextSelectionDirectionEnd
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacaccessibilityselectionchangeuserinfohtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/accessibility/selection-change-userinfo.html (0 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/accessibility/selection-change-userinfo.html                                (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/selection-change-userinfo.html        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -0,0 +1,217 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body id=&quot;body&quot;&gt;
+
+&lt;div role=&quot;textbox&quot; tabindex=0 id=&quot;textbox&quot; contenteditable=true&gt;
+&lt;p&gt;one two three. four five six.&lt;/p&gt;
+&lt;p&gt;seven eight nine.&lt;/p&gt;
+&lt;/div&gt;
+
+&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+&lt;div id=&quot;notifications&quot;&gt;&lt;/div&gt;
+
+&lt;script&gt;
+
+    description(&quot;This tests selection change notifications user info data.&quot;);
+
+    var AXTextStateChangeTypeSelectionMove = 2;
+    var AXTextStateChangeTypeSelectionExtend = AXTextStateChangeTypeSelectionMove + 1;
+
+    var AXTextSelectionDirectionBeginning = 1;
+    var AXTextSelectionDirectionEnd = AXTextSelectionDirectionBeginning + 1;
+    var AXTextSelectionDirectionPrevious = AXTextSelectionDirectionEnd + 1;
+    var AXTextSelectionDirectionNext = AXTextSelectionDirectionPrevious + 1;
+
+    var AXTextSelectionGranularityCharacter = 1;
+    var AXTextSelectionGranularityWord = AXTextSelectionGranularityCharacter + 1;
+    var AXTextSelectionGranularityLine = AXTextSelectionGranularityWord + 1;
+    var AXTextSelectionGranularitySentence = AXTextSelectionGranularityLine + 1;
+    var AXTextSelectionGranularityParagraph = AXTextSelectionGranularitySentence + 1;
+    var AXTextSelectionGranularityDocument = AXTextSelectionGranularityParagraph + 2;
+
+    var gran = [&quot;character&quot;, &quot;word&quot;, &quot;sentence&quot;, &quot;line&quot;, &quot;paragraph&quot;, &quot;lineboundary&quot;, &quot;sentenceboundary&quot;, &quot;paragraphboundary&quot;, &quot;documentboundary&quot;];
+    var webArea = 0;
+    var count = 0;
+    var results = [];
+    var resultIndex = 0;
+    function notificationCallback(notification, userInfo) {
+        if (notification == &quot;AXSelectedTextChanged&quot;) {
+            count++;
+            if (userInfo)
+                results.push(userInfo);
+            if (count == gran.length * 4) {
+                resultIndex++;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionMove&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularityCharacter&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionNext&quot;);
+
+                resultIndex++;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionMove&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularityCharacter&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionPrevious&quot;);
+
+                resultIndex++;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionMove&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularityWord&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionNext&quot;);
+
+                resultIndex++;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionMove&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularityWord&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionPrevious&quot;);
+
+                resultIndex++;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionMove&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularitySentence&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionNext&quot;);
+
+                resultIndex++;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionMove&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularitySentence&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionPrevious&quot;);
+
+                resultIndex++;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionMove&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularityLine&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionNext&quot;);
+
+                resultIndex++;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionMove&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularityLine&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionPrevious&quot;);
+
+                resultIndex++;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionMove&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularityParagraph&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionNext&quot;);
+
+                resultIndex++;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionMove&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularityParagraph&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionPrevious&quot;);
+
+                resultIndex++;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionMove&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularityLine&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionEnd&quot;);
+
+                resultIndex++;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionMove&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularityLine&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionBeginning&quot;);
+
+                resultIndex++;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionMove&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularitySentence&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionEnd&quot;);
+
+                resultIndex++;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionMove&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularitySentence&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionBeginning&quot;);
+
+                resultIndex++;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionMove&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularityParagraph&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionEnd&quot;);
+
+                resultIndex++;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionMove&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularityParagraph&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionBeginning&quot;);
+
+                resultIndex++;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionMove&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularityDocument&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionEnd&quot;);
+
+                resultIndex++;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionMove&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularityDocument&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionBeginning&quot;);
+
+                resultIndex++;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionExtend&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularityCharacter&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionNext&quot;);
+
+                resultIndex += 2;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionExtend&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularityWord&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionNext&quot;);
+
+                resultIndex += 2;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionExtend&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularitySentence&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionNext&quot;);
+
+                resultIndex += 2;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionExtend&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularityLine&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionNext&quot;);
+
+                resultIndex += 2;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionExtend&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularityParagraph&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionNext&quot;);
+
+                resultIndex += 2;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionExtend&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularityLine&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionEnd&quot;);
+
+                resultIndex += 2;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionExtend&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularitySentence&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionEnd&quot;);
+
+                resultIndex += 2;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionExtend&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularityParagraph&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionEnd&quot;);
+
+                resultIndex += 2;
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeSelectionExtend&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionGranularity\&quot;]&quot;, &quot;AXTextSelectionGranularityDocument&quot;);
+                shouldBe(&quot;results[resultIndex][\&quot;AXTextSelectionDirection\&quot;]&quot;, &quot;AXTextSelectionDirectionEnd&quot;);
+
+                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(&quot;addedNotification&quot;, &quot;true&quot;);
+
+        textbox = document.getElementById(&quot;textbox&quot;);
+        textbox.focus();
+
+        // Trigger selection changes.
+        var s = window.getSelection();
+        s.setPosition(textbox, 0);
+        for (var i in gran) {
+            s.modify(&quot;move&quot;, &quot;forward&quot;, gran[i]);
+            s.modify(&quot;move&quot;, &quot;backward&quot;, gran[i]);
+        }
+        for (var i in gran) {
+            s.setPosition(textbox, 0);
+            s.modify(&quot;extend&quot;, &quot;forward&quot;, gran[i]);
+        }
+    }
+
+&lt;/script&gt;
+
+&lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacaccessibilityvaluechangeuserinfoexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/accessibility/value-change-userinfo-expected.txt (0 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/accessibility/value-change-userinfo-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/value-change-userinfo-expected.txt        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+0234567890
+This tests value change notifications user info data.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS addedNotification is true
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeEdit
+PASS results[resultIndex][&quot;AXTextChangeValues&quot;][0][&quot;AXTextChangeValue&quot;] is &quot;0&quot;
+PASS results[resultIndex][&quot;AXTextChangeValues&quot;][0][&quot;AXTextEditType&quot;] is AXTextEditTypeCut
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeEdit
+PASS results[resultIndex][&quot;AXTextChangeValues&quot;][0][&quot;AXTextChangeValue&quot;] is &quot;1&quot;
+PASS results[resultIndex][&quot;AXTextChangeValues&quot;][0][&quot;AXTextEditType&quot;] is AXTextEditTypeDelete
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeEdit
+PASS results[resultIndex][&quot;AXTextChangeValues&quot;][0][&quot;AXTextChangeValue&quot;] is &quot;0&quot;
+PASS results[resultIndex][&quot;AXTextChangeValues&quot;][0][&quot;AXTextEditType&quot;] is AXTextEditTypePaste
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeEdit
+PASS results[resultIndex][&quot;AXTextChangeValues&quot;][0][&quot;AXTextChangeValue&quot;] is &quot;234567890&quot;
+PASS results[resultIndex][&quot;AXTextChangeValues&quot;][0][&quot;AXTextEditType&quot;] is AXTextEditTypePaste
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeEdit
+PASS results[resultIndex][&quot;AXTextChangeValues&quot;][0][&quot;AXTextChangeValue&quot;] is &quot;1&quot;
+PASS results[resultIndex][&quot;AXTextChangeValues&quot;][0][&quot;AXTextEditType&quot;] is AXTextEditTypeTyping
+PASS results[resultIndex][&quot;AXTextStateChangeType&quot;] is AXTextStateChangeTypeEdit
+PASS results[resultIndex][&quot;AXTextChangeValues&quot;][0][&quot;AXTextChangeValue&quot;] is &quot;1&quot;
+PASS results[resultIndex][&quot;AXTextChangeValues&quot;][0][&quot;AXTextEditType&quot;] is AXTextEditTypeDelete
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacaccessibilityvaluechangeuserinfohtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/accessibility/value-change-userinfo.html (0 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/accessibility/value-change-userinfo.html                                (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/value-change-userinfo.html        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -0,0 +1,97 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;../../../editing/editing.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body id=&quot;body&quot;&gt;
+
+    &lt;div role=&quot;textbox&quot; tabindex=0 id=&quot;textbox&quot; contenteditable=true&gt;01234567890&lt;/div&gt;
+
+    &lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+    &lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;notifications&quot;&gt;&lt;/div&gt;
+
+    &lt;script&gt;
+
+        description(&quot;This tests value change notifications user info data.&quot;);
+
+        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 == &quot;AXValueChanged&quot;) {
+                count++;
+                results.push(userInfo);
+                if (count == 6) {
+
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeEdit&quot;);
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextChangeValues\&quot;][0][\&quot;AXTextChangeValue\&quot;]&quot;, &quot;\&quot;0\&quot;&quot;);
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextChangeValues\&quot;][0][\&quot;AXTextEditType\&quot;]&quot;, &quot;AXTextEditTypeCut&quot;);
+
+                    resultIndex++;
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeEdit&quot;);
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextChangeValues\&quot;][0][\&quot;AXTextChangeValue\&quot;]&quot;, &quot;\&quot;1\&quot;&quot;);
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextChangeValues\&quot;][0][\&quot;AXTextEditType\&quot;]&quot;, &quot;AXTextEditTypeDelete&quot;);
+
+                    resultIndex++;
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeEdit&quot;);
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextChangeValues\&quot;][0][\&quot;AXTextChangeValue\&quot;]&quot;, &quot;\&quot;0\&quot;&quot;);
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextChangeValues\&quot;][0][\&quot;AXTextEditType\&quot;]&quot;, &quot;AXTextEditTypePaste&quot;);
+
+                    resultIndex++;
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeEdit&quot;);
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextChangeValues\&quot;][0][\&quot;AXTextChangeValue\&quot;]&quot;, &quot;\&quot;234567890\&quot;&quot;);
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextChangeValues\&quot;][0][\&quot;AXTextEditType\&quot;]&quot;, &quot;AXTextEditTypePaste&quot;);
+
+                    resultIndex++;
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeEdit&quot;);
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextChangeValues\&quot;][0][\&quot;AXTextChangeValue\&quot;]&quot;, &quot;\&quot;1\&quot;&quot;);
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextChangeValues\&quot;][0][\&quot;AXTextEditType\&quot;]&quot;, &quot;AXTextEditTypeTyping&quot;);
+
+                    resultIndex++;
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextStateChangeType\&quot;]&quot;, &quot;AXTextStateChangeTypeEdit&quot;);
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextChangeValues\&quot;][0][\&quot;AXTextChangeValue\&quot;]&quot;, &quot;\&quot;1\&quot;&quot;);
+                    shouldBe(&quot;results[resultIndex][\&quot;AXTextChangeValues\&quot;][0][\&quot;AXTextEditType\&quot;]&quot;, &quot;AXTextEditTypeDelete&quot;);
+
+                    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(&quot;addedNotification&quot;, &quot;true&quot;);
+
+            var textbox = document.getElementById(&quot;textbox&quot;);
+            textbox.focus();
+
+            execSetSelectionCommand(textbox, 0);
+            execExtendSelectionRightByCharacterCommand();
+            cutCommand();
+            execExtendSelectionRightByCharacterCommand();
+            pasteCommand();
+            eventSender.keyDown(&quot;1&quot;);
+            deleteCommand();
+        }
+    &lt;/script&gt;
+
+    &lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -1513,6 +1513,8 @@
</span><span class="cx">     editing/RemoveNodeCommand.cpp
</span><span class="cx">     editing/RemoveNodePreservingChildrenCommand.cpp
</span><span class="cx">     editing/RenderedPosition.cpp
</span><ins>+    editing/ReplaceDeleteFromTextNodeCommand.cpp
+    editing/ReplaceInsertIntoTextNodeCommand.cpp
</ins><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 (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/ChangeLog        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -1,3 +1,240 @@
</span><ins>+2015-04-26  Doug Russell  &lt;d_russell@apple.com&gt;
+
+        AX: richer text change notifications (142719)
+        https://bugs.webkit.org/show_bug.cgi?id=142719
+
+        Reviewed by Darin Adler.
+
+        Richer accessibility value change notifications. Introduce AXTextEditType,
+        postTextStateChangeNotification and postTextReplacementNotification to give assistive
+        tech apps more reliable context for responding to changes in web content. Also implement
+        a mechanism to post value changes in password form fields in coalesced ticks to thwart
+        analyzing the cadence of changes.
+
+        Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent,
+        and an overload of postTextReplacementNotification to give assistive tech apps more
+        reliable context for responding to changes in web content selection. Also block posting
+        selection changes on password fields.
+
+        Tests: platform/mac/accessibility/input-replacevalue-userinfo.html
+               platform/mac/accessibility/selection-change-userinfo.html
+               platform/mac/accessibility/value-change-userinfo.html
+
+        * CMakeLists.txt:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::AXObjectCache::AXObjectCache):
+        (WebCore::AXObjectCache::notificationPostTimerFired):
+        (WebCore::AXObjectCache::passwordNotificationPostTimerFired):
+        (WebCore::AXObjectCache::showIntent):
+        (WebCore::AXObjectCache::setTextSelectionIntent):
+        (WebCore::isPasswordFieldOrContainedByPasswordField):
+        (WebCore::AXObjectCache::postTextStateChangeNotification):
+        (WebCore::AXObjectCache::postTextReplacementNotification):
+        (WebCore::AXObjectCache::enqueuePasswordValueChangeNotification):
+        (WebCore::AXObjectCache::rootWebArea):
+        (WebCore::AXObjectCache::textChangeForEditType):
+        (WebCore::AXObjectCache::selectedChildrenChanged): Deleted.
+        (WebCore::AXObjectCache::frameLoadingEventNotification): Deleted.
+        * accessibility/AXObjectCache.h:
+        (WebCore::AXObjectCache::postTextStateChangeNotification):
+        (WebCore::AXObjectCache::postTextReplacementNotification):
+        (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
+        (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
+        (WebCore::AXObjectCache::textChangeForEditType):
+        (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
+        (WebCore::AXObjectCache::computedObjectAttributeCache): Deleted.
+        (WebCore::AXObjectCache::getOrCreate): Deleted.
+        (WebCore::AXObjectCache::attachWrapper): Deleted.
+        * accessibility/AXTextStateChangeIntent.h: Added.
+        (WebCore::AXTextStateChangeIntent::AXTextStateChangeIntent):
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::passwordFieldOrContainingPasswordField):
+        * accessibility/AccessibilityNodeObject.h:
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::isContainedByPasswordField):
+        * accessibility/AccessibilityObject.h:
+        (WebCore::AccessibilityObject::passwordFieldOrContainingPasswordField):
+        (WebCore::AccessibilityObject::isPasswordField): Deleted.
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::setSelectedTextRange):
+        (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
+        * accessibility/AccessibilityScrollView.h:
+        * accessibility/atk/AXObjectCacheAtk.cpp:
+        (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
+        * accessibility/ios/AXObjectCacheIOS.mm:
+        (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
+        (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
+        * accessibility/mac/AXObjectCacheMac.mm:
+        (WebCore::AXObjectCache::setShouldRepostNotificationsForTests):
+        (WebCore::AXPostNotificationWithUserInfo):
+        (WebCore::AXObjectCache::postPlatformNotification):
+        (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
+        (WebCore::textReplacementChangeDictionary):
+        (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
+        * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
+        * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
+        (+[WebAccessibilityObjectWrapperBase accessibilitySetShouldRepostNotifications:]):
+        (-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:]):
+        (arrayRemovingNonJSONTypes):
+        (dictionaryRemovingNonJSONTypes):
+        (-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:userInfo:]):
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (textMarkerRangeFromVisiblePositions):
+        (-[WebAccessibilityObjectWrapper textMarkerRangeFromVisiblePositions:endPosition:]):
+        * editing/AppendNodeCommand.cpp:
+        (WebCore::AppendNodeCommand::AppendNodeCommand):
+        (WebCore::sendAXTextChangedIgnoringLineBreaks):
+        (WebCore::AppendNodeCommand::doApply):
+        (WebCore::AppendNodeCommand::doUnapply):
+        * editing/AppendNodeCommand.h:
+        (WebCore::AppendNodeCommand::create):
+        * editing/ApplyStyleCommand.cpp:
+        (WebCore::ApplyStyleCommand::ApplyStyleCommand):
+        (WebCore::ApplyStyleCommand::applyBlockStyle): Deleted.
+        * editing/ApplyStyleCommand.h:
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::EditCommandComposition::unapplyEditType):
+        (WebCore::CompositeEditCommand::CompositeEditCommand):
+        (WebCore::CompositeEditCommand::apply):
+        (WebCore::CompositeEditCommand::insertParagraphSeparator):
+        (WebCore::CompositeEditCommand::insertNodeBefore):
+        (WebCore::CompositeEditCommand::appendNode):
+        (WebCore::CompositeEditCommand::removeNodePreservingChildren):
+        (WebCore::CompositeEditCommand::insertTextIntoNode):
+        (WebCore::CompositeEditCommand::deleteTextFromNode):
+        (WebCore::CompositeEditCommand::replaceTextInNode):
+        (WebCore::CompositeEditCommand::moveParagraphs):
+        (WebCore::EditCommandComposition::getNodesInCommand): Deleted.
+        (WebCore::CompositeEditCommand::applyStyle): Deleted.
+        (WebCore::CompositeEditCommand::insertLineBreak): Deleted.
+        (WebCore::CompositeEditCommand::insertNodeAt): Deleted.
+        (WebCore::CompositeEditCommand::removeChildrenInRange): Deleted.
+        (WebCore::CompositeEditCommand::inputText): Deleted.
+        * editing/CompositeEditCommand.h:
+        * editing/DeleteFromTextNodeCommand.cpp:
+        (WebCore::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand):
+        (WebCore::DeleteFromTextNodeCommand::doApply):
+        (WebCore::DeleteFromTextNodeCommand::doUnapply):
+        * editing/DeleteFromTextNodeCommand.h:
+        (WebCore::DeleteFromTextNodeCommand::create):
+        (WebCore::DeleteFromTextNodeCommand::deletedText):
+        * editing/DeleteSelectionCommand.cpp:
+        (WebCore::DeleteSelectionCommand::DeleteSelectionCommand):
+        (WebCore::DeleteSelectionCommand::preservesTypingStyle): Deleted.
+        * editing/DeleteSelectionCommand.h:
+        (WebCore::DeleteSelectionCommand::create):
+        * editing/DictationCommand.cpp:
+        (WebCore::DictationCommand::insertTextRunWithoutNewlines):
+        (WebCore::DictationCommand::insertParagraphSeparator):
+        * editing/EditAction.h:
+        * editing/EditCommand.cpp:
+        (WebCore::EditCommand::EditCommand):
+        (WebCore::EditCommand::editingAction):
+        (WebCore::EditCommand::applyEditType):
+        (WebCore::EditCommand::unapplyEditType):
+        (WebCore::SimpleEditCommand::SimpleEditCommand):
+        (WebCore::SimpleEditCommand::notifyAccessibilityForTextChange):
+        (WebCore::EditCommand::setParent): Deleted.
+        * editing/EditCommand.h:
+        * editing/EditingAllInOne.cpp:
+        * editing/Editor.cpp:
+        (WebCore::Editor::handleTextEvent):
+        (WebCore::Editor::deleteSelectionWithSmartDelete):
+        (WebCore::Editor::replaceSelectionWithFragment):
+        (WebCore::Editor::replaceSelectionWithText):
+        (WebCore::Editor::appliedEditing):
+        (WebCore::Editor::unappliedEditing):
+        (WebCore::Editor::performCutOrCopy):
+        (WebCore::Editor::markMisspellingsAfterTypingToWord):
+        (WebCore::Editor::changeBackToReplacedString):
+        (WebCore::Editor::transpose):
+        (WebCore::Editor::changeSelectionAfterCommand):
+        * editing/Editor.h:
+        * editing/EditorCommand.cpp:
+        (WebCore::executeInsertFragment):
+        * editing/FrameSelection.cpp:
+        (WebCore::FrameSelection::moveTo):
+        (WebCore::FrameSelection::moveWithoutValidationTo):
+        (WebCore::FrameSelection::setSelectionByMouseIfDifferent):
+        (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
+        (WebCore::FrameSelection::setSelection):
+        (WebCore::FrameSelection::updateAndRevealSelection):
+        (WebCore::isBoundary):
+        (WebCore::FrameSelection::textSelectionIntent):
+        (WebCore::FrameSelection::modify):
+        (WebCore::FrameSelection::selectAll):
+        (WebCore::FrameSelection::wordSelectionContainingCaretSelection):
+        (WebCore::FrameSelection::modifyMovingBackward): Deleted.
+        (WebCore::FrameSelection::selectFrameElementInParentIfFullySelected): Deleted.
+        (WebCore::FrameSelection::selectionAtWordStart): Deleted.
+        * editing/FrameSelection.h:
+        (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
+        (WebCore::FrameSelection::selection): Deleted.
+        * editing/InsertIntoTextNodeCommand.cpp:
+        (WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand):
+        (WebCore::InsertIntoTextNodeCommand::doApply):
+        (WebCore::InsertIntoTextNodeCommand::doUnapply):
+        * editing/InsertIntoTextNodeCommand.h:
+        (WebCore::InsertIntoTextNodeCommand::create):
+        (WebCore::InsertIntoTextNodeCommand::insertedText):
+        * editing/InsertNodeBeforeCommand.cpp:
+        (WebCore::InsertNodeBeforeCommand::InsertNodeBeforeCommand):
+        (WebCore::InsertNodeBeforeCommand::doApply):
+        (WebCore::InsertNodeBeforeCommand::doUnapply):
+        * editing/InsertNodeBeforeCommand.h:
+        (WebCore::InsertNodeBeforeCommand::create):
+        * editing/InsertParagraphSeparatorCommand.cpp:
+        (WebCore::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand):
+        * editing/InsertParagraphSeparatorCommand.h:
+        (WebCore::InsertParagraphSeparatorCommand::create):
+        * editing/InsertTextCommand.cpp:
+        (WebCore::InsertTextCommand::InsertTextCommand):
+        * editing/InsertTextCommand.h:
+        (WebCore::InsertTextCommand::create):
+        (WebCore::InsertTextCommand::createWithMarkerSupplier):
+        * editing/MoveSelectionCommand.cpp:
+        (WebCore::MoveSelectionCommand::doApply):
+        * editing/RemoveNodePreservingChildrenCommand.cpp:
+        (WebCore::RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand):
+        * editing/RemoveNodePreservingChildrenCommand.h:
+        (WebCore::RemoveNodePreservingChildrenCommand::create):
+        * editing/ReplaceDeleteFromTextNodeCommand.cpp: Copied from Source/WebCore/editing/AppendNodeCommand.h.
+        (WebCore::ReplaceDeleteFromTextNodeCommand::ReplaceDeleteFromTextNodeCommand):
+        (WebCore::ReplaceDeleteFromTextNodeCommand::notifyAccessibilityForTextChange):
+        * editing/ReplaceDeleteFromTextNodeCommand.h: Copied from Source/WebCore/editing/AppendNodeCommand.h.
+        * editing/ReplaceInsertIntoTextNodeCommand.cpp: Added.
+        (WebCore::ReplaceInsertIntoTextNodeCommand::ReplaceInsertIntoTextNodeCommand):
+        (WebCore::ReplaceInsertIntoTextNodeCommand::notifyAccessibilityForTextChange):
+        * editing/ReplaceInsertIntoTextNodeCommand.h: Copied from Source/WebCore/editing/RemoveNodePreservingChildrenCommand.h.
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
+        (WebCore::ReplaceSelectionCommand::InsertedNodes::didReplaceNode): Deleted.
+        (WebCore::ReplaceSelectionCommand::insertAsListItems): Deleted.
+        * editing/ReplaceSelectionCommand.h:
+        (WebCore::ReplaceSelectionCommand::create):
+        * editing/TypingCommand.cpp:
+        (WebCore::TypingCommand::insertTextRunWithoutNewlines):
+        (WebCore::TypingCommand::insertParagraphSeparator):
+        * editing/atk/FrameSelectionAtk.cpp:
+        (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
+        * editing/ios/DictationCommandIOS.cpp:
+        (WebCore::DictationCommandIOS::DictationCommandIOS):
+        * editing/ios/DictationCommandIOS.h:
+        * editing/mac/FrameSelectionMac.mm:
+        (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
+        * html/HTMLTextFormControlElement.cpp:
+        (WebCore::HTMLTextFormControlElement::setInnerTextValue):
+        * page/DragController.cpp:
+        (WebCore::DragController::concludeEditDrag):
+        * page/EventHandler.cpp:
+        (WebCore::setInitialKeyboardSelection):
+        * page/FocusController.cpp:
+        (WebCore::FocusController::advanceFocusInDocumentOrder):
+
</ins><span class="cx"> 2015-04-26  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r176751): line-height ignored in &lt;button&gt; elements
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -14777,6 +14777,34 @@
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\editing\ReplaceDeleteFromTextNodeCommand.cpp&quot;&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+    &lt;/ClCompile&gt;
+    &lt;ClCompile Include=&quot;..\editing\ReplaceInsertIntoTextNodeCommand.cpp&quot;&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\editing\ReplaceNodeWithSpanCommand.cpp&quot;&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="lines">@@ -19545,6 +19573,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\accessibility\AccessibilityTableHeaderContainer.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\accessibility\AccessibilityTableRow.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\accessibility\AXObjectCache.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\accessibility\AXTextStateChangeIntent.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\accessibility\win\AccessibilityObjectWrapperWin.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\AdjustViewSizeOrNot.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\AlternativeTextClient.h&quot; /&gt;
</span><span class="lines">@@ -21087,6 +21116,8 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\editing\RemoveNodeCommand.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\editing\RemoveNodePreservingChildrenCommand.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\editing\RenderedPosition.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\editing\ReplaceDeleteFromTextNodeCommand.h&quot; /&gt;
+    &lt;ClInclude Include=&quot;..\editing\ReplaceInsertIntoTextNodeCommand.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\editing\ReplaceNodeWithSpanCommand.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\editing\ReplaceSelectionCommand.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\editing\SetNodeAttributeCommand.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -3525,6 +3525,12 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\editing\RenderedPosition.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;editing&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\editing\ReplaceDeleteFromTextNodeCommand.cpp&quot;&gt;
+      &lt;Filter&gt;editing&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
+    &lt;ClCompile Include=&quot;..\editing\ReplaceInsertIntoTextNodeCommand.cpp&quot;&gt;
+      &lt;Filter&gt;editing&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\editing\ReplaceNodeWithSpanCommand.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;editing&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -7668,6 +7674,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\accessibility\AXObjectCache.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;accessibility&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\accessibility\AXTextStateChangeIntent.h&quot;&gt;
+        &lt;Filter&gt;accessibility&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\accessibility\win\AccessibilityObjectWrapperWin.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;accessibility\win&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><span class="lines">@@ -10677,6 +10686,12 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\editing\RenderedPosition.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;editing&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\editing\ReplaceDeleteFromTextNodeCommand.h&quot;&gt;
+      &lt;Filter&gt;editing&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
+    &lt;ClInclude Include=&quot;..\editing\ReplaceInsertIntoTextNodeCommand.h&quot;&gt;
+      &lt;Filter&gt;editing&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\editing\ReplaceNodeWithSpanCommand.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;editing&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -3250,6 +3250,7 @@
</span><span class="cx">                 9001774112E0347800648462 /* OESStandardDerivatives.h in Headers */ = {isa = PBXBuildFile; fileRef = 9001773E12E0347800648462 /* OESStandardDerivatives.h */; };
</span><span class="cx">                 9001788012E0370700648462 /* JSOESStandardDerivatives.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9001787E12E0370700648462 /* JSOESStandardDerivatives.cpp */; };
</span><span class="cx">                 9001788112E0370700648462 /* JSOESStandardDerivatives.h in Headers */ = {isa = PBXBuildFile; fileRef = 9001787F12E0370700648462 /* JSOESStandardDerivatives.h */; };
</span><ins>+                91C9F2F91AE3BEB00095B61C /* AXTextStateChangeIntent.h in Headers */ = {isa = PBXBuildFile; fileRef = 91C9F2F81AE3BE240095B61C /* AXTextStateChangeIntent.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 9302B0BD0D79F82900C7EE83 /* PageGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */; };
</span><span class="cx">                 9302B0BF0D79F82C00C7EE83 /* PageGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 9302B0BE0D79F82C00C7EE83 /* PageGroup.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 9305B24D098F1B6B00C28855 /* Timer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9305B24C098F1B6B00C28855 /* Timer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -6395,6 +6396,10 @@
</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><ins>+                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 */; };
</ins><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">@@ -10500,6 +10505,7 @@
</span><span class="cx">                 9001773F12E0347800648462 /* OESStandardDerivatives.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = OESStandardDerivatives.idl; path = canvas/OESStandardDerivatives.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9001787E12E0370700648462 /* JSOESStandardDerivatives.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSOESStandardDerivatives.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9001787F12E0370700648462 /* JSOESStandardDerivatives.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSOESStandardDerivatives.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                91C9F2F81AE3BE240095B61C /* AXTextStateChangeIntent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AXTextStateChangeIntent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroup.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9302B0BE0D79F82C00C7EE83 /* PageGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageGroup.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9305B24C098F1B6B00C28855 /* Timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Timer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -14040,6 +14046,10 @@
</span><span class="cx">                 F52AD5E31534245F0059FBE6 /* EmptyClients.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EmptyClients.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 F544F78615CFB2A800AF33A8 /* PlatformLocale.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformLocale.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 F544F78715CFB2A800AF33A8 /* PlatformLocale.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformLocale.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                F5528DA31AC1033E000EF7AD /* ReplaceDeleteFromTextNodeCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReplaceDeleteFromTextNodeCommand.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                F5528DA41AC1033E000EF7AD /* ReplaceDeleteFromTextNodeCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReplaceDeleteFromTextNodeCommand.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                F5528DA71AC109DF000EF7AD /* ReplaceInsertIntoTextNodeCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReplaceInsertIntoTextNodeCommand.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                F5528DA81AC109DF000EF7AD /* ReplaceInsertIntoTextNodeCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReplaceInsertIntoTextNodeCommand.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 F55B3D791251F12D003EF269 /* BaseTextInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseTextInputType.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 F55B3D7A1251F12D003EF269 /* BaseTextInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseTextInputType.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 F55B3D7B1251F12D003EF269 /* ButtonInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ButtonInputType.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -15661,6 +15671,7 @@
</span><span class="cx">                                 29A812130FBB9C1D00510293 /* AccessibilityTableRow.h */,
</span><span class="cx">                                 2981CAAF131822EC00D12F2A /* AXObjectCache.cpp */,
</span><span class="cx">                                 29A8121A0FBB9C1D00510293 /* AXObjectCache.h */,
</span><ins>+                                91C9F2F81AE3BE240095B61C /* AXTextStateChangeIntent.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = accessibility;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -17794,6 +17805,10 @@
</span><span class="cx">                                 93309DB8099E64910056E581 /* RemoveNodePreservingChildrenCommand.h */,
</span><span class="cx">                                 9B32CDA813DF7FA900F34D13 /* RenderedPosition.cpp */,
</span><span class="cx">                                 9B32CDA713DF7FA900F34D13 /* RenderedPosition.h */,
</span><ins>+                                F5528DA41AC1033E000EF7AD /* ReplaceDeleteFromTextNodeCommand.cpp */,
+                                F5528DA31AC1033E000EF7AD /* ReplaceDeleteFromTextNodeCommand.h */,
+                                F5528DA71AC109DF000EF7AD /* ReplaceInsertIntoTextNodeCommand.cpp */,
+                                F5528DA81AC109DF000EF7AD /* ReplaceInsertIntoTextNodeCommand.h */,
</ins><span class="cx">                                 A89CCC500F44E98100B5DA10 /* ReplaceNodeWithSpanCommand.cpp */,
</span><span class="cx">                                 A89CCC510F44E98100B5DA10 /* ReplaceNodeWithSpanCommand.h */,
</span><span class="cx">                                 93309DBA099E64910056E581 /* ReplaceSelectionCommand.cpp */,
</span><span class="lines">@@ -23728,6 +23743,7 @@
</span><span class="cx">                                 6C568CB119DAFEA000430CA2 /* MaskImageOperation.h in Headers */,
</span><span class="cx">                                 0F580FAF149800D400FB5BD8 /* AnimationUtilities.h in Headers */,
</span><span class="cx">                                 4A4F65721AA997F100E38CDD /* RealtimeMediaSourceCapabilities.h in Headers */,
</span><ins>+                                F5528DA51AC1033E000EF7AD /* ReplaceDeleteFromTextNodeCommand.h in Headers */,
</ins><span class="cx">                                 93309DD7099E64920056E581 /* AppendNodeCommand.h in Headers */,
</span><span class="cx">                                 1A8F6BBD0DB55CDC001DB794 /* ApplicationCache.h in Headers */,
</span><span class="cx">                                 1A8F6BBF0DB55CDC001DB794 /* ApplicationCacheGroup.h in Headers */,
</span><span class="lines">@@ -25653,6 +25669,7 @@
</span><span class="cx">                                 BC60DA3A0D2A302800B9918F /* JSXMLHttpRequestException.h in Headers */,
</span><span class="cx">                                 F916C48E0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h in Headers */,
</span><span class="cx">                                 BCDFD4960E30592F009D10AD /* JSXMLHttpRequestUpload.h in Headers */,
</span><ins>+                                F5528DAA1AC109DF000EF7AD /* ReplaceInsertIntoTextNodeCommand.h in Headers */,
</ins><span class="cx">                                 1ACE53F70A8D19470022947D /* JSXMLSerializer.h in Headers */,
</span><span class="cx">                                 1A762C740A074F2600989F5B /* JSXPathEvaluator.h in Headers */,
</span><span class="cx">                                 BC60DB4A0D2A3D1E00B9918F /* JSXPathException.h in Headers */,
</span><span class="lines">@@ -26706,6 +26723,7 @@
</span><span class="cx">                                 7C4C96DD1AD4483500365A50 /* JSReadableStream.h in Headers */,
</span><span class="cx">                                 83C1D428178D5AB400141E68 /* SVGPathSegCurvetoCubicRel.h in Headers */,
</span><span class="cx">                                 B2227A690D00BF220071B782 /* SVGPathSegCurvetoCubicSmooth.h in Headers */,
</span><ins>+                                91C9F2F91AE3BEB00095B61C /* AXTextStateChangeIntent.h in Headers */,
</ins><span class="cx">                                 83C1D429178D5AB400141E68 /* SVGPathSegCurvetoCubicSmoothAbs.h in Headers */,
</span><span class="cx">                                 83C1D42A178D5AB400141E68 /* SVGPathSegCurvetoCubicSmoothRel.h in Headers */,
</span><span class="cx">                                 B2227A6D0D00BF220071B782 /* SVGPathSegCurvetoQuadratic.h in Headers */,
</span><span class="lines">@@ -28464,6 +28482,7 @@
</span><span class="cx">                                 510192D118B6B9AB007FC7A1 /* ImageControlsRootElementMac.cpp in Sources */,
</span><span class="cx">                                 A77979190D6B9D0C003851B9 /* ImageData.cpp in Sources */,
</span><span class="cx">                                 97205AB51239291000B17380 /* ImageDocument.cpp in Sources */,
</span><ins>+                                F5528DA61AC1033E000EF7AD /* ReplaceDeleteFromTextNodeCommand.cpp in Sources */,
</ins><span class="cx">                                 F55B3DC11251F12D003EF269 /* ImageInputType.cpp in Sources */,
</span><span class="cx">                                 089582550E857A7E00F82C83 /* ImageLoader.cpp in Sources */,
</span><span class="cx">                                 B275357B0B053814002CE64F /* ImageMac.mm in Sources */,
</span><span class="lines">@@ -29911,6 +29930,7 @@
</span><span class="cx">                                 FE36FD1616C7826500F887C1 /* SQLTransactionStateMachine.cpp in Sources */,
</span><span class="cx">                                 1A2E6E590CC55213004A2062 /* SQLValue.cpp in Sources */,
</span><span class="cx">                                 4476531B133170990006B789 /* SSLKeyGeneratorIOS.cpp in Sources */,
</span><ins>+                                F5528DA91AC109DF000EF7AD /* ReplaceInsertIntoTextNodeCommand.cpp in Sources */,
</ins><span class="cx">                                 93F19AE608245E59001E9ABC /* SSLKeyGeneratorMac.cpp in Sources */,
</span><span class="cx">                                 BC7FA62E0D1F0EFF00DB22A9 /* StaticNodeList.cpp in Sources */,
</span><span class="cx">                                 A5AFB34F115151A700B045CB /* StepRange.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAXObjectCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008, 2009, 2010, 2015 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -90,6 +90,9 @@
</span><span class="cx"> 
</span><span class="cx"> using namespace HTMLNames;
</span><span class="cx"> 
</span><ins>+// Post value change notifications for password fields or elements contained in password fields at a 40hz interval to thwart analysis of typing cadence
+static double AccessibilityPasswordValueChangeNotificationInterval = 0.025;
+
</ins><span class="cx"> AccessibilityObjectInclusion AXComputedObjectAttributeCache::getIgnored(AXID id) const
</span><span class="cx"> {
</span><span class="cx">     HashMap&lt;AXID, CachedAXObjectAttributes&gt;::const_iterator it = m_idMapping.find(id);
</span><span class="lines">@@ -129,6 +132,7 @@
</span><span class="cx"> AXObjectCache::AXObjectCache(Document&amp; document)
</span><span class="cx">     : m_document(document)
</span><span class="cx">     , m_notificationPostTimer(*this, &amp;AXObjectCache::notificationPostTimerFired)
</span><ins>+    , m_passwordNotificationPostTimer(*this, &amp;AXObjectCache::passwordNotificationPostTimerFired)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -705,7 +709,7 @@
</span><span class="cx">     Ref&lt;Document&gt; protectorForCacheOwner(m_document);
</span><span class="cx">     m_notificationPostTimer.stop();
</span><span class="cx">     
</span><del>-    // In DRT, posting notifications has a tendency to immediately queue up other notifications, which can lead to unexpected behavior
</del><ins>+    // In tests, posting notifications has a tendency to immediately queue up other notifications, which can lead to unexpected behavior
</ins><span class="cx">     // when the notification list is cleared at the end. Instead copy this list at the start.
</span><span class="cx">     auto notifications = WTF::move(m_notificationsToPost);
</span><span class="cx">     
</span><span class="lines">@@ -742,6 +746,20 @@
</span><span class="cx">             childrenChanged(obj-&gt;parentObject());
</span><span class="cx">     }
</span><span class="cx"> }
</span><ins>+
+void AXObjectCache::passwordNotificationPostTimerFired()
+{
+#if PLATFORM(COCOA)
+    m_passwordNotificationPostTimer.stop();
+
+    // In tests, posting notifications has a tendency to immediately queue up other notifications, which can lead to unexpected behavior
+    // when the notification list is cleared at the end. Instead copy this list at the start.
+    auto notifications = WTF::move(m_passwordNotificationsToPost);
+
+    for (auto&amp; notification : notifications)
+        postTextStateChangePlatformNotification(notification.get(), AXTextEditTypeInsert, &quot; &quot;, VisiblePosition());
+#endif
+}
</ins><span class="cx">     
</span><span class="cx"> void AXObjectCache::postNotification(RenderObject* renderer, AXNotification notification, PostTarget postTarget, PostType postType)
</span><span class="cx"> {
</span><span class="lines">@@ -850,18 +868,220 @@
</span><span class="cx">     postNotification(renderer, AXSelectedChildrenChanged, TargetObservableParent);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void AXObjectCache::nodeTextChangeNotification(Node* node, AXTextChange textChange, unsigned offset, const String&amp; text)
</del><ins>+#ifndef NDEBUG
+void AXObjectCache::showIntent(const AXTextStateChangeIntent &amp;intent)
</ins><span class="cx"> {
</span><ins>+    switch (intent.type) {
+    case AXTextStateChangeTypeUnknown:
+        dataLog(&quot;Unknown&quot;);
+        break;
+    case AXTextStateChangeTypeEdit:
+        dataLog(&quot;Edit::&quot;);
+        break;
+    case AXTextStateChangeTypeSelectionMove:
+        dataLog(&quot;Move::&quot;);
+        break;
+    case AXTextStateChangeTypeSelectionExtend:
+        dataLog(&quot;Extend::&quot;);
+        break;
+    }
+    switch (intent.type) {
+    case AXTextStateChangeTypeUnknown:
+        break;
+    case AXTextStateChangeTypeEdit:
+        switch (intent.change) {
+        case AXTextEditTypeUnknown:
+            dataLog(&quot;Unknown&quot;);
+            break;
+        case AXTextEditTypeDelete:
+            dataLog(&quot;Delete&quot;);
+            break;
+        case AXTextEditTypeInsert:
+            dataLog(&quot;Insert&quot;);
+            break;
+        case AXTextEditTypeDictation:
+            dataLog(&quot;DictationInsert&quot;);
+            break;
+        case AXTextEditTypeTyping:
+            dataLog(&quot;TypingInsert&quot;);
+            break;
+        case AXTextEditTypeCut:
+            dataLog(&quot;Cut&quot;);
+            break;
+        case AXTextEditTypePaste:
+            dataLog(&quot;Paste&quot;);
+            break;
+        }
+        break;
+    case AXTextStateChangeTypeSelectionMove:
+    case AXTextStateChangeTypeSelectionExtend:
+        switch (intent.selection.direction) {
+        case AXTextSelectionDirectionUnknown:
+            dataLog(&quot;Unknown::&quot;);
+            break;
+        case AXTextSelectionDirectionBeginning:
+            dataLog(&quot;Beginning::&quot;);
+            break;
+        case AXTextSelectionDirectionEnd:
+            dataLog(&quot;End::&quot;);
+            break;
+        case AXTextSelectionDirectionPrevious:
+            dataLog(&quot;Previous::&quot;);
+            break;
+        case AXTextSelectionDirectionNext:
+            dataLog(&quot;Next::&quot;);
+            break;
+        case AXTextSelectionDirectionDiscontiguous:
+            dataLog(&quot;Discontiguous::&quot;);
+            break;
+        }
+        switch (intent.selection.direction) {
+        case AXTextSelectionDirectionUnknown:
+        case AXTextSelectionDirectionBeginning:
+        case AXTextSelectionDirectionEnd:
+        case AXTextSelectionDirectionPrevious:
+        case AXTextSelectionDirectionNext:
+            switch (intent.selection.granularity) {
+            case AXTextSelectionGranularityUnknown:
+                dataLog(&quot;Unknown&quot;);
+                break;
+            case AXTextSelectionGranularityCharacter:
+                dataLog(&quot;Character&quot;);
+                break;
+            case AXTextSelectionGranularityWord:
+                dataLog(&quot;Word&quot;);
+                break;
+            case AXTextSelectionGranularityLine:
+                dataLog(&quot;Line&quot;);
+                break;
+            case AXTextSelectionGranularitySentence:
+                dataLog(&quot;Sentence&quot;);
+                break;
+            case AXTextSelectionGranularityParagraph:
+                dataLog(&quot;Paragraph&quot;);
+                break;
+            case AXTextSelectionGranularityPage:
+                dataLog(&quot;Page&quot;);
+                break;
+            case AXTextSelectionGranularityDocument:
+                dataLog(&quot;Document&quot;);
+                break;
+            case AXTextSelectionGranularityAll:
+                dataLog(&quot;All&quot;);
+                break;
+            }
+            break;
+        case AXTextSelectionDirectionDiscontiguous:
+            break;
+        }
+        break;
+    }
+    if (intent.isSynchronizing)
+        dataLog(&quot;-Sync&quot;);
+    dataLog(&quot;\n&quot;);
+}
+#endif
+
+void AXObjectCache::setTextSelectionIntent(AXTextStateChangeIntent intent)
+{
+    m_textSelectionIntent = intent;
+}
+
+static bool isPasswordFieldOrContainedByPasswordField(AccessibilityObject* object)
+{
+    return object &amp;&amp; (object-&gt;isPasswordField() || object-&gt;isContainedByPasswordField());
+}
+
+void AXObjectCache::postTextStateChangeNotification(Node* node, const AXTextStateChangeIntent&amp; intent, const VisibleSelection&amp; selection)
+{
</ins><span class="cx">     if (!node)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(COCOA)
</ins><span class="cx">     stopCachingComputedObjectAttributes();
</span><span class="cx"> 
</span><del>-    // Delegate on the right platform
-    AccessibilityObject* obj = getOrCreate(node);
-    nodeTextChangePlatformNotification(obj, textChange, offset, text);
</del><ins>+    AccessibilityObject* object = getOrCreate(node);
+    if (object) {
+        if (isPasswordFieldOrContainedByPasswordField(object))
+            return;
+        object = object-&gt;observableObject();
+    }
+
+    postTextStateChangePlatformNotification(object, (intent.type == AXTextStateChangeTypeUnknown) ? m_textSelectionIntent : intent, selection);
+#else
+    postNotification(node-&gt;renderer(), AXObjectCache::AXSelectedTextChanged, TargetObservableParent);
+    UNUSED_PARAM(intent);
+    UNUSED_PARAM(selection);
+#endif
+
+    setTextSelectionIntent(AXTextStateChangeIntent());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void AXObjectCache::postTextStateChangeNotification(Node* node, AXTextEditType type, const String&amp; text, const VisiblePosition&amp; position)
+{
+    if (!node)
+        return;
+    ASSERT(type != AXTextEditTypeUnknown);
+
+    stopCachingComputedObjectAttributes();
+
+    AccessibilityObject* object = getOrCreate(node);
+#if PLATFORM(COCOA)
+    if (object) {
+        if (enqueuePasswordValueChangeNotification(object))
+            return;
+        object = object-&gt;observableObject();
+    }
+
+    postTextStateChangePlatformNotification(object, type, text, position);
+#else
+    nodeTextChangePlatformNotification(object, textChangeForEditType(type), position.deepEquivalent().deprecatedEditingOffset(), text);
+#endif
+}
+
+void AXObjectCache::postTextReplacementNotification(Node* node, AXTextEditType deletionType, const String&amp; deletedText, AXTextEditType insertionType, const String&amp; insertedText, const VisiblePosition&amp; position)
+{
+    if (!node)
+        return;
+    ASSERT(deletionType == AXTextEditTypeDelete);
+    ASSERT(insertionType == AXTextEditTypeInsert || insertionType == AXTextEditTypeTyping || insertionType == AXTextEditTypeDictation || insertionType == AXTextEditTypePaste);
+
+    stopCachingComputedObjectAttributes();
+
+    AccessibilityObject* object = getOrCreate(node);
+#if PLATFORM(COCOA)
+    if (object) {
+        if (enqueuePasswordValueChangeNotification(object))
+            return;
+        object = object-&gt;observableObject();
+    }
+
+    postTextReplacementPlatformNotification(object, deletionType, deletedText, insertionType, insertedText, position);
+#else
+    nodeTextChangePlatformNotification(object, textChangeForEditType(deletionType), position.deepEquivalent().deprecatedEditingOffset(), deletedText);
+    nodeTextChangePlatformNotification(object, textChangeForEditType(insertionType), position.deepEquivalent().deprecatedEditingOffset(), insertedText);
+#endif
+}
+
+bool AXObjectCache::enqueuePasswordValueChangeNotification(AccessibilityObject* object)
+{
+    if (!isPasswordFieldOrContainedByPasswordField(object))
+        return false;
+
+    AccessibilityObject* observableObject = object-&gt;observableObject();
+    if (!observableObject) {
+        ASSERT_NOT_REACHED();
+        // return true even though the enqueue didn't happen because this is a password field and caller shouldn't post a notification
+        return true;
+    }
+
+    m_passwordNotificationsToPost.add(observableObject);
+    if (!m_passwordNotificationPostTimer.isActive())
+        m_passwordNotificationPostTimer.startOneShot(AccessibilityPasswordValueChangeNotificationInterval);
+
+    return true;
+}
+
</ins><span class="cx"> void AXObjectCache::frameLoadingEventNotification(Frame* frame, AXLoadingEvent loadingEvent)
</span><span class="cx"> {
</span><span class="cx">     if (!frame)
</span><span class="lines">@@ -1084,6 +1304,14 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+AccessibilityObject* AXObjectCache::rootWebArea()
+{
+    AccessibilityObject* rootObject = this-&gt;rootObject();
+    if (!rootObject || !rootObject-&gt;isAccessibilityScrollView())
+        return nullptr;
+    return downcast&lt;AccessibilityScrollView&gt;(*rootObject).webAreaObject();
+}
+
</ins><span class="cx"> AXAttributeCacheEnabler::AXAttributeCacheEnabler(AXObjectCache* cache)
</span><span class="cx">     : m_cache(cache)
</span><span class="cx"> {
</span><span class="lines">@@ -1096,6 +1324,26 @@
</span><span class="cx">     if (m_cache)
</span><span class="cx">         m_cache-&gt;stopCachingComputedObjectAttributes();
</span><span class="cx"> }
</span><ins>+
+#if !PLATFORM(COCOA)
+AXTextChange AXObjectCache::textChangeForEditType(AXTextEditType type)
+{
+    switch (type) {
+    case AXTextEditTypeCut:
+    case AXTextEditTypeDelete:
+        return AXTextDeleted;
+    case AXTextEditTypeInsert:
+    case AXTextEditTypeDictation:
+    case AXTextEditTypeTyping:
+    case AXTextEditTypePaste:
+        return AXTextInserted;
+    case AXTextEditTypeUnknown:
+        break;
+    }
+    ASSERT_NOT_REACHED();
+    return AXTextInserted;
+}
+#endif
</ins><span class="cx">     
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAXObjectCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AXObjectCache.h (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AXObjectCache.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010, 2011, 2015 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -26,12 +26,14 @@
</span><span class="cx"> #ifndef AXObjectCache_h
</span><span class="cx"> #define AXObjectCache_h
</span><span class="cx"> 
</span><ins>+#include &quot;AXTextStateChangeIntent.h&quot;
</ins><span class="cx"> #include &quot;AccessibilityObject.h&quot;
</span><span class="cx"> #include &quot;Timer.h&quot;
</span><span class="cx"> #include &lt;limits.h&gt;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><ins>+#include &lt;wtf/ListHashSet.h&gt;
</ins><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -67,6 +69,10 @@
</span><span class="cx">     HashMap&lt;AXID, CachedAXObjectAttributes&gt; m_idMapping;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(COCOA)
+enum AXTextChange { AXTextInserted, AXTextDeleted };
+#endif
+
</ins><span class="cx"> enum PostTarget { TargetElement, TargetObservableParent };
</span><span class="cx"> 
</span><span class="cx"> enum PostType { PostSynchronously, PostAsynchronously };
</span><span class="lines">@@ -189,13 +195,16 @@
</span><span class="cx">     void postNotification(Node*, AXNotification, PostTarget = TargetElement, PostType = PostAsynchronously);
</span><span class="cx">     void postNotification(AccessibilityObject*, Document*, AXNotification, PostTarget = TargetElement, PostType = PostAsynchronously);
</span><span class="cx"> 
</span><del>-    enum AXTextChange {
-        AXTextInserted,
-        AXTextDeleted,
-    };
</del><ins>+#ifndef NDEBUG
+    void showIntent(const AXTextStateChangeIntent&amp;);
+#endif
</ins><span class="cx"> 
</span><del>-    void nodeTextChangeNotification(Node*, AXTextChange, unsigned offset, const String&amp;);
</del><ins>+    void setTextSelectionIntent(AXTextStateChangeIntent);
</ins><span class="cx"> 
</span><ins>+    void postTextStateChangeNotification(Node*, AXTextEditType, const String&amp;, const VisiblePosition&amp;);
+    void postTextReplacementNotification(Node*, AXTextEditType deletionType, const String&amp; deletedText, AXTextEditType insertionType, const String&amp; insertedText, const VisiblePosition&amp;);
+    void postTextStateChangeNotification(Node*, const AXTextStateChangeIntent&amp;, const VisibleSelection&amp;);
+
</ins><span class="cx">     enum AXLoadingEvent {
</span><span class="cx">         AXLoadingStarted,
</span><span class="cx">         AXLoadingReloaded,
</span><span class="lines">@@ -213,12 +222,24 @@
</span><span class="cx">     AXComputedObjectAttributeCache* computedObjectAttributeCache() { return m_computedObjectAttributeCache.get(); }
</span><span class="cx"> 
</span><span class="cx">     Document&amp; document() const { return m_document; }
</span><del>-    
</del><ins>+
+#if PLATFORM(MAC)
+    static void setShouldRepostNotificationsForTests(bool value);
+#endif
+
</ins><span class="cx"> protected:
</span><span class="cx">     void postPlatformNotification(AccessibilityObject*, AXNotification);
</span><span class="cx">     void platformHandleFocusedUIElementChanged(Node* oldFocusedNode, Node* newFocusedNode);
</span><span class="cx"> 
</span><del>-    void nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned offset, const String&amp;);
</del><ins>+#if PLATFORM(COCOA)
+    void postTextStateChangePlatformNotification(AccessibilityObject*, const AXTextStateChangeIntent&amp;, const VisibleSelection&amp;);
+    void postTextStateChangePlatformNotification(AccessibilityObject*, AXTextEditType, const String&amp;, const VisiblePosition&amp;);
+    void postTextReplacementPlatformNotification(AccessibilityObject*, AXTextEditType, const String&amp;, AXTextEditType, const String&amp;, const VisiblePosition&amp;);
+#else
+    static AXTextChange textChangeForEditType(AXTextEditType);
+    void nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned, const String&amp;);
+#endif
+
</ins><span class="cx">     void frameLoadingEventPlatformNotification(AccessibilityObject*, AXLoadingEvent);
</span><span class="cx">     void textChanged(AccessibilityObject*);
</span><span class="cx">     void labelChanged(Element*);
</span><span class="lines">@@ -229,6 +250,21 @@
</span><span class="cx">     bool isNodeInUse(Node* n) { return m_textMarkerNodes.contains(n); }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><ins>+    AccessibilityObject* rootWebArea();
+
+    static AccessibilityObject* focusedImageMapUIElement(HTMLAreaElement*);
+
+    AXID getAXID(AccessibilityObject*);
+
+    void notificationPostTimerFired();
+
+    bool enqueuePasswordValueChangeNotification(AccessibilityObject*);
+    void passwordNotificationPostTimerFired();
+
+    void handleMenuOpened(Node*);
+    void handleLiveRegionCreated(Node*);
+    void handleMenuItemSelected(Node*);
+
</ins><span class="cx">     Document&amp; m_document;
</span><span class="cx">     HashMap&lt;AXID, RefPtr&lt;AccessibilityObject&gt;&gt; m_objects;
</span><span class="cx">     HashMap&lt;RenderObject*, AXID&gt; m_renderObjectMapping;
</span><span class="lines">@@ -238,19 +274,17 @@
</span><span class="cx">     std::unique_ptr&lt;AXComputedObjectAttributeCache&gt; m_computedObjectAttributeCache;
</span><span class="cx">     WEBCORE_EXPORT static bool gAccessibilityEnabled;
</span><span class="cx">     WEBCORE_EXPORT static bool gAccessibilityEnhancedUserInterfaceEnabled;
</span><del>-    
</del><ins>+
</ins><span class="cx">     HashSet&lt;AXID&gt; m_idsInUse;
</span><del>-    
</del><ins>+
</ins><span class="cx">     Timer m_notificationPostTimer;
</span><span class="cx">     Vector&lt;std::pair&lt;RefPtr&lt;AccessibilityObject&gt;, AXNotification&gt;&gt; m_notificationsToPost;
</span><del>-    void notificationPostTimerFired();
-    void handleMenuOpened(Node*);
-    void handleLiveRegionCreated(Node*);
-    void handleMenuItemSelected(Node*);
-    
-    static AccessibilityObject* focusedImageMapUIElement(HTMLAreaElement*);
-    
-    AXID getAXID(AccessibilityObject*);
</del><ins>+
+    Timer m_passwordNotificationPostTimer;
+
+    ListHashSet&lt;RefPtr&lt;AccessibilityObject&gt;&gt; m_passwordNotificationsToPost;
+
+    AXTextStateChangeIntent m_textSelectionIntent;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class AXAttributeCacheEnabler
</span><span class="lines">@@ -308,8 +342,9 @@
</span><span class="cx"> inline void AXObjectCache::handleAttributeChanged(const QualifiedName&amp;, Element*) { }
</span><span class="cx"> inline void AXObjectCache::recomputeIsIgnored(RenderObject*) { }
</span><span class="cx"> inline void AXObjectCache::handleScrolledToAnchor(const Node*) { }
</span><del>-inline void AXObjectCache::nodeTextChangeNotification(Node*, AXTextChange, unsigned, const String&amp;) { }
-inline void AXObjectCache::nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned, const String&amp;) { }
</del><ins>+inline void AXObjectCache::postTextStateChangeNotification(Node*, const AXTextStateChangeIntent&amp;, const VisibleSelection&amp;) { }
+inline void AXObjectCache::postTextStateChangeNotification(Node*, AXTextEditType, const String&amp;, const VisiblePosition&amp;) { }
+inline void AXObjectCache::postTextReplacementNotification(Node*, AXTextEditType, const String&amp;, AXTextEditType, const String&amp;, const VisiblePosition&amp;) { }
</ins><span class="cx"> inline void AXObjectCache::postNotification(AccessibilityObject*, Document*, AXNotification, PostTarget, PostType) { }
</span><span class="cx"> inline void AXObjectCache::postNotification(RenderObject*, AXNotification, PostTarget, PostType) { }
</span><span class="cx"> inline void AXObjectCache::postNotification(Node*, AXNotification, PostTarget, PostType) { }
</span><span class="lines">@@ -320,7 +355,15 @@
</span><span class="cx"> inline void AXObjectCache::remove(Widget*) { }
</span><span class="cx"> inline void AXObjectCache::selectedChildrenChanged(RenderObject*) { }
</span><span class="cx"> inline void AXObjectCache::selectedChildrenChanged(Node*) { }
</span><ins>+#if PLATFORM(COCOA)
+inline void AXObjectCache::postTextStateChangePlatformNotification(AccessibilityObject*, const AXTextStateChangeIntent&amp;, const VisibleSelection&amp;) { }
+inline void AXObjectCache::postTextStateChangePlatformNotification(AccessibilityObject*, AXTextEditType, const String&amp;, const VisiblePosition&amp;) { }
+inline void AXObjectCache::postTextReplacementPlatformNotification(AccessibilityObject*, AXTextEditType, const String&amp;, AXTextEditType, const String&amp;, const VisiblePosition&amp;) { }
+#else
+inline AXTextChange AXObjectCache::textChangeForEditType(AXTextEditType) { return AXTextInserted; }
+inline void AXObjectCache::nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned, const String&amp;) { }
</ins><span class="cx"> #endif
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAXTextStateChangeIntenth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/accessibility/AXTextStateChangeIntent.h (0 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AXTextStateChangeIntent.h                                (rev 0)
+++ trunk/Source/WebCore/accessibility/AXTextStateChangeIntent.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -0,0 +1,103 @@
</span><ins>+/*
+ * 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 AXTextStateChangeIntent_h
+#define AXTextStateChangeIntent_h
+
+namespace WebCore {
+    
+enum AXTextStateChangeType {
+    AXTextStateChangeTypeUnknown,
+    AXTextStateChangeTypeEdit,
+    AXTextStateChangeTypeSelectionMove,
+    AXTextStateChangeTypeSelectionExtend
+};
+
+enum AXTextEditType {
+    AXTextEditTypeUnknown,
+    AXTextEditTypeDelete, // Generic text delete
+    AXTextEditTypeInsert, // Generic text insert
+    AXTextEditTypeTyping, // Insert via typing
+    AXTextEditTypeDictation, // Insert via dictation
+    AXTextEditTypeCut, // Delete via Cut
+    AXTextEditTypePaste // Insert via Paste
+};
+
+enum AXTextSelectionDirection {
+    AXTextSelectionDirectionUnknown,
+    AXTextSelectionDirectionBeginning,
+    AXTextSelectionDirectionEnd,
+    AXTextSelectionDirectionPrevious,
+    AXTextSelectionDirectionNext,
+    AXTextSelectionDirectionDiscontiguous
+};
+
+enum AXTextSelectionGranularity {
+    AXTextSelectionGranularityUnknown,
+    AXTextSelectionGranularityCharacter,
+    AXTextSelectionGranularityWord,
+    AXTextSelectionGranularityLine,
+    AXTextSelectionGranularitySentence,
+    AXTextSelectionGranularityParagraph,
+    AXTextSelectionGranularityPage,
+    AXTextSelectionGranularityDocument,
+    AXTextSelectionGranularityAll // All granularity represents the action of selecting the whole document as a single action. Extending selection by some other granularity until it encompasses the whole document will not result in a all granularity notification.
+};
+
+struct AXTextSelection {
+    AXTextSelectionDirection direction;
+    AXTextSelectionGranularity granularity;
+};
+
+struct AXTextStateChangeIntent {
+    AXTextStateChangeType type;
+    union {
+        AXTextSelection selection;
+        AXTextEditType change;
+    };
+    bool isSynchronizing { false };
+
+    AXTextStateChangeIntent(AXTextStateChangeType type = AXTextStateChangeTypeUnknown, AXTextSelection selection = AXTextSelection())
+        : type(type)
+        , selection(selection)
+    { }
+
+    AXTextStateChangeIntent(AXTextEditType change)
+        : type(AXTextStateChangeTypeEdit)
+        , change(change)
+    { }
+
+    AXTextStateChangeIntent(AXTextStateChangeType type, bool isSynchronizing)
+        : type(type)
+        , selection()
+        , isSynchronizing(isSynchronizing)
+    {
+        ASSERT(type == AXTextStateChangeTypeSelectionMove || type == AXTextStateChangeTypeSelectionExtend);
+    }
+};
+
+}
+
+#endif // AXTextStateChangeIntent_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityNodeObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -552,6 +552,27 @@
</span><span class="cx">     return inputElement-&gt;isPasswordField();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+AccessibilityObject* AccessibilityNodeObject::passwordFieldOrContainingPasswordField()
+{
+    Node* node = this-&gt;node();
+    if (!node)
+        return nullptr;
+
+    if (HTMLInputElement* inputElement = node-&gt;toInputElement()) {
+        if (inputElement-&gt;isPasswordField())
+            return this;
+    }
+
+    Element* element = node-&gt;shadowHost();
+    if (!element || !is&lt;HTMLInputElement&gt;(element))
+        return nullptr;
+
+    if (AXObjectCache* cache = axObjectCache())
+        return cache-&gt;getOrCreate(element);
+
+    return nullptr;
+}
+
</ins><span class="cx"> bool AccessibilityNodeObject::isInputImage() const
</span><span class="cx"> {
</span><span class="cx">     Node* node = this-&gt;node();
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityNodeObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -88,6 +88,7 @@
</span><span class="cx">     virtual bool isNativeImage() const override;
</span><span class="cx">     virtual bool isNativeTextControl() const override;
</span><span class="cx">     virtual bool isPasswordField() const override;
</span><ins>+    virtual AccessibilityObject* passwordFieldOrContainingPasswordField() override;
</ins><span class="cx">     virtual bool isProgressIndicator() const override;
</span><span class="cx">     virtual bool isSearchField() const override;
</span><span class="cx">     virtual bool isSlider() const override;
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -2646,4 +2646,17 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+bool AccessibilityObject::isContainedByPasswordField() const
+{
+    Node* node = this-&gt;node();
+    if (!node)
+        return false;
+    
+    if (ariaRoleAttribute() != UnknownRole)
+        return false;
+
+    Element* element = node-&gt;shadowHost();
+    return is&lt;HTMLInputElement&gt;(element) &amp;&amp; downcast&lt;HTMLInputElement&gt;(*element).isPasswordField();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -463,6 +463,8 @@
</span><span class="cx">     virtual bool isNativeImage() const { return false; }
</span><span class="cx">     virtual bool isImageButton() const { return false; }
</span><span class="cx">     virtual bool isPasswordField() const { return false; }
</span><ins>+    bool isContainedByPasswordField() const;
+    virtual AccessibilityObject* passwordFieldOrContainingPasswordField() { return nullptr; }
</ins><span class="cx">     virtual bool isNativeTextControl() const { return false; }
</span><span class="cx">     virtual bool isSearchField() const { return false; }
</span><span class="cx">     bool isWebArea() const { return roleValue() == WebAreaRole; }
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -1491,14 +1491,17 @@
</span><span class="cx"> void AccessibilityRenderObject::setSelectedTextRange(const PlainTextRange&amp; range)
</span><span class="cx"> {
</span><span class="cx">     if (isNativeTextControl()) {
</span><ins>+        if (AXObjectCache* cache = axObjectCache())
+            cache-&gt;setTextSelectionIntent(AXTextStateChangeIntent(range.length ? AXTextStateChangeTypeSelectionExtend : AXTextStateChangeTypeSelectionMove, true));
</ins><span class="cx">         HTMLTextFormControlElement&amp; textControl = downcast&lt;RenderTextControl&gt;(*m_renderer).textFormControlElement();
</span><span class="cx">         textControl.setSelectionRange(range.start, range.start + range.length);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Node* node = m_renderer-&gt;node();
</span><del>-    m_renderer-&gt;frame().selection().setSelection(VisibleSelection(Position(node, range.start, Position::PositionIsOffsetInAnchor),
-        Position(node, range.start + range.length, Position::PositionIsOffsetInAnchor), DOWNSTREAM));
</del><ins>+    VisibleSelection newSelection(Position(node, range.start, Position::PositionIsOffsetInAnchor), Position(node, range.start + range.length, Position::PositionIsOffsetInAnchor), DOWNSTREAM);
+    AXTextStateChangeIntent newIntent(range.length ? AXTextStateChangeTypeSelectionExtend : AXTextStateChangeTypeSelectionMove, true);
+    m_renderer-&gt;frame().selection().setSelection(newSelection, FrameSelection::defaultSetSelectionOptions(), newIntent);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> URL AccessibilityRenderObject::url() const
</span><span class="lines">@@ -1963,13 +1966,16 @@
</span><span class="cx"> {
</span><span class="cx">     if (range.start.isNull() || range.end.isNull())
</span><span class="cx">         return;
</span><del>-    
</del><ins>+
</ins><span class="cx">     // make selection and tell the document to use it. if it's zero length, then move to that position
</span><del>-    if (range.start == range.end)
</del><ins>+    if (range.start == range.end) {
+        if (AXObjectCache* cache = axObjectCache())
+            cache-&gt;setTextSelectionIntent(AXTextStateChangeIntent(AXTextStateChangeTypeSelectionMove, true));
</ins><span class="cx">         m_renderer-&gt;frame().selection().moveTo(range.start, UserTriggered);
</span><ins>+    }
</ins><span class="cx">     else {
</span><span class="cx">         VisibleSelection newSelection = VisibleSelection(range.start, range.end);
</span><del>-        m_renderer-&gt;frame().selection().setSelection(newSelection);
</del><ins>+        m_renderer-&gt;frame().selection().setSelection(newSelection, FrameSelection::defaultSetSelectionOptions(), AXTextStateChangeIntent(AXTextStateChangeTypeSelectionExtend, true));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityScrollViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityScrollView.h (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityScrollView.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/accessibility/AccessibilityScrollView.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -43,6 +43,8 @@
</span><span class="cx">     virtual ~AccessibilityScrollView();
</span><span class="cx">     virtual void detach(AccessibilityDetachmentType, AXObjectCache*) override;
</span><span class="cx"> 
</span><ins>+    AccessibilityObject* webAreaObject() const;
+
</ins><span class="cx"> private:
</span><span class="cx">     explicit AccessibilityScrollView(ScrollView*);
</span><span class="cx">     
</span><span class="lines">@@ -71,7 +73,6 @@
</span><span class="cx">     virtual AccessibilityObject* parentObject() const override;
</span><span class="cx">     virtual AccessibilityObject* parentObjectIfExists() const override;
</span><span class="cx">     
</span><del>-    AccessibilityObject* webAreaObject() const;
</del><span class="cx">     virtual AccessibilityObject* firstChild() const override { return webAreaObject(); }
</span><span class="cx">     AccessibilityScrollbar* addChildScrollbar(Scrollbar*);
</span><span class="cx">     void removeChildScrollbar(AccessibilityObject*);
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityatkAXObjectCacheAtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -268,10 +268,10 @@
</span><span class="cx">     // Select the right signal to be emitted
</span><span class="cx">     CString detail;
</span><span class="cx">     switch (textChange) {
</span><del>-    case AXObjectCache::AXTextInserted:
</del><ins>+    case AXTextInserted:
</ins><span class="cx">         detail = &quot;text-insert&quot;;
</span><span class="cx">         break;
</span><del>-    case AXObjectCache::AXTextDeleted:
</del><ins>+    case AXTextDeleted:
</ins><span class="cx">         detail = &quot;text-remove&quot;;
</span><span class="cx">         break;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityiosAXObjectCacheIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -95,10 +95,21 @@
</span><span class="cx">     [obj-&gt;wrapper() accessibilityPostedNotification:notificationString];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void AXObjectCache::nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned, const String&amp;)
</del><ins>+void AXObjectCache::postTextStateChangePlatformNotification(AccessibilityObject* object, const AXTextStateChangeIntent&amp;, const VisibleSelection&amp;)
</ins><span class="cx"> {
</span><ins>+    postPlatformNotification(object, AXSelectedTextChanged);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void AXObjectCache::postTextStateChangePlatformNotification(AccessibilityObject* object, AXTextEditType, const String&amp;, const VisiblePosition&amp;)
+{
+    postPlatformNotification(object, AXValueChanged);
+}
+
+void AXObjectCache::postTextReplacementPlatformNotification(AccessibilityObject* object, AXTextEditType, const String&amp;, AXTextEditType, const String&amp;, const VisiblePosition&amp;)
+{
+    postPlatformNotification(object, AXValueChanged);
+}
+
</ins><span class="cx"> void AXObjectCache::frameLoadingEventPlatformNotification(AccessibilityObject* axFrameObject, AXLoadingEvent loadingEvent)
</span><span class="cx"> {
</span><span class="cx">     if (!axFrameObject)
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilitymacAXObjectCacheMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -44,6 +44,53 @@
</span><span class="cx"> #define NSAccessibilityLiveRegionCreatedNotification @&quot;AXLiveRegionCreated&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#ifndef NSAccessibilityTextStateChangeTypeKey
+#define NSAccessibilityTextStateChangeTypeKey @&quot;AXTextStateChangeType&quot;
+#endif
+
+#ifndef NSAccessibilityTextStateSyncKey
+#define NSAccessibilityTextStateSyncKey @&quot;AXTextStateSync&quot;
+#endif
+
+#ifndef NSAccessibilityTextSelectionDirection
+#define NSAccessibilityTextSelectionDirection @&quot;AXTextSelectionDirection&quot;
+#endif
+
+#ifndef NSAccessibilityTextSelectionGranularity
+#define NSAccessibilityTextSelectionGranularity @&quot;AXTextSelectionGranularity&quot;
+#endif
+
+#ifndef NSAccessibilityTextEditType
+#define NSAccessibilityTextEditType @&quot;AXTextEditType&quot;
+#endif
+
+#ifndef NSAccessibilityTextChangeValues
+#define NSAccessibilityTextChangeValues @&quot;AXTextChangeValues&quot;
+#endif
+
+#ifndef NSAccessibilityTextChangeValue
+#define NSAccessibilityTextChangeValue @&quot;AXTextChangeValue&quot;
+#endif
+
+#ifndef NSAccessibilityTextChangeValueLength
+#define NSAccessibilityTextChangeValueLength @&quot;AXTextChangeValueLength&quot;
+#endif
+
+#ifndef NSAccessibilityTextChangeValueStartMarker
+#define NSAccessibilityTextChangeValueStartMarker @&quot;AXTextChangeValueStartMarker&quot;
+#endif
+
+#ifndef NSAccessibilityTextChangeElement
+#define NSAccessibilityTextChangeElement @&quot;AXTextChangeElement&quot;
+#endif
+
+#ifndef NSAccessibilitySelectedTextMarkerRangeAttribute
+#define NSAccessibilitySelectedTextMarkerRangeAttribute @&quot;AXSelectedTextMarkerRange&quot;
+#endif
+
+// Very large strings can negatively impact the performance of notifications, so this length is chosen to try to fit an average paragraph or line of text, but not allow strings to be large enough to hurt performance.
+static const NSUInteger AXValueChangeTruncationLength = 1000;
+
</ins><span class="cx"> // The simple Cocoa calls in this file don't throw exceptions.
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -60,6 +107,21 @@
</span><span class="cx">     obj-&gt;setWrapper(wrapper.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static BOOL axShouldRepostNotificationsForTests = false;
+
+void AXObjectCache::setShouldRepostNotificationsForTests(bool value)
+{
+    axShouldRepostNotificationsForTests = value;
+}
+
+static void AXPostNotificationWithUserInfo(id object, NSString *notification, id userInfo)
+{
+    NSAccessibilityPostNotificationWithUserInfo(object, notification, userInfo);
+    // To simplify monitoring for notifications in tests, repost as a simple NSNotification instead of forcing test infrastucture to setup an IPC client and do all the translation between WebCore types and platform specific IPC types and back
+    if (UNLIKELY(axShouldRepostNotificationsForTests))
+        [object accessibilityPostedNotification:notification userInfo:userInfo];
+}
+
</ins><span class="cx"> void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotification notification)
</span><span class="cx"> {
</span><span class="cx">     if (!obj)
</span><span class="lines">@@ -149,17 +211,116 @@
</span><span class="cx"> #pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
</span><span class="cx">     ASSERT([obj-&gt;wrapper() accessibilityIsIgnored] || true);
</span><span class="cx"> #pragma clang diagnostic pop
</span><del>-    
-    NSAccessibilityPostNotification(obj-&gt;wrapper(), macNotification);
-    
-    // Used by DRT to know when notifications are posted.
-    [obj-&gt;wrapper() accessibilityPostedNotification:macNotification];
</del><ins>+
+    AXPostNotificationWithUserInfo(obj-&gt;wrapper(), macNotification, nil);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void AXObjectCache::nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned, const String&amp;)
</del><ins>+void AXObjectCache::postTextStateChangePlatformNotification(AccessibilityObject* object, const AXTextStateChangeIntent&amp; intent, const VisibleSelection&amp; selection)
</ins><span class="cx"> {
</span><ins>+    if (!object)
+        object = rootWebArea();
+
+    if (!object)
+        return;
+
+    NSMutableDictionary *userInfo = [[NSMutableDictionary alloc] initWithCapacity:5];
+    if (intent.isSynchronizing)
+        [userInfo setObject:[NSNumber numberWithBool:YES] forKey:NSAccessibilityTextStateSyncKey];
+    if (intent.type != AXTextStateChangeTypeUnknown) {
+        [userInfo setObject:[NSNumber numberWithInt:intent.type] forKey:NSAccessibilityTextStateChangeTypeKey];
+        switch (intent.type) {
+        case AXTextStateChangeTypeSelectionMove:
+        case AXTextStateChangeTypeSelectionExtend:
+            [userInfo setObject:[NSNumber numberWithInt:intent.selection.direction] forKey:NSAccessibilityTextSelectionDirection];
+            switch (intent.selection.direction) {
+            case AXTextSelectionDirectionUnknown:
+                break;
+            case AXTextSelectionDirectionBeginning:
+            case AXTextSelectionDirectionEnd:
+            case AXTextSelectionDirectionPrevious:
+            case AXTextSelectionDirectionNext:
+                [userInfo setObject:[NSNumber numberWithInt:intent.selection.granularity] forKey:NSAccessibilityTextSelectionGranularity];
+                break;
+            case AXTextSelectionDirectionDiscontiguous:
+                break;
+            }
+            break;
+        case AXTextStateChangeTypeUnknown:
+        case AXTextStateChangeTypeEdit:
+            break;
+        }
+    }
+    if (!selection.isNone()) {
+        if (id textMarkerRange = [object-&gt;wrapper() textMarkerRangeFromVisiblePositions:selection.visibleStart() endPosition:selection.visibleEnd()])
+            [userInfo setObject:textMarkerRange forKey:NSAccessibilitySelectedTextMarkerRangeAttribute];
+    }
+
+    if (id wrapper = object-&gt;wrapper())
+        [userInfo setObject:wrapper forKey:NSAccessibilityTextChangeElement];
+
+    AXPostNotificationWithUserInfo(rootWebArea()-&gt;wrapper(), NSAccessibilitySelectedTextChangedNotification, userInfo);
+    AXPostNotificationWithUserInfo(object-&gt;wrapper(), NSAccessibilitySelectedTextChangedNotification, userInfo);
+
+    [userInfo release];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static NSDictionary *textReplacementChangeDictionary(AccessibilityObject* object, AXTextEditType type, const String&amp; string, const VisiblePosition&amp; position)
+{
+    NSString *text = (NSString *)string;
+    NSUInteger length = [text length];
+    if (!length)
+        return nil;
+    NSMutableDictionary *change = [[NSMutableDictionary alloc] initWithCapacity:4];
+    [change setObject:[NSNumber numberWithInt:type] forKey:NSAccessibilityTextEditType];
+    if (length &gt; AXValueChangeTruncationLength) {
+        [change setObject:[NSNumber numberWithInt:length] forKey:NSAccessibilityTextChangeValueLength];
+        text = [text substringToIndex:AXValueChangeTruncationLength];
+    }
+    [change setObject:text forKey:NSAccessibilityTextChangeValue];
+    if (position.isNotNull()) {
+        if (id textMarker = [object-&gt;wrapper() textMarkerForVisiblePosition:position])
+            [change setObject:textMarker forKey:NSAccessibilityTextChangeValueStartMarker];
+    }
+    return [change autorelease];
+}
+
+void AXObjectCache::postTextStateChangePlatformNotification(AccessibilityObject* object, AXTextEditType type, const String&amp; text, const VisiblePosition&amp; position)
+{
+    if (!text.length())
+        return;
+
+    postTextReplacementPlatformNotification(object, AXTextEditTypeUnknown, &quot;&quot;, type, text, position);
+}
+
+void AXObjectCache::postTextReplacementPlatformNotification(AccessibilityObject* object, AXTextEditType deletionType, const String&amp; deletedText, AXTextEditType insertionType, const String&amp; insertedText, const VisiblePosition&amp; position)
+{
+    if (!object)
+        object = rootWebArea();
+
+    if (!object)
+        return;
+
+    NSMutableDictionary *userInfo = [[NSMutableDictionary alloc] initWithCapacity:4];
+    userInfo[NSAccessibilityTextStateChangeTypeKey] = @(AXTextStateChangeTypeEdit);
+
+    NSMutableArray *changes = [[NSMutableArray alloc] initWithCapacity:2];
+    if (NSDictionary *change = textReplacementChangeDictionary(object, deletionType, deletedText, position))
+        [changes addObject:change];
+    if (NSDictionary *change = textReplacementChangeDictionary(object, insertionType, insertedText, position))
+        [changes addObject:change];
+    if (changes.count)
+        [userInfo setObject:changes forKey:NSAccessibilityTextChangeValues];
+    [changes release];
+
+    if (id wrapper = object-&gt;wrapper())
+        userInfo[NSAccessibilityTextChangeElement] = wrapper;
+
+    AXPostNotificationWithUserInfo(rootWebArea()-&gt;wrapper(), NSAccessibilityValueChangedNotification, userInfo);
+    AXPostNotificationWithUserInfo(object-&gt;wrapper(), NSAccessibilityValueChangedNotification, userInfo);
+
+    [userInfo release];
+}
+
</ins><span class="cx"> void AXObjectCache::frameLoadingEventPlatformNotification(AccessibilityObject* axFrameObject, AXLoadingEvent loadingEvent)
</span><span class="cx"> {
</span><span class="cx">     if (!axFrameObject)
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.h (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -56,8 +56,9 @@
</span><span class="cx"> - (NSString *)ariaLandmarkRoleDescription;
</span><span class="cx"> 
</span><span class="cx"> - (id)attachmentView;
</span><del>-// Used to inform an element when a notification is posted for it. Used by DRT.
</del><ins>+// Used to inform an element when a notification is posted for it. Used by tests.
</ins><span class="cx"> - (void)accessibilityPostedNotification:(NSString *)notificationName;
</span><ins>+- (void)accessibilityPostedNotification:(NSString *)notificationName userInfo:(NSDictionary *)userInfo;
</ins><span class="cx"> 
</span><span class="cx"> - (CGPathRef)convertPathToScreenSpace:(WebCore::Path &amp;)path;
</span><span class="cx"> - (CGPoint)convertPointToScreenSpace:(WebCore::FloatPoint &amp;)point;
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperBasemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -383,13 +383,69 @@
</span><span class="cx"> + (void)accessibilitySetShouldRepostNotifications:(BOOL)repost
</span><span class="cx"> {
</span><span class="cx">     accessibilityShouldRepostNotifications = repost;
</span><ins>+#if PLATFORM(MAC)
+    AXObjectCache::setShouldRepostNotificationsForTests(repost);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)accessibilityPostedNotification:(NSString *)notificationName
</span><span class="cx"> {
</span><ins>+    if (accessibilityShouldRepostNotifications)
+        [self accessibilityPostedNotification:notificationName userInfo:nil];
+}
+
+static NSArray *arrayRemovingNonJSONTypes(NSArray *array)
+{
+    ASSERT([array isKindOfClass:[NSArray class]]);
+    NSMutableArray *mutableArray = [array mutableCopy];
+    for (NSUInteger i = 0; i &lt; [mutableArray count];) {
+        id value = [mutableArray objectAtIndex:i];
+        if ([value isKindOfClass:[NSDictionary class]])
+            [mutableArray replaceObjectAtIndex:i withObject:dictionaryRemovingNonJSONTypes(value)];
+        else if ([value isKindOfClass:[NSArray class]])
+            [mutableArray replaceObjectAtIndex:i withObject:arrayRemovingNonJSONTypes(value)];
+        else if (!([value isKindOfClass:[NSString class]] || [value isKindOfClass:[NSNumber class]])) {
+            [mutableArray removeObjectAtIndex:i];
+            continue;
+        }
+        i++;
+    }
+    return [mutableArray autorelease];
+}
+
+static NSDictionary *dictionaryRemovingNonJSONTypes(NSDictionary *dictionary)
+{
+    ASSERT([dictionary isKindOfClass:[NSDictionary class]]);
+    NSMutableDictionary *mutableDictionary = [dictionary mutableCopy];
+    for (NSString *key in dictionary) {
+        id value = [dictionary objectForKey:key];
+        if ([value isKindOfClass:[NSDictionary class]])
+            [mutableDictionary setObject:dictionaryRemovingNonJSONTypes(value) forKey:key];
+        else if ([value isKindOfClass:[NSArray class]])
+            [mutableDictionary setObject:arrayRemovingNonJSONTypes(value) forKey:key];
+        else if (!([value isKindOfClass:[NSString class]] || [value isKindOfClass:[NSNumber class]]))
+            [mutableDictionary removeObjectForKey:key];
+    }
+    return [mutableDictionary autorelease];
+}
+
+- (void)accessibilityPostedNotification:(NSString *)notificationName userInfo:(NSDictionary *)userInfo
+{
</ins><span class="cx">     if (accessibilityShouldRepostNotifications) {
</span><del>-        NSDictionary* userInfo = [NSDictionary dictionaryWithObjectsAndKeys:notificationName, @&quot;notificationName&quot;, nil];
-        [[NSNotificationCenter defaultCenter] postNotificationName:@&quot;AXDRTNotification&quot; object:self userInfo:userInfo];
</del><ins>+        ASSERT(notificationName);
+        NSDictionary *info = nil;
+        if (userInfo) {
+            NSData *userInfoData = [NSJSONSerialization dataWithJSONObject:dictionaryRemovingNonJSONTypes(userInfo) options:(NSJSONWritingOptions)0 error:nil];
+            if (userInfoData) {
+                NSString *userInfoString = [[NSString alloc] initWithData:userInfoData encoding:NSUTF8StringEncoding];
+                if (userInfoString)
+                    info = [NSDictionary dictionaryWithObjectsAndKeys:notificationName, @&quot;notificationName&quot;, userInfoString, @&quot;userInfo&quot;, nil];
+                [userInfoString release];
+            }
+        }
+        if (!info)
+            info = [NSDictionary dictionaryWithObjectsAndKeys:notificationName, @&quot;notificationName&quot;, nil];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@&quot;AXDRTNotification&quot; object:self userInfo:info];
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.h (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -33,6 +33,9 @@
</span><span class="cx"> 
</span><span class="cx"> @interface WebAccessibilityObjectWrapper : WebAccessibilityObjectWrapperBase
</span><span class="cx"> 
</span><ins>+- (id)textMarkerRangeFromVisiblePositions:(const WebCore::VisiblePosition&amp;)startPosition endPosition:(const WebCore::VisiblePosition&amp;)endPosition;
+- (id)textMarkerForVisiblePosition:(const WebCore::VisiblePosition&amp;)visiblePos;
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> #endif // WebAccessibilityObjectWrapper_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -1136,14 +1136,14 @@
</span><span class="cx">     return [attrString autorelease];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static id textMarkerRangeFromVisiblePositions(AXObjectCache *cache, VisiblePosition startPosition, VisiblePosition endPosition)
</del><ins>+static id textMarkerRangeFromVisiblePositions(AXObjectCache *cache, const VisiblePosition&amp; startPosition, const VisiblePosition&amp; endPosition)
</ins><span class="cx"> {
</span><span class="cx">     id startTextMarker = textMarkerForVisiblePosition(cache, startPosition);
</span><span class="cx">     id endTextMarker = textMarkerForVisiblePosition(cache, endPosition);
</span><span class="cx">     return textMarkerRangeFromMarkers(startTextMarker, endTextMarker);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (id)textMarkerRangeFromVisiblePositions:(VisiblePosition)startPosition endPosition:(VisiblePosition)endPosition
</del><ins>+- (id)textMarkerRangeFromVisiblePositions:(const VisiblePosition&amp;)startPosition endPosition:(const VisiblePosition&amp;)endPosition
</ins><span class="cx"> {
</span><span class="cx">     return textMarkerRangeFromVisiblePositions(m_object-&gt;axObjectCache(), startPosition, endPosition);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingAppendNodeCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/AppendNodeCommand.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/AppendNodeCommand.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/AppendNodeCommand.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -30,12 +30,13 @@
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;ExceptionCodePlaceholder.h&quot;
</span><span class="cx"> #include &quot;RenderElement.h&quot;
</span><ins>+#include &quot;Text.h&quot;
</ins><span class="cx"> #include &quot;htmlediting.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-AppendNodeCommand::AppendNodeCommand(PassRefPtr&lt;ContainerNode&gt; parent, PassRefPtr&lt;Node&gt; node)
-    : SimpleEditCommand(parent-&gt;document())
</del><ins>+AppendNodeCommand::AppendNodeCommand(PassRefPtr&lt;ContainerNode&gt; parent, PassRefPtr&lt;Node&gt; node, EditAction editingAction)
+    : SimpleEditCommand(parent-&gt;document(), editingAction)
</ins><span class="cx">     , m_parent(parent)
</span><span class="cx">     , m_node(node)
</span><span class="cx"> {
</span><span class="lines">@@ -46,15 +47,23 @@
</span><span class="cx">     ASSERT(m_parent-&gt;hasEditableStyle() || !m_parent-&gt;renderer());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void sendAXTextChangedIgnoringLineBreaks(Node* node, AXObjectCache::AXTextChange textChange)
</del><ins>+static void sendAXTextChangedIgnoringLineBreaks(Node* node, AXTextEditType type)
</ins><span class="cx"> {
</span><del>-    String nodeValue = node-&gt;nodeValue();
</del><ins>+    if (!node)
+        return;
+
+    if (!AXObjectCache::accessibilityEnabled())
+        return;
+
+    String text = node-&gt;nodeValue();
</ins><span class="cx">     // Don't consider linebreaks in this command
</span><del>-    if (nodeValue == &quot;\n&quot;)
</del><ins>+    if (text == &quot;\n&quot;)
</ins><span class="cx">       return;
</span><span class="cx"> 
</span><del>-    if (AXObjectCache* cache = node-&gt;document().existingAXObjectCache())
-        cache-&gt;nodeTextChangeNotification(node, textChange, 0, nodeValue);
</del><ins>+    if (AXObjectCache* cache = node-&gt;document().existingAXObjectCache()) {
+        Position position = is&lt;Text&gt;(node) ? Position(downcast&lt;Text&gt;(node), 0) : createLegacyEditingPosition(node, 0);
+        cache-&gt;postTextStateChangeNotification(node, type, text, VisiblePosition(position));
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AppendNodeCommand::doApply()
</span><span class="lines">@@ -64,18 +73,16 @@
</span><span class="cx"> 
</span><span class="cx">     m_parent-&gt;appendChild(m_node.get(), IGNORE_EXCEPTION);
</span><span class="cx"> 
</span><del>-    if (AXObjectCache::accessibilityEnabled())
-        sendAXTextChangedIgnoringLineBreaks(m_node.get(), AXObjectCache::AXTextInserted);
</del><ins>+    sendAXTextChangedIgnoringLineBreaks(m_node.get(), applyEditType());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AppendNodeCommand::doUnapply()
</span><span class="cx"> {
</span><span class="cx">     if (!m_parent-&gt;hasEditableStyle())
</span><span class="cx">         return;
</span><del>-        
</del><ins>+
</ins><span class="cx">     // Need to notify this before actually deleting the text
</span><del>-    if (AXObjectCache::accessibilityEnabled())
-        sendAXTextChangedIgnoringLineBreaks(m_node.get(), AXObjectCache::AXTextDeleted);
</del><ins>+    sendAXTextChangedIgnoringLineBreaks(m_node.get(), unapplyEditType());
</ins><span class="cx"> 
</span><span class="cx">     m_node-&gt;remove(IGNORE_EXCEPTION);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingAppendNodeCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/AppendNodeCommand.h (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/AppendNodeCommand.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/AppendNodeCommand.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -32,13 +32,13 @@
</span><span class="cx"> 
</span><span class="cx"> class AppendNodeCommand : public SimpleEditCommand {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;AppendNodeCommand&gt; create(PassRefPtr&lt;ContainerNode&gt; parent, PassRefPtr&lt;Node&gt; node)
</del><ins>+    static Ref&lt;AppendNodeCommand&gt; create(PassRefPtr&lt;ContainerNode&gt; parent, PassRefPtr&lt;Node&gt; node, EditAction editingAction)
</ins><span class="cx">     {
</span><del>-        return adoptRef(*new AppendNodeCommand(parent, node));
</del><ins>+        return adoptRef(*new AppendNodeCommand(parent, node, editingAction));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    AppendNodeCommand(PassRefPtr&lt;ContainerNode&gt; parent, PassRefPtr&lt;Node&gt;);
</del><ins>+    AppendNodeCommand(PassRefPtr&lt;ContainerNode&gt; parent, PassRefPtr&lt;Node&gt;, EditAction);
</ins><span class="cx"> 
</span><span class="cx">     virtual void doApply() override;
</span><span class="cx">     virtual void doUnapply() override;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingApplyStyleCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ApplyStyleCommand.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ApplyStyleCommand.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/ApplyStyleCommand.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -123,9 +123,8 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ApplyStyleCommand::ApplyStyleCommand(Document&amp; document, const EditingStyle* style, EditAction editingAction, EPropertyLevel propertyLevel)
</span><del>-    : CompositeEditCommand(document)
</del><ins>+    : CompositeEditCommand(document, editingAction)
</ins><span class="cx">     , m_style(style-&gt;copy())
</span><del>-    , m_editingAction(editingAction)
</del><span class="cx">     , m_propertyLevel(propertyLevel)
</span><span class="cx">     , m_start(endingSelection().start().downstream())
</span><span class="cx">     , m_end(endingSelection().end().upstream())
</span><span class="lines">@@ -136,9 +135,8 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ApplyStyleCommand::ApplyStyleCommand(Document&amp; document, const EditingStyle* style, const Position&amp; start, const Position&amp; end, EditAction editingAction, EPropertyLevel propertyLevel)
</span><del>-    : CompositeEditCommand(document)
</del><ins>+    : CompositeEditCommand(document, editingAction)
</ins><span class="cx">     , m_style(style-&gt;copy())
</span><del>-    , m_editingAction(editingAction)
</del><span class="cx">     , m_propertyLevel(propertyLevel)
</span><span class="cx">     , m_start(start)
</span><span class="cx">     , m_end(end)
</span><span class="lines">@@ -149,9 +147,8 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ApplyStyleCommand::ApplyStyleCommand(PassRefPtr&lt;Element&gt; element, bool removeOnly, EditAction editingAction)
</span><del>-    : CompositeEditCommand(element-&gt;document())
</del><ins>+    : CompositeEditCommand(element-&gt;document(), editingAction)
</ins><span class="cx">     , m_style(EditingStyle::create())
</span><del>-    , m_editingAction(editingAction)
</del><span class="cx">     , m_propertyLevel(PropertyDefault)
</span><span class="cx">     , m_start(endingSelection().start().downstream())
</span><span class="cx">     , m_end(endingSelection().end().upstream())
</span><span class="lines">@@ -163,9 +160,8 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ApplyStyleCommand::ApplyStyleCommand(Document&amp; document, const EditingStyle* style, IsInlineElementToRemoveFunction isInlineElementToRemoveFunction, EditAction editingAction)
</span><del>-    : CompositeEditCommand(document)
</del><ins>+    : CompositeEditCommand(document, editingAction)
</ins><span class="cx">     , m_style(style-&gt;copy())
</span><del>-    , m_editingAction(editingAction)
</del><span class="cx">     , m_propertyLevel(PropertyDefault)
</span><span class="cx">     , m_start(endingSelection().start().downstream())
</span><span class="cx">     , m_end(endingSelection().end().upstream())
</span><span class="lines">@@ -226,11 +222,6 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-EditAction ApplyStyleCommand::editingAction() const
-{
-    return m_editingAction;
-}
-
</del><span class="cx"> void ApplyStyleCommand::applyBlockStyle(EditingStyle *style)
</span><span class="cx"> {
</span><span class="cx">     // update document layout once before removing styles
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingApplyStyleCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ApplyStyleCommand.h (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ApplyStyleCommand.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/ApplyStyleCommand.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -72,7 +72,6 @@
</span><span class="cx">     ApplyStyleCommand(Document&amp;, const EditingStyle*, bool (*isInlineElementToRemove)(const Element*), EditAction);
</span><span class="cx"> 
</span><span class="cx">     virtual void doApply() override;
</span><del>-    virtual EditAction editingAction() const override;
</del><span class="cx"> 
</span><span class="cx">     // style-removal helpers
</span><span class="cx">     bool isStyledInlineElementToRemove(Element*) const;
</span><span class="lines">@@ -122,7 +121,6 @@
</span><span class="cx">     Position endPosition();
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;EditingStyle&gt; m_style;
</span><del>-    EditAction m_editingAction;
</del><span class="cx">     EPropertyLevel m_propertyLevel;
</span><span class="cx">     Position m_start;
</span><span class="cx">     Position m_end;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingCompositeEditCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/CompositeEditCommand.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -58,6 +58,8 @@
</span><span class="cx"> #include &quot;RenderBlockFlow.h&quot;
</span><span class="cx"> #include &quot;RenderText.h&quot;
</span><span class="cx"> #include &quot;RenderedDocumentMarker.h&quot;
</span><ins>+#include &quot;ReplaceDeleteFromTextNodeCommand.h&quot;
+#include &quot;ReplaceInsertIntoTextNodeCommand.h&quot;
</ins><span class="cx"> #include &quot;ReplaceNodeWithSpanCommand.h&quot;
</span><span class="cx"> #include &quot;ReplaceSelectionCommand.h&quot;
</span><span class="cx"> #include &quot;ScopedEventQueue.h&quot;
</span><span class="lines">@@ -162,13 +164,31 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+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;
+}
+
</ins><span class="cx"> void applyCommand(PassRefPtr&lt;CompositeEditCommand&gt; command)
</span><span class="cx"> {
</span><span class="cx">     command-&gt;apply();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-CompositeEditCommand::CompositeEditCommand(Document&amp; document)
-    : EditCommand(document)
</del><ins>+CompositeEditCommand::CompositeEditCommand(Document&amp; document, EditAction editingAction)
+    : EditCommand(document, editingAction)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -187,6 +207,7 @@
</span><span class="cx">         case EditActionSetWritingDirection:
</span><span class="cx">         case EditActionCut:
</span><span class="cx">         case EditActionUnspecified:
</span><ins>+        case EditActionInsert:
</ins><span class="cx">         case EditActionDelete:
</span><span class="cx">         case EditActionDictation:
</span><span class="cx">             break;
</span><span class="lines">@@ -296,7 +317,7 @@
</span><span class="cx"> 
</span><span class="cx"> void CompositeEditCommand::insertParagraphSeparator(bool useDefaultParagraphElement, bool pasteBlockqutoeIntoUnquotedArea)
</span><span class="cx"> {
</span><del>-    applyCommandToComposite(InsertParagraphSeparatorCommand::create(document(), useDefaultParagraphElement, pasteBlockqutoeIntoUnquotedArea));
</del><ins>+    applyCommandToComposite(InsertParagraphSeparatorCommand::create(document(), useDefaultParagraphElement, pasteBlockqutoeIntoUnquotedArea, editingAction()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CompositeEditCommand::insertLineBreak()
</span><span class="lines">@@ -322,7 +343,7 @@
</span><span class="cx"> 
</span><span class="cx"> void CompositeEditCommand::insertNodeBefore(PassRefPtr&lt;Node&gt; insertChild, PassRefPtr&lt;Node&gt; refChild, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable)
</span><span class="cx"> {
</span><del>-    applyCommandToComposite(InsertNodeBeforeCommand::create(insertChild, refChild, shouldAssumeContentIsAlwaysEditable));
</del><ins>+    applyCommandToComposite(InsertNodeBeforeCommand::create(insertChild, refChild, shouldAssumeContentIsAlwaysEditable, editingAction()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CompositeEditCommand::insertNodeAfter(PassRefPtr&lt;Node&gt; insertChild, PassRefPtr&lt;Node&gt; refChild)
</span><span class="lines">@@ -373,7 +394,7 @@
</span><span class="cx"> void CompositeEditCommand::appendNode(PassRefPtr&lt;Node&gt; node, PassRefPtr&lt;ContainerNode&gt; parent)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(canHaveChildrenForEditing(parent.get()));
</span><del>-    applyCommandToComposite(AppendNodeCommand::create(parent, node));
</del><ins>+    applyCommandToComposite(AppendNodeCommand::create(parent, node, editingAction()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CompositeEditCommand::removeChildrenInRange(PassRefPtr&lt;Node&gt; node, unsigned from, unsigned to)
</span><span class="lines">@@ -397,7 +418,7 @@
</span><span class="cx"> 
</span><span class="cx"> void CompositeEditCommand::removeNodePreservingChildren(PassRefPtr&lt;Node&gt; node, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable)
</span><span class="cx"> {
</span><del>-    applyCommandToComposite(RemoveNodePreservingChildrenCommand::create(node, shouldAssumeContentIsAlwaysEditable));
</del><ins>+    applyCommandToComposite(RemoveNodePreservingChildrenCommand::create(node, shouldAssumeContentIsAlwaysEditable, editingAction()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CompositeEditCommand::removeNodeAndPruneAncestors(PassRefPtr&lt;Node&gt; node)
</span><span class="lines">@@ -525,20 +546,21 @@
</span><span class="cx"> void CompositeEditCommand::insertTextIntoNode(PassRefPtr&lt;Text&gt; node, unsigned offset, const String&amp; text)
</span><span class="cx"> {
</span><span class="cx">     if (!text.isEmpty())
</span><del>-        applyCommandToComposite(InsertIntoTextNodeCommand::create(node, offset, text));
</del><ins>+        applyCommandToComposite(InsertIntoTextNodeCommand::create(node, offset, text, editingAction()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CompositeEditCommand::deleteTextFromNode(PassRefPtr&lt;Text&gt; node, unsigned offset, unsigned count)
</span><span class="cx"> {
</span><del>-    applyCommandToComposite(DeleteFromTextNodeCommand::create(node, offset, count));
</del><ins>+    applyCommandToComposite(DeleteFromTextNodeCommand::create(node, offset, count, editingAction()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CompositeEditCommand::replaceTextInNode(PassRefPtr&lt;Text&gt; prpNode, unsigned offset, unsigned count, const String&amp; replacementText)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;Text&gt; node(prpNode);
</span><del>-    applyCommandToComposite(DeleteFromTextNodeCommand::create(node, offset, count));
</del><ins>+    RefPtr&lt;DeleteFromTextNodeCommand&gt; deleteCommand = ReplaceDeleteFromTextNodeCommand::create(WTF::move(node), offset, count);
+    applyCommandToComposite(deleteCommand);
</ins><span class="cx">     if (!replacementText.isEmpty())
</span><del>-        applyCommandToComposite(InsertIntoTextNodeCommand::create(node, offset, replacementText));
</del><ins>+        applyCommandToComposite(ReplaceInsertIntoTextNodeCommand::create(WTF::move(node), offset, replacementText, deleteCommand-&gt;deletedText(), editingAction()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Position CompositeEditCommand::replaceSelectedTextInNode(const String&amp; text)
</span><span class="lines">@@ -1289,7 +1311,7 @@
</span><span class="cx">     ReplaceSelectionCommand::CommandOptions options = ReplaceSelectionCommand::SelectReplacement | ReplaceSelectionCommand::MovingParagraph;
</span><span class="cx">     if (!preserveStyle)
</span><span class="cx">         options |= ReplaceSelectionCommand::MatchStyle;
</span><del>-    applyCommandToComposite(ReplaceSelectionCommand::create(document(), fragment, options));
</del><ins>+    applyCommandToComposite(ReplaceSelectionCommand::create(document(), WTF::move(fragment), options));
</ins><span class="cx"> 
</span><span class="cx">     frame().editor().markMisspellingsAndBadGrammar(endingSelection());
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingCompositeEditCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/CompositeEditCommand.h (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/CompositeEditCommand.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/CompositeEditCommand.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -59,6 +59,8 @@
</span><span class="cx">     virtual void getNodesInCommand(HashSet&lt;Node*&gt;&amp;);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    AXTextEditType unapplyEditType() const;
+
</ins><span class="cx"> private:
</span><span class="cx">     EditCommandComposition(Document&amp;, const VisibleSelection&amp; startingSelection, const VisibleSelection&amp; endingSelection, EditAction);
</span><span class="cx"> 
</span><span class="lines">@@ -89,7 +91,7 @@
</span><span class="cx">     virtual bool shouldStopCaretBlinking() const { return false; }
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    explicit CompositeEditCommand(Document&amp;);
</del><ins>+    explicit CompositeEditCommand(Document&amp;, EditAction = EditActionUnspecified);
</ins><span class="cx"> 
</span><span class="cx">     //
</span><span class="cx">     // sugary-sweet convenience functions to help create and apply edit commands in composite commands
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingDeleteFromTextNodeCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/DeleteFromTextNodeCommand.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2005, 2008, 2015 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -34,8 +34,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-DeleteFromTextNodeCommand::DeleteFromTextNodeCommand(PassRefPtr&lt;Text&gt; node, unsigned offset, unsigned count)
-    : SimpleEditCommand(node-&gt;document())
</del><ins>+DeleteFromTextNodeCommand::DeleteFromTextNodeCommand(RefPtr&lt;Text&gt;&amp;&amp; node, unsigned offset, unsigned count, EditAction editingAction)
+    : SimpleEditCommand(node-&gt;document(), editingAction)
</ins><span class="cx">     , m_node(node)
</span><span class="cx">     , m_offset(offset)
</span><span class="cx">     , m_count(count)
</span><span class="lines">@@ -58,8 +58,8 @@
</span><span class="cx">         return;
</span><span class="cx">     
</span><span class="cx">     // Need to notify this before actually deleting the text
</span><del>-    if (AXObjectCache* cache = document().existingAXObjectCache())
-        cache-&gt;nodeTextChangeNotification(m_node.get(), AXObjectCache::AXTextDeleted, m_offset, m_text);
</del><ins>+    if (AXObjectCache::accessibilityEnabled())
+        notifyAccessibilityForTextChange(m_node.get(), applyEditType(), m_text, VisiblePosition(Position(m_node, m_offset)));
</ins><span class="cx"> 
</span><span class="cx">     m_node-&gt;deleteData(m_offset, m_count, ec);
</span><span class="cx"> }
</span><span class="lines">@@ -73,8 +73,8 @@
</span><span class="cx"> 
</span><span class="cx">     m_node-&gt;insertData(m_offset, m_text, IGNORE_EXCEPTION);
</span><span class="cx"> 
</span><del>-    if (AXObjectCache* cache = document().existingAXObjectCache())
-        cache-&gt;nodeTextChangeNotification(m_node.get(), AXObjectCache::AXTextInserted, m_offset, m_text);
</del><ins>+    if (AXObjectCache::accessibilityEnabled())
+        notifyAccessibilityForTextChange(m_node.get(), unapplyEditType(), m_text, VisiblePosition(Position(m_node, m_offset)));
</ins><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 (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/DeleteFromTextNodeCommand.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/DeleteFromTextNodeCommand.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2005, 2006, 2008, 2015 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -34,14 +34,17 @@
</span><span class="cx"> 
</span><span class="cx"> class DeleteFromTextNodeCommand : public SimpleEditCommand {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;DeleteFromTextNodeCommand&gt; create(PassRefPtr&lt;Text&gt; node, unsigned offset, unsigned count)
</del><ins>+    static Ref&lt;DeleteFromTextNodeCommand&gt; create(RefPtr&lt;Text&gt;&amp;&amp; node, unsigned offset, unsigned count, EditAction editingAction = EditActionDelete)
</ins><span class="cx">     {
</span><del>-        return adoptRef(*new DeleteFromTextNodeCommand(node, offset, count));
</del><ins>+        return adoptRef(*new DeleteFromTextNodeCommand(WTF::move(node), offset, count, editingAction));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    const String&amp; deletedText();
+
+protected:
+    DeleteFromTextNodeCommand(RefPtr&lt;Text&gt;&amp;&amp;, unsigned offset, unsigned count, EditAction);
+
</ins><span class="cx"> private:
</span><del>-    DeleteFromTextNodeCommand(PassRefPtr&lt;Text&gt;, unsigned offset, unsigned count);
-
</del><span class="cx">     virtual void doApply() override;
</span><span class="cx">     virtual void doUnapply() override;
</span><span class="cx">     
</span><span class="lines">@@ -55,6 +58,11 @@
</span><span class="cx">     String m_text;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+inline const String&amp; DeleteFromTextNodeCommand::deletedText()
+{
+    return m_text;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // DeleteFromTextNodeCommand_h
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingDeleteSelectionCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -72,8 +72,8 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-DeleteSelectionCommand::DeleteSelectionCommand(Document&amp; document, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool sanitizeMarkup)
-    : CompositeEditCommand(document)
</del><ins>+DeleteSelectionCommand::DeleteSelectionCommand(Document&amp; document, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool sanitizeMarkup, EditAction editingAction)
+    : CompositeEditCommand(document, editingAction)
</ins><span class="cx">     , m_hasSelectionToDelete(false)
</span><span class="cx">     , m_smartDelete(smartDelete)
</span><span class="cx">     , m_mergeBlocksAfterDelete(mergeBlocksAfterDelete)
</span><span class="lines">@@ -90,8 +90,8 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-DeleteSelectionCommand::DeleteSelectionCommand(const VisibleSelection&amp; selection, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool sanitizeMarkup)
-    : CompositeEditCommand(selection.start().anchorNode()-&gt;document())
</del><ins>+DeleteSelectionCommand::DeleteSelectionCommand(const VisibleSelection&amp; selection, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool sanitizeMarkup, EditAction editingAction)
+    : CompositeEditCommand(selection.start().anchorNode()-&gt;document(), editingAction)
</ins><span class="cx">     , m_hasSelectionToDelete(true)
</span><span class="cx">     , m_smartDelete(smartDelete)
</span><span class="cx">     , m_mergeBlocksAfterDelete(mergeBlocksAfterDelete)
</span><span class="lines">@@ -884,14 +884,6 @@
</span><span class="cx">     clearTransientState();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-EditAction DeleteSelectionCommand::editingAction() const
-{
-    // Note that DeleteSelectionCommand is also used when the user presses the Delete key,
-    // but in that case there's a TypingCommand that supplies the editingAction(), so
-    // the Undo menu correctly shows &quot;Undo Typing&quot;
-    return EditActionCut;
-}
-
</del><span class="cx"> // Normally deletion doesn't preserve the typing style that was present before it.  For example,
</span><span class="cx"> // type a character, Bold, then delete the character and start typing.  The Bold typing style shouldn't
</span><span class="cx"> // stick around.  Deletion should preserve a typing style that *it* sets, however.
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingDeleteSelectionCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/DeleteSelectionCommand.h (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/DeleteSelectionCommand.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/DeleteSelectionCommand.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -34,23 +34,22 @@
</span><span class="cx"> 
</span><span class="cx"> class DeleteSelectionCommand : public CompositeEditCommand { 
</span><span class="cx"> public:
</span><del>-    static Ref&lt;DeleteSelectionCommand&gt; create(Document&amp; document, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = false, bool sanitizeMarkup = true)
</del><ins>+    static Ref&lt;DeleteSelectionCommand&gt; create(Document&amp; document, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = false, bool sanitizeMarkup = true, EditAction editingAction = EditActionDelete)
</ins><span class="cx">     {
</span><del>-        return adoptRef(*new DeleteSelectionCommand(document, smartDelete, mergeBlocksAfterDelete, replace, expandForSpecialElements, sanitizeMarkup));
</del><ins>+        return adoptRef(*new DeleteSelectionCommand(document, smartDelete, mergeBlocksAfterDelete, replace, expandForSpecialElements, sanitizeMarkup, editingAction));
</ins><span class="cx">     }
</span><del>-    static Ref&lt;DeleteSelectionCommand&gt; create(const VisibleSelection&amp; selection, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = false, bool sanitizeMarkup = true)
</del><ins>+    static Ref&lt;DeleteSelectionCommand&gt; create(const VisibleSelection&amp; selection, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = false, bool sanitizeMarkup = true, EditAction editingAction = EditActionDelete)
</ins><span class="cx">     {
</span><del>-        return adoptRef(*new DeleteSelectionCommand(selection, smartDelete, mergeBlocksAfterDelete, replace, expandForSpecialElements, sanitizeMarkup));
</del><ins>+        return adoptRef(*new DeleteSelectionCommand(selection, smartDelete, mergeBlocksAfterDelete, replace, expandForSpecialElements, sanitizeMarkup, editingAction));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    DeleteSelectionCommand(Document&amp;, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool santizeMarkup);
</del><ins>+    DeleteSelectionCommand(Document&amp;, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool santizeMarkup, EditAction = EditActionDelete);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    DeleteSelectionCommand(const VisibleSelection&amp;, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool sanitizeMarkup);
</del><ins>+    DeleteSelectionCommand(const VisibleSelection&amp;, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool sanitizeMarkup, EditAction);
</ins><span class="cx"> 
</span><span class="cx">     virtual void doApply();
</span><del>-    virtual EditAction editingAction() const;
</del><span class="cx">     
</span><span class="cx">     virtual bool preservesTypingStyle() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingDictationCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/DictationCommand.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/DictationCommand.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/DictationCommand.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -115,7 +115,7 @@
</span><span class="cx"> {
</span><span class="cx">     Vector&lt;DictationAlternative&gt; alternativesInLine;
</span><span class="cx">     collectDictationAlternativesInRange(lineStart, lineLength, alternativesInLine);
</span><del>-    RefPtr&lt;InsertTextCommand&gt; command = InsertTextCommand::createWithMarkerSupplier(document(), m_textToInsert.substring(lineStart, lineLength), DictationMarkerSupplier::create(alternativesInLine));
</del><ins>+    RefPtr&lt;InsertTextCommand&gt; command = InsertTextCommand::createWithMarkerSupplier(document(), m_textToInsert.substring(lineStart, lineLength), DictationMarkerSupplier::create(alternativesInLine), EditActionDictation);
</ins><span class="cx">     applyCommandToComposite(command, endingSelection());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -124,7 +124,7 @@
</span><span class="cx">     if (!canAppendNewLineFeedToSelection(endingSelection()))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    applyCommandToComposite(InsertParagraphSeparatorCommand::create(document()));
</del><ins>+    applyCommandToComposite(InsertParagraphSeparatorCommand::create(document(), false, false, EditActionDictation));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void DictationCommand::collectDictationAlternativesInRange(size_t rangeStart, size_t rangeLength, Vector&lt;DictationAlternative&gt;&amp; alternatives)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditActionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditAction.h (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditAction.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/EditAction.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">     typedef enum {
</span><span class="cx">         EditActionUnspecified,
</span><ins>+        EditActionInsert,
</ins><span class="cx">         EditActionSetColor,
</span><span class="cx">         EditActionSetBackgroundColor,
</span><span class="cx">         EditActionTurnOffKerning,
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditCommand.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditCommand.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/EditCommand.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;EditCommand.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;AXObjectCache.h&quot;
</ins><span class="cx"> #include &quot;CompositeEditCommand.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;Editor.h&quot;
</span><span class="lines">@@ -37,9 +38,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-EditCommand::EditCommand(Document&amp; document)
</del><ins>+EditCommand::EditCommand(Document&amp; document, EditAction editingAction)
</ins><span class="cx">     : m_document(document)
</span><span class="cx">     , m_parent(0)
</span><ins>+    , m_editingAction(editingAction)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(document.frame());
</span><span class="cx">     setStartingSelection(m_document-&gt;frame()-&gt;selection().selection());
</span><span class="lines">@@ -67,7 +69,7 @@
</span><span class="cx"> 
</span><span class="cx"> EditAction EditCommand::editingAction() const
</span><span class="cx"> {
</span><del>-    return EditActionUnspecified;
</del><ins>+    return m_editingAction;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline EditCommandComposition* compositionIfPossible(EditCommand* command)
</span><span class="lines">@@ -112,6 +114,50 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+AXTextEditType EditCommand::applyEditType() const
+{
+    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;
+    // Include default case for unhandled EditAction cases.
+    default:
+        break;
+    }
+    return AXTextEditTypeUnknown;
+}
+
+AXTextEditType EditCommand::unapplyEditType() const
+{
+    switch (applyEditType()) {
+    case AXTextEditTypeUnknown:
+        return AXTextEditTypeUnknown;
+    case AXTextEditTypeDelete:
+    case AXTextEditTypeCut:
+        return AXTextEditTypeInsert;
+    case AXTextEditTypeInsert:
+    case AXTextEditTypeTyping:
+    case AXTextEditTypeDictation:
+    case AXTextEditTypePaste:
+        return AXTextEditTypeDelete;
+    }
+    return AXTextEditTypeUnknown;
+}
+
+SimpleEditCommand::SimpleEditCommand(Document&amp; document, EditAction editingAction)
+    : EditCommand(document, editingAction)
+{
+}
+
</ins><span class="cx"> void SimpleEditCommand::doReapply()
</span><span class="cx"> {
</span><span class="cx">     doApply();
</span><span class="lines">@@ -125,4 +171,14 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+void SimpleEditCommand::notifyAccessibilityForTextChange(Node* node, AXTextEditType type, const String&amp; text, const VisiblePosition&amp; position)
+{
+    if (!AXObjectCache::accessibilityEnabled())
+        return;
+    AXObjectCache* cache = document().existingAXObjectCache();
+    if (!cache)
+        return;
+    cache-&gt;postTextStateChangeNotification(node, type, text, position);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditCommand.h (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditCommand.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/EditCommand.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #ifndef EditCommand_h
</span><span class="cx"> #define EditCommand_h
</span><span class="cx"> 
</span><ins>+#include &quot;AXTextStateChangeIntent.h&quot;
</ins><span class="cx"> #include &quot;EditAction.h&quot;
</span><span class="cx"> #include &quot;VisibleSelection.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -46,7 +47,7 @@
</span><span class="cx"> 
</span><span class="cx">     void setParent(CompositeEditCommand*);
</span><span class="cx"> 
</span><del>-    virtual EditAction editingAction() const;
</del><ins>+    EditAction editingAction() const;
</ins><span class="cx"> 
</span><span class="cx">     const VisibleSelection&amp; startingSelection() const { return m_startingSelection; }
</span><span class="cx">     const VisibleSelection&amp; endingSelection() const { return m_endingSelection; }
</span><span class="lines">@@ -59,8 +60,11 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void doApply() = 0;
</span><span class="cx"> 
</span><ins>+    AXTextEditType applyEditType() const;
+    AXTextEditType unapplyEditType() const;
+
</ins><span class="cx"> protected:
</span><del>-    explicit EditCommand(Document&amp;);
</del><ins>+    explicit EditCommand(Document&amp;, EditAction = EditActionUnspecified);
</ins><span class="cx">     EditCommand(Document&amp;, const VisibleSelection&amp;, const VisibleSelection&amp;);
</span><span class="cx"> 
</span><span class="cx">     Frame&amp; frame();
</span><span class="lines">@@ -74,6 +78,7 @@
</span><span class="cx">     VisibleSelection m_startingSelection;
</span><span class="cx">     VisibleSelection m_endingSelection;
</span><span class="cx">     CompositeEditCommand* m_parent;
</span><ins>+    EditAction m_editingAction { EditActionUnspecified };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> enum ShouldAssumeContentIsAlwaysEditable {
</span><span class="lines">@@ -91,12 +96,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    explicit SimpleEditCommand(Document&amp; document) : EditCommand(document) { }
</del><ins>+    explicit SimpleEditCommand(Document&amp;, EditAction = EditActionUnspecified);
</ins><span class="cx"> 
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx">     void addNodeAndDescendants(Node*, HashSet&lt;Node*&gt;&amp;);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    virtual void notifyAccessibilityForTextChange(Node*, AXTextEditType, const String&amp;, const VisiblePosition&amp;);
+
</ins><span class="cx"> private:
</span><span class="cx">     virtual 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 (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditingAllInOne.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/EditingAllInOne.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -59,6 +59,8 @@
</span><span class="cx"> #include &lt;RemoveNodeCommand.cpp&gt;
</span><span class="cx"> #include &lt;RemoveNodePreservingChildrenCommand.cpp&gt;
</span><span class="cx"> #include &lt;RenderedPosition.cpp&gt;
</span><ins>+#include &lt;ReplaceDeleteFromTextNodeCommand.cpp&gt;
+#include &lt;ReplaceInsertIntoTextNodeCommand.cpp&gt;
</ins><span class="cx"> #include &lt;ReplaceNodeWithSpanCommand.cpp&gt;
</span><span class="cx"> #include &lt;ReplaceSelectionCommand.cpp&gt;
</span><span class="cx"> #include &lt;SetNodeAttributeCommand.cpp&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/Editor.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -208,12 +208,12 @@
</span><span class="cx">             if (client()-&gt;performsTwoStepPaste(event-&gt;pastingFragment()))
</span><span class="cx">                 return true;
</span><span class="cx"> #endif
</span><del>-            replaceSelectionWithFragment(event-&gt;pastingFragment(), false, event-&gt;shouldSmartReplace(), event-&gt;shouldMatchStyle(), event-&gt;mailBlockquoteHandling());
</del><ins>+            replaceSelectionWithFragment(event-&gt;pastingFragment(), false, event-&gt;shouldSmartReplace(), event-&gt;shouldMatchStyle(), EditActionPaste, event-&gt;mailBlockquoteHandling());
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">         }
</span><span class="cx"> #endif
</span><span class="cx">         else 
</span><del>-            replaceSelectionWithText(event-&gt;data(), false, event-&gt;shouldSmartReplace());
</del><ins>+            replaceSelectionWithText(event-&gt;data(), false, event-&gt;shouldSmartReplace(), EditActionPaste);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -374,12 +374,12 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Editor::deleteSelectionWithSmartDelete(bool smartDelete)
</del><ins>+void Editor::deleteSelectionWithSmartDelete(bool smartDelete, EditAction editingAction)
</ins><span class="cx"> {
</span><span class="cx">     if (m_frame.selection().isNone())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    applyCommand(DeleteSelectionCommand::create(document(), smartDelete));
</del><ins>+    applyCommand(DeleteSelectionCommand::create(document(), smartDelete, true, false, false, true, editingAction));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Editor::clearText()
</span><span class="lines">@@ -520,7 +520,7 @@
</span><span class="cx">     return client()-&gt;shouldInsertNode(fragment.get(), replacingDOMRange.get(), givenAction);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Editor::replaceSelectionWithFragment(PassRefPtr&lt;DocumentFragment&gt; fragment, bool selectReplacement, bool smartReplace, bool matchStyle, MailBlockquoteHandling mailBlockquoteHandling)
</del><ins>+void Editor::replaceSelectionWithFragment(PassRefPtr&lt;DocumentFragment&gt; fragment, bool selectReplacement, bool smartReplace, bool matchStyle, EditAction editingAction, MailBlockquoteHandling mailBlockquoteHandling)
</ins><span class="cx"> {
</span><span class="cx">     VisibleSelection selection = m_frame.selection().selection();
</span><span class="cx">     if (selection.isNone() || !selection.isContentEditable() || !fragment)
</span><span class="lines">@@ -536,7 +536,7 @@
</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, EditActionPaste));
</del><ins>+    applyCommand(ReplaceSelectionCommand::create(document(), fragment, options, editingAction));
</ins><span class="cx">     revealSelectionAfterEditingOperation();
</span><span class="cx"> 
</span><span class="cx">     selection = m_frame.selection().selection();
</span><span class="lines">@@ -550,13 +550,13 @@
</span><span class="cx">     m_spellChecker-&gt;requestCheckingFor(SpellCheckRequest::create(resolveTextCheckingTypeMask(TextCheckingTypeSpelling | TextCheckingTypeGrammar), TextCheckingProcessBatch, rangeToCheck, rangeToCheck));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Editor::replaceSelectionWithText(const String&amp; text, bool selectReplacement, bool smartReplace)
</del><ins>+void Editor::replaceSelectionWithText(const String&amp; text, bool selectReplacement, bool smartReplace, EditAction editingAction)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;Range&gt; range = selectedRange();
</span><span class="cx">     if (!range)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    replaceSelectionWithFragment(createFragmentFromText(*range, text), selectReplacement, smartReplace, true);
</del><ins>+    replaceSelectionWithFragment(createFragmentFromText(*range, text), selectReplacement, smartReplace, true, editingAction);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;Range&gt; Editor::selectedRange()
</span><span class="lines">@@ -998,7 +998,8 @@
</span><span class="cx"> 
</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-&gt;isDictationCommand() ? FrameSelection::DictationTriggered : 0;
</span><del>-    changeSelectionAfterCommand(newSelection, options);
</del><ins>+    
+    changeSelectionAfterCommand(newSelection, options, cmd-&gt;applyEditType());
</ins><span class="cx">     dispatchEditableContentChangedEvents(composition-&gt;startingRootEditableElement(), composition-&gt;endingRootEditableElement());
</span><span class="cx"> 
</span><span class="cx">     updateEditorUINowIfScheduled();
</span><span class="lines">@@ -1029,7 +1030,7 @@
</span><span class="cx">     notifyTextFromControls(cmd-&gt;startingRootEditableElement(), cmd-&gt;endingRootEditableElement());
</span><span class="cx"> 
</span><span class="cx">     VisibleSelection newSelection(cmd-&gt;startingSelection());
</span><del>-    changeSelectionAfterCommand(newSelection, FrameSelection::defaultSetSelectionOptions());
</del><ins>+    changeSelectionAfterCommand(newSelection, FrameSelection::defaultSetSelectionOptions(), cmd-&gt;unapplyEditType());
</ins><span class="cx">     dispatchEditableContentChangedEvents(cmd-&gt;startingRootEditableElement(), cmd-&gt;endingRootEditableElement());
</span><span class="cx"> 
</span><span class="cx">     updateEditorUINowIfScheduled();
</span><span class="lines">@@ -1263,7 +1264,7 @@
</span><span class="cx"> 
</span><span class="cx">     didWriteSelectionToPasteboard();
</span><span class="cx">     if (action == CutAction)
</span><del>-        deleteSelectionWithSmartDelete(canSmartCopyOrDelete());
</del><ins>+        deleteSelectionWithSmartDelete(canSmartCopyOrDelete(), EditActionCut);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Editor::paste()
</span><span class="lines">@@ -2235,7 +2236,7 @@
</span><span class="cx"> 
</span><span class="cx">         if (!m_frame.editor().shouldInsertText(autocorrectedString, misspellingRange.get(), EditorInsertActionTyped))
</span><span class="cx">             return;
</span><del>-        m_frame.editor().replaceSelectionWithText(autocorrectedString, false, false);
</del><ins>+        m_frame.editor().replaceSelectionWithText(autocorrectedString, false, false, EditActionInsert);
</ins><span class="cx"> 
</span><span class="cx">         // Reset the charet one character further.
</span><span class="cx">         m_frame.selection().moveTo(m_frame.selection().selection().end());
</span><span class="lines">@@ -2581,7 +2582,7 @@
</span><span class="cx">     
</span><span class="cx">     m_alternativeTextController-&gt;recordAutocorrectionResponseReversed(replacedString, selection);
</span><span class="cx">     TextCheckingParagraph paragraph(selection);
</span><del>-    replaceSelectionWithText(replacedString, false, false);
</del><ins>+    replaceSelectionWithText(replacedString, false, false, EditActionInsert);
</ins><span class="cx">     RefPtr&lt;Range&gt; changedRange = paragraph.subrange(paragraph.checkingStart(), replacedString.length());
</span><span class="cx">     changedRange-&gt;startContainer()-&gt;document().markers().addMarker(changedRange.get(), DocumentMarker::Replacement, String());
</span><span class="cx">     m_alternativeTextController-&gt;markReversed(changedRange.get());
</span><span class="lines">@@ -2815,7 +2816,7 @@
</span><span class="cx">     // Insert the transposed characters.
</span><span class="cx">     if (!shouldInsertText(transposed, range.get(), EditorInsertActionTyped))
</span><span class="cx">         return;
</span><del>-    replaceSelectionWithText(transposed, false, false);
</del><ins>+    replaceSelectionWithText(transposed, false, false, EditActionInsert);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Editor::addToKillRing(Range* range, bool prepend)
</span><span class="lines">@@ -2847,7 +2848,7 @@
</span><span class="cx">     m_alternativeTextController-&gt;dismiss(ReasonForDismissingAlternativeTextIgnored);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Editor::changeSelectionAfterCommand(const VisibleSelection&amp; newSelection,  FrameSelection::SetSelectionOptions options)
</del><ins>+void Editor::changeSelectionAfterCommand(const VisibleSelection&amp; newSelection, FrameSelection::SetSelectionOptions options, AXTextStateChangeIntent intent)
</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">@@ -2859,7 +2860,7 @@
</span><span class="cx">     // See &lt;rdar://problem/5729315&gt; 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);
</del><ins>+        m_frame.selection().setSelection(newSelection, options, intent);
</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 (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/Editor.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -174,7 +174,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT bool deleteWithDirection(SelectionDirection, TextGranularity, bool killRing, bool isTypingAction);
</span><del>-    WEBCORE_EXPORT void deleteSelectionWithSmartDelete(bool smartDelete);
</del><ins>+    WEBCORE_EXPORT void deleteSelectionWithSmartDelete(bool smartDelete, EditAction = EditActionDelete);
</ins><span class="cx">     void clearText();
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     WEBCORE_EXPORT void removeUnchangeableStyles();
</span><span class="lines">@@ -382,8 +382,8 @@
</span><span class="cx">     void textDidChangeInTextArea(Element*);
</span><span class="cx">     WEBCORE_EXPORT WritingDirection baseWritingDirectionForSelectionStart() const;
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT void replaceSelectionWithFragment(PassRefPtr&lt;DocumentFragment&gt;, bool selectReplacement, bool smartReplace, bool matchStyle, MailBlockquoteHandling = MailBlockquoteHandling::RespectBlockquote);
-    WEBCORE_EXPORT void replaceSelectionWithText(const String&amp;, bool selectReplacement, bool smartReplace);
</del><ins>+    WEBCORE_EXPORT void replaceSelectionWithFragment(PassRefPtr&lt;DocumentFragment&gt;, bool selectReplacement, bool smartReplace, bool matchStyle, EditAction = EditActionInsert, MailBlockquoteHandling = MailBlockquoteHandling::RespectBlockquote);
+    WEBCORE_EXPORT void replaceSelectionWithText(const String&amp;, bool selectReplacement, bool smartReplace, EditAction = EditActionInsert);
</ins><span class="cx">     WEBCORE_EXPORT bool selectionStartHasMarkerFor(DocumentMarker::MarkerType, int from, int length) const;
</span><span class="cx">     void updateMarkersForWordsAffectedByEditing(bool onlyHandleWordsContainingSelection);
</span><span class="cx">     void deletedAutocorrectionAtPosition(const Position&amp;, const String&amp; originalString);
</span><span class="lines">@@ -468,7 +468,7 @@
</span><span class="cx">     enum SetCompositionMode { ConfirmComposition, CancelComposition };
</span><span class="cx">     void setComposition(const String&amp;, SetCompositionMode);
</span><span class="cx"> 
</span><del>-    void changeSelectionAfterCommand(const VisibleSelection&amp; newSelection, FrameSelection::SetSelectionOptions);
</del><ins>+    void changeSelectionAfterCommand(const VisibleSelection&amp; newSelection, FrameSelection::SetSelectionOptions, AXTextStateChangeIntent = AXTextStateChangeIntent());
</ins><span class="cx"> 
</span><span class="cx">     enum EditorActionSpecifier { CutAction, CopyAction };
</span><span class="cx">     void performCutOrCopy(EditorActionSpecifier);
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditorCommand.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditorCommand.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/EditorCommand.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -192,7 +192,7 @@
</span><span class="cx"> static bool executeInsertFragment(Frame&amp; frame, PassRefPtr&lt;DocumentFragment&gt; fragment)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(frame.document());
</span><del>-    applyCommand(ReplaceSelectionCommand::create(*frame.document(), fragment, ReplaceSelectionCommand::PreventNesting, EditActionUnspecified));
</del><ins>+    applyCommand(ReplaceSelectionCommand::create(*frame.document(), fragment, ReplaceSelectionCommand::PreventNesting, EditActionInsert));
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingFrameSelectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/FrameSelection.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/FrameSelection.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/FrameSelection.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;FrameSelection.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;AXObjectCache.h&quot;
</ins><span class="cx"> #include &quot;CharacterData.h&quot;
</span><span class="cx"> #include &quot;DeleteSelectionCommand.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="lines">@@ -139,7 +140,7 @@
</span><span class="cx"> void FrameSelection::moveTo(const VisiblePosition &amp;pos, EUserTriggered userTriggered, CursorAlignOnScroll align)
</span><span class="cx"> {
</span><span class="cx">     setSelection(VisibleSelection(pos.deepEquivalent(), pos.deepEquivalent(), pos.affinity(), m_selection.isDirectional()),
</span><del>-        defaultSetSelectionOptions(userTriggered), align);
</del><ins>+        defaultSetSelectionOptions(userTriggered), AXTextStateChangeIntent(), align);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void FrameSelection::moveTo(const VisiblePosition &amp;base, const VisiblePosition &amp;extent, EUserTriggered userTriggered)
</span><span class="lines">@@ -170,7 +171,8 @@
</span><span class="cx">     VisibleSelection newSelection;
</span><span class="cx">     newSelection.setWithoutValidation(base, extent);
</span><span class="cx">     newSelection.setIsDirectional(selectionHasDirection);
</span><del>-    setSelection(newSelection, defaultSetSelectionOptions() | (shouldSetFocus ? 0 : DoNotSetFocus));
</del><ins>+    AXTextStateChangeIntent intent(AXTextStateChangeTypeSelectionMove, AXTextSelection { AXTextSelectionDirectionDiscontiguous, AXTextSelectionGranularityUnknown });
+    setSelection(newSelection, defaultSetSelectionOptions() | (shouldSetFocus ? 0 : DoNotSetFocus), intent);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void DragCaretController::setCaretPosition(const VisiblePosition&amp; position)
</span><span class="lines">@@ -254,7 +256,13 @@
</span><span class="cx">     if (m_selection == newSelection || !shouldChangeSelection(newSelection))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    setSelection(newSelection, defaultSetSelectionOptions() | FireSelectEvent, AlignCursorOnScrollIfNeeded, granularity);
</del><ins>+    
+    AXTextStateChangeIntent intent;
+    if (AXObjectCache::accessibilityEnabled() &amp;&amp; newSelection.isCaret())
+        intent = AXTextStateChangeIntent(AXTextStateChangeTypeSelectionMove, AXTextSelection { AXTextSelectionDirectionDiscontiguous, AXTextSelectionGranularityUnknown });
+    else
+        intent = AXTextStateChangeIntent();
+    setSelection(newSelection, defaultSetSelectionOptions() | FireSelectEvent, intent, AlignCursorOnScrollIfNeeded, granularity);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool FrameSelection::setSelectionWithoutUpdatingAppearance(const VisibleSelection&amp; newSelectionPossiblyWithoutDirection, SetSelectionOptions options, CursorAlignOnScroll align, TextGranularity granularity)
</span><span class="lines">@@ -276,7 +284,7 @@
</span><span class="cx">     if (Document* newSelectionDocument = newSelection.base().document()) {
</span><span class="cx">         if (RefPtr&lt;Frame&gt; newSelectionFrame = newSelectionDocument-&gt;frame()) {
</span><span class="cx">             if (newSelectionFrame != m_frame &amp;&amp; newSelectionDocument != m_frame-&gt;document()) {
</span><del>-                newSelectionFrame-&gt;selection().setSelection(newSelection, options, align, granularity);
</del><ins>+                newSelectionFrame-&gt;selection().setSelection(newSelection, options, AXTextStateChangeIntent(), align, granularity);
</ins><span class="cx">                 // It's possible that during the above set selection, this FrameSelection has been modified by
</span><span class="cx">                 // selectFrameElementInParentIfFullySelected, but that the selection is no longer valid since
</span><span class="cx">                 // the frame is about to be destroyed. If this is the case, clear our selection.
</span><span class="lines">@@ -320,7 +328,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void FrameSelection::setSelection(const VisibleSelection&amp; selection, SetSelectionOptions options, CursorAlignOnScroll align, TextGranularity granularity)
</del><ins>+void FrameSelection::setSelection(const VisibleSelection&amp; selection, SetSelectionOptions options, AXTextStateChangeIntent intent, CursorAlignOnScroll align, TextGranularity granularity)
</ins><span class="cx"> {
</span><span class="cx">     if (!setSelectionWithoutUpdatingAppearance(selection, options, align, granularity))
</span><span class="cx">         return;
</span><span class="lines">@@ -341,7 +349,7 @@
</span><span class="cx">     if (frameView &amp;&amp; frameView-&gt;layoutPending())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    updateAndRevealSelection();
</del><ins>+    updateAndRevealSelection(intent);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void updateSelectionByUpdatingLayoutOrStyle(Frame&amp; frame)
</span><span class="lines">@@ -360,7 +368,7 @@
</span><span class="cx">         view-&gt;clearSelection();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void FrameSelection::updateAndRevealSelection()
</del><ins>+void FrameSelection::updateAndRevealSelection(const AXTextStateChangeIntent&amp; intent)
</ins><span class="cx"> {
</span><span class="cx">     if (!m_pendingSelectionUpdate)
</span><span class="cx">         return;
</span><span class="lines">@@ -380,7 +388,7 @@
</span><span class="cx">         revealSelection(alignment, RevealExtent);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    notifyAccessibilityForSelectionChange();
</del><ins>+    notifyAccessibilityForSelectionChange(intent);
</ins><span class="cx"> 
</span><span class="cx">     if (auto* client = m_frame-&gt;editor().client())
</span><span class="cx">         client-&gt;didChangeSelectionAndUpdateLayout();
</span><span class="lines">@@ -1021,8 +1029,76 @@
</span><span class="cx"> static bool isBoundary(TextGranularity granularity)
</span><span class="cx"> {
</span><span class="cx">     return granularity == LineBoundary || granularity == ParagraphBoundary || granularity == DocumentBoundary;
</span><del>-}    
</del><ins>+}
</ins><span class="cx"> 
</span><ins>+AXTextStateChangeIntent FrameSelection::textSelectionIntent(EAlteration alter, SelectionDirection direction, TextGranularity granularity)
+{
+    AXTextStateChangeIntent intent = AXTextStateChangeIntent();
+    bool flip = false;
+    if (alter == FrameSelection::AlterationMove) {
+        intent.type = AXTextStateChangeTypeSelectionMove;
+        flip = isRange() &amp;&amp; directionOfSelection() == RTL;
+    } else
+        intent.type = AXTextStateChangeTypeSelectionExtend;
+    switch (granularity) {
+    case CharacterGranularity:
+        intent.selection.granularity = AXTextSelectionGranularityCharacter;
+        break;
+    case WordGranularity:
+        intent.selection.granularity = AXTextSelectionGranularityWord;
+        break;
+    case SentenceGranularity:
+    case SentenceBoundary:
+        intent.selection.granularity = AXTextSelectionGranularitySentence;
+        break;
+    case LineGranularity:
+    case LineBoundary:
+        intent.selection.granularity = AXTextSelectionGranularityLine;
+        break;
+    case ParagraphGranularity:
+    case ParagraphBoundary:
+        intent.selection.granularity = AXTextSelectionGranularityParagraph;
+        break;
+    case DocumentGranularity:
+    case DocumentBoundary:
+        intent.selection.granularity = AXTextSelectionGranularityDocument;
+        break;
+    }
+    bool boundary = false;
+    switch (granularity) {
+    case CharacterGranularity:
+    case WordGranularity:
+    case SentenceGranularity:
+    case LineGranularity:
+    case ParagraphGranularity:
+    case DocumentGranularity:
+        break;
+    case SentenceBoundary:
+    case LineBoundary:
+    case ParagraphBoundary:
+    case DocumentBoundary:
+        boundary = true;
+        break;
+    }
+    switch (direction) {
+    case DirectionRight:
+    case DirectionForward:
+        if (boundary)
+            intent.selection.direction = flip ? AXTextSelectionDirectionBeginning : AXTextSelectionDirectionEnd;
+        else
+            intent.selection.direction = flip ? AXTextSelectionDirectionPrevious : AXTextSelectionDirectionNext;
+        break;
+    case DirectionLeft:
+    case DirectionBackward:
+        if (boundary)
+            intent.selection.direction = flip ? AXTextSelectionDirectionEnd : AXTextSelectionDirectionBeginning;
+        else
+            intent.selection.direction = flip ? AXTextSelectionDirectionNext : AXTextSelectionDirectionPrevious;
+        break;
+    }
+    return intent;
+}
+
</ins><span class="cx"> bool FrameSelection::modify(EAlteration alter, SelectionDirection direction, TextGranularity granularity, EUserTriggered userTriggered)
</span><span class="cx"> {
</span><span class="cx">     if (userTriggered == UserTriggered) {
</span><span class="lines">@@ -1077,6 +1153,11 @@
</span><span class="cx">         if (!wasRange &amp;&amp; alter == AlterationMove &amp;&amp; position == originalStartPosition)
</span><span class="cx">             return false;
</span><span class="cx"> 
</span><ins>+    if (m_frame &amp;&amp; AXObjectCache::accessibilityEnabled()) {
+        if (AXObjectCache* cache = m_frame-&gt;document()-&gt;existingAXObjectCache())
+            cache-&gt;setTextSelectionIntent(textSelectionIntent(alter, direction, granularity));
+    }
+
</ins><span class="cx">     // Some of the above operations set an xPosForVerticalArrowNavigation.
</span><span class="cx">     // Setting a selection will clear it, so save it to possibly restore later.
</span><span class="cx">     // Note: the START position type is arbitrary because it is unused, it would be
</span><span class="lines">@@ -1710,8 +1791,10 @@
</span><span class="cx"> 
</span><span class="cx">     VisibleSelection newSelection(VisibleSelection::selectionFromContentsOfNode(root.get()));
</span><span class="cx"> 
</span><del>-    if (shouldChangeSelection(newSelection))
-        setSelection(newSelection, defaultSetSelectionOptions() | FireSelectEvent);
</del><ins>+    if (shouldChangeSelection(newSelection)) {
+        AXTextStateChangeIntent intent(AXTextStateChangeTypeSelectionExtend, AXTextSelection { AXTextSelectionDirectionDiscontiguous, AXTextSelectionGranularityAll });
+        setSelection(newSelection, defaultSetSelectionOptions() | FireSelectEvent, intent);
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool FrameSelection::setSelectedRange(Range* range, EAffinity affinity, bool closeTyping)
</span><span class="lines">@@ -2145,7 +2228,7 @@
</span><span class="cx"> void FrameSelection::didLayout()
</span><span class="cx"> {
</span><span class="cx">     setCaretRectNeedsUpdate();
</span><del>-    updateAndRevealSelection();
</del><ins>+    updateAndRevealSelection(AXTextStateChangeIntent());
</ins><span class="cx">     updateDataDetectorsForSelection();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2423,7 +2506,7 @@
</span><span class="cx"> 
</span><span class="cx">     VisibleSelection newSelection = frameSelection.selection();
</span><span class="cx">     newSelection.expandUsingGranularity(WordGranularity);
</span><del>-    frameSelection.setSelection(newSelection, defaultSetSelectionOptions(), AlignCursorOnScrollIfNeeded, frameSelection.granularity());
</del><ins>+    frameSelection.setSelection(newSelection, defaultSetSelectionOptions(), AXTextStateChangeIntent(), AlignCursorOnScrollIfNeeded, frameSelection.granularity());
</ins><span class="cx"> 
</span><span class="cx">     Position startPos(frameSelection.selection().start());
</span><span class="cx">     Position endPos(frameSelection.selection().end());
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingFrameSelectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/FrameSelection.h (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/FrameSelection.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/FrameSelection.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #ifndef FrameSelection_h
</span><span class="cx"> #define FrameSelection_h
</span><span class="cx"> 
</span><ins>+#include &quot;AXTextStateChangeIntent.h&quot;
</ins><span class="cx"> #include &quot;EditingStyle.h&quot;
</span><span class="cx"> #include &quot;IntRect.h&quot;
</span><span class="cx"> #include &quot;LayoutRect.h&quot;
</span><span class="lines">@@ -144,7 +145,7 @@
</span><span class="cx">     void moveWithoutValidationTo(const Position&amp;, const Position&amp;, bool selectionHasDirection, bool shouldSetFocus);
</span><span class="cx"> 
</span><span class="cx">     const VisibleSelection&amp; selection() const { return m_selection; }
</span><del>-    WEBCORE_EXPORT void setSelection(const VisibleSelection&amp;, SetSelectionOptions = defaultSetSelectionOptions(), CursorAlignOnScroll = AlignCursorOnScrollIfNeeded, TextGranularity = CharacterGranularity);
</del><ins>+    WEBCORE_EXPORT void setSelection(const VisibleSelection&amp;, SetSelectionOptions = defaultSetSelectionOptions(), AXTextStateChangeIntent = AXTextStateChangeIntent(), CursorAlignOnScroll = AlignCursorOnScrollIfNeeded, TextGranularity = CharacterGranularity);
</ins><span class="cx">     WEBCORE_EXPORT bool setSelectedRange(Range*, EAffinity, bool closeTyping);
</span><span class="cx">     WEBCORE_EXPORT void selectAll();
</span><span class="cx">     WEBCORE_EXPORT void clear();
</span><span class="lines">@@ -272,7 +273,7 @@
</span><span class="cx"> private:
</span><span class="cx">     enum EPositionType { START, END, BASE, EXTENT };
</span><span class="cx"> 
</span><del>-    void updateAndRevealSelection();
</del><ins>+    void updateAndRevealSelection(const AXTextStateChangeIntent&amp;);
</ins><span class="cx">     void updateDataDetectorsForSelection();
</span><span class="cx"> 
</span><span class="cx">     bool setSelectionWithoutUpdatingAppearance(const VisibleSelection&amp;, SetSelectionOptions, CursorAlignOnScroll, TextGranularity);
</span><span class="lines">@@ -297,10 +298,11 @@
</span><span class="cx"> 
</span><span class="cx">     LayoutUnit lineDirectionPointForBlockDirectionNavigation(EPositionType);
</span><span class="cx"> 
</span><ins>+    AXTextStateChangeIntent textSelectionIntent(EAlteration, SelectionDirection, TextGranularity);
</ins><span class="cx"> #if HAVE(ACCESSIBILITY)
</span><del>-    void notifyAccessibilityForSelectionChange();
</del><ins>+    void notifyAccessibilityForSelectionChange(const AXTextStateChangeIntent&amp;);
</ins><span class="cx"> #else
</span><del>-    void notifyAccessibilityForSelectionChange() { }
</del><ins>+    void notifyAccessibilityForSelectionChange(const AXTextStateChangeIntent&amp;) { }
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void updateSelectionCachesIfSelectionIsInsideTextFormControl(EUserTriggered);
</span><span class="lines">@@ -367,7 +369,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if !(PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(EFL))
</span><span class="cx"> #if HAVE(ACCESSIBILITY)
</span><del>-inline void FrameSelection::notifyAccessibilityForSelectionChange()
</del><ins>+inline void FrameSelection::notifyAccessibilityForSelectionChange(const AXTextStateChangeIntent&amp;)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertIntoTextNodeCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -39,8 +39,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-InsertIntoTextNodeCommand::InsertIntoTextNodeCommand(PassRefPtr&lt;Text&gt; node, unsigned offset, const String&amp; text)
-    : SimpleEditCommand(node-&gt;document())
</del><ins>+InsertIntoTextNodeCommand::InsertIntoTextNodeCommand(RefPtr&lt;Text&gt;&amp;&amp; node, unsigned offset, const String&amp; text, EditAction editingAction)
+    : SimpleEditCommand(node-&gt;document(), editingAction)
</ins><span class="cx">     , m_node(node)
</span><span class="cx">     , m_offset(offset)
</span><span class="cx">     , m_text(text)
</span><span class="lines">@@ -66,8 +66,8 @@
</span><span class="cx"> 
</span><span class="cx">     m_node-&gt;insertData(m_offset, m_text, IGNORE_EXCEPTION);
</span><span class="cx"> 
</span><del>-    if (AXObjectCache* cache = document().existingAXObjectCache())
-        cache-&gt;nodeTextChangeNotification(m_node.get(), AXObjectCache::AXTextInserted, m_offset, m_text);
</del><ins>+    if (AXObjectCache::accessibilityEnabled())
+        notifyAccessibilityForTextChange(m_node.get(), applyEditType(), m_text, VisiblePosition(Position(m_node, m_offset)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="lines">@@ -84,8 +84,8 @@
</span><span class="cx">         return;
</span><span class="cx">         
</span><span class="cx">     // Need to notify this before actually deleting the text
</span><del>-    if (AXObjectCache* cache = document().existingAXObjectCache())
-        cache-&gt;nodeTextChangeNotification(m_node.get(), AXObjectCache::AXTextDeleted, m_offset, m_text);
</del><ins>+    if (AXObjectCache::accessibilityEnabled())
+        notifyAccessibilityForTextChange(m_node.get(), unapplyEditType(), m_text, VisiblePosition(Position(m_node, m_offset)));
</ins><span class="cx"> 
</span><span class="cx">     m_node-&gt;deleteData(m_offset, m_text.length(), IGNORE_EXCEPTION);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertIntoTextNodeCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.h (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -34,14 +34,17 @@
</span><span class="cx"> 
</span><span class="cx"> class InsertIntoTextNodeCommand : public SimpleEditCommand {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;InsertIntoTextNodeCommand&gt; create(PassRefPtr&lt;Text&gt; node, unsigned offset, const String&amp; text)
</del><ins>+    static Ref&lt;InsertIntoTextNodeCommand&gt; create(RefPtr&lt;Text&gt;&amp;&amp; node, unsigned offset, const String&amp; text, EditAction editingAction = EditActionInsert)
</ins><span class="cx">     {
</span><del>-        return adoptRef(*new InsertIntoTextNodeCommand(node, offset, text));
</del><ins>+        return adoptRef(*new InsertIntoTextNodeCommand(WTF::move(node), offset, text, editingAction));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    const String&amp; insertedText();
+
+protected:
+    InsertIntoTextNodeCommand(RefPtr&lt;Text&gt;&amp;&amp; node, unsigned offset, const String&amp; text, EditAction editingAction);
+
</ins><span class="cx"> private:
</span><del>-    InsertIntoTextNodeCommand(PassRefPtr&lt;Text&gt; node, unsigned offset, const String&amp; text);
-
</del><span class="cx">     virtual void doApply() override;
</span><span class="cx">     virtual void doUnapply() override;
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="lines">@@ -57,6 +60,11 @@
</span><span class="cx">     String m_text;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+inline const String&amp; InsertIntoTextNodeCommand::insertedText()
+{
+    return m_text;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // InsertIntoTextNodeCommand_h
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertNodeBeforeCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertNodeBeforeCommand.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertNodeBeforeCommand.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/InsertNodeBeforeCommand.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -29,13 +29,13 @@
</span><span class="cx"> #include &quot;AXObjectCache.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;ExceptionCodePlaceholder.h&quot;
</span><ins>+#include &quot;Text.h&quot;
</ins><span class="cx"> #include &quot;htmlediting.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-InsertNodeBeforeCommand::InsertNodeBeforeCommand(PassRefPtr&lt;Node&gt; insertChild, PassRefPtr&lt;Node&gt; refChild,
-    ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable)
-    : SimpleEditCommand(refChild-&gt;document())
</del><ins>+InsertNodeBeforeCommand::InsertNodeBeforeCommand(RefPtr&lt;Node&gt;&amp;&amp; insertChild, RefPtr&lt;Node&gt;&amp;&amp; refChild, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable, EditAction editingAction)
+    : SimpleEditCommand(refChild-&gt;document(), editingAction)
</ins><span class="cx">     , m_insertChild(insertChild)
</span><span class="cx">     , m_refChild(refChild)
</span><span class="cx">     , m_shouldAssumeContentIsAlwaysEditable(shouldAssumeContentIsAlwaysEditable)
</span><span class="lines">@@ -57,8 +57,10 @@
</span><span class="cx"> 
</span><span class="cx">     parent-&gt;insertBefore(m_insertChild.get(), m_refChild.get(), IGNORE_EXCEPTION);
</span><span class="cx"> 
</span><del>-    if (AXObjectCache* cache = document().existingAXObjectCache())
-        cache-&gt;nodeTextChangeNotification(m_insertChild.get(), AXObjectCache::AXTextInserted, 0, m_insertChild-&gt;nodeValue());
</del><ins>+    if (AXObjectCache::accessibilityEnabled()) {
+        Position position = is&lt;Text&gt;(m_insertChild.get()) ? Position(downcast&lt;Text&gt;(m_insertChild.get()), 0) : createLegacyEditingPosition(m_insertChild.get(), 0);
+        notifyAccessibilityForTextChange(m_insertChild.get(), applyEditType(), m_insertChild-&gt;nodeValue(), VisiblePosition(position));
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InsertNodeBeforeCommand::doUnapply()
</span><span class="lines">@@ -67,8 +69,10 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // Need to notify this before actually deleting the text
</span><del>-    if (AXObjectCache* cache = document().existingAXObjectCache())
-        cache-&gt;nodeTextChangeNotification(m_insertChild.get(), AXObjectCache::AXTextDeleted, 0, m_insertChild-&gt;nodeValue());
</del><ins>+    if (AXObjectCache::accessibilityEnabled()) {
+        Position position = is&lt;Text&gt;(m_insertChild.get()) ? Position(downcast&lt;Text&gt;(m_insertChild.get()), 0) : createLegacyEditingPosition(m_insertChild.get(), 0);
+        notifyAccessibilityForTextChange(m_insertChild.get(), unapplyEditType(), m_insertChild-&gt;nodeValue(), VisiblePosition(position));
+    }
</ins><span class="cx"> 
</span><span class="cx">     m_insertChild-&gt;remove(IGNORE_EXCEPTION);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertNodeBeforeCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertNodeBeforeCommand.h (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertNodeBeforeCommand.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/InsertNodeBeforeCommand.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -32,22 +32,23 @@
</span><span class="cx"> 
</span><span class="cx"> class InsertNodeBeforeCommand : public SimpleEditCommand {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;InsertNodeBeforeCommand&gt; create(PassRefPtr&lt;Node&gt; childToInsert, PassRefPtr&lt;Node&gt; childToInsertBefore,
-        ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable)
</del><ins>+    static Ref&lt;InsertNodeBeforeCommand&gt; create(RefPtr&lt;Node&gt;&amp;&amp; childToInsert, RefPtr&lt;Node&gt;&amp;&amp; childToInsertBefore,
+        ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable, EditAction editingAction = EditActionInsert)
</ins><span class="cx">     {
</span><del>-        return adoptRef(*new InsertNodeBeforeCommand(childToInsert, childToInsertBefore, shouldAssumeContentIsAlwaysEditable));
</del><ins>+        return adoptRef(*new InsertNodeBeforeCommand(WTF::move(childToInsert), WTF::move(childToInsertBefore), shouldAssumeContentIsAlwaysEditable, editingAction));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+protected:
+    InsertNodeBeforeCommand(RefPtr&lt;Node&gt;&amp;&amp; childToInsert, RefPtr&lt;Node&gt;&amp;&amp; childToInsertBefore, ShouldAssumeContentIsAlwaysEditable, EditAction);
+
</ins><span class="cx"> private:
</span><del>-    InsertNodeBeforeCommand(PassRefPtr&lt;Node&gt; childToInsert, PassRefPtr&lt;Node&gt; childToInsertBefore, ShouldAssumeContentIsAlwaysEditable);
-
</del><span class="cx">     virtual void doApply() override;
</span><span class="cx">     virtual void doUnapply() override;
</span><del>-    
</del><ins>+
</ins><span class="cx"> #ifndef NDEBUG
</span><span class="cx">     virtual void getNodesInCommand(HashSet&lt;Node*&gt;&amp;) override;
</span><span class="cx"> #endif
</span><del>-    
</del><ins>+
</ins><span class="cx">     RefPtr&lt;Node&gt; m_insertChild;
</span><span class="cx">     RefPtr&lt;Node&gt; m_refChild;
</span><span class="cx">     ShouldAssumeContentIsAlwaysEditable m_shouldAssumeContentIsAlwaysEditable;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertParagraphSeparatorCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -59,8 +59,8 @@
</span><span class="cx">     return curBlock;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand(Document&amp; document, bool mustUseDefaultParagraphElement, bool pasteBlockqutoeIntoUnquotedArea)
-    : CompositeEditCommand(document)
</del><ins>+InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand(Document&amp; document, bool mustUseDefaultParagraphElement, bool pasteBlockqutoeIntoUnquotedArea, EditAction editingAction)
+    : CompositeEditCommand(document, editingAction)
</ins><span class="cx">     , m_mustUseDefaultParagraphElement(mustUseDefaultParagraphElement)
</span><span class="cx">     , m_pasteBlockqutoeIntoUnquotedArea(pasteBlockqutoeIntoUnquotedArea)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertParagraphSeparatorCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.h (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -34,13 +34,13 @@
</span><span class="cx"> 
</span><span class="cx"> class InsertParagraphSeparatorCommand : public CompositeEditCommand {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;InsertParagraphSeparatorCommand&gt; create(Document&amp; document, bool useDefaultParagraphElement = false, bool pasteBlockqutoeIntoUnquotedArea = false)
</del><ins>+    static Ref&lt;InsertParagraphSeparatorCommand&gt; create(Document&amp; document, bool useDefaultParagraphElement = false, bool pasteBlockqutoeIntoUnquotedArea = false, EditAction editingAction = EditActionInsert)
</ins><span class="cx">     {
</span><del>-        return adoptRef(*new InsertParagraphSeparatorCommand(document, useDefaultParagraphElement, pasteBlockqutoeIntoUnquotedArea));
</del><ins>+        return adoptRef(*new InsertParagraphSeparatorCommand(document, useDefaultParagraphElement, pasteBlockqutoeIntoUnquotedArea, editingAction));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    InsertParagraphSeparatorCommand(Document&amp;, bool useDefaultParagraphElement, bool pasteBlockqutoeIntoUnquotedArea);
</del><ins>+    InsertParagraphSeparatorCommand(Document&amp;, bool useDefaultParagraphElement, bool pasteBlockqutoeIntoUnquotedArea, EditAction);
</ins><span class="cx"> 
</span><span class="cx">     virtual void doApply();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertTextCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertTextCommand.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertTextCommand.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/InsertTextCommand.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -37,16 +37,16 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-InsertTextCommand::InsertTextCommand(Document&amp; document, const String&amp; text, bool selectInsertedText, RebalanceType rebalanceType)
-    : CompositeEditCommand(document)
</del><ins>+InsertTextCommand::InsertTextCommand(Document&amp; document, const String&amp; text, bool selectInsertedText, RebalanceType rebalanceType, EditAction editingAction)
+    : CompositeEditCommand(document, editingAction)
</ins><span class="cx">     , m_text(text)
</span><span class="cx">     , m_selectInsertedText(selectInsertedText)
</span><span class="cx">     , m_rebalanceType(rebalanceType)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-InsertTextCommand::InsertTextCommand(Document&amp; document, const String&amp; text, PassRefPtr&lt;TextInsertionMarkerSupplier&gt; markerSupplier)
-    : CompositeEditCommand(document)
</del><ins>+InsertTextCommand::InsertTextCommand(Document&amp; document, const String&amp; text, PassRefPtr&lt;TextInsertionMarkerSupplier&gt; markerSupplier, EditAction editingAction)
+    : CompositeEditCommand(document, editingAction)
</ins><span class="cx">     , m_text(text)
</span><span class="cx">     , m_selectInsertedText(false)
</span><span class="cx">     , m_rebalanceType(RebalanceLeadingAndTrailingWhitespaces)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertTextCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertTextCommand.h (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertTextCommand.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/InsertTextCommand.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -49,21 +49,22 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     static Ref&lt;InsertTextCommand&gt; create(Document&amp; document, const String&amp; text, bool selectInsertedText = false,
</span><del>-        RebalanceType rebalanceType = RebalanceLeadingAndTrailingWhitespaces)
</del><ins>+        RebalanceType rebalanceType = RebalanceLeadingAndTrailingWhitespaces, EditAction editingAction = EditActionInsert)
</ins><span class="cx">     {
</span><del>-        return adoptRef(*new InsertTextCommand(document, text, selectInsertedText, rebalanceType));
</del><ins>+        return adoptRef(*new InsertTextCommand(document, text, selectInsertedText, rebalanceType, editingAction));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    static Ref&lt;InsertTextCommand&gt; createWithMarkerSupplier(Document&amp; document, const String&amp; text, PassRefPtr&lt;TextInsertionMarkerSupplier&gt; markerSupplier)
</del><ins>+    static Ref&lt;InsertTextCommand&gt; createWithMarkerSupplier(Document&amp; document, const String&amp; text, PassRefPtr&lt;TextInsertionMarkerSupplier&gt; markerSupplier, EditAction editingAction = EditActionInsert)
</ins><span class="cx">     {
</span><del>-        return adoptRef(*new InsertTextCommand(document, text, markerSupplier));
</del><ins>+        return adoptRef(*new InsertTextCommand(document, text, markerSupplier, editingAction));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+protected:
+    InsertTextCommand(Document&amp;, const String&amp; text, PassRefPtr&lt;TextInsertionMarkerSupplier&gt;, EditAction);
+    InsertTextCommand(Document&amp;, const String&amp; text, bool selectInsertedText, RebalanceType, EditAction);
+
</ins><span class="cx"> private:
</span><span class="cx"> 
</span><del>-    InsertTextCommand(Document&amp;, const String&amp; text, bool selectInsertedText, RebalanceType);
-    InsertTextCommand(Document&amp;, const String&amp; text, PassRefPtr&lt;TextInsertionMarkerSupplier&gt;);
-
</del><span class="cx">     void deleteCharacter();
</span><span class="cx"> 
</span><span class="cx">     virtual void doApply();
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingMoveSelectionCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/MoveSelectionCommand.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/MoveSelectionCommand.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/MoveSelectionCommand.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx">     ReplaceSelectionCommand::CommandOptions options = ReplaceSelectionCommand::SelectReplacement | ReplaceSelectionCommand::PreventNesting;
</span><span class="cx">     if (m_smartInsert)
</span><span class="cx">         options |= ReplaceSelectionCommand::SmartReplace;
</span><del>-    applyCommandToComposite(ReplaceSelectionCommand::create(document(), m_fragment, options));
</del><ins>+    applyCommandToComposite(ReplaceSelectionCommand::create(document(), WTF::move(m_fragment), options));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EditAction MoveSelectionCommand::editingAction() const
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingRemoveNodePreservingChildrenCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/RemoveNodePreservingChildrenCommand.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/RemoveNodePreservingChildrenCommand.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/RemoveNodePreservingChildrenCommand.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -31,8 +31,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand(PassRefPtr&lt;Node&gt; node, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable)
-    : CompositeEditCommand(node-&gt;document())
</del><ins>+RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand(PassRefPtr&lt;Node&gt; node, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable, EditAction editingAction)
+    : CompositeEditCommand(node-&gt;document(), editingAction)
</ins><span class="cx">     , m_node(node)
</span><span class="cx">     , m_shouldAssumeContentIsAlwaysEditable(shouldAssumeContentIsAlwaysEditable)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingRemoveNodePreservingChildrenCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/RemoveNodePreservingChildrenCommand.h (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/RemoveNodePreservingChildrenCommand.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/RemoveNodePreservingChildrenCommand.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -32,13 +32,13 @@
</span><span class="cx"> 
</span><span class="cx"> class RemoveNodePreservingChildrenCommand : public CompositeEditCommand {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;RemoveNodePreservingChildrenCommand&gt; create(PassRefPtr&lt;Node&gt; node, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable)
</del><ins>+    static Ref&lt;RemoveNodePreservingChildrenCommand&gt; create(PassRefPtr&lt;Node&gt; node, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable, EditAction editingAction)
</ins><span class="cx">     {
</span><del>-        return adoptRef(*new RemoveNodePreservingChildrenCommand(node, shouldAssumeContentIsAlwaysEditable));
</del><ins>+        return adoptRef(*new RemoveNodePreservingChildrenCommand(node, shouldAssumeContentIsAlwaysEditable, editingAction));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    explicit RemoveNodePreservingChildrenCommand(PassRefPtr&lt;Node&gt;, ShouldAssumeContentIsAlwaysEditable);
</del><ins>+    explicit RemoveNodePreservingChildrenCommand(PassRefPtr&lt;Node&gt;, ShouldAssumeContentIsAlwaysEditable, EditAction);
</ins><span class="cx"> 
</span><span class="cx">     virtual void doApply();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceDeleteFromTextNodeCommandcppfromrev183367trunkSourceWebCoreeditingAppendNodeCommandh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/editing/ReplaceDeleteFromTextNodeCommand.cpp (from rev 183367, trunk/Source/WebCore/editing/AppendNodeCommand.h) (0 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceDeleteFromTextNodeCommand.cpp                                (rev 0)
+++ trunk/Source/WebCore/editing/ReplaceDeleteFromTextNodeCommand.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+/*
+ * 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 &quot;config.h&quot;
+#include &quot;ReplaceDeleteFromTextNodeCommand.h&quot;
+
+#include &quot;Text.h&quot;
+
+namespace WebCore {
+    
+ReplaceDeleteFromTextNodeCommand::ReplaceDeleteFromTextNodeCommand(RefPtr&lt;Text&gt;&amp;&amp; text, unsigned offset, unsigned count)
+    : DeleteFromTextNodeCommand(WTF::move(text), offset, count, EditActionDelete)
+{
+}
+
+void ReplaceDeleteFromTextNodeCommand::notifyAccessibilityForTextChange(Node*, AXTextEditType, const String&amp;, const VisiblePosition&amp;)
+{
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceDeleteFromTextNodeCommandhfromrev183367trunkSourceWebCoreeditingAppendNodeCommandh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/editing/ReplaceDeleteFromTextNodeCommand.h (from rev 183367, trunk/Source/WebCore/editing/AppendNodeCommand.h) (0 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceDeleteFromTextNodeCommand.h                                (rev 0)
+++ trunk/Source/WebCore/editing/ReplaceDeleteFromTextNodeCommand.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+/*
+ * 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 &quot;DeleteFromTextNodeCommand.h&quot;
+
+namespace WebCore {
+
+class ReplaceDeleteFromTextNodeCommand final : public DeleteFromTextNodeCommand {
+public:
+    static Ref&lt;ReplaceDeleteFromTextNodeCommand&gt; create(RefPtr&lt;Text&gt;&amp;&amp; text, unsigned offset, unsigned count)
+    {
+        return adoptRef(*new ReplaceDeleteFromTextNodeCommand(WTF::move(text), offset, count));
+    }
+
+private:
+    ReplaceDeleteFromTextNodeCommand(RefPtr&lt;Text&gt;&amp;&amp;, unsigned, unsigned);
+    virtual void notifyAccessibilityForTextChange(Node*, AXTextEditType, const String&amp;, const VisiblePosition&amp;) override;
+};
+
+} // namespace WebCore
+
+#endif // ReplaceDeleteFromTextNodeCommand_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceInsertIntoTextNodeCommandcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/editing/ReplaceInsertIntoTextNodeCommand.cpp (0 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceInsertIntoTextNodeCommand.cpp                                (rev 0)
+++ trunk/Source/WebCore/editing/ReplaceInsertIntoTextNodeCommand.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+/*
+ * 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 &quot;config.h&quot;
+#include &quot;ReplaceInsertIntoTextNodeCommand.h&quot;
+
+#include &quot;AXObjectCache.h&quot;
+#include &quot;Document.h&quot;
+#include &quot;Text.h&quot;
+
+namespace WebCore {
+
+ReplaceInsertIntoTextNodeCommand::ReplaceInsertIntoTextNodeCommand(RefPtr&lt;Text&gt;&amp;&amp; node, unsigned offset, const String&amp; text, const String&amp; deletedText, EditAction editingAction)
+    : InsertIntoTextNodeCommand(WTF::move(node), offset, text, editingAction)
+    , m_deletedText(deletedText)
+{
+}
+
+void ReplaceInsertIntoTextNodeCommand::notifyAccessibilityForTextChange(Node* node, AXTextEditType type, const String&amp; text, const VisiblePosition&amp; position)
+{
+    if (!AXObjectCache::accessibilityEnabled())
+        return;
+    AXObjectCache* cache = document().existingAXObjectCache();
+    if (!cache)
+        return;
+    switch (type) {
+    case AXTextEditTypeUnknown:
+        break;
+    case AXTextEditTypeCut:
+    case AXTextEditTypeDictation:
+        ASSERT_NOT_REACHED();
+        break;
+    case AXTextEditTypeDelete:
+        cache-&gt;postTextReplacementNotification(node, AXTextEditTypeDelete, text, AXTextEditTypeInsert, m_deletedText, position);
+        break;
+    case AXTextEditTypeInsert:
+    case AXTextEditTypePaste:
+    case AXTextEditTypeTyping:
+        cache-&gt;postTextReplacementNotification(node, AXTextEditTypeDelete, m_deletedText, type, text, position);
+        break;
+    }
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceInsertIntoTextNodeCommandhfromrev183367trunkSourceWebCoreeditingRemoveNodePreservingChildrenCommandh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/editing/ReplaceInsertIntoTextNodeCommand.h (from rev 183367, trunk/Source/WebCore/editing/RemoveNodePreservingChildrenCommand.h) (0 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceInsertIntoTextNodeCommand.h                                (rev 0)
+++ trunk/Source/WebCore/editing/ReplaceInsertIntoTextNodeCommand.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * 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 &quot;InsertIntoTextNodeCommand.h&quot;
+
+namespace WebCore {
+
+class ReplaceInsertIntoTextNodeCommand final : public InsertIntoTextNodeCommand {
+public:
+    static Ref&lt;ReplaceInsertIntoTextNodeCommand&gt; create(RefPtr&lt;Text&gt;&amp;&amp; node, unsigned offset, const String&amp; text, const String&amp; deletedText, EditAction editingAction)
+    {
+        return adoptRef(*new ReplaceInsertIntoTextNodeCommand(WTF::move(node), offset, text, deletedText, editingAction));
+    }
+
+private:
+    ReplaceInsertIntoTextNodeCommand(RefPtr&lt;Text&gt;&amp;&amp;, unsigned, const String&amp;, const String&amp;, EditAction);
+    virtual void notifyAccessibilityForTextChange(Node*, AXTextEditType, const String&amp;, const VisiblePosition&amp;) override;
+
+    String m_deletedText;
+};
+
+} // namespace WebCore
+
+#endif // ReplaceInsertIntoTextNodeCommand_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceSelectionCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -47,6 +47,8 @@
</span><span class="cx"> #include &quot;RenderInline.h&quot;
</span><span class="cx"> #include &quot;RenderObject.h&quot;
</span><span class="cx"> #include &quot;RenderText.h&quot;
</span><ins>+#include &quot;ReplaceDeleteFromTextNodeCommand.h&quot;
+#include &quot;ReplaceInsertIntoTextNodeCommand.h&quot;
</ins><span class="cx"> #include &quot;SimplifyMarkupCommand.h&quot;
</span><span class="cx"> #include &quot;SmartReplace.h&quot;
</span><span class="cx"> #include &quot;StyleProperties.h&quot;
</span><span class="lines">@@ -368,15 +370,14 @@
</span><span class="cx">         m_lastNodeInserted = newNode;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ReplaceSelectionCommand::ReplaceSelectionCommand(Document&amp; document, PassRefPtr&lt;DocumentFragment&gt; fragment, CommandOptions options, EditAction editAction)
-    : CompositeEditCommand(document)
</del><ins>+ReplaceSelectionCommand::ReplaceSelectionCommand(Document&amp; document, RefPtr&lt;DocumentFragment&gt;&amp;&amp; fragment, CommandOptions options, EditAction editAction)
+    : CompositeEditCommand(document, editAction)
</ins><span class="cx">     , m_selectReplacement(options &amp; SelectReplacement)
</span><span class="cx">     , m_smartReplace(options &amp; SmartReplace)
</span><span class="cx">     , m_matchStyle(options &amp; MatchStyle)
</span><span class="cx">     , m_documentFragment(fragment)
</span><span class="cx">     , m_preventNesting(options &amp; PreventNesting)
</span><span class="cx">     , m_movingParagraph(options &amp; MovingParagraph)
</span><del>-    , m_editAction(editAction)
</del><span class="cx">     , m_sanitizeFragment(options &amp; SanitizeFragment)
</span><span class="cx">     , m_shouldMergeEnd(false)
</span><span class="cx">     , m_ignoreMailBlockquote(options &amp; IgnoreMailBlockquote)
</span><span class="lines">@@ -1427,11 +1428,6 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-EditAction ReplaceSelectionCommand::editingAction() const
-{
-    return m_editAction;
-}
-
</del><span class="cx"> // If the user is inserting a list into an existing list, instead of nesting the list,
</span><span class="cx"> // we put the list items into the existing list.
</span><span class="cx"> Node* ReplaceSelectionCommand::insertAsListItems(PassRefPtr&lt;HTMLElement&gt; prpListElement, Node* insertionBlock, const Position&amp; insertPos, InsertedNodes&amp; insertedNodes)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceSelectionCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ReplaceSelectionCommand.h (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceSelectionCommand.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/ReplaceSelectionCommand.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -48,17 +48,16 @@
</span><span class="cx"> 
</span><span class="cx">     typedef unsigned CommandOptions;
</span><span class="cx"> 
</span><del>-    static Ref&lt;ReplaceSelectionCommand&gt; create(Document&amp; document, PassRefPtr&lt;DocumentFragment&gt; fragment, CommandOptions options, EditAction action = EditActionPaste)
</del><ins>+    static Ref&lt;ReplaceSelectionCommand&gt; create(Document&amp; document, RefPtr&lt;DocumentFragment&gt;&amp;&amp; fragment, CommandOptions options, EditAction editingAction = EditActionInsert)
</ins><span class="cx">     {
</span><del>-        return adoptRef(*new ReplaceSelectionCommand(document, fragment, options, action));
</del><ins>+        return adoptRef(*new ReplaceSelectionCommand(document, WTF::move(fragment), options, editingAction));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    ReplaceSelectionCommand(Document&amp;, PassRefPtr&lt;DocumentFragment&gt;, CommandOptions, EditAction);
</del><ins>+    ReplaceSelectionCommand(Document&amp;, RefPtr&lt;DocumentFragment&gt;&amp;&amp;, CommandOptions, EditAction);
</ins><span class="cx"> 
</span><span class="cx">     virtual void doApply();
</span><del>-    virtual EditAction editingAction() const;
-    
</del><ins>+
</ins><span class="cx">     class InsertedNodes {
</span><span class="cx">     public:
</span><span class="cx">         void respondToNodeInsertion(Node*);
</span><span class="lines">@@ -120,7 +119,6 @@
</span><span class="cx">     RefPtr&lt;DocumentFragment&gt; m_documentFragment;
</span><span class="cx">     bool m_preventNesting;
</span><span class="cx">     bool m_movingParagraph;
</span><del>-    EditAction m_editAction;
</del><span class="cx">     bool m_sanitizeFragment;
</span><span class="cx">     bool m_shouldMergeEnd;
</span><span class="cx">     bool m_ignoreMailBlockquote;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTypingCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TypingCommand.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TypingCommand.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/TypingCommand.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -374,7 +374,7 @@
</span><span class="cx"> void TypingCommand::insertTextRunWithoutNewlines(const String &amp;text, bool selectInsertedText)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;InsertTextCommand&gt; command = InsertTextCommand::create(document(), text, selectInsertedText,
</span><del>-        m_compositionType == TextCompositionNone ? InsertTextCommand::RebalanceLeadingAndTrailingWhitespaces : InsertTextCommand::RebalanceAllWhitespaces);
</del><ins>+        m_compositionType == TextCompositionNone ? InsertTextCommand::RebalanceLeadingAndTrailingWhitespaces : InsertTextCommand::RebalanceAllWhitespaces, EditActionTyping);
</ins><span class="cx"> 
</span><span class="cx">     applyCommandToComposite(command, endingSelection());
</span><span class="cx"> 
</span><span class="lines">@@ -395,7 +395,7 @@
</span><span class="cx">     if (!canAppendNewLineFeedToSelection(endingSelection()))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    applyCommandToComposite(InsertParagraphSeparatorCommand::create(document()));
</del><ins>+    applyCommandToComposite(InsertParagraphSeparatorCommand::create(document(), false, false, EditActionTyping));
</ins><span class="cx">     typingAddedToOpenCommand(InsertParagraphSeparator);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingatkFrameSelectionAtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/atk/FrameSelectionAtk.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/atk/FrameSelectionAtk.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/atk/FrameSelectionAtk.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-void FrameSelection::notifyAccessibilityForSelectionChange()
</del><ins>+void FrameSelection::notifyAccessibilityForSelectionChange(const AXTextStateChangeIntent&amp;)
</ins><span class="cx"> {
</span><span class="cx">     if (!AXObjectCache::accessibilityEnabled())
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingiosDictationCommandIOScpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ios/DictationCommandIOS.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ios/DictationCommandIOS.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/ios/DictationCommandIOS.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> DictationCommandIOS::DictationCommandIOS(Document&amp; document, Vector&lt;Vector&lt;String&gt;&gt;&amp;&amp; dictationPhrases, RetainPtr&lt;id&gt; metadata)
</span><del>-    : CompositeEditCommand(document)
</del><ins>+    : CompositeEditCommand(document, EditActionDictation)
</ins><span class="cx">     , m_dictationPhrases(WTF::move(dictationPhrases))
</span><span class="cx">     , m_metadata(WTF::move(metadata))
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingiosDictationCommandIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ios/DictationCommandIOS.h (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ios/DictationCommandIOS.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/ios/DictationCommandIOS.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -44,7 +44,6 @@
</span><span class="cx">     DictationCommandIOS(Document&amp;, Vector&lt;Vector&lt;String&gt;&gt;&amp;&amp; dictationPhrases, RetainPtr&lt;id&gt; metadata);
</span><span class="cx"> 
</span><span class="cx">     virtual void doApply() override;
</span><del>-    virtual EditAction editingAction() const override { return EditActionDictation; }
</del><span class="cx"> 
</span><span class="cx">     Vector&lt;Vector&lt;String&gt;&gt; m_dictationPhrases;
</span><span class="cx">     RetainPtr&lt;id&gt; m_metadata;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingmacFrameSelectionMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/mac/FrameSelectionMac.mm (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/mac/FrameSelectionMac.mm        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/editing/mac/FrameSelectionMac.mm        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -47,13 +47,13 @@
</span><span class="cx"> #endif // !PLATFORM(IOS)
</span><span class="cx">     
</span><span class="cx">     
</span><del>-void FrameSelection::notifyAccessibilityForSelectionChange()
</del><ins>+void FrameSelection::notifyAccessibilityForSelectionChange(const AXTextStateChangeIntent&amp; intent)
</ins><span class="cx"> {
</span><span class="cx">     Document* document = m_frame-&gt;document();
</span><span class="cx"> 
</span><span class="cx">     if (m_selection.start().isNotNull() &amp;&amp; m_selection.end().isNotNull()) {
</span><span class="cx">         if (AXObjectCache* cache = document-&gt;existingAXObjectCache())
</span><del>-            cache-&gt;postNotification(m_selection.start().deprecatedNode()-&gt;renderer(), AXObjectCache::AXSelectedTextChanged, TargetObservableParent);
</del><ins>+            cache-&gt;postTextStateChangeNotification(m_selection.start().deprecatedNode(), intent, m_selection);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextFormControlElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -548,16 +548,26 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     ASSERT(isTextFormControl());
</span><del>-    bool textIsChanged = value != innerTextValueFrom(*innerText);
</del><ins>+    String previousValue = innerTextValueFrom(*innerText);
+    bool textIsChanged = value != previousValue;
</ins><span class="cx">     if (textIsChanged || !innerText-&gt;hasChildNodes()) {
</span><ins>+#if HAVE(ACCESSIBILITY) &amp;&amp; !PLATFORM(COCOA)
</ins><span class="cx">         if (textIsChanged &amp;&amp; renderer()) {
</span><span class="cx">             if (AXObjectCache* cache = document().existingAXObjectCache())
</span><span class="cx">                 cache-&gt;postNotification(this, AXObjectCache::AXValueChanged, TargetObservableParent);
</span><span class="cx">         }
</span><ins>+#endif
</ins><span class="cx">         innerText-&gt;setInnerText(value, ASSERT_NO_EXCEPTION);
</span><span class="cx"> 
</span><span class="cx">         if (value.endsWith('\n') || value.endsWith('\r'))
</span><span class="cx">             innerText-&gt;appendChild(HTMLBRElement::create(document()), ASSERT_NO_EXCEPTION);
</span><ins>+
+#if HAVE(ACCESSIBILITY) &amp;&amp; PLATFORM(COCOA)
+        if (textIsChanged &amp;&amp; renderer()) {
+            if (AXObjectCache* cache = document().existingAXObjectCache())
+                cache-&gt;postTextReplacementNotification(this, AXTextEditTypeDelete, previousValue, AXTextEditTypeInsert, value, VisiblePosition(Position(this, Position::PositionIsBeforeAnchor)));
+        }
+#endif
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     setFormControlValueMatchesRenderer(true);
</span></span></pre></div>
<a id="trunkSourceWebCorepageDragControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DragController.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DragController.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/page/DragController.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -524,7 +524,7 @@
</span><span class="cx">                     options |= ReplaceSelectionCommand::SmartReplace;
</span><span class="cx">                 if (chosePlainText)
</span><span class="cx">                     options |= ReplaceSelectionCommand::MatchStyle;
</span><del>-                applyCommand(ReplaceSelectionCommand::create(*m_documentUnderMouse, fragment, options));
</del><ins>+                applyCommand(ReplaceSelectionCommand::create(*m_documentUnderMouse, WTF::move(fragment), options));
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     } else {
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/page/EventHandler.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -3239,7 +3239,8 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    selection.setSelection(visiblePosition, FrameSelection::defaultSetSelectionOptions(UserTriggered));
</del><ins>+    AXTextStateChangeIntent intent(AXTextStateChangeTypeSelectionMove, AXTextSelection { AXTextSelectionDirectionDiscontiguous, AXTextSelectionGranularityUnknown });
+    selection.setSelection(visiblePosition, FrameSelection::defaultSetSelectionOptions(UserTriggered), intent);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void handleKeyboardSelectionMovement(Frame&amp; frame, KeyboardEvent* event)
</span></span></pre></div>
<a id="trunkSourceWebCorepageFocusControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FocusController.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FocusController.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebCore/page/FocusController.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -340,8 +340,10 @@
</span><span class="cx">     if (caretBrowsing) {
</span><span class="cx">         Position position = firstPositionInOrBeforeNode(element.get());
</span><span class="cx">         VisibleSelection newSelection(position, position, DOWNSTREAM);
</span><del>-        if (frame.selection().shouldChangeSelection(newSelection))
-            frame.selection().setSelection(newSelection);
</del><ins>+        if (frame.selection().shouldChangeSelection(newSelection)) {
+            AXTextStateChangeIntent intent(AXTextStateChangeTypeSelectionMove, AXTextSelection { AXTextSelectionDirectionDiscontiguous, AXTextSelectionGranularityUnknown });
+            frame.selection().setSelection(newSelection, FrameSelection::defaultSetSelectionOptions(UserTriggered), intent);
+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     element-&gt;focus(false, direction);
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebKit/mac/ChangeLog        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2015-04-26  Doug Russell  &lt;d_russell@apple.com&gt;
+
+        AX: richer text change notifications (142719)
+        https://bugs.webkit.org/show_bug.cgi?id=142719
+
+        Reviewed by Darin Adler.
+
+        Richer accessibility value change notifications. Introduce AXTextEditType,
+        postTextStateChangeNotification and postTextReplacementNotification to give assistive
+        tech apps more reliable context for responding to changes in web content. Also implement
+        a mechanism to post value changes in password form fields in coalesced ticks to thwart
+        analyzing the cadence of changes.
+
+        Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent,
+        and an overload of postTextReplacementNotification to give assistive tech apps more
+        reliable context for responding to changes in web content selection. Also block posting
+        selection changes on password fields.
+
+        * WebCoreSupport/WebEditorClient.mm:
+        (undoNameForEditAction):
+
</ins><span class="cx"> 2015-04-24  Timothy Hatcher  &lt;timothy@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Remove native window dock controls
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebEditorClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -546,6 +546,7 @@
</span><span class="cx">     // FIXME: This is identical to code in WebKit2's WebEditCommandProxy class; would be nice to share the strings instead of having two copies.
</span><span class="cx">     switch (editAction) {
</span><span class="cx">         case EditActionUnspecified: return nil;
</span><ins>+        case EditActionInsert: return nil;
</ins><span class="cx">         case EditActionSetColor: return UI_STRING_KEY_INTERNAL(&quot;Set Color&quot;, &quot;Set Color (Undo action name)&quot;, &quot;Undo action name&quot;);
</span><span class="cx">         case EditActionSetBackgroundColor: return UI_STRING_KEY_INTERNAL(&quot;Set Background Color&quot;, &quot;Set Background Color (Undo action name)&quot;, &quot;Undo action name&quot;);
</span><span class="cx">         case EditActionTurnOffKerning: return UI_STRING_KEY_INTERNAL(&quot;Turn Off Kerning&quot;, &quot;Turn Off Kerning (Undo action name)&quot;, &quot;Undo action name&quot;);
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebKit2/ChangeLog        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2015-04-26  Doug Russell  &lt;d_russell@apple.com&gt;
+
+        AX: richer text change notifications (142719)
+        https://bugs.webkit.org/show_bug.cgi?id=142719
+
+        Reviewed by Darin Adler.
+
+        Richer accessibility value change notifications. Introduce AXTextEditType,
+        postTextStateChangeNotification and postTextReplacementNotification to give assistive
+        tech apps more reliable context for responding to changes in web content. Also implement
+        a mechanism to post value changes in password form fields in coalesced ticks to thwart
+        analyzing the cadence of changes.
+
+        Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent,
+        and an overload of postTextReplacementNotification to give assistive tech apps more
+        reliable context for responding to changes in web content selection. Also block posting
+        selection changes on password fields.
+
+        * UIProcess/WebEditCommandProxy.cpp:
+        (WebKit::WebEditCommandProxy::nameForEditAction):
+
</ins><span class="cx"> 2015-04-26  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;rdar://problem/20702337&gt; REGRESSION (r182952): Plug-in service fails to load because it links against WebKit2.framework
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebEditCommandProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebEditCommandProxy.cpp (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebEditCommandProxy.cpp        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Source/WebKit2/UIProcess/WebEditCommandProxy.cpp        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -74,6 +74,8 @@
</span><span class="cx">     switch (editAction) {
</span><span class="cx">     case EditActionUnspecified:
</span><span class="cx">         return String();
</span><ins>+    case EditActionInsert:
+        return String();
</ins><span class="cx">     case EditActionSetColor:
</span><span class="cx">         return WEB_UI_STRING_KEY(&quot;Set Color&quot;, &quot;Set Color (Undo action name)&quot;, &quot;Undo action name&quot;);
</span><span class="cx">     case EditActionSetBackgroundColor:
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Tools/ChangeLog        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2015-04-26  Doug Russell  &lt;d_russell@apple.com&gt;
+
+        AX: richer text change notifications (142719)
+        https://bugs.webkit.org/show_bug.cgi?id=142719
+
+        Reviewed by Darin Adler.
+
+        Richer accessibility value change notifications. Introduce AXTextEditType,
+        postTextStateChangeNotification and postTextReplacementNotification to give assistive
+        tech apps more reliable context for responding to changes in web content. Also implement
+        a mechanism to post value changes in password form fields in coalesced ticks to thwart
+        analyzing the cadence of changes.
+
+        Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent,
+        and an overload of postTextReplacementNotification to give assistive tech apps more
+        reliable context for responding to changes in web content selection. Also block posting
+        selection changes on password fields.
+
+        * DumpRenderTree/mac/AccessibilityNotificationHandler.h:
+        * DumpRenderTree/mac/AccessibilityNotificationHandler.mm:
+        (-[AccessibilityNotificationHandler stopObserving]):
+        (-[AccessibilityNotificationHandler _notificationReceived:]):
+        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+        (AccessibilityUIElement::removeNotificationListener):
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm:
+        (-[AccessibilityNotificationHandler _notificationReceived:]):
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+        (WTR::AccessibilityUIElement::removeNotificationListener):
+
</ins><span class="cx"> 2015-04-25  Sungmann Cho  &lt;sungmann.cho@navercorp.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add myself to contributors.json
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacAccessibilityNotificationHandlerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/AccessibilityNotificationHandler.h (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/AccessibilityNotificationHandler.h        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Tools/DumpRenderTree/mac/AccessibilityNotificationHandler.h        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> - (void)setPlatformElement:(id)platformElement;
</span><span class="cx"> - (void)setCallback:(JSObjectRef)callback;
</span><span class="cx"> - (void)startObserving;
</span><ins>+- (void)stopObserving;
</ins><span class="cx"> 
</span><span class="cx"> @end
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacAccessibilityNotificationHandlermm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/AccessibilityNotificationHandler.mm (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/AccessibilityNotificationHandler.mm        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Tools/DumpRenderTree/mac/AccessibilityNotificationHandler.mm        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -104,6 +104,11 @@
</span><span class="cx">     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_notificationReceived:) name:@&quot;AXDRTNotification&quot; object:nil];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)stopObserving
+{
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+}
+
</ins><span class="cx"> - (void)_notificationReceived:(NSNotification *)notification
</span><span class="cx"> {
</span><span class="cx">     NSString *notificationName = [[notification userInfo] objectForKey:@&quot;notificationName&quot;];
</span><span class="lines">@@ -112,16 +117,27 @@
</span><span class="cx">     if (m_platformElement &amp;&amp; m_platformElement != [notification object])
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    NSString *userInfoJSONValue = notification.userInfo[@&quot;userInfo&quot;];
+
</ins><span class="cx">     JSRetainPtr&lt;JSStringRef&gt; jsNotification(Adopt, [notificationName createJSStringRef]);
</span><span class="cx">     JSValueRef notificationNameArgument = JSValueMakeString([mainFrame globalContext], jsNotification.get());
</span><ins>+    JSValueRef userInfoJSONValueArgument = nil;
+    if ([userInfoJSONValue length]) {
+        JSRetainPtr&lt;JSStringRef&gt; jsUserInfoJSONValue(Adopt, [userInfoJSONValue createJSStringRef]);
+        userInfoJSONValueArgument = JSValueMakeFromJSONString([mainFrame globalContext], jsUserInfoJSONValue.get());
+    }
</ins><span class="cx">     if (m_platformElement) {
</span><del>-        // Listener for one element just gets one argument, the notification name.
-        JSObjectCallAsFunction([mainFrame globalContext], m_notificationFunctionCallback, 0, 1, &amp;notificationNameArgument, 0);
</del><ins>+        // Listener for one element gets the notification name and userInfo.
+        JSValueRef arguments[2];
+        arguments[0] = notificationNameArgument;
+        arguments[1] = userInfoJSONValueArgument;
+        JSObjectCallAsFunction([mainFrame globalContext], m_notificationFunctionCallback, 0, 2, arguments, 0);
</ins><span class="cx">     } else {
</span><del>-        // A global listener gets the element and the notification name as arguments.
-        JSValueRef arguments[2];
</del><ins>+        // A global listener gets the element, notification name and userInfo.
+        JSValueRef arguments[3];
</ins><span class="cx">         arguments[0] = AccessibilityUIElement::makeJSAccessibilityUIElement([mainFrame globalContext], AccessibilityUIElement([notification object]));
</span><span class="cx">         arguments[1] = notificationNameArgument;
</span><ins>+        arguments[2] = userInfoJSONValueArgument;
</ins><span class="cx">         JSObjectCallAsFunction([mainFrame globalContext], m_notificationFunctionCallback, 0, 2, arguments, 0);
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacAccessibilityUIElementMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -1446,6 +1446,7 @@
</span><span class="cx">     // Mac programmers should not be trying to remove a listener that's already removed.
</span><span class="cx">     ASSERT(m_notificationHandler);
</span><span class="cx"> 
</span><ins>+    [m_notificationHandler stopObserving];
</ins><span class="cx">     [m_notificationHandler release];
</span><span class="cx">     m_notificationHandler = nil;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityNotificationHandlermm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -125,19 +125,30 @@
</span><span class="cx">     if (m_platformElement &amp;&amp; m_platformElement != [notification object])
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    NSString *userInfoJSONValue = notification.userInfo[@&quot;userInfo&quot;];
+
</ins><span class="cx">     WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(WTR::InjectedBundle::singleton().page()-&gt;page());
</span><span class="cx">     JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame);
</span><span class="cx"> 
</span><span class="cx">     JSRetainPtr&lt;JSStringRef&gt; jsNotification(Adopt, [notificationName createJSStringRef]);
</span><span class="cx">     JSValueRef notificationNameArgument = JSValueMakeString(context, jsNotification.get());
</span><ins>+    JSValueRef userInfoJSONValueArgument = nil;
+    if ([userInfoJSONValue length]) {
+        JSRetainPtr&lt;JSStringRef&gt; jsUserInfoJSONValue(Adopt, [userInfoJSONValue createJSStringRef]);
+        userInfoJSONValueArgument = JSValueMakeFromJSONString(context, jsUserInfoJSONValue.get());
+    }
</ins><span class="cx">     if (m_platformElement) {
</span><del>-        // Listener for one element just gets one argument, the notification name.
-        JSObjectCallAsFunction(context, const_cast&lt;JSObjectRef&gt;(m_notificationFunctionCallback), 0, 1, &amp;notificationNameArgument, 0);
</del><ins>+        // Listener for one element gets the notification name and userInfo.
+        JSValueRef arguments[2];
+        arguments[0] = notificationNameArgument;
+        arguments[1] = userInfoJSONValueArgument;
+        JSObjectCallAsFunction(context, const_cast&lt;JSObjectRef&gt;(m_notificationFunctionCallback), 0, 2, arguments, 0);
</ins><span class="cx">     } else {
</span><del>-        // A global listener gets the element and the notification name as arguments.
-        JSValueRef arguments[2];
</del><ins>+        // A global listener gets the element, notification name and userInfo.
+        JSValueRef arguments[3];
</ins><span class="cx">         arguments[0] = toJS(context, WTF::getPtr(WTR::AccessibilityUIElement::create([notification object])));
</span><span class="cx">         arguments[1] = notificationNameArgument;
</span><ins>+        arguments[2] = userInfoJSONValueArgument;
</ins><span class="cx">         JSObjectCallAsFunction(context, const_cast&lt;JSObjectRef&gt;(m_notificationFunctionCallback), 0, 2, arguments, 0);
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityUIElementMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (183367 => 183368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm        2015-04-26 21:26:42 UTC (rev 183367)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm        2015-04-26 22:17:11 UTC (rev 183368)
</span><span class="lines">@@ -1476,6 +1476,7 @@
</span><span class="cx">     // Mac programmers should not be trying to remove a listener that's already removed.
</span><span class="cx">     ASSERT(m_notificationHandler);
</span><span class="cx"> 
</span><ins>+    [m_notificationHandler stopObserving];
</ins><span class="cx">     [m_notificationHandler release];
</span><span class="cx">     m_notificationHandler = nil;
</span><span class="cx">     
</span></span></pre>
</div>
</div>

</body>
</html>