- Revision
- 241547
- Author
- [email protected]
- Date
- 2019-02-14 09:06:03 -0800 (Thu, 14 Feb 2019)
Log Message
Web Inspector: don't include accessibility role in DOM.Node object payloads
https://bugs.webkit.org/show_bug.cgi?id=194623
<rdar://problem/36384037>
Reviewed by Devin Rousso.
Source/_javascript_Core:
Remove property of DOM.Node that is no longer being sent.
* inspector/protocol/DOM.json:
Source/WebCore:
Accessibility properties are complicated to fetch at all the points where we want to build and push nodes immediately.
Turning on AX often indirectly causes style recalc and layout. This is bad because we are often building nodes in the
first place due to a DOM node tree update (i.e., NodeInserted).
It turns out that DOM.getAccessibilityPropertiesForNode is called every time we display
the computed role in the Elements Tab > Nodes Sidebar > Accessibility Section. So it is not
necessary to collect this information in a problematic way when initially pushing the node, as
it will be updated anyway.
No new tests, no change in behavior.
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForNode):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (241546 => 241547)
--- trunk/Source/_javascript_Core/ChangeLog 2019-02-14 16:44:41 UTC (rev 241546)
+++ trunk/Source/_javascript_Core/ChangeLog 2019-02-14 17:06:03 UTC (rev 241547)
@@ -1,3 +1,15 @@
+2019-02-13 Brian Burg <[email protected]>
+
+ Web Inspector: don't include accessibility role in DOM.Node object payloads
+ https://bugs.webkit.org/show_bug.cgi?id=194623
+ <rdar://problem/36384037>
+
+ Reviewed by Devin Rousso.
+
+ Remove property of DOM.Node that is no longer being sent.
+
+ * inspector/protocol/DOM.json:
+
2019-02-13 Keith Miller <[email protected]> and Yusuke Suzuki <[email protected]>
We should only make rope strings when concatenating strings long enough.
Modified: trunk/Source/_javascript_Core/inspector/protocol/DOM.json (241546 => 241547)
--- trunk/Source/_javascript_Core/inspector/protocol/DOM.json 2019-02-14 16:44:41 UTC (rev 241546)
+++ trunk/Source/_javascript_Core/inspector/protocol/DOM.json 2019-02-14 17:06:03 UTC (rev 241547)
@@ -65,7 +65,6 @@
{ "name": "shadowRoots", "type": "array", "optional": true, "items": { "$ref": "Node" }, "description": "Shadow root list for given element host." },
{ "name": "templateContent", "$ref": "Node", "optional": true, "description": "Content document fragment for template elements" },
{ "name": "pseudoElements", "type": "array", "items": { "$ref": "Node" }, "optional": true, "description": "Pseudo elements associated with this node." },
- { "name": "role", "type": "string", "optional": true, "description": "Computed value for first recognized role token, default role per element, or overridden role." },
{ "name": "contentSecurityPolicyHash", "type": "string", "optional": true, "description": "Computed SHA-256 Content Security Policy hash source for given element." }
]
},
Modified: trunk/Source/WebCore/ChangeLog (241546 => 241547)
--- trunk/Source/WebCore/ChangeLog 2019-02-14 16:44:41 UTC (rev 241546)
+++ trunk/Source/WebCore/ChangeLog 2019-02-14 17:06:03 UTC (rev 241547)
@@ -1,3 +1,25 @@
+2019-02-13 Brian Burg <[email protected]>
+
+ Web Inspector: don't include accessibility role in DOM.Node object payloads
+ https://bugs.webkit.org/show_bug.cgi?id=194623
+ <rdar://problem/36384037>
+
+ Reviewed by Devin Rousso.
+
+ Accessibility properties are complicated to fetch at all the points where we want to build and push nodes immediately.
+ Turning on AX often indirectly causes style recalc and layout. This is bad because we are often building nodes in the
+ first place due to a DOM node tree update (i.e., NodeInserted).
+
+ It turns out that DOM.getAccessibilityPropertiesForNode is called every time we display
+ the computed role in the Elements Tab > Nodes Sidebar > Accessibility Section. So it is not
+ necessary to collect this information in a problematic way when initially pushing the node, as
+ it will be updated anyway.
+
+ No new tests, no change in behavior.
+
+ * inspector/agents/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::buildObjectForNode):
+
2019-02-14 Zalan Bujtas <[email protected]>
[LFC][BFC][MarginCollapse] Replaced boxes don't collapse through their margins
Modified: trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp (241546 => 241547)
--- trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp 2019-02-14 16:44:41 UTC (rev 241546)
+++ trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp 2019-02-14 17:06:03 UTC (rev 241547)
@@ -1594,15 +1594,6 @@
value->setShadowRootType(shadowRootType(shadowRoot.mode()));
}
- // Need to enable AX to get the computed role.
- if (!WebCore::AXObjectCache::accessibilityEnabled())
- WebCore::AXObjectCache::enableAccessibility();
-
- if (AXObjectCache* axObjectCache = node->document().axObjectCache()) {
- if (AccessibilityObject* axObject = axObjectCache->getOrCreate(node))
- value->setRole(axObject->computedRoleString());
- }
-
return value;
}
Modified: trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js (241546 => 241547)
--- trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js 2019-02-14 16:44:41 UTC (rev 241546)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js 2019-02-14 17:06:03 UTC (rev 241547)
@@ -48,7 +48,7 @@
this._nodeValue = payload.nodeValue;
this._pseudoType = payload.pseudoType;
this._shadowRootType = payload.shadowRootType;
- this._computedRole = payload.role;
+ this._computedRole = null;
this._contentSecurityPolicyHash = payload.contentSecurityPolicyHash;
if (this._nodeType === Node.DOCUMENT_NODE)
@@ -586,6 +586,8 @@
function accessibilityPropertiesCallback(error, accessibilityProperties)
{
if (!error && callback && accessibilityProperties) {
+ this._computedRole = accessibilityProperties.role;
+
callback({
activeDescendantNodeId: accessibilityProperties.activeDescendantNodeId,
busy: accessibilityProperties.busy,