Changeset 241547 in webkit


Ignore:
Timestamp:
Feb 14, 2019 9:06:03 AM (5 years ago)
Author:
BJ Burg
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/JavaScriptCore:

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):

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r241493 r241547  
     12019-02-13  Brian Burg  <bburg@apple.com>
     2
     3        Web Inspector: don't include accessibility role in DOM.Node object payloads
     4        https://bugs.webkit.org/show_bug.cgi?id=194623
     5        <rdar://problem/36384037>
     6
     7        Reviewed by Devin Rousso.
     8
     9        Remove property of DOM.Node that is no longer being sent.
     10
     11        * inspector/protocol/DOM.json:
     12
    1132019-02-13  Keith Miller  <keith_miller@apple.com> and Yusuke Suzuki  <ysuzuki@apple.com>
    214
  • trunk/Source/JavaScriptCore/inspector/protocol/DOM.json

    r241110 r241547  
    6666                { "name": "templateContent", "$ref": "Node", "optional": true, "description": "Content document fragment for template elements" },
    6767                { "name": "pseudoElements", "type": "array", "items": { "$ref": "Node" }, "optional": true, "description": "Pseudo elements associated with this node." },
    68                 { "name": "role", "type": "string", "optional": true, "description": "Computed value for first recognized role token, default role per element, or overridden role." },
    6968                { "name": "contentSecurityPolicyHash", "type": "string", "optional": true, "description": "Computed SHA-256 Content Security Policy hash source for given element." }
    7069            ]
  • trunk/Source/WebCore/ChangeLog

    r241546 r241547  
     12019-02-13  Brian Burg  <bburg@apple.com>
     2
     3        Web Inspector: don't include accessibility role in DOM.Node object payloads
     4        https://bugs.webkit.org/show_bug.cgi?id=194623
     5        <rdar://problem/36384037>
     6
     7        Reviewed by Devin Rousso.
     8
     9        Accessibility properties are complicated to fetch at all the points where we want to build and push nodes immediately.
     10        Turning on AX often indirectly causes style recalc and layout. This is bad because we are often building nodes in the
     11        first place due to a DOM node tree update (i.e., NodeInserted).
     12
     13        It turns out that DOM.getAccessibilityPropertiesForNode is called every time we display
     14        the computed role in the Elements Tab > Nodes Sidebar > Accessibility Section. So it is not
     15        necessary to collect this information in a problematic way when initially pushing the node, as
     16        it will be updated anyway.
     17
     18        No new tests, no change in behavior.
     19
     20        * inspector/agents/InspectorDOMAgent.cpp:
     21        (WebCore::InspectorDOMAgent::buildObjectForNode):
     22
    1232019-02-14  Zalan Bujtas  <zalan@apple.com>
    224
  • trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp

    r241495 r241547  
    15951595    }
    15961596
    1597     // Need to enable AX to get the computed role.
    1598     if (!WebCore::AXObjectCache::accessibilityEnabled())
    1599         WebCore::AXObjectCache::enableAccessibility();
    1600 
    1601     if (AXObjectCache* axObjectCache = node->document().axObjectCache()) {
    1602         if (AccessibilityObject* axObject = axObjectCache->getOrCreate(node))
    1603             value->setRole(axObject->computedRoleString());
    1604     }
    1605 
    16061597    return value;
    16071598}
  • trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js

    r240884 r241547  
    4949        this._pseudoType = payload.pseudoType;
    5050        this._shadowRootType = payload.shadowRootType;
    51         this._computedRole = payload.role;
     51        this._computedRole = null;
    5252        this._contentSecurityPolicyHash = payload.contentSecurityPolicyHash;
    5353
     
    587587        {
    588588            if (!error && callback && accessibilityProperties) {
     589                this._computedRole = accessibilityProperties.role;
     590
    589591                callback({
    590592                    activeDescendantNodeId: accessibilityProperties.activeDescendantNodeId,
Note: See TracChangeset for help on using the changeset viewer.