<!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>[51582] 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/51582">51582</a></dd>
<dt>Author</dt> <dd>cfleizach@apple.com</dd>
<dt>Date</dt> <dd>2009-12-01 20:40:18 -0800 (Tue, 01 Dec 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>WAI-ARIA: implement support for ARIA drag and drop
https://bugs.webkit.org/show_bug.cgi?id=32007

Reviewed by Darin Adler.

WebCore: 

Test: platform/mac/accessibility/aria-drag-drop.html

* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::supportsARIADropping):
(WebCore::AccessibilityObject::supportsARIADragging):
(WebCore::AccessibilityObject::isARIAGrabbed):
(WebCore::AccessibilityObject::setARIAGrabbed):
(WebCore::AccessibilityObject::determineARIADropEffects):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::supportsARIADropping):
(WebCore::AccessibilityRenderObject::supportsARIADragging):
(WebCore::AccessibilityRenderObject::isARIAGrabbed):
(WebCore::AccessibilityRenderObject::setARIAGrabbed):
(WebCore::AccessibilityRenderObject::determineARIADropEffects):
* accessibility/AccessibilityRenderObject.h:
* accessibility/mac/AccessibilityObjectWrapper.mm:
(-[AccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
(-[AccessibilityObjectWrapper accessibilityAttributeValue:]):
(-[AccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
(-[AccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
* html/HTMLAttributeNames.in:

WebKitTools: 

* DumpRenderTree/AccessibilityUIElement.cpp:
(getARIADropEffectsCallback):
(getARIAIsGrabbedCallback):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::ariaIsGrabbed):
(AccessibilityUIElement::ariaDropEffects):

LayoutTests: 

* platform/mac/accessibility/aria-drag-drop-expected.txt: Added.
* platform/mac/accessibility/aria-drag-drop.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCoreaccessibilityAccessibilityObjecth">trunk/WebCore/accessibility/AccessibilityObject.h</a></li>
<li><a href="#trunkWebCoreaccessibilityAccessibilityRenderObjectcpp">trunk/WebCore/accessibility/AccessibilityRenderObject.cpp</a></li>
<li><a href="#trunkWebCoreaccessibilityAccessibilityRenderObjecth">trunk/WebCore/accessibility/AccessibilityRenderObject.h</a></li>
<li><a href="#trunkWebCoreaccessibilitymacAccessibilityObjectWrappermm">trunk/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm</a></li>
<li><a href="#trunkWebCorehtmlHTMLAttributeNamesin">trunk/WebCore/html/HTMLAttributeNames.in</a></li>
<li><a href="#trunkWebKitToolsChangeLog">trunk/WebKitTools/ChangeLog</a></li>
<li><a href="#trunkWebKitToolsDumpRenderTreeAccessibilityUIElementcpp">trunk/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp</a></li>
<li><a href="#trunkWebKitToolsDumpRenderTreeAccessibilityUIElementh">trunk/WebKitTools/DumpRenderTree/AccessibilityUIElement.h</a></li>
<li><a href="#trunkWebKitToolsDumpRenderTreemacAccessibilityUIElementMacmm">trunk/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsplatformmacaccessibilityariadragdropexpectedtxt">trunk/LayoutTests/platform/mac/accessibility/aria-drag-drop-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacaccessibilityariadragdrophtml">trunk/LayoutTests/platform/mac/accessibility/aria-drag-drop.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (51581 => 51582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2009-12-02 03:49:26 UTC (rev 51581)
+++ trunk/LayoutTests/ChangeLog        2009-12-02 04:40:18 UTC (rev 51582)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2009-12-01  Chris Fleizach  &lt;cfleizach@apple.com&gt;
+
+        Reviewed by Darin Adler.
+
+        WAI-ARIA: implement support for ARIA drag and drop
+        https://bugs.webkit.org/show_bug.cgi?id=32007
+
+        * platform/mac/accessibility/aria-drag-drop-expected.txt: Added.
+        * platform/mac/accessibility/aria-drag-drop.html: Added.
+
</ins><span class="cx"> 2009-12-01  Adam Barth  &lt;abarth@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Darin Adler.
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacaccessibilityariadragdropexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/accessibility/aria-drag-drop-expected.txt (0 => 51582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/accessibility/aria-drag-drop-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/aria-drag-drop-expected.txt        2009-12-02 04:40:18 UTC (rev 51582)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+drop
+grab
+grab
+This tests that the ARIA drag and drop attributes work as intended.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS body.childAtIndex(0).ariaDropEffects is 'copy,move'
+PASS body.childAtIndex(1).ariaIsGrabbed is true
+PASS body.childAtIndex(2).ariaIsGrabbed is false
+PASS body.childAtIndex(1).isAttributeSettable('AXGrabbed') is true
+PASS body.childAtIndex(2).isAttributeSettable('AXGrabbed') is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacaccessibilityariadragdrophtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/accessibility/aria-drag-drop.html (0 => 51582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/accessibility/aria-drag-drop.html                                (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/aria-drag-drop.html        2009-12-02 04:40:18 UTC (rev 51582)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;link rel=&quot;stylesheet&quot; href=&quot;../../../fast/js/resources/js-test-style.css&quot;&gt;
+&lt;script&gt;
+var successfullyParsed = false;
+&lt;/script&gt;
+&lt;script src=&quot;../../../fast/js/resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body id=&quot;body&quot;&gt;
+
+&lt;div tabindex=0 aria-dropeffect=&quot;copy move&quot; role=&quot;button&quot; aria-label=&quot;drop&quot;&gt;drop&lt;/div&gt;
+&lt;div tabindex=0 aria-grabbed=true role=&quot;button&quot; aria-label=&quot;grab1&quot;&gt;grab&lt;/div&gt;
+&lt;div tabindex=0 aria-grabbed=false role=&quot;button&quot; aria-label=&quot;grab2&quot;&gt;grab&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 the ARIA drag and drop attributes work as intended.&quot;);
+
+    if (window.accessibilityController) {
+
+          var body = document.getElementById(&quot;body&quot;);
+          body.focus();
+          body = accessibilityController.focusedElement;
+
+          shouldBe(&quot;body.childAtIndex(0).ariaDropEffects&quot;, &quot;'copy,move'&quot;);
+
+          shouldBe(&quot;body.childAtIndex(1).ariaIsGrabbed&quot;, &quot;true&quot;);
+          shouldBe(&quot;body.childAtIndex(2).ariaIsGrabbed&quot;, &quot;false&quot;);
+          shouldBe(&quot;body.childAtIndex(1).isAttributeSettable('AXGrabbed')&quot;, &quot;true&quot;);
+          shouldBe(&quot;body.childAtIndex(2).isAttributeSettable('AXGrabbed')&quot;, &quot;true&quot;);
+    }
+
+    successfullyParsed = true;
+&lt;/script&gt;
+
+&lt;script src=&quot;../../../fast/js/resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (51581 => 51582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2009-12-02 03:49:26 UTC (rev 51581)
+++ trunk/WebCore/ChangeLog        2009-12-02 04:40:18 UTC (rev 51582)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2009-12-01  Chris Fleizach  &lt;cfleizach@apple.com&gt;
+
+        Reviewed by Darin Adler.
+
+        WAI-ARIA: implement support for ARIA drag and drop
+        https://bugs.webkit.org/show_bug.cgi?id=32007
+
+        Test: platform/mac/accessibility/aria-drag-drop.html
+
+        * accessibility/AccessibilityObject.h:
+        (WebCore::AccessibilityObject::supportsARIADropping):
+        (WebCore::AccessibilityObject::supportsARIADragging):
+        (WebCore::AccessibilityObject::isARIAGrabbed):
+        (WebCore::AccessibilityObject::setARIAGrabbed):
+        (WebCore::AccessibilityObject::determineARIADropEffects):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::supportsARIADropping):
+        (WebCore::AccessibilityRenderObject::supportsARIADragging):
+        (WebCore::AccessibilityRenderObject::isARIAGrabbed):
+        (WebCore::AccessibilityRenderObject::setARIAGrabbed):
+        (WebCore::AccessibilityRenderObject::determineARIADropEffects):
+        * accessibility/AccessibilityRenderObject.h:
+        * accessibility/mac/AccessibilityObjectWrapper.mm:
+        (-[AccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
+        (-[AccessibilityObjectWrapper accessibilityAttributeValue:]):
+        (-[AccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
+        (-[AccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
+        * html/HTMLAttributeNames.in:
+
</ins><span class="cx"> 2009-12-01  Adam Barth  &lt;abarth@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=21288
</span></span></pre></div>
<a id="trunkWebCoreaccessibilityAccessibilityObjecth"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/accessibility/AccessibilityObject.h (51581 => 51582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/accessibility/AccessibilityObject.h        2009-12-02 03:49:26 UTC (rev 51581)
+++ trunk/WebCore/accessibility/AccessibilityObject.h        2009-12-02 04:40:18 UTC (rev 51582)
</span><span class="lines">@@ -331,6 +331,13 @@
</span><span class="cx">     virtual bool supportsARIAFlowTo() const { return false; }
</span><span class="cx">     virtual void ariaFlowToElements(AccessibilityChildrenVector&amp;) const { }
</span><span class="cx">     
</span><ins>+    // ARIA drag and drop
+    virtual bool supportsARIADropping() { return false; }
+    virtual bool supportsARIADragging() { return false; }
+    virtual bool isARIAGrabbed() { return false; }
+    virtual void setARIAGrabbed(bool) { }
+    virtual void determineARIADropEffects(Vector&lt;String&gt;&amp;) { }
+    
</ins><span class="cx">     virtual AccessibilityObject* doAccessibilityHitTest(const IntPoint&amp;) const { return 0; }
</span><span class="cx">     virtual AccessibilityObject* focusedUIElement() const { return 0; }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/accessibility/AccessibilityRenderObject.cpp (51581 => 51582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/accessibility/AccessibilityRenderObject.cpp        2009-12-02 03:49:26 UTC (rev 51581)
+++ trunk/WebCore/accessibility/AccessibilityRenderObject.cpp        2009-12-02 04:40:18 UTC (rev 51582)
</span><span class="lines">@@ -1309,6 +1309,40 @@
</span><span class="cx">         
</span><span class="cx"> }
</span><span class="cx">     
</span><ins>+bool AccessibilityRenderObject::supportsARIADropping()
+{
+    const AtomicString&amp; dropEffect = getAttribute(aria_dropeffectAttr).string();
+    return !dropEffect.isEmpty();
+}
+
+bool AccessibilityRenderObject::supportsARIADragging()
+{
+    const AtomicString&amp; grabbed = getAttribute(aria_grabbedAttr).string();
+    return equalIgnoringCase(grabbed, &quot;true&quot;) || equalIgnoringCase(grabbed, &quot;false&quot;);   
+}
+
+bool AccessibilityRenderObject::isARIAGrabbed()
+{
+    return elementAttributeValue(aria_grabbedAttr);
+}
+
+void AccessibilityRenderObject::setARIAGrabbed(bool grabbed)
+{
+    setElementAttributeValue(aria_grabbedAttr, grabbed);
+}
+
+void AccessibilityRenderObject::determineARIADropEffects(Vector&lt;String&gt;&amp; effects)
+{
+    String dropEffects = getAttribute(aria_dropeffectAttr).string();
+    if (dropEffects.isEmpty()) {
+        effects.clear();
+        return;
+    }
+    
+    dropEffects.replace('\n', ' ');
+    dropEffects.split(' ', effects);
+}
+    
</ins><span class="cx"> bool AccessibilityRenderObject::exposesTitleUIElement() const
</span><span class="cx"> {
</span><span class="cx">     if (!isControl())
</span></span></pre></div>
<a id="trunkWebCoreaccessibilityAccessibilityRenderObjecth"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/accessibility/AccessibilityRenderObject.h (51581 => 51582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/accessibility/AccessibilityRenderObject.h        2009-12-02 03:49:26 UTC (rev 51581)
+++ trunk/WebCore/accessibility/AccessibilityRenderObject.h        2009-12-02 04:40:18 UTC (rev 51582)
</span><span class="lines">@@ -222,6 +222,12 @@
</span><span class="cx">     virtual bool supportsARIAFlowTo() const;
</span><span class="cx">     virtual void ariaFlowToElements(AccessibilityChildrenVector&amp;) const;
</span><span class="cx"> 
</span><ins>+    virtual bool supportsARIADropping();
+    virtual bool supportsARIADragging();
+    virtual bool isARIAGrabbed();
+    virtual void setARIAGrabbed(bool);
+    virtual void determineARIADropEffects(Vector&lt;String&gt;&amp;);
+    
</ins><span class="cx">     virtual VisiblePosition visiblePositionForPoint(const IntPoint&amp;) const;
</span><span class="cx">     virtual VisiblePosition visiblePositionForIndex(unsigned indexValue, bool lastIndexOK) const;    
</span><span class="cx">     virtual int index(const VisiblePosition&amp;) const;
</span></span></pre></div>
<a id="trunkWebCoreaccessibilitymacAccessibilityObjectWrappermm"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm (51581 => 51582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm        2009-12-02 03:49:26 UTC (rev 51581)
+++ trunk/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm        2009-12-02 04:40:18 UTC (rev 51582)
</span><span class="lines">@@ -123,6 +123,14 @@
</span><span class="cx"> #define NSAccessibilityOwnsAttribute @&quot;AXOwns&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#ifndef NSAccessibilityGrabbedAttribute
+#define NSAccessibilityGrabbedAttribute @&quot;AXGrabbed&quot;
+#endif
+
+#ifndef NSAccessibilityDropEffectsAttribute
+#define NSAccessibilityDropEffectsAttribute @&quot;AXDropEffects&quot;
+#endif
+
</ins><span class="cx"> #ifdef BUILDING_ON_TIGER
</span><span class="cx"> typedef unsigned NSUInteger;
</span><span class="cx"> #define NSAccessibilityValueDescriptionAttribute @&quot;AXValueDescription&quot;
</span><span class="lines">@@ -582,6 +590,12 @@
</span><span class="cx">     if (m_object-&gt;supportsARIAOwns())
</span><span class="cx">         [additional addObject:NSAccessibilityOwnsAttribute];
</span><span class="cx"> 
</span><ins>+    if (m_object-&gt;supportsARIADragging())
+        [additional addObject:NSAccessibilityGrabbedAttribute];
+
+    if (m_object-&gt;supportsARIADropping())
+        [additional addObject:NSAccessibilityDropEffectsAttribute];
+
</ins><span class="cx">     return additional;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1739,6 +1753,20 @@
</span><span class="cx">         return convertToNSArray(ariaOwns);
</span><span class="cx">     }
</span><span class="cx">     
</span><ins>+    if ([attributeName isEqualToString:NSAccessibilityGrabbedAttribute])
+        return [NSNumber numberWithBool:m_object-&gt;isARIAGrabbed()];
+    
+    if ([attributeName isEqualToString:NSAccessibilityDropEffectsAttribute]) {
+        Vector&lt;String&gt; dropEffects;
+        m_object-&gt;determineARIADropEffects(dropEffects);
+        size_t length = dropEffects.size();
+
+        NSMutableArray* dropEffectsArray = [NSMutableArray arrayWithCapacity:length];
+        for (size_t i = 0; i &lt; length; ++i)
+            [dropEffectsArray addObject:dropEffects[i]];
+        return dropEffectsArray;
+    }
+    
</ins><span class="cx">     // this is used only by DumpRenderTree for testing
</span><span class="cx">     if ([attributeName isEqualToString:@&quot;AXClickPoint&quot;])
</span><span class="cx">         return [NSValue valueWithPoint:m_object-&gt;clickPoint()];
</span><span class="lines">@@ -1813,6 +1841,9 @@
</span><span class="cx">         [attributeName isEqualToString: NSAccessibilityVisibleCharacterRangeAttribute])
</span><span class="cx">         return m_object-&gt;canSetTextRangeAttributes();
</span><span class="cx">     
</span><ins>+    if ([attributeName isEqualToString:NSAccessibilityGrabbedAttribute])
+        return YES;
+    
</ins><span class="cx">     return NO;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2101,7 +2132,8 @@
</span><span class="cx">         convertToVector(array, selectedRows);
</span><span class="cx">         if (m_object-&gt;isTree())
</span><span class="cx">             m_object-&gt;setSelectedRows(selectedRows);
</span><del>-    }
</del><ins>+    } else if ([attributeName isEqualToString:NSAccessibilityGrabbedAttribute])
+        m_object-&gt;setARIAGrabbed([number boolValue]);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static RenderObject* rendererForView(NSView* view)
</span></span></pre></div>
<a id="trunkWebCorehtmlHTMLAttributeNamesin"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/html/HTMLAttributeNames.in (51581 => 51582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/html/HTMLAttributeNames.in        2009-12-02 03:49:26 UTC (rev 51581)
+++ trunk/WebCore/html/HTMLAttributeNames.in        2009-12-02 04:40:18 UTC (rev 51582)
</span><span class="lines">@@ -17,8 +17,10 @@
</span><span class="cx"> aria-controls
</span><span class="cx"> aria-describedby
</span><span class="cx"> aria-disabled
</span><ins>+aria-dropeffect
</ins><span class="cx"> aria-expanded
</span><span class="cx"> aria-flowto
</span><ins>+aria-grabbed
</ins><span class="cx"> aria-hidden
</span><span class="cx"> aria-label
</span><span class="cx"> aria-labeledby
</span></span></pre></div>
<a id="trunkWebKitToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/ChangeLog (51581 => 51582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/ChangeLog        2009-12-02 03:49:26 UTC (rev 51581)
+++ trunk/WebKitTools/ChangeLog        2009-12-02 04:40:18 UTC (rev 51582)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2009-12-01  Chris Fleizach  &lt;cfleizach@apple.com&gt;
+
+        Reviewed by Darin Adler.
+
+        WAI-ARIA: implement support for ARIA drag and drop
+        https://bugs.webkit.org/show_bug.cgi?id=32007
+
+        * DumpRenderTree/AccessibilityUIElement.cpp:
+        (getARIADropEffectsCallback):
+        (getARIAIsGrabbedCallback):
+        (AccessibilityUIElement::getJSClass):
+        * DumpRenderTree/AccessibilityUIElement.h:
+        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+        (AccessibilityUIElement::ariaIsGrabbed):
+        (AccessibilityUIElement::ariaDropEffects):
+
</ins><span class="cx"> 2009-12-01  Nikolas Zimmermann  &lt;nzimmermann@rim.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Not reviewed. GTK DRT try 2.
</span></span></pre></div>
<a id="trunkWebKitToolsDumpRenderTreeAccessibilityUIElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp (51581 => 51582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp        2009-12-02 03:49:26 UTC (rev 51581)
+++ trunk/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp        2009-12-02 04:40:18 UTC (rev 51582)
</span><span class="lines">@@ -313,6 +313,17 @@
</span><span class="cx"> 
</span><span class="cx"> // Static Value Getters
</span><span class="cx"> 
</span><ins>+static JSValueRef getARIADropEffectsCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    JSRetainPtr&lt;JSStringRef&gt; dropEffects(Adopt, toAXElement(thisObject)-&gt;ariaDropEffects());
+    return JSValueMakeString(context, dropEffects.get());
+}
+
+static JSValueRef getARIAIsGrabbedCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    return JSValueMakeBoolean(context, toAXElement(thisObject)-&gt;ariaIsGrabbed());
+}
+
</ins><span class="cx"> static JSValueRef getIsValidCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><span class="cx">     AccessibilityUIElement* uiElement = toAXElement(thisObject);
</span><span class="lines">@@ -515,6 +526,8 @@
</span><span class="cx">         { &quot;documentEncoding&quot;, getDocumentEncodingCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { &quot;documentURI&quot;, getDocumentURICallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { &quot;isValid&quot;, getIsValidCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><ins>+        { &quot;ariaIsGrabbed&quot;, getARIAIsGrabbedCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { &quot;ariaDropEffects&quot;, getARIADropEffectsCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</ins><span class="cx">         { 0, 0, 0, 0 }
</span><span class="cx">     };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebKitToolsDumpRenderTreeAccessibilityUIElementh"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/DumpRenderTree/AccessibilityUIElement.h (51581 => 51582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/DumpRenderTree/AccessibilityUIElement.h        2009-12-02 03:49:26 UTC (rev 51581)
+++ trunk/WebKitTools/DumpRenderTree/AccessibilityUIElement.h        2009-12-02 04:40:18 UTC (rev 51582)
</span><span class="lines">@@ -135,6 +135,11 @@
</span><span class="cx">     AccessibilityUIElement ariaOwnsElementAtIndex(unsigned);
</span><span class="cx">     AccessibilityUIElement ariaFlowToElementAtIndex(unsigned);
</span><span class="cx"> 
</span><ins>+    // ARIA Drag and Drop
+    bool ariaIsGrabbed() const;
+    // A space concatentated string of all the drop effects.
+    JSStringRef ariaDropEffects() const;
+    
</ins><span class="cx">     // Parameterized attributes
</span><span class="cx">     int lineForIndex(int);
</span><span class="cx">     JSStringRef boundsForRange(unsigned location, unsigned length);
</span></span></pre></div>
<a id="trunkWebKitToolsDumpRenderTreemacAccessibilityUIElementMacmm"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm (51581 => 51582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm        2009-12-02 03:49:26 UTC (rev 51581)
+++ trunk/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm        2009-12-02 04:40:18 UTC (rev 51582)
</span><span class="lines">@@ -44,6 +44,14 @@
</span><span class="cx"> #define NSAccessibilityOwnsAttribute @&quot;AXOwns&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#ifndef NSAccessibilityGrabbedAttribute
+#define NSAccessibilityGrabbedAttribute @&quot;AXGrabbed&quot;
+#endif
+
+#ifndef NSAccessibilityDropEffectsAttribute
+#define NSAccessibilityDropEffectsAttribute @&quot;AXDropEffects&quot;
+#endif
+
</ins><span class="cx"> @interface NSObject (WebKitAccessibilityArrayCategory)
</span><span class="cx"> - (NSArray *)accessibilityArrayAttributeValues:(NSString *)attribute index:(NSUInteger)index maxCount:(NSUInteger)maxCount;
</span><span class="cx"> @end
</span><span class="lines">@@ -512,6 +520,31 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool AccessibilityUIElement::ariaIsGrabbed() const
+{
+    id value = [m_element accessibilityAttributeValue:NSAccessibilityGrabbedAttribute];
+    if ([value isKindOfClass:[NSNumber class]])
+        return [value boolValue];
+    return false;
+}
+
+JSStringRef AccessibilityUIElement::ariaDropEffects() const
+{
+    id value = [m_element accessibilityAttributeValue:NSAccessibilityDropEffectsAttribute];
+    if (![value isKindOfClass:[NSArray class]])
+        return 0;
+
+    NSMutableString* dropEffects = [NSMutableString string];
+    NSInteger length = [value count];
+    for (NSInteger k = 0; k &lt; length; ++k) {
+        [dropEffects appendString:[value objectAtIndex:k]];
+        if (k &lt; length - 1)
+            [dropEffects appendString:@&quot;,&quot;];
+    }
+    
+    return [dropEffects createJSStringRef];
+}
+
</ins><span class="cx"> // parameterized attributes
</span><span class="cx"> int AccessibilityUIElement::lineForIndex(int index)
</span><span class="cx"> {
</span></span></pre>
</div>
</div>

</body>
</html>