DevTools eye dropper command should use a dedicated descriptor & target
Categories
(DevTools :: General, task, P3)
Tracking
(Fission Milestone:M8, firefox91 fixed)
Tracking | Status | |
---|---|---|
firefox91 | --- | fixed |
People
(Reporter: jdescottes, Assigned: jdescottes)
References
Details
(Whiteboard: dt-fission-m3-mvp)
Attachments
(1 file)
See https://phabricator.services.mozilla.com/D109470#inline-613143
In order to pick a color on the page, the eyedropper tool can create a TabDescriptor + inspector front early: https://searchfox.org/mozilla-central/rev/6c9ff2820d3aae683ec87c53c79e5108d54f3f76/devtools/client/menus.js#133-139
const descriptor = await TabDescriptorFactory.createDescriptorForTab(
window.gBrowser.selectedTab
);
const target = await descriptor.getTarget();
await target.attach();
const inspectorFront = await target.getFront("inspector");
Since the tab descriptor is cached per tab in the TabDescriptorFactory, this descriptor & front will be reused if you open a toolbox afterwards.
This is confusing and fragile. The eyedropper should not rely on the cache of descriptors which is really intended for toolboxes.
This might get fixed indirectly by Bug 1700909 when we move the descriptor (or rather commands) caching to gDevTools.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 1•3 years ago
|
||
Note that I think that bug 1700909 doesn't have to be a blocker.
We can probably migrate from TabDescriptorFactory to CommandsFactory and it should address target switching issues.
Assignee | ||
Comment 2•3 years ago
|
||
Adding some easy STRs to reproduce the bug here:
- open https://www.mozilla.org/en-US/
- start the eyedropper (Tools > Browser Tools > Eyedropper)
- close the eyedropper
- open the toolbox
- select the body in the inspector
ER: The ruleview should show a rule for body pointing to protocol-mozilla.66302a5234e3.css (you might see a different hash)
AR: The ruleview shows "inline" for all rules
This is because the toolbox will reuse a cached Front created without watcher support (https://searchfox.org/mozilla-central/rev/b7bc94b4689a7f002c61d016c6e162e5e5708bf3/devtools/client/fronts/inspector.js#58-67).
Assignee | ||
Comment 3•3 years ago
|
||
Depends on D119170
Updated•3 years ago
|
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/54a777ac91e3 [devtools] Use a dedicated commands instance for the eyedropper menu item r=nchevobbe
Comment 5•3 years ago
|
||
bugherder |
Description
•