Closed Bug 2005708 Opened 5 days ago Closed 19 hours ago

Empty warning for selector `:scope ~ *` (SiblingCombinatorAfterScope warning)

Categories

(DevTools :: Inspector: Rules, defect)

defect

Tracking

(firefox-esr140 unaffected, firefox146 wontfix, firefox147 wontfix, firefox148 fixed)

RESOLVED FIXED
148 Branch
Tracking Status
firefox-esr140 --- unaffected
firefox146 --- wontfix
firefox147 --- wontfix
firefox148 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Attached file test_case.html

Steps to reproduce

  1. Open the attached test case
  2. Open the inspector
  3. Inspect the <h1> element
  4. Hover the warning icon in the selector

Actual results

The warning is empty


In the browser console, we can see the following error:

10:29:05.301 Unknown selector warning kind 
Array [ "SiblingCombinatorAfterScope" ]
css-selector-warnings-tooltip-helper.js:45:17

That's coming from https://searchfox.org/firefox-main/rev/e7114bcf28158b46e516178c06201e4849201eba/devtools/client/shared/widgets/tooltip/css-selector-warnings-tooltip-helper.js#34,44-45

#getTemplate(data, tooltip) {
...
    if (!SELECTOR_WARNINGS[selectorWarningKind]) {
      console.error("Unknown selector warning kind", data);

and indeed we don't have a SiblingCombinatorAfterScope warning in https://searchfox.org/firefox-main/rev/e7114bcf28158b46e516178c06201e4849201eba/devtools/client/shared/widgets/tooltip/css-selector-warnings-tooltip-helper.js#9-15

const SELECTOR_WARNINGS = {
  UnconstrainedHas: {
    l10nId: "css-selector-warning-unconstrained-has",
    // There could be a specific section on the MDN :has page for this: https://github.com/mdn/mdn/issues/469
    learnMoreUrl: null,
  },
};

The warning was added on the platform side in Bug 1882379

David, maybe we could add a comment on top of https://searchfox.org/firefox-main/rev/e7114bcf28158b46e516178c06201e4849201eba/layout/style/CSSStyleRule.cpp#359-366

SelectorWarningKind ToWebIDLSelectorWarningKind(
    StyleSelectorWarningKind aKind) {
  switch (aKind) {
    case StyleSelectorWarningKind::UnconstraintedRelativeSelector:
      return SelectorWarningKind::UnconstrainedHas;
    case StyleSelectorWarningKind::SiblingCombinatorAfterScopeSelector:
      return SelectorWarningKind::SiblingCombinatorAfterScope;
  }

to indicate a bug should be filed for devtools/an entry should be added in https://searchfox.org/firefox-main/rev/e7114bcf28158b46e516178c06201e4849201eba/devtools/client/shared/widgets/tooltip/css-selector-warnings-tooltip-helper.js

Flags: needinfo?(dshin)
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED

(In reply to Nicolas Chevobbe [:nchevobbe] from comment #1)

David, maybe we could add a comment on top of https://searchfox.org/firefox-main/rev/e7114bcf28158b46e516178c06201e4849201eba/layout/style/CSSStyleRule.cpp#359-366

SelectorWarningKind ToWebIDLSelectorWarningKind(
    StyleSelectorWarningKind aKind) {
  switch (aKind) {
    case StyleSelectorWarningKind::UnconstraintedRelativeSelector:
      return SelectorWarningKind::UnconstrainedHas;
    case StyleSelectorWarningKind::SiblingCombinatorAfterScopeSelector:
      return SelectorWarningKind::SiblingCombinatorAfterScope;
  }

to indicate a bug should be filed for devtools/an entry should be added in https://searchfox.org/firefox-main/rev/e7114bcf28158b46e516178c06201e4849201eba/devtools/client/shared/widgets/tooltip/css-selector-warnings-tooltip-helper.js

Ahh.. My bad, and good idea. Bug 2005744 filed

Flags: needinfo?(dshin)

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

Pushed by nchevobbe@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/202ae50fb8ff https://hg.mozilla.org/integration/autoland/rev/832e596543ce [devtools] Handle SiblingCombinatorAfterScope selector warning in the Inspector. r=dshin,fluent-reviewers,devtools-reviewers,bolsson,ochameau
Status: ASSIGNED → RESOLVED
Closed: 19 hours ago
Resolution: --- → FIXED
Target Milestone: --- → 148 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: