Closed Bug 1818180 Opened 2 years ago Closed 2 years ago

The browser console autocomplete and returning function for querySelector no longer works inside of a shadowRoot

Categories

(DevTools :: Console, defect, P3)

Desktop
Unspecified
defect

Tracking

(firefox-esr102 unaffected, firefox110 unaffected, firefox111 wontfix, firefox112 wontfix, firefox113 wontfix, firefox114 fix-optional)

RESOLVED DUPLICATE of bug 1815381
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]:

  1. Open the Nightly browser and navigate to about:logins.
  2. Open the browser console (CTRL+SHIFT+K/CMD+OPT+K).
  3. Type the following in the DevTools console: document.querySelector('login-intro').shadowRoot.q
  4. 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.
Attached image Screenshot_1.png

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?

Flags: needinfo?(arai.unmht)

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.

https://searchfox.org/mozilla-central/rev/611660bff9e6d52f1769bf216a7fbd12ece4d2d2/dom/webidl/Element.webidl#283,287-288

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.

Flags: needinfo?(arai.unmht)
See Also: → 1806598
Regressed by: 1806598

Set release status flags based on info from the regressing bug 1806598

Set release status flags based on info from the regressing bug 1806598

Whiteboard: [devtools-triage]

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.

Priority: -- → P3
Whiteboard: [devtools-triage]

Fixed bug 1815381 patch.

Status: NEW → RESOLVED
Closed: 2 years ago
Duplicate of bug: 1815381
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: