Closed Bug 1291390 Opened 8 years ago Closed 8 years ago

Stylo: Wrong cascade level used for preferences stylesheet

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: bholley, Assigned: bholley)

References

Details

Attachments

(3 files)

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.
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+
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)
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+
(In reply to Cameron McCormack (:heycam) from comment #4)
> Nit: please wrap at 80 columns.

This line is removed in the third patch anyway.
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
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: