Closed Bug 2015818 Opened 3 months ago Closed 19 days ago

Support nested attr() in modern syntax

Categories

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

enhancement

Tracking

(firefox152 fixed)

RESOLVED FIXED
152 Branch
Tracking Status
firefox152 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Attached file test case

Steps to reproduce

  1. Set layout.css.attr.enabled to true in about:config
  2. Open the attached test case
  3. Open the inspector
  4. Select the first <h1> element (expand the pseudo element section if it wasn't already)
  5. Select the second <h1> element
  6. Select the third <h1> element

Here's the CSS rule:

h1::after {
	content: attr(data-x raw-string, attr(data-y, "z"));
	color: gold;
	padding: 10px;
}

At step 4, the element does not have any attribute, the data-x is striked through, but there's no indication of what is used/dismissed in attr(data-y, "z").
Expected: data-y should be striked through

At step 5, the element only has a data-y attribute. the data-x is striked through, but there's no indication of what is used/dismissed in attr(data-y, "z").
Expected: "z" should be striked through

At step 6, the element has a data-x attribute. the data-x is not striked through, but after that, only the attr( element is striked through
Expected: the whole attr(data-y, "z") should be striked through


Basically, this should be handled similarly to how we handle var() where we can also have nested var() calls
(and I guess we can have a mix of nested var() and attr() and everything should work properly)

No longer depends on: 2011646
See Also: → 2014751

there's discussion to enable modern attr() in Nightly, so we should look into this soon-ish

Priority: -- → P2

When an attr() function is used in the fallback part for an upper attr() function,
we need to properly style it when the fallback isn't used.
Since we're working with the modern syntax here, we take this as an opportunity
to properly style the whole first parameter, type data included, when the attribute
isn't set.
Test cases are added to properly cover this.

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/8a8cd5282cf0 https://hg.mozilla.org/integration/autoland/rev/c4bd76ea982d [devtools] Support nested attr() in OutputParser. r=devtools-reviewers,jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 19 days ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: