Commit d4620531 authored by Jandro Alderman's avatar Jandro Alderman Committed by Commit Bot

Fix small bug with DOM Snapshot ShadowRootType.

As currently written, element nodes in Shadow DOM trees won't be
properly annotated with shadowRootType. Change an else if to a
plain if to address this. Tests fixed accordingly.

R=dgozman@chromium.org

Change-Id: Ie912de6663c8b4ed0a3638f80cd81ccbcf7e1b31
Reviewed-on: https://chromium-review.googlesource.com/951866Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Commit-Queue: Jandro Alderman <aalderman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542285}
parent 5ff974fc
......@@ -595,7 +595,8 @@ Tests DOMSnapshot.getSnapshot method.
"backendNodeId": "<number>",
"childNodeIndexes": [
53
]
],
"shadowRootType": "open"
},
{
"nodeType": 3,
......@@ -625,7 +626,8 @@ Tests DOMSnapshot.getSnapshot method.
"value": "font-family: ahem;"
}
],
"layoutNodeIndex": 28
"layoutNodeIndex": 28,
"shadowRootType": "open"
},
{
"nodeType": 1,
......@@ -635,7 +637,8 @@ Tests DOMSnapshot.getSnapshot method.
"childNodeIndexes": [
57
],
"layoutNodeIndex": 29
"layoutNodeIndex": 29,
"shadowRootType": "open"
},
{
"nodeType": 3,
......
......@@ -119,7 +119,8 @@ Tests DOMSnapshot.getSnapshot method returning input values.
"name": "name",
"value": "user-agent-custom-assign-slot"
}
]
],
"shadowRootType": "user-agent"
},
{
"nodeType": 1,
......@@ -205,6 +206,7 @@ Tests DOMSnapshot.getSnapshot method returning input values.
16
],
"layoutNodeIndex": 7,
"shadowRootType": "user-agent",
"isClickable": true
},
{
......@@ -418,6 +420,7 @@ Tests DOMSnapshot.getSnapshot method returning input values.
31
],
"layoutNodeIndex": 22,
"shadowRootType": "user-agent",
"isClickable": true
},
{
......
......@@ -279,7 +279,8 @@ int InspectorDOMSnapshotAgent::VisitNode(Node* node,
DocumentType* doc_type = ToDocumentType(node);
value->setPublicId(doc_type->publicId());
value->setSystemId(doc_type->systemId());
} else if (node->IsInShadowTree()) {
}
if (node->IsInShadowTree()) {
value->setShadowRootType(
InspectorDOMAgent::GetShadowRootType(node->ContainingShadowRoot()));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment