<!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>[168042] 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/168042">168042</a></dd>
<dt>Author</dt> <dd>cfleizach@apple.com</dd>
<dt>Date</dt> <dd>2014-04-30 13:47:16 -0700 (Wed, 30 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>AX: Make &quot;contenteditable&quot; regions into AXTextAreas
https://bugs.webkit.org/show_bug.cgi?id=132379

Reviewed by Mario Sanchez Prada.


Source/WebCore: 
Make contenteditable regions into AXTextAreas. This will allow for a more standardized
interface for interaction with assistive technologies.

Test: accessibility/content-editable-as-textarea.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::hasContentEditableAttributeSet):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::contentEditableAttributeIsEnabled):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::documentBasedSelectedTextRange):
(WebCore::AccessibilityRenderObject::selectedText):
(WebCore::AccessibilityRenderObject::selectedTextRange):
(WebCore::AccessibilityRenderObject::renderObjectIsObservable):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
(WebCore::AccessibilityRenderObject::ariaSelectedTextRange): Deleted.
* accessibility/AccessibilityRenderObject.h:

LayoutTests: 
* accessibility/content-editable-as-textarea.html: Added.
* platform/mac-mountainlion/accessibility/content-editable-as-textarea-expected.txt: Added.
* platform/mac/accessibility/content-editable-as-textarea-expected.txt: 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="#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="#trunkSourceWebCoreaccessibilityAccessibilityRenderObjecth">trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsaccessibilitycontenteditableastextareahtml">trunk/LayoutTests/accessibility/content-editable-as-textarea.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacaccessibilitycontenteditableastextareaexpectedtxt">trunk/LayoutTests/platform/mac/accessibility/content-editable-as-textarea-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacmountainlionaccessibilitycontenteditableastextareaexpectedtxt">trunk/LayoutTests/platform/mac-mountainlion/accessibility/content-editable-as-textarea-expected.txt</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (168041 => 168042)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-04-30 20:42:19 UTC (rev 168041)
+++ trunk/LayoutTests/ChangeLog        2014-04-30 20:47:16 UTC (rev 168042)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2014-04-30  Chris Fleizach  &lt;cfleizach@apple.com&gt;
+
+        AX: Make &quot;contenteditable&quot; regions into AXTextAreas
+        https://bugs.webkit.org/show_bug.cgi?id=132379
+
+        Reviewed by Mario Sanchez Prada.
+
+        * accessibility/content-editable-as-textarea.html: Added.
+        * platform/mac-mountainlion/accessibility/content-editable-as-textarea-expected.txt: Added.
+        * platform/mac/accessibility/content-editable-as-textarea-expected.txt: Added.
+
</ins><span class="cx"> 2014-04-30  David Kilzer  &lt;ddkilzer@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Move iphone-simulator test results landed in r167402 to the correct directory
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitycontenteditableastextareahtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/content-editable-as-textarea.html (0 => 168042)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/content-editable-as-textarea.html                                (rev 0)
+++ trunk/LayoutTests/accessibility/content-editable-as-textarea.html        2014-04-30 20:47:16 UTC (rev 168042)
</span><span class="lines">@@ -0,0 +1,66 @@
</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 behaves as a proper AXTextArea.&quot;);
+
+    var notification = 0;
+    var textArea = 0;
+    function callback(notification) {
+        if (notification == &quot;AXValueChanged&quot;) {
+            textArea.removeNotificationListener();
+            debug(&quot;Updated value: &quot; + textArea.stringValue);
+            document.getElementById(&quot;content&quot;).style.visibility = &quot;hidden&quot;;
+            finishJSTest();
+        }
+    }
+
+    if (window.accessibilityController) {
+        window.jsTestIsAsync = true;
+
+        textArea = accessibilityController.accessibleElementById(&quot;content&quot;);
+        textArea.addNotificationListener(callback);
+
+        debug(&quot;Role: &quot; + textArea.role);
+        debug(&quot;Value: &quot; + textArea.stringValue);
+        debug(&quot;Value (writable): &quot; + textArea.isAttributeSettable(&quot;AXValue&quot;));
+        debug(&quot;String with range: &quot; + textArea.stringForRange(1, 9));
+        debug(&quot;Attributed string with range: &quot; + textArea.attributedStringForRange(1, 9));
+        debug(&quot;Line for index(0): &quot; + textArea.lineForIndex(0));
+        debug(&quot;Line for index(7): &quot; + textArea.lineForIndex(7));
+        debug(&quot;Range for line(0): &quot; + textArea.rangeForLine(0));
+        debug(&quot;Range for line(1): &quot; + textArea.rangeForLine(1));
+        debug(&quot;Bounds for range: &quot; + textArea.boundsForRange(3, 5));
+
+        var range = document.createRange();
+        range.setStart(document.getElementById(&quot;content&quot;).firstChild, 0);
+        range.setEnd(document.getElementById(&quot;content&quot;).firstChild, 4);
+        var sel = window.getSelection();
+        sel.addRange(range);
+
+        debug(&quot;Selected text range: &quot; + textArea.selectedTextRange);
+        debug(&quot;Selected text: &quot; + textArea.stringAttributeValue(&quot;AXSelectedText&quot;));
+
+        // Send a value cahnge.
+        document.getElementById(&quot;content&quot;).focus();
+        eventSender.keyDown('q', []);
+    }
+
+&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="trunkLayoutTestsplatformmacaccessibilitycontenteditableastextareaexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/accessibility/content-editable-as-textarea-expected.txt (0 => 168042)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/accessibility/content-editable-as-textarea-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/content-editable-as-textarea-expected.txt        2014-04-30 20:47:16 UTC (rev 168042)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+
+This tests that a contenteditable region behaves as a proper AXTextArea.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Role: AXRole: AXTextArea
+Value: AXValue: hello
+world
+Value (writable): true
+String with range: ello
+worl
+Attributed string with range: ello
+{
+    AXBackgroundColor = &quot; [ (kCGColorSpaceDeviceRGB)] ( 0 0 0 0 )&quot;;
+    AXFont =     {
+        AXFontFamily = Times;
+        AXFontName = &quot;Times-Roman&quot;;
+        AXFontSize = 16;
+        AXVisibleName = &quot;Times Roman&quot;;
+    };
+    AXForegroundColor = &quot; [ (kCGColorSpaceDeviceRGB)] ( 0 0 0 1 )&quot;;
+}worl{
+    AXBackgroundColor = &quot; [ (kCGColorSpaceDeviceRGB)] ( 0 0 0 0 )&quot;;
+    AXFont =     {
+        AXFontFamily = Times;
+        AXFontName = &quot;Times-Bold&quot;;
+        AXFontSize = 16;
+        AXVisibleName = &quot;Times Bold&quot;;
+    };
+    AXForegroundColor = &quot; [ (kCGColorSpaceDeviceRGB)] ( 0 0 0 1 )&quot;;
+    AXMarkedMisspelled = 1;
+    AXMisspelled = 1;
+}
+Line for index(0): 0
+Line for index(7): 1
+Range for line(0): {0, 6}
+Range for line(1): {6, 6}
+Bounds for range: {{-1.000000, -1.000000}, {31.000000, 36.000000}}
+Selected text range: {0, 3}
+Selected text: hel
+Updated value: AXValue: qlo
+world
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacmountainlionaccessibilitycontenteditableastextareaexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac-mountainlion/accessibility/content-editable-as-textarea-expected.txt (0 => 168042)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-mountainlion/accessibility/content-editable-as-textarea-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac-mountainlion/accessibility/content-editable-as-textarea-expected.txt        2014-04-30 20:47:16 UTC (rev 168042)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+
+This tests that a contenteditable region behaves as a proper AXTextArea.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Role: AXRole: AXTextArea
+Value: AXValue: hello
+world
+Value (writable): true
+String with range: ello
+worl
+Attributed string with range: ello
+{
+    AXBackgroundColor = &quot; [ (kCGColorSpaceDeviceRGB)] ( 0 0 0 0 )&quot;;
+    AXFont =     {
+        AXFontFamily = Times;
+        AXFontName = &quot;Times-Roman&quot;;
+        AXFontSize = 16;
+        AXVisibleName = &quot;Times Roman&quot;;
+    };
+    AXForegroundColor = &quot; [ (kCGColorSpaceDeviceRGB)] ( 0 0 0 1 )&quot;;
+}worl{
+    AXBackgroundColor = &quot; [ (kCGColorSpaceDeviceRGB)] ( 0 0 0 0 )&quot;;
+    AXFont =     {
+        AXFontFamily = Times;
+        AXFontName = &quot;Times-Bold&quot;;
+        AXFontSize = 16;
+        AXVisibleName = &quot;Times Bold&quot;;
+    };
+    AXForegroundColor = &quot; [ (kCGColorSpaceDeviceRGB)] ( 0 0 0 1 )&quot;;
+    AXMisspelled = 1;
+}
+Line for index(0): 0
+Line for index(7): 1
+Range for line(0): {0, 6}
+Range for line(1): {6, 6}
+Bounds for range: {{-1.000000, -1.000000}, {31.000000, 36.000000}}
+Selected text range: {0, 3}
+Selected text: hel
+Updated value: AXValue: qlo
+world
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (168041 => 168042)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-04-30 20:42:19 UTC (rev 168041)
+++ trunk/Source/WebCore/ChangeLog        2014-04-30 20:47:16 UTC (rev 168042)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2014-04-29  Chris Fleizach  &lt;cfleizach@apple.com&gt;
+
+        AX: Make &quot;contenteditable&quot; regions into AXTextAreas
+        https://bugs.webkit.org/show_bug.cgi?id=132379
+
+        Reviewed by Mario Sanchez Prada.
+
+        Make contenteditable regions into AXTextAreas. This will allow for a more standardized
+        interface for interaction with assistive technologies.
+
+        Test: accessibility/content-editable-as-textarea.html
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::hasContentEditableAttributeSet):
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::contentEditableAttributeIsEnabled):
+        * accessibility/AccessibilityObject.h:
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::documentBasedSelectedTextRange):
+        (WebCore::AccessibilityRenderObject::selectedText):
+        (WebCore::AccessibilityRenderObject::selectedTextRange):
+        (WebCore::AccessibilityRenderObject::renderObjectIsObservable):
+        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
+        (WebCore::AccessibilityRenderObject::ariaSelectedTextRange): Deleted.
+        * accessibility/AccessibilityRenderObject.h:
+
</ins><span class="cx"> 2014-04-30  Brian J. Burg  &lt;burg@cs.washington.edu&gt;
</span><span class="cx"> 
</span><span class="cx">         Clean up unnecessary methods in the BackForwardClient interface
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityNodeObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (168041 => 168042)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2014-04-30 20:42:19 UTC (rev 168041)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2014-04-30 20:47:16 UTC (rev 168042)
</span><span class="lines">@@ -2012,11 +2012,7 @@
</span><span class="cx"> // This only returns true if this is the element that actually has the contentEditable attribute set.
</span><span class="cx"> bool AccessibilityNodeObject::hasContentEditableAttributeSet() const
</span><span class="cx"> {
</span><del>-    if (!hasAttribute(contenteditableAttr))
-        return false;
-    const AtomicString&amp; contentEditableValue = getAttribute(contenteditableAttr);
-    // Both &quot;true&quot; (case-insensitive) and the empty string count as true.
-    return contentEditableValue.isEmpty() || equalIgnoringCase(contentEditableValue, &quot;true&quot;);
</del><ins>+    return contentEditableAttributeIsEnabled(element());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityNodeObject::canSetSelectedAttribute() const
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (168041 => 168042)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2014-04-30 20:42:19 UTC (rev 168041)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2014-04-30 20:47:16 UTC (rev 168042)
</span><span class="lines">@@ -1314,7 +1314,20 @@
</span><span class="cx"> 
</span><span class="cx">     return obj-&gt;document().axObjectCache()-&gt;getOrCreate(obj);
</span><span class="cx"> }
</span><del>-
</del><ins>+    
+bool AccessibilityObject::contentEditableAttributeIsEnabled(Element* element)
+{
+    if (!element)
+        return false;
+    
+    if (!element-&gt;hasAttribute(contenteditableAttr))
+        return false;
+    
+    const AtomicString&amp; contentEditableValue = element-&gt;fastGetAttribute(contenteditableAttr);
+    // Both &quot;true&quot; (case-insensitive) and the empty string count as true.
+    return contentEditableValue.isEmpty() || equalIgnoringCase(contentEditableValue, &quot;true&quot;);
+}
+    
</ins><span class="cx"> #if HAVE(ACCESSIBILITY)
</span><span class="cx"> int AccessibilityObject::lineForPosition(const VisiblePosition&amp; visiblePos) const
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (168041 => 168042)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.h        2014-04-30 20:42:19 UTC (rev 168041)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h        2014-04-30 20:47:16 UTC (rev 168042)
</span><span class="lines">@@ -843,6 +843,7 @@
</span><span class="cx">     virtual bool ariaLiveRegionBusy() const { return false; }
</span><span class="cx">     static const String defaultLiveRegionStatusForRole(AccessibilityRole);
</span><span class="cx">     static bool liveRegionStatusIsEnabled(const AtomicString&amp;);
</span><ins>+    static bool contentEditableAttributeIsEnabled(Element*);
</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 (168041 => 168042)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2014-04-30 20:42:19 UTC (rev 168041)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2014-04-30 20:47:16 UTC (rev 168042)
</span><span class="lines">@@ -1420,7 +1420,7 @@
</span><span class="cx">     return text().length();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PlainTextRange AccessibilityRenderObject::ariaSelectedTextRange() const
</del><ins>+PlainTextRange AccessibilityRenderObject::documentBasedSelectedTextRange() const
</ins><span class="cx"> {
</span><span class="cx">     Node* node = m_renderer-&gt;node();
</span><span class="cx">     if (!node)
</span><span class="lines">@@ -1449,10 +1449,7 @@
</span><span class="cx">         return textControl.selectedText();
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    if (ariaRoleAttribute() == UnknownRole)
-        return String();
-    
-    return doAXStringForRange(ariaSelectedTextRange());
</del><ins>+    return doAXStringForRange(documentBasedSelectedTextRange());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const AtomicString&amp; AccessibilityRenderObject::accessKey() const
</span><span class="lines">@@ -1483,10 +1480,7 @@
</span><span class="cx">         return PlainTextRange(textControl.selectionStart(), textControl.selectionEnd() - textControl.selectionStart());
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    if (ariaRole == UnknownRole)
-        return PlainTextRange();
-    
-    return ariaSelectedTextRange();
</del><ins>+    return documentBasedSelectedTextRange();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityRenderObject::setSelectedTextRange(const PlainTextRange&amp; range)
</span><span class="lines">@@ -2394,11 +2388,14 @@
</span><span class="cx">     
</span><span class="cx">     // AX clients will listen for AXSelectedChildrenChanged on listboxes.
</span><span class="cx">     Node* node = renderer-&gt;node();
</span><ins>+    if (!node)
+        return false;
+    
</ins><span class="cx">     if (nodeHasRole(node, &quot;listbox&quot;) || (renderer-&gt;isBoxModelObject() &amp;&amp; toRenderBoxModelObject(renderer)-&gt;isListBox()))
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     // Textboxes should send out notifications.
</span><del>-    if (nodeHasRole(node, &quot;textbox&quot;))
</del><ins>+    if (nodeHasRole(node, &quot;textbox&quot;) || (node-&gt;isElementNode() &amp;&amp; contentEditableAttributeIsEnabled(toElement(node))))
</ins><span class="cx">         return true;
</span><span class="cx">     
</span><span class="cx">     return false;
</span><span class="lines">@@ -2510,7 +2507,10 @@
</span><span class="cx">             return ColorWellRole;
</span><span class="cx"> #endif
</span><span class="cx">     }
</span><del>-
</del><ins>+    
+    if (hasContentEditableAttributeSet())
+        return TextAreaRole;
+    
</ins><span class="cx">     if (isFileUploadButton())
</span><span class="cx">         return ButtonRole;
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityRenderObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h (168041 => 168042)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h        2014-04-30 20:42:19 UTC (rev 168041)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h        2014-04-30 20:47:16 UTC (rev 168042)
</span><span class="lines">@@ -233,7 +233,7 @@
</span><span class="cx">     bool isAllowedChildOfTree() const;
</span><span class="cx">     bool hasTextAlternative() const;
</span><span class="cx">     String positionalDescriptionForMSAA() const;
</span><del>-    PlainTextRange ariaSelectedTextRange() const;
</del><ins>+    PlainTextRange documentBasedSelectedTextRange() const;
</ins><span class="cx">     Element* rootEditableElementForPosition(const Position&amp;) const;
</span><span class="cx">     bool nodeIsTextControl(const Node*) const;
</span><span class="cx">     virtual void setNeedsToUpdateChildren() override { m_childrenDirty = true; }
</span></span></pre>
</div>
</div>

</body>
</html>