Browser Toolbox Rules tab incorrectly shows height and width as invalid for img elements
Categories
(DevTools :: Inspector, defect, P3)
Tracking
(firefox102 fixed)
Tracking | Status | |
---|---|---|
firefox102 | --- | fixed |
People
(Reporter: henry-x, Assigned: jdescottes)
Details
Attachments
(2 files)
Steps to reproduce.
- Open the Browser Toolbox.
- Find an
<img>
element whose computeddisplay
has not been changed from the defaultinline
. - Inspect its CSS "Rules" and set its width or height.
Result
The width
and height
properties will be greyed out with an "info" icon that says "width has no effect on this element since it has a display of inline", or the equivalent for "height".
Expect
The width
and height
properties are valid for replaced elements like <img>
, so shouldn't be shown as invalid. Note, this works fine when using the "Web Developer Tools" inspector for <img>
elements on web pages.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Thanks for filing, can you share more details? I tried inspecting and modifying img tags in the Browser Chrome and I can't reproduce the issue.
Is this something you see when debugging thunderbird?
Reporter | ||
Comment 2•2 years ago
|
||
(In reply to Julian Descottes [:jdescottes] from comment #1)
Thanks for filing, can you share more details? I tried inspecting and modifying img tags in the Browser Chrome and I can't reproduce the issue.
Is this something you see when debugging thunderbird?
This does come up more in Thunderbird because we have a lot of img
elements. But I can reproduce using firefox tip as well:
- Open firefox.
- Open the Browser Toolbar.
- Find and select a
.tab-icon-stack
in the Inspector. - In the Rules tab, add the rule
display: block;
. This is needed because the original grid display treats the child img as a grid item, causing it to loose its computed inline display. - Select the child
.tab-icon-image
. - Scroll to the CSS rule from "tabs.css" that sets the height and width to 16px. These two rules will have invalid icons next to them.
Assignee | ||
Comment 3•2 years ago
|
||
Perfect thanks! Probably an issue around https://searchfox.org/mozilla-central/rev/9f95c41a962c9228f569f8a6b2c30edbb50b65ae/devtools/server/actors/utils/inactive-property-helper.js#839
Assignee | ||
Comment 4•2 years ago
|
||
Our logic checks for nodeName
, which in this case is html:img
, whereas we assume it would be img
Assignee | ||
Comment 5•2 years ago
|
||
Let's use localName instead.
Assignee | ||
Comment 6•2 years ago
|
||
It was not clear which methods/getters were internal or not.
Exposing only the helper method helps with refactoring
Assignee | ||
Comment 7•2 years ago
|
||
Depends on D146898
nodeName can include the namespace prefix eg html:img, failing some of our string comparisons
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c638dd0fa366 [devtools] Only export isPropertyUsed from inactive-property-helper.js r=nchevobbe https://hg.mozilla.org/integration/autoland/rev/51a3fc9e4d16 [devtools] Use localName instead of nodeName in inactive-property-helper.js r=nchevobbe
Updated•2 years ago
|
Comment 10•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c638dd0fa366
https://hg.mozilla.org/mozilla-central/rev/51a3fc9e4d16
Description
•