Commit 53865c16 authored by Patrick Brosset's avatar Patrick Brosset Committed by Commit Bot

DevTools: Show the grid overlay on grid containers only

The new grid overlay needs to be shown only on grid container elements.
The legacy one would be displayed when hovering items too. We no longer
want to do this.

Here are before/after screenshots taken while hovering over an element
that is both a grid item and grid container. In the Before shot, you
can see the parent grid being highlighted too. Not in the After shot.

Before: https://i.imgur.com/lKeakiu.jpg

After: https://i.imgur.com/aCZB1cT.jpg

Bug: 1047356
Change-Id: I2d12fa06d7b86d5b1c19a38560b466a00d96fb32
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2224985
Commit-Queue: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: default avatarBrandon Goddard <brgoddar@microsoft.com>
Reviewed-by: default avatarPeter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774312}
parent 7c2c97f0
...@@ -770,14 +770,6 @@ void InspectorHighlight::AppendNodeHighlight( ...@@ -770,14 +770,6 @@ void InspectorHighlight::AppendNodeHighlight(
ToLayoutGrid(layout_object), ToLayoutGrid(layout_object),
highlight_config, scale_, true)); highlight_config, scale_, true));
} }
LayoutObject* parent = layout_object->Parent();
if (!parent || !parent->IsLayoutGrid())
return;
if (!BuildNodeQuads(parent->GetNode(), &content, &padding, &border, &margin))
return;
grid_info_->pushValue(BuildGridInfo(node->GetDocument().View(),
ToLayoutGrid(parent), highlight_config,
scale_, false));
} }
std::unique_ptr<protocol::DictionaryValue> InspectorHighlight::AsProtocolValue() std::unique_ptr<protocol::DictionaryValue> InspectorHighlight::AsProtocolValue()
......
...@@ -421,121 +421,6 @@ nestedGrid{ ...@@ -421,121 +421,6 @@ nestedGrid{
"columnHatchColor": "rgba(128, 128, 128, 0)" "columnHatchColor": "rgba(128, 128, 128, 0)"
}, },
"isPrimaryGrid": true "isPrimaryGrid": true
},
{
"rows": [
"M",
108,
1208,
"L",
108,
-92,
"L",
208,
-92,
"L",
208,
1208,
"Z",
"M",
228,
1208,
"L",
228,
-92,
"L",
328,
-92,
"L",
328,
1208,
"Z"
],
"rowGaps": [
"M",
208,
1208,
"L",
208,
-92,
"L",
228,
-92,
"L",
228,
1208,
"Z"
],
"columns": [
"M",
108,
1208,
"L",
108,
1158,
"L",
328,
1158,
"L",
328,
1208,
"Z",
"M",
108,
1108,
"L",
108,
-92,
"L",
328,
-92,
"L",
328,
1108,
"Z"
],
"columnGaps": [
"M",
108,
1158,
"L",
108,
1108,
"L",
328,
1108,
"L",
328,
1158,
"Z"
],
"gridBorder": [
"M",
108,
1208,
"L",
108,
-92,
"L",
328,
-92,
"L",
328,
1208,
"Z"
],
"gridHighlightConfig": {
"gridBorderDash": false,
"cellBorderDash": true,
"showGridExtensionLines": true,
"gridBorderColor": "rgba(255, 0, 0, 0)",
"cellBorderColor": "rgba(128, 0, 0, 0)",
"rowGapColor": "rgba(0, 255, 0, 0)",
"columnGapColor": "rgba(0, 0, 255, 0)",
"rowHatchColor": "rgba(255, 255, 255, 0)",
"columnHatchColor": "rgba(128, 128, 128, 0)"
},
"isPrimaryGrid": false
} }
] ]
} }
......
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