Closed Bug 1934914 Opened 1 year ago Closed 5 months ago

On CSSScopeRule with `:scope` selector, CSSScopeRule#selectorMatchesElement(0, scopedElement) returns false

Categories

(DevTools :: Inspector: Rules, defect, P2)

defect
Points:
3

Tracking

(firefox143 fixed)

RESOLVED FIXED
143 Branch
Tracking Status
firefox143 --- fixed

People

(Reporter: nchevobbe, Assigned: dshin)

References

(Blocks 1 open bug)

Details

(Whiteboard: [at-scope-m2])

Attachments

(3 files)

With the following HTML:

<footer id="scoped">
  <style>
    @scope {
      :scope {
        color: red;
      }
    }
  </style>
</footer>

executing scopedRule.selectorMatchesElement(0, document.querySelector("#scoped")) returns false.
I'm expecting it to return true as the rule does apply on the #scoped element.

I attached a patch which adds a failing assertion to demonstrate the issue.
David, would you know what's happening here?

Flags: needinfo?(dshin)

Right, need to handle this. Somewhere here we need to collect scoped rules as well as parent style rules, as well as ensuring that we're in scope.

Blocks: @scope
Flags: needinfo?(dshin)
Severity: -- → S3
Priority: -- → P2
Assignee: nobody → dshin
Status: NEW → ASSIGNED
Pushed by dshin@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/20d9dd96cb8d https://hg.mozilla.org/integration/autoland/rev/18192a2c7e42 Remove unused `stylist` param in `scope_condition_matches`. r=firefox-style-system-reviewers,emilio https://github.com/mozilla-firefox/firefox/commit/5fd9ce062a67 https://hg.mozilla.org/integration/autoland/rev/2954a81e7a0b Support @scope in CSSScopeRule#selectorMatchesElement. r=firefox-style-system-reviewers,devtools-reviewers,nchevobbe,emilio
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 143 Branch
Whiteboard: [at-scope-triage]
QA Whiteboard: [qa-triage-done-c144/b143]
Points: --- → 3
Whiteboard: [at-scope-triage] → [at-scope-m2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: