<!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>[225511] 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/225511">225511</a></dd>
<dt>Author</dt> <dd>n_wang@apple.com</dd>
<dt>Date</dt> <dd>2017-12-04 17:24:19 -0800 (Mon, 04 Dec 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>AX: AOM: Implement relation type properties
https://bugs.webkit.org/show_bug.cgi?id=179500

Reviewed by Ryosuke Niwa.

Source/WebCore:

Accessibility Object Model
Explainer: https://wicg.github.io/aom/explainer.html
Spec: https://wicg.github.io/aom/spec/

Implemented the AOM support for activeDescendant, details and errorMessage.
The corresponding ARIA attributes all take IDREFs, and the AOM properties
take references to AccessibleNodes instead.

Test: accessibility/mac/AOM-relation-property.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::getAttribute const):
(WebCore::AccessibilityObject::hasProperty const):
(WebCore::AccessibilityObject::stringValueForProperty const):
(WebCore::AccessibilityObject::boolValueForProperty const):
(WebCore::AccessibilityObject::intValueForProperty const):
(WebCore::AccessibilityObject::unsignedValueForProperty const):
(WebCore::AccessibilityObject::doubleValueForProperty const):
(WebCore::AccessibilityObject::elementValueForProperty const):
(WebCore::AccessibilityObject::supportsARIAAttributes const):
(WebCore::AccessibilityObject::elementsFromProperty const):
(WebCore::AccessibilityObject::elementsReferencedByProperty const):
(WebCore::AccessibilityObject::ariaActiveDescendantReferencingElements const):
(WebCore::AccessibilityObject::ariaDetailsElements const):
(WebCore::AccessibilityObject::ariaDetailsReferencingElements const):
(WebCore::AccessibilityObject::ariaErrorMessageElements const):
(WebCore::AccessibilityObject::ariaErrorMessageReferencingElements const):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::activeDescendant const):
* accessibility/AccessibleNode.cpp:
(WebCore::ariaAttributeMap):
(WebCore::isPropertyValueRelation):
(WebCore::AccessibleNode::attributeFromAXPropertyName):
(WebCore::AccessibleNode::setRelationProperty):
(WebCore::AccessibleNode::singleRelationValueForProperty):
(WebCore::AccessibleNode::activeDescendant const):
(WebCore::AccessibleNode::setActiveDescendant):
(WebCore::AccessibleNode::details const):
(WebCore::AccessibleNode::setDetails):
(WebCore::AccessibleNode::errorMessage const):
(WebCore::AccessibleNode::setErrorMessage):
* accessibility/AccessibleNode.h:
* accessibility/AccessibleNode.idl:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

Tools:

* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
(WTR::AccessibilityUIElement::ariaDetailsElementAtIndex):
(WTR::AccessibilityUIElement::ariaErrorMessageElementAtIndex):
(WTR::AccessibilityUIElement::ariaDescribedByReferencingElementAtIndex):
(WTR::AccessibilityUIElement::ariaDetailsReferencingElementAtIndex):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::ariaDetailsElementAtIndex):
(WTR::AccessibilityUIElement::ariaErrorMessageElementAtIndex):

LayoutTests:

Only enable this test on WK2.

* accessibility/mac/AOM-relation-property-expected.txt: Added.
* accessibility/mac/AOM-relation-property.html: Added.
* platform/mac-wk1/TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk1TestExpectations">trunk/LayoutTests/platform/mac-wk1/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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="#trunkSourceWebCoreaccessibilityAccessibleNodecpp">trunk/Source/WebCore/accessibility/AccessibleNode.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibleNodeh">trunk/Source/WebCore/accessibility/AccessibleNode.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibleNodeidl">trunk/Source/WebCore/accessibility/AccessibleNode.idl</a></li>
<li><a href="#trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperMacmm">trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleAccessibilityUIElementh">trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityUIElementMacmm">trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsaccessibilitymacAOMrelationpropertyexpectedtxt">trunk/LayoutTests/accessibility/mac/AOM-relation-property-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilitymacAOMrelationpropertyhtml">trunk/LayoutTests/accessibility/mac/AOM-relation-property.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (225510 => 225511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2017-12-05 01:19:25 UTC (rev 225510)
+++ trunk/LayoutTests/ChangeLog 2017-12-05 01:24:19 UTC (rev 225511)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2017-12-04  Nan Wang  <n_wang@apple.com>
+
+        AX: AOM: Implement relation type properties
+        https://bugs.webkit.org/show_bug.cgi?id=179500
+
+        Reviewed by Ryosuke Niwa.
+
+        Only enable this test on WK2.
+
+        * accessibility/mac/AOM-relation-property-expected.txt: Added.
+        * accessibility/mac/AOM-relation-property.html: Added.
+        * platform/mac-wk1/TestExpectations:
+
</ins><span class="cx"> 2017-12-04  Zalan Bujtas  <zalan@apple.com>
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r211531): Text flow changes and overlaps other text after double-click selecting paragraph
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymacAOMrelationpropertyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/mac/AOM-relation-property-expected.txt (0 => 225511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/AOM-relation-property-expected.txt                           (rev 0)
+++ trunk/LayoutTests/accessibility/mac/AOM-relation-property-expected.txt      2017-12-05 01:24:19 UTC (rev 225511)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+Menu item 1
+Menu item 2
+
+Information about the error.
+This tests relation type Accessibility Object Model properties.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+ActiveDescendant support
+PASS axRelation.isSelected is false
+PASS axRelation.isSelected is true
+PASS axRelation.boolAttributeValue('AXIsActiveDescendantOfFocusedContainer') is false
+PASS axRelation.boolAttributeValue('AXIsActiveDescendantOfFocusedContainer') is true
+PASS axRelation.boolAttributeValue('AXIsActiveDescendantOfFocusedContainer') is false
+PASS axRelation.boolAttributeValue('AXIsActiveDescendantOfFocusedContainer') is true
+
+Details support
+PASS axNode.ariaDetailsElementAtIndex(0) is null
+PASS axNode.ariaDetailsElementAtIndex(0).childAtIndex(0).stringValue is "AXValue: Detailed descriptive information."
+PASS axNode.ariaDetailsElementAtIndex(0) is null
+
+ErrorMessage support
+PASS axNode.ariaErrorMessageElementAtIndex(0) is null
+PASS axNode.ariaErrorMessageElementAtIndex(0).childAtIndex(0).stringValue is "AXValue: Information about the error."
+
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymacAOMrelationpropertyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/mac/AOM-relation-property.html (0 => 225511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/AOM-relation-property.html                           (rev 0)
+++ trunk/LayoutTests/accessibility/mac/AOM-relation-property.html      2017-12-05 01:24:19 UTC (rev 225511)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+<!DOCTYPE HTML>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../../resources/accessibility-helper.js"></script>
+</head>
+<body>
+
+<div id="menu" role="menu" aria-label="First menu" tabindex="-1">
+<div role="menuitem" id="item1" aria-label="item 1" tabindex="-1">Menu item 1</div>
+<div role="menuitem" id="item2" aria-label="item 2" tabindex="0">Menu item 2</div>
+</div>
+
+<input id="input">
+<div id="details">Detailed descriptive information.</div>
+<div id="error">Information about the error.</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+    description("This tests relation type Accessibility Object Model properties.");
+    if (window.accessibilityController) {
+        var node;
+        var axNode;
+        var relation;
+        var axRelation;
+
+        testActiveDescendant();
+        testDetails();
+        testErrorMessage();
+    }
+
+    function testActiveDescendant() {
+        debug("\nActiveDescendant support");
+        node = document.getElementById("menu");
+        axNode = accessibilityController.accessibleElementById("menu");
+        relation = document.getElementById("item1");
+        axRelation = accessibilityController.accessibleElementById("item1");
+
+        // Active Descendant makes the Menu item selected. 
+        shouldBeFalse("axRelation.isSelected");
+        node.accessibleNode.activeDescendant = relation.accessibleNode;
+        shouldBeTrue("axRelation.isSelected");
+        
+        // Test that we are able to get the right container.
+        shouldBeFalse("axRelation.boolAttributeValue('AXIsActiveDescendantOfFocusedContainer')");
+        node.focus();
+        shouldBeTrue("axRelation.boolAttributeValue('AXIsActiveDescendantOfFocusedContainer')");
+        
+        // Make sure it falls back to ARIA attribute if AOM property is not set.
+        node.accessibleNode.activeDescendant = null;
+        shouldBeFalse("axRelation.boolAttributeValue('AXIsActiveDescendantOfFocusedContainer')");
+        node.setAttribute("aria-activedescendant", "item1");
+        shouldBeTrue("axRelation.boolAttributeValue('AXIsActiveDescendantOfFocusedContainer')");
+    }
+
+    function testDetails() {
+        debug("\nDetails support");
+        node = document.getElementById("input");
+        axNode = accessibilityController.accessibleElementById("input");
+        relation = document.getElementById("details");
+        
+        shouldBeNull("axNode.ariaDetailsElementAtIndex(0)");
+        node.accessibleNode.details = relation.accessibleNode;
+        shouldBeEqualToString("axNode.ariaDetailsElementAtIndex(0).childAtIndex(0).stringValue", "AXValue: Detailed descriptive information.");
+        
+        // Test removing the details element.
+        relation.parentElement.removeChild(relation);
+        shouldBeNull("axNode.ariaDetailsElementAtIndex(0)");
+    }
+
+    function testErrorMessage() {
+        debug("\nErrorMessage support");
+        node = document.getElementById("input");
+        axNode = accessibilityController.accessibleElementById("input");
+        relation = document.getElementById("error");
+        
+        shouldBeNull("axNode.ariaErrorMessageElementAtIndex(0)");
+        node.accessibleNode.errorMessage = relation.accessibleNode;
+        shouldBeEqualToString("axNode.ariaErrorMessageElementAtIndex(0).childAtIndex(0).stringValue", "AXValue: Information about the error.");
+    }
+
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk1TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (225510 => 225511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk1/TestExpectations      2017-12-05 01:19:25 UTC (rev 225510)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations 2017-12-05 01:24:19 UTC (rev 225511)
</span><span class="lines">@@ -473,3 +473,4 @@
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/172044 [ Debug ] imported/w3c/web-platform-tests/IndexedDB/open-request-queue.html [ Pass Timeout ]
</span><span class="cx"> 
</span><ins>+webkit.org/b/179500 accessibility/mac/AOM-relation-property.html [ Skip ]
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (225510 => 225511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2017-12-05 01:19:25 UTC (rev 225510)
+++ trunk/Source/WebCore/ChangeLog      2017-12-05 01:24:19 UTC (rev 225511)
</span><span class="lines">@@ -1,3 +1,57 @@
</span><ins>+2017-12-04  Nan Wang  <n_wang@apple.com>
+
+        AX: AOM: Implement relation type properties
+        https://bugs.webkit.org/show_bug.cgi?id=179500
+
+        Reviewed by Ryosuke Niwa.
+
+        Accessibility Object Model
+        Explainer: https://wicg.github.io/aom/explainer.html
+        Spec: https://wicg.github.io/aom/spec/
+
+        Implemented the AOM support for activeDescendant, details and errorMessage.
+        The corresponding ARIA attributes all take IDREFs, and the AOM properties
+        take references to AccessibleNodes instead.
+
+        Test: accessibility/mac/AOM-relation-property.html
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::getAttribute const):
+        (WebCore::AccessibilityObject::hasProperty const):
+        (WebCore::AccessibilityObject::stringValueForProperty const):
+        (WebCore::AccessibilityObject::boolValueForProperty const):
+        (WebCore::AccessibilityObject::intValueForProperty const):
+        (WebCore::AccessibilityObject::unsignedValueForProperty const):
+        (WebCore::AccessibilityObject::doubleValueForProperty const):
+        (WebCore::AccessibilityObject::elementValueForProperty const):
+        (WebCore::AccessibilityObject::supportsARIAAttributes const):
+        (WebCore::AccessibilityObject::elementsFromProperty const):
+        (WebCore::AccessibilityObject::elementsReferencedByProperty const):
+        (WebCore::AccessibilityObject::ariaActiveDescendantReferencingElements const):
+        (WebCore::AccessibilityObject::ariaDetailsElements const):
+        (WebCore::AccessibilityObject::ariaDetailsReferencingElements const):
+        (WebCore::AccessibilityObject::ariaErrorMessageElements const):
+        (WebCore::AccessibilityObject::ariaErrorMessageReferencingElements const):
+        * accessibility/AccessibilityObject.h:
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::activeDescendant const):
+        * accessibility/AccessibleNode.cpp:
+        (WebCore::ariaAttributeMap):
+        (WebCore::isPropertyValueRelation):
+        (WebCore::AccessibleNode::attributeFromAXPropertyName):
+        (WebCore::AccessibleNode::setRelationProperty):
+        (WebCore::AccessibleNode::singleRelationValueForProperty):
+        (WebCore::AccessibleNode::activeDescendant const):
+        (WebCore::AccessibleNode::setActiveDescendant):
+        (WebCore::AccessibleNode::details const):
+        (WebCore::AccessibleNode::setDetails):
+        (WebCore::AccessibleNode::errorMessage const):
+        (WebCore::AccessibleNode::setErrorMessage):
+        * accessibility/AccessibleNode.h:
+        * accessibility/AccessibleNode.idl:
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
+
</ins><span class="cx"> 2017-12-04  Simon Fraser  <simon.fraser@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Minor DisplayRefreshMonitor-related cleanup
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (225510 => 225511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp       2017-12-05 01:19:25 UTC (rev 225510)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp  2017-12-05 01:24:19 UTC (rev 225511)
</span><span class="lines">@@ -2139,7 +2139,7 @@
</span><span class="cx">     
</span><span class="cx"> const AtomicString& AccessibilityObject::getAttribute(const QualifiedName& attribute) const
</span><span class="cx"> {
</span><del>-    if (Element* element = this->element())
</del><ins>+    if (auto* element = this->element())
</ins><span class="cx">         return element->attributeWithoutSynchronization(attribute);
</span><span class="cx">     return nullAtom();
</span><span class="cx"> }
</span><span class="lines">@@ -2146,7 +2146,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityObject::hasProperty(AXPropertyName propertyKey) const
</span><span class="cx"> {
</span><del>-    if (Element* element = this->element())
</del><ins>+    if (auto* element = this->element())
</ins><span class="cx">         return AccessibleNode::hasProperty(*element, propertyKey);
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="lines">@@ -2153,7 +2153,7 @@
</span><span class="cx"> 
</span><span class="cx"> const String AccessibilityObject::stringValueForProperty(AXPropertyName propertyKey) const
</span><span class="cx"> {
</span><del>-    if (Element* element = this->element())
</del><ins>+    if (auto* element = this->element())
</ins><span class="cx">         return AccessibleNode::effectiveStringValueForElement(*element, propertyKey);
</span><span class="cx">     return nullAtom();
</span><span class="cx"> }
</span><span class="lines">@@ -2160,7 +2160,7 @@
</span><span class="cx"> 
</span><span class="cx"> std::optional<bool> AccessibilityObject::boolValueForProperty(AXPropertyName propertyKey) const
</span><span class="cx"> {
</span><del>-    if (Element* element = this->element())
</del><ins>+    if (auto* element = this->element())
</ins><span class="cx">         return AccessibleNode::effectiveBoolValueForElement(*element, propertyKey);
</span><span class="cx">     return std::nullopt;
</span><span class="cx"> }
</span><span class="lines">@@ -2167,7 +2167,7 @@
</span><span class="cx"> 
</span><span class="cx"> int AccessibilityObject::intValueForProperty(AXPropertyName propertyKey) const
</span><span class="cx"> {
</span><del>-    if (Element* element = this->element())
</del><ins>+    if (auto* element = this->element())
</ins><span class="cx">         return AccessibleNode::effectiveIntValueForElement(*element, propertyKey);
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -2174,7 +2174,7 @@
</span><span class="cx"> 
</span><span class="cx"> unsigned AccessibilityObject::unsignedValueForProperty(AXPropertyName propertyKey) const
</span><span class="cx"> {
</span><del>-    if (Element* element = this->element())
</del><ins>+    if (auto* element = this->element())
</ins><span class="cx">         return AccessibleNode::effectiveUnsignedValueForElement(*element, propertyKey);
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -2181,11 +2181,23 @@
</span><span class="cx"> 
</span><span class="cx"> double AccessibilityObject::doubleValueForProperty(AXPropertyName propertyKey) const
</span><span class="cx"> {
</span><del>-    if (Element* element = this->element())
</del><ins>+    if (auto* element = this->element())
</ins><span class="cx">         return AccessibleNode::effectiveDoubleValueForElement(*element, propertyKey);
</span><span class="cx">     return 0.0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Element* AccessibilityObject::elementValueForProperty(AXPropertyName propertyKey) const
+{
+    if (auto* element = this->element()) {
+        auto elements = AccessibleNode::effectiveElementsValueForElement(*element, propertyKey);
+        size_t size = elements.size();
+        ASSERT(!size || size == 1);
+        if (size)
+            return elements.first().get();
+    }
+    return nullptr;
+}
+
</ins><span class="cx"> // Lacking concrete evidence of orientation, horizontal means width > height. vertical is height > width;
</span><span class="cx"> AccessibilityOrientation AccessibilityObject::orientation() const
</span><span class="cx"> {
</span><span class="lines">@@ -2555,9 +2567,9 @@
</span><span class="cx">         || hasAttribute(aria_controlsAttr)
</span><span class="cx">         || hasProperty(AXPropertyName::Current)
</span><span class="cx">         || hasAttribute(aria_describedbyAttr)
</span><del>-        || hasAttribute(aria_detailsAttr)
</del><ins>+        || hasProperty(AXPropertyName::Details)
</ins><span class="cx">         || hasProperty(AXPropertyName::Disabled)
</span><del>-        || hasAttribute(aria_errormessageAttr)
</del><ins>+        || hasProperty(AXPropertyName::ErrorMessage)
</ins><span class="cx">         || hasAttribute(aria_flowtoAttr)
</span><span class="cx">         || hasProperty(AXPropertyName::HasPopUp)
</span><span class="cx">         || hasProperty(AXPropertyName::Invalid)
</span><span class="lines">@@ -3432,6 +3444,57 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void AccessibilityObject::elementsFromProperty(AccessibilityChildrenVector& children, AXPropertyName property) const
+{
+    auto* element = this->element();
+    if (!element)
+        return;
+    
+    auto* cache = axObjectCache();
+    if (!cache)
+        return;
+
+    auto elements = AccessibleNode::effectiveElementsValueForElement(*element, property);
+    for (const auto& element : elements) {
+        if (AccessibilityObject* axObject = cache->getOrCreate(element.get()))
+            children.append(axObject);
+    }
+}
+
+void AccessibilityObject::elementsReferencedByProperty(AccessibilityChildrenVector& elements, AXPropertyName property) const
+{
+    auto* thisElement = this->element();
+    if (!thisElement)
+        return;
+    
+    auto id = identifierAttribute();
+    bool idIsEmpty = id.isEmpty();
+    auto* accessibleNode = thisElement->existingAccessibleNode();
+    if (idIsEmpty && !accessibleNode)
+        return;
+
+    auto* cache = axObjectCache();
+    if (!cache)
+        return;
+
+    for (auto& element : descendantsOfType<Element>(node()->treeScope().rootNode())) {
+        bool shouldStore = false;
+        auto referencedAccessibleNodes = AccessibleNode::relationsValueForProperty(element, property);
+        if (referencedAccessibleNodes.size())
+            shouldStore = referencedAccessibleNodes.contains(accessibleNode);
+        if (!shouldStore && !idIsEmpty) {
+            const AtomicString& idList = element.attributeWithoutSynchronization(AccessibleNode::attributeFromAXPropertyName(property));
+            if (SpaceSplitString(idList, false).contains(id))
+                shouldStore = true;
+        }
+
+        if (!shouldStore)
+            continue;
+        if (AccessibilityObject* axObject = cache->getOrCreate(&element))
+            elements.append(axObject);
+    }
+}
+
</ins><span class="cx"> bool AccessibilityObject::isActiveDescendantOfFocusedContainer() const
</span><span class="cx"> {
</span><span class="cx">     AccessibilityChildrenVector containers;
</span><span class="lines">@@ -3446,7 +3509,7 @@
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityObject::ariaActiveDescendantReferencingElements(AccessibilityChildrenVector& containers) const
</span><span class="cx"> {
</span><del>-    ariaElementsReferencedByAttribute(containers, aria_activedescendantAttr);
</del><ins>+    elementsReferencedByProperty(containers, AXPropertyName::ActiveDescendant);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityObject::ariaControlsElements(AccessibilityChildrenVector& ariaControls) const
</span><span class="lines">@@ -3471,22 +3534,22 @@
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityObject::ariaDetailsElements(AccessibilityChildrenVector& ariaDetails) const
</span><span class="cx"> {
</span><del>-    ariaElementsFromAttribute(ariaDetails, aria_detailsAttr);
</del><ins>+    elementsFromProperty(ariaDetails, AXPropertyName::Details);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityObject::ariaDetailsReferencingElements(AccessibilityChildrenVector& detailsFor) const
</span><span class="cx"> {
</span><del>-    ariaElementsReferencedByAttribute(detailsFor, aria_detailsAttr);
</del><ins>+    elementsReferencedByProperty(detailsFor, AXPropertyName::Details);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityObject::ariaErrorMessageElements(AccessibilityChildrenVector& ariaErrorMessage) const
</span><span class="cx"> {
</span><del>-    ariaElementsFromAttribute(ariaErrorMessage, aria_errormessageAttr);
</del><ins>+    elementsFromProperty(ariaErrorMessage, AXPropertyName::ErrorMessage);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityObject::ariaErrorMessageReferencingElements(AccessibilityChildrenVector& errorMessageFor) const
</span><span class="cx"> {
</span><del>-    ariaElementsReferencedByAttribute(errorMessageFor, aria_errormessageAttr);
</del><ins>+    elementsReferencedByProperty(errorMessageFor, AXPropertyName::ErrorMessage);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityObject::ariaFlowToElements(AccessibilityChildrenVector& flowTo) const
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (225510 => 225511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.h 2017-12-05 01:19:25 UTC (rev 225510)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h    2017-12-05 01:24:19 UTC (rev 225511)
</span><span class="lines">@@ -899,6 +899,7 @@
</span><span class="cx">     int intValueForProperty(AXPropertyName) const;
</span><span class="cx">     unsigned unsignedValueForProperty(AXPropertyName) const;
</span><span class="cx">     double doubleValueForProperty(AXPropertyName) const;
</span><ins>+    Element* elementValueForProperty(AXPropertyName) const;
</ins><span class="cx"> 
</span><span class="cx">     virtual VisiblePositionRange visiblePositionRange() const { return VisiblePositionRange(); }
</span><span class="cx">     virtual VisiblePositionRange visiblePositionRangeForLine(unsigned) const { return VisiblePositionRange(); }
</span><span class="lines">@@ -1168,6 +1169,8 @@
</span><span class="cx"> 
</span><span class="cx">     void ariaElementsFromAttribute(AccessibilityChildrenVector&, const QualifiedName&) const;
</span><span class="cx">     void ariaElementsReferencedByAttribute(AccessibilityChildrenVector&, const QualifiedName&) const;
</span><ins>+    void elementsFromProperty(AccessibilityChildrenVector&, AXPropertyName) const;
+    void elementsReferencedByProperty(AccessibilityChildrenVector&, AXPropertyName) const;
</ins><span class="cx"> 
</span><span class="cx">     AccessibilityObject* radioGroupAncestor() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (225510 => 225511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2017-12-05 01:19:25 UTC (rev 225510)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp    2017-12-05 01:24:19 UTC (rev 225511)
</span><span class="lines">@@ -2438,15 +2438,8 @@
</span><span class="cx">     if (!m_renderer)
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span><del>-    const AtomicString& activeDescendantAttrStr = getAttribute(aria_activedescendantAttr);
-    if (activeDescendantAttrStr.isNull() || activeDescendantAttrStr.isEmpty())
-        return nullptr;
</del><span class="cx">     
</span><del>-    Element* element = this->element();
-    if (!element)
-        return nullptr;
-    
-    Element* target = element->treeScope().getElementById(activeDescendantAttrStr);
</del><ins>+    Element* target = elementValueForProperty(AXPropertyName::ActiveDescendant);
</ins><span class="cx">     if (!target)
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibleNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibleNode.cpp (225510 => 225511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibleNode.cpp    2017-12-05 01:19:25 UTC (rev 225510)
+++ trunk/Source/WebCore/accessibility/AccessibleNode.cpp       2017-12-05 01:24:19 UTC (rev 225511)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx">             AXPropertyName name;
</span><span class="cx">             QualifiedName ariaAttribute;
</span><span class="cx">         } attributes[] = {
</span><ins>+            { AXPropertyName::ActiveDescendant, aria_activedescendantAttr },
</ins><span class="cx">             { AXPropertyName::Atomic, aria_atomicAttr },
</span><span class="cx">             { AXPropertyName::Autocomplete, aria_autocompleteAttr },
</span><span class="cx">             { AXPropertyName::Busy, aria_busyAttr },
</span><span class="lines">@@ -53,7 +54,9 @@
</span><span class="cx">             { AXPropertyName::ColIndex, aria_colindexAttr },
</span><span class="cx">             { AXPropertyName::ColSpan, aria_colspanAttr },
</span><span class="cx">             { AXPropertyName::Current, aria_currentAttr },
</span><ins>+            { AXPropertyName::Details, aria_detailsAttr },
</ins><span class="cx">             { AXPropertyName::Disabled, aria_disabledAttr },
</span><ins>+            { AXPropertyName::ErrorMessage, aria_errormessageAttr },
</ins><span class="cx">             { AXPropertyName::Expanded, aria_expandedAttr },
</span><span class="cx">             { AXPropertyName::HasPopUp, aria_haspopupAttr },
</span><span class="cx">             { AXPropertyName::Hidden, aria_hiddenAttr },
</span><span class="lines">@@ -177,6 +180,23 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static bool isPropertyValueRelation(AXPropertyName propertyName)
+{
+    switch (propertyName) {
+    case AXPropertyName::ActiveDescendant:
+    case AXPropertyName::Details:
+    case AXPropertyName::ErrorMessage:
+        return true;
+    default:
+        return false;
+    }
+}
+
+QualifiedName AccessibleNode::attributeFromAXPropertyName(AXPropertyName propertyName)
+{
+    return ariaAttributeMap().get(propertyName);
+}
+
</ins><span class="cx"> bool AccessibleNode::hasProperty(Element& element, AXPropertyName propertyName)
</span><span class="cx"> {
</span><span class="cx">     if (auto* accessibleNode = element.existingAccessibleNode()) {
</span><span class="lines">@@ -220,6 +240,14 @@
</span><span class="cx">     setProperty(propertyName, value, value.isEmpty());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void AccessibleNode::setRelationProperty(AXPropertyName propertyName, AccessibleNode* value)
+{
+    Vector<RefPtr<AccessibleNode>> accessibleNodes;
+    if (value)
+        accessibleNodes.append(value);
+    setProperty(propertyName, accessibleNodes, !value);
+}
+
</ins><span class="cx"> const String AccessibleNode::effectiveStringValueForElement(Element& element, AXPropertyName propertyName)
</span><span class="cx"> {
</span><span class="cx">     const String& value = stringValueForProperty(element, propertyName);
</span><span class="lines">@@ -306,6 +334,48 @@
</span><span class="cx">     return 0.0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+RefPtr<AccessibleNode> AccessibleNode::singleRelationValueForProperty(Element& element, AXPropertyName propertyName)
+{
+    Vector<RefPtr<AccessibleNode>> accessibleNodes = relationsValueForProperty(element, propertyName);
+    size_t size = accessibleNodes.size();
+    ASSERT(!size || size == 1);
+    if (size)
+        return accessibleNodes.first();
+    return nullptr;
+}
+
+Vector<RefPtr<AccessibleNode>> AccessibleNode::relationsValueForProperty(Element& element, AXPropertyName propertyName)
+{
+    const PropertyValueVariant&& variant = AccessibleNode::valueForProperty(element, propertyName);
+    if (WTF::holds_alternative<Vector<RefPtr<AccessibleNode>>>(variant))
+        return WTF::get<Vector<RefPtr<AccessibleNode>>>(variant);
+    return Vector<RefPtr<AccessibleNode>> { };
+}
+
+Vector<RefPtr<Element>> AccessibleNode::effectiveElementsValueForElement(Element& element, AXPropertyName propertyName)
+{
+    Vector<RefPtr<Element>> elements;
+    auto value = relationsValueForProperty(element, propertyName);
+    if (value.size()) {
+        for (auto accessibleNode : value)
+            elements.append(&accessibleNode->m_ownerElement);
+        return elements;
+    }
+
+    if (ariaAttributeMap().contains(propertyName) && isPropertyValueRelation(propertyName)) {
+        const AtomicString& attrStr = element.attributeWithoutSynchronization(ariaAttributeMap().get(propertyName));
+        if (attrStr.isNull() || attrStr.isEmpty())
+            return elements;
+        auto spaceSplitString = SpaceSplitString(attrStr, false);
+        size_t length = spaceSplitString.size();
+        for (size_t i = 0; i < length; ++i) {
+            if (auto* idElement = element.treeScope().getElementById(spaceSplitString[i]))
+                elements.append(idElement);
+        }
+    }
+    return elements;
+}
+
</ins><span class="cx"> void AccessibleNode::notifyAttributeChanged(const WebCore::QualifiedName& name)
</span><span class="cx"> {
</span><span class="cx">     if (AXObjectCache* cache = m_ownerElement.document().axObjectCache())
</span><span class="lines">@@ -312,6 +382,17 @@
</span><span class="cx">         cache->handleAttributeChanged(name, &m_ownerElement);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+RefPtr<AccessibleNode> AccessibleNode::activeDescendant() const
+{
+    return singleRelationValueForProperty(m_ownerElement, AXPropertyName::ActiveDescendant);
+}
+
+void AccessibleNode::setActiveDescendant(AccessibleNode* value)
+{
+    setRelationProperty(AXPropertyName::ActiveDescendant, value);
+    notifyAttributeChanged(aria_activedescendantAttr);
+}
+
</ins><span class="cx"> std::optional<bool> AccessibleNode::atomic() const
</span><span class="cx"> {
</span><span class="cx">     return optionalValueForProperty<bool>(m_ownerElement, AXPropertyName::Atomic);
</span><span class="lines">@@ -400,11 +481,34 @@
</span><span class="cx">     notifyAttributeChanged(aria_currentAttr);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+RefPtr<AccessibleNode> AccessibleNode::details() const
+{
+    return singleRelationValueForProperty(m_ownerElement, AXPropertyName::Details);
+}
+
+void AccessibleNode::setDetails(AccessibleNode* value)
+{
+    setRelationProperty(AXPropertyName::Details, value);
+    notifyAttributeChanged(aria_detailsAttr);
+}
+
</ins><span class="cx"> std::optional<bool> AccessibleNode::disabled() const
</span><span class="cx"> {
</span><span class="cx">     return optionalValueForProperty<bool>(m_ownerElement, AXPropertyName::Disabled);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+RefPtr<AccessibleNode> AccessibleNode::errorMessage() const
+{
+    return singleRelationValueForProperty(m_ownerElement, AXPropertyName::ErrorMessage);
+}
+
+void AccessibleNode::setErrorMessage(AccessibleNode* value)
+{
+    setRelationProperty(AXPropertyName::ErrorMessage, value);
+    notifyAttributeChanged(aria_errormessageAttr);
+}
+
+
</ins><span class="cx"> void AccessibleNode::setDisabled(std::optional<bool> value)
</span><span class="cx"> {
</span><span class="cx">     setOptionalProperty<bool>(AXPropertyName::Disabled, value);
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibleNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibleNode.h (225510 => 225511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibleNode.h      2017-12-05 01:19:25 UTC (rev 225510)
+++ trunk/Source/WebCore/accessibility/AccessibleNode.h 2017-12-05 01:24:19 UTC (rev 225511)
</span><span class="lines">@@ -36,10 +36,11 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-typedef Variant<std::nullptr_t, String, bool, int, unsigned, double> PropertyValueVariant;
</del><ins>+typedef Variant<std::nullptr_t, String, bool, int, unsigned, double, Vector<RefPtr<AccessibleNode>>> PropertyValueVariant;
</ins><span class="cx"> 
</span><span class="cx"> enum class AXPropertyName {
</span><span class="cx">     None,
</span><ins>+    ActiveDescendant,
</ins><span class="cx">     Atomic,
</span><span class="cx">     Autocomplete,
</span><span class="cx">     Busy,
</span><span class="lines">@@ -48,7 +49,9 @@
</span><span class="cx">     ColIndex,
</span><span class="cx">     ColSpan,
</span><span class="cx">     Current,
</span><ins>+    Details,
</ins><span class="cx">     Disabled,
</span><ins>+    ErrorMessage,
</ins><span class="cx">     Expanded,
</span><span class="cx">     HasPopUp,
</span><span class="cx">     Hidden,
</span><span class="lines">@@ -105,13 +108,20 @@
</span><span class="cx">     void ref() { m_ownerElement.ref(); }
</span><span class="cx">     void deref() { m_ownerElement.deref(); }
</span><span class="cx"> 
</span><ins>+    static QualifiedName attributeFromAXPropertyName(AXPropertyName);
+
</ins><span class="cx">     static const String effectiveStringValueForElement(Element&, AXPropertyName);
</span><span class="cx">     static std::optional<bool> effectiveBoolValueForElement(Element&, AXPropertyName);
</span><span class="cx">     static int effectiveIntValueForElement(Element&, AXPropertyName);
</span><span class="cx">     static unsigned effectiveUnsignedValueForElement(Element&, AXPropertyName);
</span><span class="cx">     static double effectiveDoubleValueForElement(Element&, AXPropertyName);
</span><ins>+    static Vector<RefPtr<Element>> effectiveElementsValueForElement(Element&, AXPropertyName);
+    static Vector<RefPtr<AccessibleNode>> relationsValueForProperty(Element&, AXPropertyName);
</ins><span class="cx">     static bool hasProperty(Element&, AXPropertyName);
</span><span class="cx"> 
</span><ins>+    RefPtr<AccessibleNode> activeDescendant() const;
+    void setActiveDescendant(AccessibleNode*);
+
</ins><span class="cx">     std::optional<bool> atomic() const;
</span><span class="cx">     void setAtomic(std::optional<bool>);
</span><span class="cx">     
</span><span class="lines">@@ -136,9 +146,15 @@
</span><span class="cx">     String current() const;
</span><span class="cx">     void setCurrent(const String&);
</span><span class="cx"> 
</span><ins>+    RefPtr<AccessibleNode> details() const;
+    void setDetails(AccessibleNode*);
+
</ins><span class="cx">     std::optional<bool> disabled() const;
</span><span class="cx">     void setDisabled(std::optional<bool>);
</span><span class="cx"> 
</span><ins>+    RefPtr<AccessibleNode> errorMessage() const;
+    void setErrorMessage(AccessibleNode*);
+
</ins><span class="cx">     std::optional<bool> expanded() const;
</span><span class="cx">     void setExpanded(std::optional<bool>);
</span><span class="cx"> 
</span><span class="lines">@@ -233,10 +249,12 @@
</span><span class="cx">     static const PropertyValueVariant valueForProperty(Element&, AXPropertyName);
</span><span class="cx">     static const String stringValueForProperty(Element&, AXPropertyName);
</span><span class="cx">     template<typename T> static std::optional<T> optionalValueForProperty(Element&, AXPropertyName);
</span><ins>+    static RefPtr<AccessibleNode> singleRelationValueForProperty(Element&, AXPropertyName);
</ins><span class="cx">     
</span><span class="cx">     void setProperty(AXPropertyName, PropertyValueVariant&&, bool);
</span><span class="cx">     template<typename T> void setOptionalProperty(AXPropertyName, std::optional<T>);
</span><span class="cx">     void setStringProperty(AXPropertyName, const String&);
</span><ins>+    void setRelationProperty(AXPropertyName, AccessibleNode*);
</ins><span class="cx">     
</span><span class="cx">     void notifyAttributeChanged(const WebCore::QualifiedName&);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibleNodeidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibleNode.idl (225510 => 225511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibleNode.idl    2017-12-05 01:19:25 UTC (rev 225510)
+++ trunk/Source/WebCore/accessibility/AccessibleNode.idl       2017-12-05 01:24:19 UTC (rev 225511)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx">     SkipVTableValidation,
</span><span class="cx">     EnabledAtRuntime=AccessibilityObjectModel,
</span><span class="cx"> ] interface AccessibleNode {
</span><ins>+    attribute AccessibleNode? activeDescendant;
</ins><span class="cx">     attribute boolean? atomic;
</span><span class="cx">     attribute DOMString? autocomplete;
</span><span class="cx">     attribute boolean? busy;
</span><span class="lines">@@ -35,7 +36,9 @@
</span><span class="cx">     attribute unsigned long? colIndex;
</span><span class="cx">     attribute unsigned long? colSpan;
</span><span class="cx">     attribute DOMString? current;
</span><ins>+    attribute AccessibleNode? details;
</ins><span class="cx">     attribute boolean? disabled;
</span><ins>+    attribute AccessibleNode? errorMessage;
</ins><span class="cx">     attribute boolean? expanded;
</span><span class="cx">     attribute DOMString? hasPopUp;
</span><span class="cx">     attribute boolean? hidden;
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (225510 => 225511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm       2017-12-05 01:19:25 UTC (rev 225510)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm  2017-12-05 01:24:19 UTC (rev 225511)
</span><span class="lines">@@ -3202,6 +3202,21 @@
</span><span class="cx">     if ([attributeName isEqualToString:@"AXReadOnlyValue"])
</span><span class="cx">         return m_object->readOnlyValue();
</span><span class="cx"> 
</span><ins>+    if ([attributeName isEqualToString:@"AXIsActiveDescendantOfFocusedContainer"])
+        return [NSNumber numberWithBool:m_object->isActiveDescendantOfFocusedContainer()];
+
+    if ([attributeName isEqualToString:@"AXDetailsElements"]) {
+        AccessibilityObject::AccessibilityChildrenVector details;
+        m_object->ariaDetailsElements(details);
+        return convertToNSArray(details);
+    }
+
+    if ([attributeName isEqualToString:@"AXErrorMessageElements"]) {
+        AccessibilityObject::AccessibilityChildrenVector errorMessages;
+        m_object->ariaErrorMessageElements(errorMessages);
+        return convertToNSArray(errorMessages);
+    }
+
</ins><span class="cx">     if (m_object->isWebArea() && [attributeName isEqualToString:NSAccessibilityPreventKeyboardDOMEventDispatchAttribute])
</span><span class="cx">         return [NSNumber numberWithBool:m_object->preventKeyboardDOMEventDispatch()];
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (225510 => 225511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2017-12-05 01:19:25 UTC (rev 225510)
+++ trunk/Tools/ChangeLog       2017-12-05 01:24:19 UTC (rev 225511)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2017-12-04  Nan Wang  <n_wang@apple.com>
+
+        AX: AOM: Implement relation type properties
+        https://bugs.webkit.org/show_bug.cgi?id=179500
+
+        Reviewed by Ryosuke Niwa.
+
+        * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
+        (WTR::AccessibilityUIElement::ariaDetailsElementAtIndex):
+        (WTR::AccessibilityUIElement::ariaErrorMessageElementAtIndex):
+        (WTR::AccessibilityUIElement::ariaDescribedByReferencingElementAtIndex):
+        (WTR::AccessibilityUIElement::ariaDetailsReferencingElementAtIndex):
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+        (WTR::AccessibilityUIElement::ariaDetailsElementAtIndex):
+        (WTR::AccessibilityUIElement::ariaErrorMessageElementAtIndex):
+
</ins><span class="cx"> 2017-12-04  Simon Fraser  <simon.fraser@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Minor DisplayRefreshMonitor-related cleanup
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleAccessibilityUIElementh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h (225510 => 225511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h     2017-12-05 01:19:25 UTC (rev 225510)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h        2017-12-05 01:24:19 UTC (rev 225511)
</span><span class="lines">@@ -195,6 +195,14 @@
</span><span class="cx">     RefPtr<AccessibilityUIElement> ariaOwnsElementAtIndex(unsigned);
</span><span class="cx">     RefPtr<AccessibilityUIElement> ariaFlowToElementAtIndex(unsigned);
</span><span class="cx">     RefPtr<AccessibilityUIElement> ariaControlsElementAtIndex(unsigned);
</span><ins>+#if PLATFORM(MAC) || PLATFORM(GTK)
+    RefPtr<AccessibilityUIElement> ariaDetailsElementAtIndex(unsigned);
+    RefPtr<AccessibilityUIElement> ariaErrorMessageElementAtIndex(unsigned);
+#else
+    RefPtr<AccessibilityUIElement> ariaDetailsElementAtIndex(unsigned) { return nullptr; }
+    RefPtr<AccessibilityUIElement> ariaErrorMessageElementAtIndex(unsigned) { return nullptr; }
+#endif
+
</ins><span class="cx"> #if PLATFORM(GTK)
</span><span class="cx">     RefPtr<AccessibilityUIElement> ariaLabelledByElementAtIndex(unsigned);
</span><span class="cx">     RefPtr<AccessibilityUIElement> ariaDescribedByElementAtIndex(unsigned);
</span><span class="lines">@@ -203,9 +211,7 @@
</span><span class="cx">     RefPtr<AccessibilityUIElement> ariaControlsReferencingElementAtIndex(unsigned);
</span><span class="cx">     RefPtr<AccessibilityUIElement> ariaLabelledByReferencingElementAtIndex(unsigned);
</span><span class="cx">     RefPtr<AccessibilityUIElement> ariaDescribedByReferencingElementAtIndex(unsigned);
</span><del>-    RefPtr<AccessibilityUIElement> ariaDetailsElementAtIndex(unsigned);
</del><span class="cx">     RefPtr<AccessibilityUIElement> ariaDetailsReferencingElementAtIndex(unsigned);
</span><del>-    RefPtr<AccessibilityUIElement> ariaErrorMessageElementAtIndex(unsigned);
</del><span class="cx">     RefPtr<AccessibilityUIElement> ariaErrorMessageReferencingElementAtIndex(unsigned);
</span><span class="cx"> #else
</span><span class="cx">     RefPtr<AccessibilityUIElement> ariaLabelledByElementAtIndex(unsigned) { return nullptr; }
</span><span class="lines">@@ -215,9 +221,7 @@
</span><span class="cx">     RefPtr<AccessibilityUIElement> ariaControlsReferencingElementAtIndex(unsigned) { return nullptr; }
</span><span class="cx">     RefPtr<AccessibilityUIElement> ariaLabelledByReferencingElementAtIndex(unsigned) { return nullptr; }
</span><span class="cx">     RefPtr<AccessibilityUIElement> ariaDescribedByReferencingElementAtIndex(unsigned) { return nullptr; }
</span><del>-    RefPtr<AccessibilityUIElement> ariaDetailsElementAtIndex(unsigned) { return nullptr; }
</del><span class="cx">     RefPtr<AccessibilityUIElement> ariaDetailsReferencingElementAtIndex(unsigned) { return nullptr; }
</span><del>-    RefPtr<AccessibilityUIElement> ariaErrorMessageElementAtIndex(unsigned) { return nullptr; }
</del><span class="cx">     RefPtr<AccessibilityUIElement> ariaErrorMessageReferencingElementAtIndex(unsigned) { return nullptr; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityUIElementMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (225510 => 225511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm     2017-12-05 01:19:25 UTC (rev 225510)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm        2017-12-05 01:24:19 UTC (rev 225511)
</span><span class="lines">@@ -417,6 +417,26 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+RefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaDetailsElementAtIndex(unsigned index)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSArray* details = [m_element accessibilityAttributeValue:@"AXDetailsElements"];
+    if (index < [details count])
+        return AccessibilityUIElement::create([details objectAtIndex:index]);
+    END_AX_OBJC_EXCEPTIONS
+    return nullptr;
+}
+
+RefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaErrorMessageElementAtIndex(unsigned index)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSArray* errorMessages = [m_element accessibilityAttributeValue:@"AXErrorMessageElements"];
+    if (index < [errorMessages count])
+        return AccessibilityUIElement::create([errorMessages objectAtIndex:index]);
+    END_AX_OBJC_EXCEPTIONS
+    return nullptr;
+}
+
</ins><span class="cx"> RefPtr<AccessibilityUIElement> AccessibilityUIElement::disclosedRowAtIndex(unsigned index)
</span><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span></span></pre>
</div>
</div>

</body>
</html>