Don't display grid and flex info in the markup-view, rule-view, layout-view when selected elements aren't grid or flex containers
Categories
(DevTools :: Inspector, defect, P3)
Tracking
(Not tracked)
People
(Reporter: miker, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
Comment 1•6 years ago
|
||
Reporter | ||
Comment 2•6 years ago
|
||
Comment 3•6 years ago
|
||
Updated•6 years ago
|
Reporter | ||
Comment 4•6 years ago
|
||
Comment 5•6 years ago
|
||
Reporter | ||
Comment 6•6 years ago
|
||
Comment 7•6 years ago
|
||
Comment 8•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 9•6 years ago
|
||
Thanks Daniel.
I think using GetContainerAsFlex
to guard against displaying this information is the right thing to do.
And we should do this to avoid showing info in the layout sidebar, but also avoid showing the icon in the CSS rule-view, and the badge in the markup-view.
I also think we should do exactly the same thing for grid containers (using the GetGridFragments
API).
So I'm re-titling this bug to that effect.
I think one part of the fix is to change this function:
https://searchfox.org/mozilla-central/rev/76fe4bb385348d3f45bbebcf69ba8c7283dfcec7/devtools/server/actors/inspector/node.js#223-250
right now it only uses elements' computed styles to return their display types. In case that computed display value is grid/inline-grid/flex/inline-flex, then I think we should double-check by calling GetContainerAsFlex
or GetGridFragments
before returning those values.
Now, for the CSS rule-view, it's a little more complex, because today we just display the flex and grid icons based on the properties we see in the rule. If display:grid
is found, then we display the grid icon next to it. Now if the element isn't actually a grid, clicking on the icon won't do anything, so it's not too big a deal. But still, it'd be nice to avoid showing the icon, or maybe show a warning message?
That'd be a more complex project, I think, maybe better as its own bug.
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Comment 12•6 years ago
|
||
Ah, Victoria's example is really bug 1518943 (just filed). So, disregard comment 10 and comment 11 for the purposes of this bug here.
Reporter | ||
Updated•5 years ago
|
Updated•2 years ago
|
Description
•