<!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>[168360] 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/168360">168360</a></dd>
<dt>Author</dt> <dd>cfleizach@apple.com</dd>
<dt>Date</dt> <dd>2014-05-06 09:17:19 -0700 (Tue, 06 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>AX: VoiceOver does not announce text changes for content editable regions in Safari
https://bugs.webkit.org/show_bug.cgi?id=132577

Reviewed by Mario Sanchez Prada.

Source/WebCore:
When text or children are changed inside of a contenteditable region, we need to
convert those actions into AXValueChange notifications.

Test: accessibility/content-editable-set-inner-text-generates-axvalue-notification.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::childrenChanged):
(WebCore::AccessibilityNodeObject::hasContentEditableAttributeSet): Deleted.
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::hasContentEditableAttributeSet):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::textChanged):

LayoutTests:
* accessibility/content-editable-set-inner-text-generates-axvalue-notification-expected.txt: Added.
* accessibility/content-editable-set-inner-text-generates-axvalue-notification.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsaccessibilitycontenteditablesetinnertextgeneratesaxvaluenotificationexpectedtxt">trunk/LayoutTests/accessibility/content-editable-set-inner-text-generates-axvalue-notification-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilitycontenteditablesetinnertextgeneratesaxvaluenotificationhtml">trunk/LayoutTests/accessibility/content-editable-set-inner-text-generates-axvalue-notification.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (168359 => 168360)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-05-06 14:14:49 UTC (rev 168359)
+++ trunk/LayoutTests/ChangeLog        2014-05-06 16:17:19 UTC (rev 168360)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-05-06  Chris Fleizach  &lt;cfleizach@apple.com&gt;
+
+        AX: VoiceOver does not announce text changes for content editable regions in Safari
+        https://bugs.webkit.org/show_bug.cgi?id=132577
+
+        Reviewed by Mario Sanchez Prada.
+
+        * accessibility/content-editable-set-inner-text-generates-axvalue-notification-expected.txt: Added.
+        * accessibility/content-editable-set-inner-text-generates-axvalue-notification.html: Added.
+
</ins><span class="cx"> 2014-05-06  Dirk Schulze  &lt;krit@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [SVG2] Share &quot;on&quot;- event attributes with HTMLElement
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitycontenteditablesetinnertextgeneratesaxvaluenotificationexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/content-editable-set-inner-text-generates-axvalue-notification-expected.txt (0 => 168360)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/content-editable-set-inner-text-generates-axvalue-notification-expected.txt                                (rev 0)
+++ trunk/LayoutTests/accessibility/content-editable-set-inner-text-generates-axvalue-notification-expected.txt        2014-05-06 16:17:19 UTC (rev 168360)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+This tests that a contenteditable region will send an AXValueChange notification when JS methods for changing children are used.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Updated value: AXValue: Test1
+Updated value: AXValue: Test2
+Updated value: AXValue: Test3
+Updated value: AXValue: Test3Test4
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilitycontenteditablesetinnertextgeneratesaxvaluenotificationhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/content-editable-set-inner-text-generates-axvalue-notification.html (0 => 168360)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/content-editable-set-inner-text-generates-axvalue-notification.html                                (rev 0)
+++ trunk/LayoutTests/accessibility/content-editable-set-inner-text-generates-axvalue-notification.html        2014-05-06 16:17:19 UTC (rev 168360)
</span><span class="lines">@@ -0,0 +1,59 @@
</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 id=&quot;content&quot; contenteditable tabindex=&quot;0&quot;&gt;
+hello&lt;br&gt;
+&lt;b&gt;world&lt;/b&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;script&gt;
+
+    description(&quot;This tests that a contenteditable region will send an AXValueChange notification when JS methods for changing children are used.&quot;);
+
+    var notification = 0;
+    var textArea = 0;
+    var valueChangeCount = 0;
+    function callback(notification) {
+        if (notification == &quot;AXValueChanged&quot;) {
+            debug(&quot;Updated value: &quot; + textArea.stringValue);
+            valueChangeCount++;
+
+            if (valueChangeCount == 1) {
+                document.getElementById(&quot;content&quot;).innerHTML = &quot;Test2&quot;;
+            }
+            else if (valueChangeCount == 2) {
+                document.getElementById(&quot;content&quot;).innerText = &quot;Test3&quot;;
+            }
+            else if (valueChangeCount == 3) {
+                document.getElementById(&quot;content&quot;).appendChild(document.createTextNode(&quot;Test4&quot;));
+            }
+            else if (valueChangeCount == 4) {
+                document.getElementById(&quot;content&quot;).style.visibility = &quot;hidden&quot;;
+                textArea.removeNotificationListener();
+                finishJSTest();
+            }
+        }
+    }
+
+    if (window.accessibilityController) {
+        window.jsTestIsAsync = true;
+
+        textArea = accessibilityController.accessibleElementById(&quot;content&quot;);
+        textArea.addNotificationListener(callback);
+
+        // Send value changes.
+        document.getElementById(&quot;content&quot;).innerText = &quot;Test1&quot;;
+    }
+
+&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="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (168359 => 168360)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-05-06 14:14:49 UTC (rev 168359)
+++ trunk/Source/WebCore/ChangeLog        2014-05-06 16:17:19 UTC (rev 168360)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2014-05-06  Chris Fleizach  &lt;cfleizach@apple.com&gt;
+
+        AX: VoiceOver does not announce text changes for content editable regions in Safari
+        https://bugs.webkit.org/show_bug.cgi?id=132577
+
+        Reviewed by Mario Sanchez Prada.
+
+        When text or children are changed inside of a contenteditable region, we need to 
+        convert those actions into AXValueChange notifications.
+
+        Test: accessibility/content-editable-set-inner-text-generates-axvalue-notification.html
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::childrenChanged):
+        (WebCore::AccessibilityNodeObject::hasContentEditableAttributeSet): Deleted.
+        * accessibility/AccessibilityNodeObject.h:
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::hasContentEditableAttributeSet):
+        * accessibility/AccessibilityObject.h:
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::textChanged):
+
</ins><span class="cx"> 2014-05-06  Dirk Schulze  &lt;krit@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [SVG2] Share &quot;on&quot;- event attributes with HTMLElement
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityNodeObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (168359 => 168360)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2014-05-06 14:14:49 UTC (rev 168359)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2014-05-06 16:17:19 UTC (rev 168360)
</span><span class="lines">@@ -152,7 +152,7 @@
</span><span class="cx">             cache-&gt;postNotification(parent, parent-&gt;document(), AXObjectCache::AXLiveRegionChanged);
</span><span class="cx">         
</span><span class="cx">         // If this element is an ARIA text control, notify the AT of changes.
</span><del>-        if (parent-&gt;isARIATextControl() &amp;&amp; !parent-&gt;isNativeTextControl() &amp;&amp; !parent-&gt;node()-&gt;hasEditableStyle())
</del><ins>+        if ((parent-&gt;isARIATextControl() || parent-&gt;hasContentEditableAttributeSet()) &amp;&amp; !parent-&gt;isNativeTextControl())
</ins><span class="cx">             cache-&gt;postNotification(parent, parent-&gt;document(), AXObjectCache::AXValueChanged);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -2008,13 +2008,6 @@
</span><span class="cx">     return role;
</span><span class="cx"> }   
</span><span class="cx"> 
</span><del>-// If you call node-&gt;hasEditableStyle() since that will return true if an ancestor is editable.
-// This only returns true if this is the element that actually has the contentEditable attribute set.
-bool AccessibilityNodeObject::hasContentEditableAttributeSet() const
-{
-    return contentEditableAttributeIsEnabled(element());
-}
-
</del><span class="cx"> bool AccessibilityNodeObject::canSetSelectedAttribute() const
</span><span class="cx"> {
</span><span class="cx">     // Elements that can be selected
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityNodeObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h (168359 => 168360)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h        2014-05-06 14:14:49 UTC (rev 168359)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h        2014-05-06 16:17:19 UTC (rev 168360)
</span><span class="lines">@@ -177,7 +177,6 @@
</span><span class="cx">     virtual AccessibilityRole ariaRoleAttribute() const override;
</span><span class="cx">     AccessibilityRole determineAriaRoleAttribute() const;
</span><span class="cx">     AccessibilityRole remapAriaRoleDueToParent(AccessibilityRole) const;
</span><del>-    bool hasContentEditableAttributeSet() const;
</del><span class="cx">     virtual bool isDescendantOfBarrenParent() const override;
</span><span class="cx">     void alterSliderValue(bool increase);
</span><span class="cx">     void changeValueByStep(bool increase);
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (168359 => 168360)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2014-05-06 14:14:49 UTC (rev 168359)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2014-05-06 16:17:19 UTC (rev 168360)
</span><span class="lines">@@ -1316,6 +1316,13 @@
</span><span class="cx">     return obj-&gt;document().axObjectCache()-&gt;getOrCreate(obj);
</span><span class="cx"> }
</span><span class="cx">     
</span><ins>+// If you call node-&gt;hasEditableStyle() since that will return true if an ancestor is editable.
+// This only returns true if this is the element that actually has the contentEditable attribute set.
+bool AccessibilityObject::hasContentEditableAttributeSet() const
+{
+    return contentEditableAttributeIsEnabled(element());
+}
+
</ins><span class="cx"> bool AccessibilityObject::contentEditableAttributeIsEnabled(Element* element)
</span><span class="cx"> {
</span><span class="cx">     if (!element)
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (168359 => 168360)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.h        2014-05-06 14:14:49 UTC (rev 168359)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h        2014-05-06 16:17:19 UTC (rev 168360)
</span><span class="lines">@@ -846,6 +846,7 @@
</span><span class="cx">     static const String defaultLiveRegionStatusForRole(AccessibilityRole);
</span><span class="cx">     static bool liveRegionStatusIsEnabled(const AtomicString&amp;);
</span><span class="cx">     static bool contentEditableAttributeIsEnabled(Element*);
</span><ins>+    bool hasContentEditableAttributeSet() const;
</ins><span class="cx">     
</span><span class="cx">     bool supportsARIAAttributes() const;
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (168359 => 168360)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2014-05-06 14:14:49 UTC (rev 168359)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2014-05-06 16:17:19 UTC (rev 168360)
</span><span class="lines">@@ -2767,7 +2767,7 @@
</span><span class="cx">         if (parent-&gt;supportsARIALiveRegion())
</span><span class="cx">             cache-&gt;postNotification(renderParent, AXObjectCache::AXLiveRegionChanged);
</span><span class="cx"> 
</span><del>-        if (parent-&gt;isARIATextControl() &amp;&amp; !parent-&gt;isNativeTextControl() &amp;&amp; !parent-&gt;node()-&gt;hasEditableStyle())
</del><ins>+        if ((parent-&gt;isARIATextControl() || parent-&gt;hasContentEditableAttributeSet()) &amp;&amp; !parent-&gt;isNativeTextControl())
</ins><span class="cx">             cache-&gt;postNotification(renderParent, AXObjectCache::AXValueChanged);
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>