Update browser_parsable_css.js to check that variables that are defined are actually referenced

RESOLVED FIXED in Firefox 60

Status

()

enhancement
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: jaws, Assigned: jaws)

Tracking

unspecified
Firefox 60
Points:
---

Firefox Tracking Flags

(firefox60 fixed)

Details

Attachments

(1 attachment)

Bug 1440877 found a case where we were defining a variable (--toolbar-gbimage) but never referenced it. Whether it is a result of a typo or unnecessary CSS, we can alert developers when they are adding effectively dead code to the tree.
Assignee: nobody → jaws
Status: NEW → ASSIGNED
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 7

a year ago
mozreview-review
Comment on attachment 8954791 [details]
Bug 1441882 - Update browser_parsable_css.js to check that variables that are defined are actually referenced.

https://reviewboard.mozilla.org/r/223906/#review229986

Thanks!
Attachment #8954791 - Flags: review?(gijskruitbosch+bugs) → review+
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 13

a year ago
mozreview-review
Comment on attachment 8954791 [details]
Bug 1441882 - Update browser_parsable_css.js to check that variables that are defined are actually referenced.

https://reviewboard.mozilla.org/r/223906/#review230092

::: browser/base/content/test/static/browser_parsable_css.js:137
(Diff revision 6)
> +  {propName: "--in-content-category-background",
> +   isFromDevTools: false},

--in-content-category-background is actually not used.

https://searchfox.org/mozilla-central/search?q=--in-content-category-background&case=true&regexp=false&path=

::: browser/base/content/test/static/browser_parsable_css.js:139
(Diff revision 6)
> +  {propName: "--separator-border-image",
> +   isFromDevTools: true},

This is not counted because the usage of border-image seems wrong.

normally, it should be `border-image: var(--separator-border-image) 1 1;`

Atm, it's used as `border-image: var(--separator-border-image);` where var(--separator-border-image) is a gradient, which is incorrect.

::: browser/base/content/test/static/browser_parsable_css.js:141
(Diff revision 6)
> +  {propName: "--bezier-diagonal-color",
> +   isFromDevTools: true},
> +  {propName: "--bezier-grid-color",
> +   isFromDevTools: true},

These seem used within a gradient, not sure your code handles that atm.
Comment hidden (mozreview-request)

Comment 15

a year ago
Pushed by jwein@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5e05f1b82846
Update browser_parsable_css.js to check that variables that are defined are actually referenced. r=Gijs

Comment 16

a year ago
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/e9b33e8d7623
Update browser_parsable_css.js to check that variables that are defined are actually referenced: Remove --breakpoint-hover-background because it has been already fixed. r=bustage-fix CLOSED TREE

Comment 17

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/5e05f1b82846
https://hg.mozilla.org/mozilla-central/rev/e9b33e8d7623
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 60
You need to log in before you can comment on or make changes to this bug.