The browser console autocomplete and returning function for querySelector no longer works inside of a shadowRoot
Categories
(DevTools :: Console, defect, P3)
Tracking
(firefox-esr102 unaffected, firefox110 unaffected, firefox111 wontfix, firefox112 wontfix, firefox113 wontfix, firefox114 fix-optional)
| Tracking | Status | |
|---|---|---|
| firefox-esr102 | --- | unaffected |
| firefox110 | --- | unaffected |
| firefox111 | --- | wontfix |
| firefox112 | --- | wontfix |
| firefox113 | --- | wontfix |
| firefox114 | --- | fix-optional |
People
(Reporter: cmuntean, Unassigned)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(2 files)
[Affected versions]:
- Firefox Beta 111.0b4;
- Firefox Nightly 112.0a1;
[Affected Platforms]:
- Mac 12.4
- Windows 10 x64
- Linux Mint 20
[Steps to reproduce]:
- Open the Nightly browser and navigate to about:logins.
- Open the browser console (CTRL+SHIFT+K/CMD+OPT+K).
- Type the following in the DevTools console:
document.querySelector('login-intro').shadowRoot.q - Observe the console behavior.
[Expected result]:
- The querySelector suggestion/autocomplete and returning function is displayed.
[Actual result]:
- The querySelector suggestion/autocomplete and returning function is NOT displayed.
[Regression]:
- This issue is not reproducible on Firefox 110. Considering this, using mozregression tool I have found the following pushlog:
Last good revision: b6a3b24b90c420472fe71460e387a8dfd31e2d3d
First bad revision: 5c2b32e98bede1e87f5243d8a929de67179d9b83
Pushlog: Link.
It seems that one of these patches from the provided pushlog introduced this behavior.
[Notes]:
- I have attached a screen recording of the issue.
| Reporter | ||
Comment 1•2 years ago
|
||
I have also attached a screenshot to compare the behavior form Firefox 110 release and Nightly 112.0a1.
@Tooru Fujisawa not sure if this is intended or not, but could you please take a look over this?
Comment 2•2 years ago
|
||
This is intentional change, comes from bug 1806598 patch.
The details are the following:
Previously, all DOM native getters are considered side-effect free (which was simply wrong), and all of them are evaluated during eager evaluation.
The autocomplete depends on the eager evaluation to get the list of suggestion items without having side effect.
Bug 1806598 patch changed the behavior and now only DOM native getters explicitly annotated "side-effect-free" are evaluated during eager evaluation,
and thus other getters are no longer eagerly evaluated, and the autocomplete stops working for such case.
In this case, Element.prototype.shadowRoot getter is not marked as "side-effect-free" in the WebIDL, thus, after bug 1806598, the expression is no longer eagerly evaluated, and the value of document.querySelector('login-intro').shadowRoot becomes unknown, and the autocomplete doesn't work.
partial interface Element {
...
[BinaryName="shadowRootByMode"]
readonly attribute ShadowRoot? shadowRoot;
What needs to be done here is to add more annotation to WebIDL,
or perhaps, if the getter is really effectful, not showing the suggestion might be the "correct" behavior.
Comment 3•2 years ago
|
||
Set release status flags based on info from the regressing bug 1806598
Updated•2 years ago
|
Comment 4•2 years ago
|
||
Set release status flags based on info from the regressing bug 1806598
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 5•2 years ago
|
||
This is a minor regression, we can still evaluate the statements, and it's better to be safe here rather than evaluating getters which would have side effects.
Updated•2 years ago
|
Updated•2 years ago
|
Comment 6•2 years ago
|
||
Fixed bug 1815381 patch.
Description
•