Closed Bug 1418152 Opened 7 years ago Closed 7 years ago

stylo: Attribute selector including whitespace is ignored

Categories

(Core :: CSS Parsing and Computation, defect, P1)

57 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox-esr52 --- unaffected
firefox57 + fixed
firefox58 --- fixed
firefox59 --- fixed

People

(Reporter: open, Assigned: heycam)

References

Details

(Keywords: regression)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:57.0) Gecko/20100101 Firefox/57.0
Build ID: 20171112125346

Steps to reproduce:

In Firefox 57 a CSS attribute selector including whitespace is ignored, as example `[ data-attr ] { … };` will not be rendered.
Coming from https://phabricator.wikimedia.org/T180138 – the LESS compiler's minification saved us from bigger negative impact.
This is a regression from Firefox 56 and below, the whitespace shouldn't result in the selector being ignored.



Actual results:

Simplified testcase:
https://codepen.io/Volker_E/full/vWWXVp/




Expected results:

Expected result:
foo div should feature green background
bar div should feature blue background
Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core
[Tracking Requested - why for this release]: Breaks CSS, it means widely affected.

Expected result should be:
foo div should feature blue background
bar div should feature green background



Setting layout.css.servo.enabled = false fixes the problem
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Attribute selector including whitespace is ignored → stylo: Attribute selector including whitespace is ignored
Severity: normal → major
Thanks Volker and Alice.  I think we just need an `input.skip_whitespace()` call at the start of parse_attribute_selector.
Assignee: nobody → cam
Status: NEW → ASSIGNED
Approval Request Comment
[Feature/Bug causing the regression]: Stylo
[User impact if declined]: some CSS selectors will fail to parse and cause page rendering/usability problems
[Is this code covered by automated tests?]: yes
[Has the fix been verified in Nightly?]: yes
[Needs manual test from QE? If yes, steps to reproduce]: no
[List of other uplifts needed for the feature/fix]: none
[Is the change risky?]: no
[Why is the change risky/not risky?]: it's a very small CSS parser change
[String changes made/needed]: none
Attachment #8929942 - Flags: approval-mozilla-beta?
Approval Request Comment
(see comment 7)

This might be worth taking as a ride-along if we do a 57 dot release.
Attachment #8929946 - Flags: approval-mozilla-release?
Priority: -- → P1
RESOLVED FIXED since the Servo patch made its way over to mozilla-central.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Comment on attachment 8929942 [details] [diff] [review]
patch for beta uplift

Fix a stylo issue. Beta58+.
Attachment #8929942 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Comment on attachment 8929946 [details] [diff] [review]
patch for release uplift

Taking it as ride along for 57 to fix a regression.
Attachment #8929946 - Flags: approval-mozilla-release? → approval-mozilla-release+
(In reply to Cameron McCormack (:heycam) from comment #7)
> [Is this code covered by automated tests?]: yes
> [Has the fix been verified in Nightly?]: yes
> [Needs manual test from QE? If yes, steps to reproduce]: no

Has automated coverage, does not need manual testing - per Cameron.
Flags: qe-verify-
For posterity, here's the link to the Beta uplift:
https://hg.mozilla.org/releases/mozilla-beta/rev/65eaccbc3cdd
Target Milestone: --- → mozilla59
Are there any public stats for 57.0.1 installs? We have hacks in place to work around this bug, but would like to know when 57.0.0 usage has dropped enough for us to revert these, but the UA string only reports "57.0"

Ed S
Wikimedia
(In reply to ejsanders from comment #17)
> Are there any public stats for 57.0.1 installs? We have hacks in place to
> work around this bug, but would like to know when 57.0.0 usage has dropped
> enough for us to revert these, but the UA string only reports "57.0"

Chris, do you know the answer to this?
Flags: needinfo?(cpeterson)
(In reply to ejsanders from comment #17)
> Are there any public stats for 57.0.1 installs? We have hacks in place to
> work around this bug, but would like to know when 57.0.0 usage has dropped
> enough for us to revert these, but the UA string only reports "57.0"

The following dashboards (aka "Mission Control") show the usage hours for different Firefox versions, so you can track how quickly people update. 57.0.1 usage is still low and there will always be some stragglers stuck on 57.0.0 for whatever reason. Note that there is now a 57.0.2 dot release.

https://data-missioncontrol.dev.mozaws.net/#/release/windows/main_crashes
https://data-missioncontrol.dev.mozaws.net/#/release/mac/main_crashes
https://data-missioncontrol.dev.mozaws.net/#/release/linux/main_crashes

You can also distinguish dot releases in JavaScript using navigator.buildID, which is a build timestamp. Unfortunately, that won't help you if you need to check on the server side to determine which CSS file to serve. The Mission Control dashboards show the buildIDs for each release:

57.0.0 = 20171112125346
57.0.1 = 20171128222554
57.0.2 = 20171206182557

Note that there are some Linux distro builds with buildIDs that are > the Mac and Windows buildIDs, so it would be safer to check for <= 57.0.1's buildID instead of == or > 57.0.0's buildID.
Flags: needinfo?(cpeterson)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: