Commit cc53e069 authored by alexclarke's avatar alexclarke Committed by Commit bot

Fix crash in CSS.getLayoutTreeAndStyles

For pages where there was a FrameOwnerElement with a null
ContentDocument CSS.getLayoutTreeAndStyles would crash.  This patch
fixes that.

BUG=680497, 546953

Review-Url: https://codereview.chromium.org/2623273006
Cr-Commit-Position: refs/heads/master@{#443513}
parent 0ffd4012
...@@ -2369,10 +2369,12 @@ void InspectorCSSAgent::visitLayoutTreeNodes( ...@@ -2369,10 +2369,12 @@ void InspectorCSSAgent::visitLayoutTreeNodes(
if (node->isFrameOwnerElement()) { if (node->isFrameOwnerElement()) {
Document* contentDocument = Document* contentDocument =
toHTMLFrameOwnerElement(node)->contentDocument(); toHTMLFrameOwnerElement(node)->contentDocument();
if (contentDocument) {
contentDocument->updateStyleAndLayoutTree(); contentDocument->updateStyleAndLayoutTree();
visitLayoutTreeNodes(contentDocument->documentElement(), layoutTreeNodes, visitLayoutTreeNodes(contentDocument->documentElement(),
cssPropertyWhitelist, styleToIndexMap, layoutTreeNodes, cssPropertyWhitelist,
computedStyles); styleToIndexMap, computedStyles);
}
} }
LayoutObject* layoutObject = node->layoutObject(); LayoutObject* layoutObject = node->layoutObject();
......
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