Color editor popup does not open for button with space content
Categories
(DevTools :: Inspector, defect, P2)
Tracking
(firefox96 fixed)
Tracking | Status | |
---|---|---|
firefox96 | --- | fixed |
People
(Reporter: nchevobbe, Assigned: jdescottes)
Details
Attachments
(1 file)
Steps to reproduce
- Open a tab with
data:text/html,<meta charset=utf8><style>button {color: tomato;}</style><button> </button>
- Open devtools
- In the inspector, select the
<button>
element - In the rule view, click on the color swatch to open the color editor
Expected results
The popup is opened
Actual results
The popup does not open
There's the following message in the browser console
TypeError: can't access property "bounds", getAdjustedQuads(...)[0] is undefined
getBackgroundColor resource://devtools/server/actors/inspector/utils.js:475
getBackgroundColor resource://devtools/server/actors/inspector/node.js:652
handler resource://devtools/shared/protocol/Actor.js:175
onPacket resource://devtools/server/devtools-server-connection.js:379
_onPacketReceived resource://devtools/shared/transport/js-window-actor-transport.js:48
emit resource://gre/modules/EventEmitter.jsm:160
receiveMessage resource://devtools/server/connectors/js-window-actor/DevToolsFrameChild.jsm:513
Actor.js:99:15
it's pointing at: https://searchfox.org/mozilla-central/rev/3b86063e6d46b2f130513c499343cd47773062b1/devtools/server/actors/inspector/utils.js#471-475
The issue is visible in Firefox 78+
Comment 1•3 years ago
|
||
The severity field is not set for this bug.
:jdescottes, could you have a look please?
For more information, please visit auto_nag documentation.
Assignee | ||
Comment 2•3 years ago
|
||
Sounds like an easy P2 S3.
This is somewhat related to Bug 1567310. If we update https://searchfox.org/mozilla-central/rev/7241c1f9e94377b70b49cf702264269779c5c322/devtools/shared/layout/utils.js#168 to set createFramesForSuppressedWhitespace
to true, the color picker works. However, given the explanations in the initial bug, I don't think we should simply do that.
So I guess we should update https://searchfox.org/mozilla-central/rev/7241c1f9e94377b70b49cf702264269779c5c322/devtools/server/actors/inspector/utils.js#471-475 to use the fallback also if getBoxQuads returned an empty array.
Should be checked with a mochitest.
Assignee | ||
Comment 3•3 years ago
|
||
The getBackgroundColor already has fallback paths for several situations.
We now use the fallback in case getAdjustedQuads returned an empty array.
A browser mochitest is added to cover this issue as well.
Updated•3 years ago
|
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a3e50b873fc0 [devtools] Color picker should fallback on getClosestBackgroundColor for elements without quads r=nchevobbe
Comment 5•3 years ago
|
||
bugherder |
Description
•