Closed Bug 1290013 Opened 8 years ago Closed 8 years ago

add a pref to disable/enable stylo

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: heycam, Assigned: heycam)

References

Details

Attachments

(1 file, 3 obsolete files)

In order to use reftests to verify stylo against stock Gecko rendering, we need a way to turn stylo on or off for a given document.  We can add a method to control whether a docshell will load its next document with stylo enabled.
Attached patch patch (obsolete) — Splinter Review
Is this patch enough to get reftest stylo mode switching working?
Attachment #8775518 - Flags: feedback?(slyu)
Attached patch patch (obsolete) — Splinter Review
Rebased.
Attachment #8775518 - Attachment is obsolete: true
Attachment #8775518 - Flags: feedback?(slyu)
Attachment #8777257 - Flags: feedback?(slyu)
Attached patch patch (obsolete) — Splinter Review
Attachment #8777257 - Attachment is obsolete: true
Attachment #8777257 - Flags: feedback?(slyu)
Attachment #8777714 - Flags: review?(bobbyholley)
Dumb question - why can't we just make it pref-controlled, and toggle the pref back and forth between loads on the reftest? It seems like that would be a lot simpler than munging the docshell, and give us automatic UI as well.
That would work too.  And I guess, since we will eventually want this to have a pref when we ship in Nightly, may as well do that now.
Attached patch patch v2Splinter Review
I don't think there should be any problems, but Shing can you test this patch with some reftest runner changes that set the pref?
Attachment #8777714 - Attachment is obsolete: true
Attachment #8777714 - Flags: review?(bobbyholley)
Attachment #8778027 - Flags: feedback?(slyu)
Comment on attachment 8778027 [details] [diff] [review]
patch v2

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

r=me with those fixes.

::: dom/base/nsDocument.cpp
@@ +13413,5 @@
>    // we avoid Servo-backed style sets for SVG documents.
>    if (!mDocumentContainer) {
>      NS_WARNING("stylo: No docshell yet, assuming Gecko style system");
> +  } else if (nsLayoutUtils::SupportsServoStyleBackend(this) &&
> +             Preferences::GetBool("layout.stylo.enabled")) {

Can you use a BoolVarCache instead? No sense in doing hash table lookups when we don't need to.

::: modules/libpref/init/all.js
@@ +5489,5 @@
>  #endif
> +
> +#ifdef MOZ_STYLO
> +// Is the Servo-backed style system enabled?
> +pref("layout.stylo.enabled", true);

Nit: Can we call this layout.css.servo.enabled instead? This pref is likely to persist for a few releases when we ship, and I'd rather keep the rather-opaque 'stylo' moniker from propagating too far.
Attachment #8778027 - Flags: review+
Oh also - can you move the pref check to nsPresContext::StyloEnabled instead? It seems more appropriate there.
I moved it to nsLayoutUtils, where we've got a bunch of other on-Initialize pref caches set up.
Summary: add a way to disable and enable stylo in a docshell → add a pref to disable/enable stylo
https://hg.mozilla.org/mozilla-central/rev/ba23c008090d
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Comment on attachment 8778027 [details] [diff] [review]
patch v2

Cleaning up
Attachment #8778027 - Flags: feedback?(slyu) → feedback+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: