Closed Bug 2023648 Opened 3 months ago Closed 3 months ago

The var() function seems to be broken when it spans several lines

Categories

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

defect

Tracking

(firefox-esr140 unaffected, firefox148 unaffected, firefox149 fixed, firefox150 fixed)

RESOLVED FIXED
150 Branch
Tracking Status
firefox-esr140 --- unaffected
firefox148 --- unaffected
firefox149 --- fixed
firefox150 --- fixed

People

(Reporter: julienw, Assigned: nchevobbe)

References

(Regression)

Details

(Keywords: regression)

Attachments

(4 files, 1 obsolete file)

Attached file testcase

STR:

  1. Open the attachment.
  2. Inspect the cyan square.

=> Notice that the var name is absent in the rule.

Attached image screenshot

The source is:

div {
  width: var(
    --foo, 500px
  );
  height: 500px;
  background: cyan;
}

But the result in the devtools' inspector is:

div {
  width: var(, 500px);
  height: 500px;
  background: cyan;
}
Severity: -- → S3
Flags: needinfo?(nchevobbe)
Priority: -- → P2
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED

submitted patch to fix the issue. This could also be triggered with something as simple as having a space before the var name (e.g. var( --x))

Flags: needinfo?(nchevobbe)
Attachment #9555205 - Attachment description: Bug 2023648 - [devtools] Fix OutputParser handling of multiline var(). r=#devtools → Bug 2023648 - [devtools] Fix OutputParser handling of var() with whitespaces. r=#devtools
Keywords: regression
Regressed by: 1854104

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

Pushed by nchevobbe@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/af634291e68f https://hg.mozilla.org/integration/autoland/rev/0c0a60e4cf37 [devtools] Fix OutputParser handling of var() with whitespaces. r=devtools-reviewers,bomsy
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch

(asked for beta uplift, even though I know there won't be any beta release, I just want the patch to be included in 149 so we don't ship the bug in release)

In Bug 1854104 I made a change to in #parseMatchingParens to return all the
tokens we parsed, including whitespaces.
This threw off the logic for parsing var(), so we're reverting this.
Because of this, we need a small adjustment in the function responsible to
parse attr() (adding a space after we handle a Comma).

Original Revision: https://phabricator.services.mozilla.com/D288689

Attachment #9556084 - Attachment is obsolete: true

firefox-release Uplift Approval Request

  • User impact if declined/Reason for urgency: Users won't see variables used in var() in the inspector if there's whitespace before the variable name
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: no
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing: -
  • Risk associated with taking this patch: low
  • Explanation of risk level: simple devtools-only change, reverting the regressing patch, covered by test
  • String changes made/needed?: -
  • Is Android affected?: no
Attachment #9556517 - Flags: approval-mozilla-release?

In Bug 1854104 I made a change to in #parseMatchingParens to return all the
tokens we parsed, including whitespaces.
This threw off the logic for parsing var(), so we're reverting this.
Because of this, we need a small adjustment in the function responsible to
parse attr() (adding a space after we handle a Comma).

Original Revision: https://phabricator.services.mozilla.com/D288689

QA Whiteboard: [qa-triage-done-c151/b150]
Attachment #9556517 - Flags: approval-mozilla-release? → approval-mozilla-release+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: