Closed Bug 1959940 Opened 4 months ago Closed 4 months ago

Inherited properties from ::details-content pseudo element are not displayed in the computed panel

Categories

(DevTools :: Inspector, defect, P3)

defect

Tracking

(firefox139 fixed)

RESOLVED FIXED
139 Branch
Tracking Status
firefox139 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

  1. Set layout.css.details-content.enabled to true
  2. Navigate to data:text/html,<meta charset=utf8><style>details::details-content {color: tomato;}</style><details open><summary>Example summary</summary><p>First paragraph.</p><p>Second paragraph</p></details>
  3. Open the inspector
  4. Select one of the p element inside the <details> node
  5. Open the computed panel
  6. Expand the color property

Expected result: the ::details-content rule should be displayed
Actual result: it's not


I have a WIP patch for Bug 1953807 where I'm displaying inherited declarations from ::details-content rules, but it's not enough.
In https://searchfox.org/mozilla-central/rev/19764d620c02025bdcc8d1f3c4fcf5a580407a01/devtools/server/actors/inspector/css-logic.js#480,483

selectorMatchesElement(domRule, idx) {
...
    if (domRule.selectorMatchesElement(idx, element)) {

With domRule being the ::details-content, idx being 0, and element being the <slot> representing the ::details-content element, domRule.selectorMatchesElement returns false. It also returns false if element is <details>.
We probably need to make some tweaks to https://searchfox.org/mozilla-central/rev/19764d620c02025bdcc8d1f3c4fcf5a580407a01/layout/style/CSSStyleRule.cpp#254-297

This allows to actually show inherited element backed pseudo element rules
(e.g. ::details-content) in the computed panel selector matches.
A test is added to cover this scenario.

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Severity: -- → S3
Priority: -- → P3
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1e4b7f0c279a [devtools] Look for element-backed pseudo element match in CssLogic#selectorMatchesElement. r=devtools-reviewers,jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 139 Branch
QA Whiteboard: [qa-triage-done-c140/b139]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: