Stylo: Wrong cascade level used for preferences stylesheet

RESOLVED FIXED in Firefox 51

Status

()

Core
CSS Parsing and Computation
RESOLVED FIXED
2 years ago
5 months ago

People

(Reporter: bholley, Assigned: bholley)

Tracking

(Blocks: 1 bug)

unspecified
mozilla51
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox51 fixed)

Details

Attachments

(3 attachments)

(Assignee)

Description

2 years ago
Right now we load the preferences stylesheet as an author stylesheet, rather than a user stylesheet. This causes it to take precedence over page-provided style rules, which isn't what happens in the gecko path and leads to incorrect behavior.

Bug 1291376 covers larger architectural issues that I'm not worrying about in this bug.
(Assignee)

Comment 1

2 years ago
Created attachment 8777076 [details] [diff] [review]
Part 1 - Hoist the ParsingMode getter to the superclass and give it a special binary name for WebIDL. v1

In the next patch we want to introduce an accessor called ParsingMode, which conflicts with this one.
Attachment #8777076 - Flags: review?(cam)
Attachment #8777076 - Flags: review+
(Assignee)

Comment 2

2 years ago
Created attachment 8777077 [details] [diff] [review]
Part 2 - Use the parsing mode from the stylesheet when building preferences stylesheet. v1

In practice this will be the 'agent' level rather than the 'author' level, given
the SetParsingMode call immediately after creating the stylesheet. This change
aligns behavior with CSSStyleSheet::ReparseSheet.
Attachment #8777077 - Flags: review?(cam)
(Assignee)

Comment 3

2 years ago
Created attachment 8777078 [details] [diff] [review]
Part 3 - Make parsing mode an immutable property of the StyleSheet. v1
Attachment #8777078 - Flags: review?(cam)
Summary: Wrong cascade level used for preferences stylesheet → Stylo: Wrong cascade level used for preferences stylesheet
Attachment #8777076 - Flags: review?(cam) → review+
Comment on attachment 8777077 [details] [diff] [review]
Part 2 - Use the parsing mode from the stylesheet when building preferences stylesheet. v1

Review of attachment 8777077 [details] [diff] [review]:
-----------------------------------------------------------------

::: layout/style/nsLayoutStylesheetCache.cpp
@@ +950,5 @@
>  
>    if (sheet->IsGecko()) {
>      sheet->AsGecko()->ReparseSheet(sheetText);
>    } else {
> +    sheet->AsServo()->ParseSheet(sheetText, uri, uri, nullptr, 0, sheet->AsServo()->ParsingMode());

Nit: please wrap at 80 columns.
Attachment #8777077 - Flags: review?(cam) → review+
Attachment #8777078 - Flags: review?(cam) → review+
(Assignee)

Comment 5

2 years ago
(In reply to Cameron McCormack (:heycam) from comment #4)
> Nit: please wrap at 80 columns.

This line is removed in the third patch anyway.

Comment 7

2 years ago
Pushed by bholley@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0ee3385b2da3
Hoist the ParsingMode getter to the superclass and give it a special binary name for WebIDL. r=bholley,r=heycam
https://hg.mozilla.org/integration/mozilla-inbound/rev/edd278067c96
Use the parsing mode from the stylesheet when building preferences stylesheet. r=heycam
https://hg.mozilla.org/integration/mozilla-inbound/rev/d6806f6068fd
Make parsing mode an immutable property of the StyleSheet. r=heycam

Comment 8

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/0ee3385b2da3
https://hg.mozilla.org/mozilla-central/rev/edd278067c96
https://hg.mozilla.org/mozilla-central/rev/d6806f6068fd
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox51: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Depends on: 1436782
You need to log in before you can comment on or make changes to this bug.