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

Add stacking context information to InspectorDOMSnapshot.

R=pfeldman@chromium.org

Change-Id: Ib16d60ee5ec23b7e6ac1e7b5f657651beeeb7168
Reviewed-on: https://chromium-review.googlesource.com/1142520
Commit-Queue: Jandro Alderman <aalderman@chromium.org>
Reviewed-by: default avatarAndrey Kosyakov <caseq@chromium.org>
Reviewed-by: default avatarPavel Feldman <pfeldman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584861}
parent e298efad
...@@ -750,7 +750,8 @@ Tests DOMSnapshot.getSnapshot method. ...@@ -750,7 +750,8 @@ Tests DOMSnapshot.getSnapshot method.
"y": 0, "y": 0,
"width": 800, "width": 800,
"height": 600 "height": 600
} },
"isStackingContext": true
}, },
{ {
"domNodeIndex": 1, "domNodeIndex": 1,
...@@ -760,7 +761,8 @@ Tests DOMSnapshot.getSnapshot method. ...@@ -760,7 +761,8 @@ Tests DOMSnapshot.getSnapshot method.
"width": 785, "width": 785,
"height": 1135 "height": 1135
}, },
"styleIndex": 0 "styleIndex": 0,
"isStackingContext": true
}, },
{ {
"domNodeIndex": 9, "domNodeIndex": 9,
...@@ -1295,7 +1297,8 @@ Tests DOMSnapshot.getSnapshot method. ...@@ -1295,7 +1297,8 @@ Tests DOMSnapshot.getSnapshot method.
"width": 32, "width": 32,
"height": 200 "height": 200
}, },
"styleIndex": 11 "styleIndex": 11,
"isStackingContext": true
}, },
{ {
"domNodeIndex": 33, "domNodeIndex": 33,
...@@ -1328,7 +1331,8 @@ Tests DOMSnapshot.getSnapshot method. ...@@ -1328,7 +1331,8 @@ Tests DOMSnapshot.getSnapshot method.
"numCharacters": 5 "numCharacters": 5
} }
], ],
"styleIndex": 12 "styleIndex": 12,
"isStackingContext": true
}, },
{ {
"domNodeIndex": 35, "domNodeIndex": 35,
...@@ -1347,7 +1351,8 @@ Tests DOMSnapshot.getSnapshot method. ...@@ -1347,7 +1351,8 @@ Tests DOMSnapshot.getSnapshot method.
"y": 0, "y": 0,
"width": 400, "width": 400,
"height": 200 "height": 200
} },
"isStackingContext": true
}, },
{ {
"domNodeIndex": 37, "domNodeIndex": 37,
...@@ -1357,7 +1362,8 @@ Tests DOMSnapshot.getSnapshot method. ...@@ -1357,7 +1362,8 @@ Tests DOMSnapshot.getSnapshot method.
"width": 400, "width": 400,
"height": 200 "height": 200
}, },
"styleIndex": 14 "styleIndex": 14,
"isStackingContext": true
}, },
{ {
"domNodeIndex": 44, "domNodeIndex": 44,
......
...@@ -248,7 +248,8 @@ Tests DOMSnapshot.getSnapshot exports layout tree nodes associated with pseudo e ...@@ -248,7 +248,8 @@ Tests DOMSnapshot.getSnapshot exports layout tree nodes associated with pseudo e
"y": 0, "y": 0,
"width": 800, "width": 800,
"height": 600 "height": 600
} },
"isStackingContext": true
}, },
{ {
"domNodeIndex": 1, "domNodeIndex": 1,
...@@ -258,7 +259,8 @@ Tests DOMSnapshot.getSnapshot exports layout tree nodes associated with pseudo e ...@@ -258,7 +259,8 @@ Tests DOMSnapshot.getSnapshot exports layout tree nodes associated with pseudo e
"width": 800, "width": 800,
"height": 600 "height": 600
}, },
"styleIndex": 0 "styleIndex": 0,
"isStackingContext": true
}, },
{ {
"domNodeIndex": 8, "domNodeIndex": 8,
...@@ -278,7 +280,8 @@ Tests DOMSnapshot.getSnapshot exports layout tree nodes associated with pseudo e ...@@ -278,7 +280,8 @@ Tests DOMSnapshot.getSnapshot exports layout tree nodes associated with pseudo e
"width": 200, "width": 200,
"height": 200 "height": 200
}, },
"styleIndex": 0 "styleIndex": 0,
"isStackingContext": true
}, },
{ {
"domNodeIndex": 11, "domNodeIndex": 11,
...@@ -344,7 +347,8 @@ Tests DOMSnapshot.getSnapshot exports layout tree nodes associated with pseudo e ...@@ -344,7 +347,8 @@ Tests DOMSnapshot.getSnapshot exports layout tree nodes associated with pseudo e
"numCharacters": 7 "numCharacters": 7
} }
], ],
"styleIndex": 0 "styleIndex": 0,
"isStackingContext": true
}, },
{ {
"domNodeIndex": 14, "domNodeIndex": 14,
...@@ -354,7 +358,8 @@ Tests DOMSnapshot.getSnapshot exports layout tree nodes associated with pseudo e ...@@ -354,7 +358,8 @@ Tests DOMSnapshot.getSnapshot exports layout tree nodes associated with pseudo e
"width": 200, "width": 200,
"height": 200 "height": 200
}, },
"styleIndex": 0 "styleIndex": 0,
"isStackingContext": true
}, },
{ {
"domNodeIndex": 15, "domNodeIndex": 15,
...@@ -450,7 +455,8 @@ Tests DOMSnapshot.getSnapshot exports layout tree nodes associated with pseudo e ...@@ -450,7 +455,8 @@ Tests DOMSnapshot.getSnapshot exports layout tree nodes associated with pseudo e
"width": 200, "width": 200,
"height": 200 "height": 200
}, },
"styleIndex": 0 "styleIndex": 0,
"isStackingContext": true
}, },
{ {
"domNodeIndex": 20, "domNodeIndex": 20,
...@@ -615,7 +621,8 @@ Tests DOMSnapshot.getSnapshot exports layout tree nodes associated with pseudo e ...@@ -615,7 +621,8 @@ Tests DOMSnapshot.getSnapshot exports layout tree nodes associated with pseudo e
"numCharacters": 13 "numCharacters": 13
} }
], ],
"styleIndex": 0 "styleIndex": 0,
"isStackingContext": true
} }
], ],
"computedStyles": [ "computedStyles": [
......
...@@ -189,7 +189,8 @@ Emulating device: 600x600x1 ...@@ -189,7 +189,8 @@ Emulating device: 600x600x1
"y": 0, "y": 0,
"width": 300, "width": 300,
"height": 300 "height": 300
} },
"isStackingContext": true
}, },
{ {
"domNodeIndex": 3, "domNodeIndex": 3,
...@@ -198,7 +199,8 @@ Emulating device: 600x600x1 ...@@ -198,7 +199,8 @@ Emulating device: 600x600x1
"y": 0, "y": 0,
"width": 300, "width": 300,
"height": 0 "height": 0
} },
"isStackingContext": true
}, },
{ {
"domNodeIndex": 15, "domNodeIndex": 15,
...@@ -216,7 +218,8 @@ Emulating device: 600x600x1 ...@@ -216,7 +218,8 @@ Emulating device: 600x600x1
"y": 100, "y": 100,
"width": 100, "width": 100,
"height": 100 "height": 100
} },
"isStackingContext": true
}, },
{ {
"domNodeIndex": 17, "domNodeIndex": 17,
...@@ -238,7 +241,8 @@ Emulating device: 600x600x1 ...@@ -238,7 +241,8 @@ Emulating device: 600x600x1
"startCharacterIndex": 0, "startCharacterIndex": 0,
"numCharacters": 6 "numCharacters": 6
} }
] ],
"isStackingContext": true
} }
], ],
"computedStyles": [] "computedStyles": []
......
...@@ -2076,6 +2076,8 @@ experimental domain DOMSnapshot ...@@ -2076,6 +2076,8 @@ experimental domain DOMSnapshot
# that are painted together will have the same index. Only provided if includePaintOrder in # that are painted together will have the same index. Only provided if includePaintOrder in
# getSnapshot was true. # getSnapshot was true.
optional integer paintOrder optional integer paintOrder
# Set to true to indicate the element begins a new stacking context.
optional boolean isStackingContext
# A subset of the full ComputedStyle as defined by the request whitelist. # A subset of the full ComputedStyle as defined by the request whitelist.
type ComputedStyle extends object type ComputedStyle extends object
...@@ -2185,6 +2187,8 @@ experimental domain DOMSnapshot ...@@ -2185,6 +2187,8 @@ experimental domain DOMSnapshot
array of Rectangle bounds array of Rectangle bounds
# Contents of the LayoutText, if any. # Contents of the LayoutText, if any.
array of StringIndex text array of StringIndex text
# Stacking context information.
RareBooleanData stackingContexts
# Details of post layout rendered text positions. The exact layout should not be regarded as # Details of post layout rendered text positions. The exact layout should not be regarded as
# stable and may change between versions. # stable and may change between versions.
......
...@@ -540,6 +540,7 @@ void InspectorDOMSnapshotAgent::VisitDocument2(Document* document) { ...@@ -540,6 +540,7 @@ void InspectorDOMSnapshotAgent::VisitDocument2(Document* document) {
.setBounds(protocol::Array<protocol::Array<double>>::create()) .setBounds(protocol::Array<protocol::Array<double>>::create())
.setText(protocol::Array<int>::create()) .setText(protocol::Array<int>::create())
.setStyles(protocol::Array<protocol::Array<int>>::create()) .setStyles(protocol::Array<protocol::Array<int>>::create())
.setStackingContexts(BooleanData())
.build()) .build())
.setTextBoxes( .setTextBoxes(
protocol::DOMSnapshot::TextBoxSnapshot::create() protocol::DOMSnapshot::TextBoxSnapshot::create()
...@@ -813,6 +814,9 @@ int InspectorDOMSnapshotAgent::VisitLayoutTreeNode(LayoutObject* layout_object, ...@@ -813,6 +814,9 @@ int InspectorDOMSnapshotAgent::VisitLayoutTreeNode(LayoutObject* layout_object,
if (style_index != -1) if (style_index != -1)
layout_tree_node->setStyleIndex(style_index); layout_tree_node->setStyleIndex(style_index);
if (layout_object->Style() && layout_object->Style()->IsStacked())
layout_tree_node->setIsStackingContext(true);
if (paint_order_map_) { if (paint_order_map_) {
PaintLayer* paint_layer = layout_object->EnclosingLayer(); PaintLayer* paint_layer = layout_object->EnclosingLayer();
...@@ -866,6 +870,9 @@ int InspectorDOMSnapshotAgent::BuildLayoutTreeNode(LayoutObject* layout_object, ...@@ -866,6 +870,9 @@ int InspectorDOMSnapshotAgent::BuildLayoutTreeNode(LayoutObject* layout_object,
layout_tree_snapshot->getBounds()->addItem(BuildRectForFloatRect2( layout_tree_snapshot->getBounds()->addItem(BuildRectForFloatRect2(
FloatRect(layout_object->AbsoluteBoundingBoxRect()))); FloatRect(layout_object->AbsoluteBoundingBoxRect())));
if (layout_object->Style() && layout_object->Style()->IsStacked())
SetRare(layout_tree_snapshot->getStackingContexts(), layout_index);
String text = layout_object->IsText() ? ToLayoutText(layout_object)->GetText() String text = layout_object->IsText() ? ToLayoutText(layout_object)->GetText()
: String(); : String();
layout_tree_snapshot->getText()->addItem(AddString(text)); layout_tree_snapshot->getText()->addItem(AddString(text));
......
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