Closed Bug 2014751 Opened 7 months ago Closed 4 months ago

attr() doesn't strike through attribute name when attribute value is not valid for the specified syntax in type()

Categories

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

defect

Tracking

(firefox153 fixed)

RESOLVED FIXED
153 Branch
Tracking Status
firefox153 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

(Blocks 2 open bugs)

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. Inspect the blue background Hello element

Expected results

In the rule view, for the background-color declaration, in attr() the data-bg is strike through (because the data-bg attribute value is 12px, which doesn't match the type(<color>) we have

Actual results

The blue fallback is strike through


This styling mechanism only check for the presence of the attribute, but when the attr() is using a type(), we should check that the value does check the syntax.
We can probably use InspectorUtils.valueMatchesSyntax (see InspectorUtils.webidl)

See Also: → 2015818
Severity: -- → S3
Priority: -- → P2
Depends on: 2033464
No longer depends on: 2033464

Check if the attribute value does match the definedd attr() attr-type parameter
to see if the attribute value or the fallback is being used.
In the attr() tooltip, indicate when the attribute value doesn't match the specified
type.

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Blocks: 2040912
Pushed by nchevobbe@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/7cfad5d34cab https://hg.mozilla.org/integration/autoland/rev/3cf027900442 [devtools] Handle modern attr() syntax in OutputParser. r=devtools-reviewers,ochameau.
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 153 Branch
QA Whiteboard: [qa-triage-done-c154/b153]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: