Quantum/Stylo

From MozillaWiki
Jump to: navigation, search

Stylo (a.k.a. Quantum CSS) will integrate Servo's CSS style system into Gecko, such that the style system code can be shared by Gecko and Servo. Stylo V1 will support Firefox on Windows, macOS, and Linux. Android support may ship in a later release. Stylo is a core part of Project Quantum.

To help test Stylo, download Firefox Nightly. To confirm that Stylo is enabled, check about:support for "Stylo: true (enabled by default)". If it's not, then set the about:config pref layout.css.servo.enabled to true.

For a deep dive into Stylo internals, check out Lin Clark's Mozilla Hacks blog post "Inside a super fast CSS engine: Quantum CSS (aka Stylo)".

Getting Involved

If you're interested in contributing to Stylo or Servo, drop by the #servo IRC channel on Mozilla's IRC server.

One front where you can help out is adding new properties to Servo's CSS parsing crate. This requires familiarity with Rust, but is otherwise a good way to dip your toes into Servo's style system. To get started, see Servo's CSS property hacking guide for more information.

If you do not know Rust, you can help implement keyword properties. See the Stylo hacking guide for more details. The Stylo hacking guide also has instructions for building Stylo if you wish to play with it yourself. If you know C++, Firefox bug 1277133 has information about easy Gecko bugs that will assist Stylo's integration with Gecko.

Some Stylo bugs that are good for new Servo contributors are tagged on GitHub as “easy” bugs and “less-easy” bugs.

Committing stylo changes

The process for committing a Stylo change that involves both Gecko and Servo changes is as follows:

  1. Create a Github PR against https://github.com/servo/servo with the Servo changes in question.
  2. Get that reviewed and checked into Servo's github repository.
  3. Wait for servo-vcs-sync to land the Servo changes on Gecko's autoland.
  4. Land the Gecko changes on autoland.

A more exhaustive / overwhelming description of the workflow is also available.

Try Syntax

For most Stylo changes, it should be sufficient to build on all platforms and test on Linux 64-bit only, which helps save resources in automation. To do this, you can use:

./mach try -b do -p all -u all[x64]

To build and test all Stylo platforms running in automation, you can use:

./mach try -b do -p linux,linux64,linux64-haz,macosx64,win32,win64 -u all

To build all possible platforms to ensure code compiles everywhere, but only test with Stylo enabled, you can use:

./mach try -b do -p all -u all[linux32,linux64,linux64-stylo-sequential,macosx64,windows7-32,windows10-64]

Release Criteria

Stylo should not cause us to regress any CSS feature unless we explicitly decide that regressing that specific feature is acceptable. The existing test suite will be the primary benchmark of this, with cross-validation from an automated analysis and manual QA of the Alexa Top 500 sites.

  • Stylo should be enabled by default on all desktop platforms.
  • Stylo should have zero P1 and P2 bugs.
  • Stylo should pass all (non-disabled) Gecko reftests and mochitests.
  • Stylo should support at least as many CSS properties as than Gecko. Firefox = 375. Stylo = 375. Chrome = 276. DONE!
  • Stylo should pass visual diff testing for the Alexa top sites. (bug 1331552) DONE!
  • Stylo's sequential mode performance on Talos tp5 and tp6 should be at least as fast as Gecko's.
  • Stylo's parallel mode performance on Talos tp5 and tp6 should be faster than Gecko's. Ideally, Stylo should scale linearly with the number of cores.
  • Stylo's performance on Speedometer should be at least as fast as Gecko's.
  • Stylo's memory usage (as measured by AWSY and user telemetry) should not exceed to Gecko's by more than X% (TBD).
  • Stylo's crash rate should be less than or equal to Gecko's.
  • Stylo's user engagement metrics should be greater than or equal to Gecko's.
Linux32 Linux64 macOS Win32 Win64 Android
Build bug 1366050 bug 1374824 bug 1375774 bug 1384258 bug 1384258 bug 1366049
AWSY not tested 1% regression 1% regression 2% regression 3% regression 0% change
Speedometer not tested linux64 Perfherder macOS Perfherder win7-32 Perfherder

win8-32 desktop

win10-32 reference laptop

win10-64 Perfherder

win8-64 desktop

win10-64 reference laptop

not tested
tp5 not tested linux64 macOS win7-32 win10-64 tp4m (tiny improvement)
tp6a not tested not tested macOS win7-32 win10-64 not tested
tp6f not tested not tested macOS win7-32 win10-64 not tested
tp6g not tested not tested macOS win7-32 win10-64 not tested
tp6y not tested not tested macOS win7-32 win10-64 not tested
Autophone not tested not tested not tested not tested not tested remote-blank (tiny improvement)

remote-nytimes (tiny regression)

remote-tsvg (tiny regression bug 1420369)

remote-twitter (tiny regression bug 1420369)

Milestones

stylo-central

stylo-nightly

  • Enable Stylo in Nightly (bug 1330412) (dependencies)
    • Implement parsing of all CSS properties supported by Firefox
    • Fix and enable all tests (without skipping or expecting failure)
    • Fix all crashes and assertion failures
      • Fuzz Stylo
      • Pass [Auto-tools/Projects/BugHunter Bughunter]
    • Manual QA sign-off
      • Smoke test Alexa Top N sites
      • Exploratory testing of browser UI and features

stylo-release

  • Stylo meta bug 1243581 (dependencies)
  • Run experiment comparing Stylo vs Gecko on engagement ratio, performance, crash rate, and memory usage.
  • Let Stylo ride the trains
    • Enable Stylo on all platforms (bug stylo-nightly)
      • Pass QA on all platforms (tests, fuzzing, BugHunter)
  • Ship Stylo to Release

Bugs

P1 Bugs

Full Query
ID Priority Summary Keywords Assigned to
1422653 P1 stylo: We spend a ridiculous amount of time in GetFlattenedTreeParentNodeInternal / StyleChildrenIterator on stylo-chrome. Emilio Cobos Álvarez [:emilio]
1424798 P1 stylo: Cannot animation from translate(0%) to translate(0%, 100px) in Firefox 58 onwards regression Manish Goregaokar [:manishearth]
1420423 P1 stylo: Large regression on some talos tests when enabling stylo-chrome
1421374 P1 stylo: Regression on AWSY when enabling stylo-chrome
1424324 P1 2.14 - 4.26% Explicit Memory / JS (linux32-stylo-disabled, linux64, linux64-stylo-disabled, linux64-stylo-sequential, osx-10-10, windows10-64, windows7-32) regression on push 1938afc341937d701acfb196279193f4cc640696 (Thu Dec 7 2017) perf, regression

5 Total; 5 Open (100%); 0 Resolved (0%); 0 Verified (0%);


P2 Bugs

Full Query
ID Priority Summary Keywords Assigned to
1415940 P2 Stylo: insertRule() with newlines can break rules inspector Brad Werth [:bradwerth]
1405796 P2 stylo: Assertion failure: !child->IsRelocated() (Child should be in its ordinal position) in [@ mozilla::a11y::DocAccessible::DoARIAOwnsRelocation] assertion, testcase Eitan Isaacson [:eeejay]
1405880 P2 stylo: Assertion failure: !HasAnyOfFlags(kAllServoDescendantBits | NODE_NEEDS_FRAME) in [@ mozilla::dom::Element::UnbindFromTree] assertion, testcase Emilio Cobos Álvarez [:emilio]
1422522 P2 stylo: GitHub page loading time is slower due to worse querySelectorAll performance. Emilio Cobos Álvarez [:emilio]
1422651 P2 stylo: Style sharing is effectively disabled for elements with XBL bindings, which may affect stylo-chrome. Emilio Cobos Álvarez [:emilio]
1413497 P2 stylo: tests/editor/reftests/824080-2.html is failure on Android/styloVsGecko Makoto Kato [:m_kato] (slow due to PTO, back at Jan)
1418296 P2 3.73% Resident Memory (linux32-stylo-disabled) regression on push e74e4ec2cb39 (Wed Nov 15 2017) perf, regression Makoto Kato [:m_kato] (slow due to PTO, back at Jan)
1420369 P2 stylo: 6.21 - 6.54% remote-tsvg / remote-twitter (android-6-0-armv8-api16, android-7-1-armv8-api16) regression on push db56323cd08f4883e4824199b441a3141be655e5 (Thu Nov 23 2017) perf, regression Makoto Kato [:m_kato] (slow due to PTO, back at Jan)
1351737 P2 stylo: Large code size for property value parsing
1391341 P2 stylo: Font size inherits differently than in Gecko dev-doc-complete, regression
1413654 P2 stylo: We rely on the initial ResolveStyleFor call when computing the body style for scroll propagation to deal with updating the stylist
1416903 P2 stylo: Crash in core::result::unwrap_failed<T> | style::selector_map::MaybeCaseInsensitiveHashMap<T>::entry<T> crash
1418902 P2 stylo: Stop updating animation data on pseudo elements whose content value is changed to 'none' reproducible
1421408 P2 stylo: Computing property values takes much longer time than Gecko perf
1421545 P2 Update test_bug1150308.html to work with Shadow DOM v1 and stylo
1422615 P2 stylo: Stop cascading an element for restyling if the element has display:none
1422416 P2 stylo: No need to mark uncacheable for style adjustment based on reset properties only Xidorn Quan [:xidorn] UTC-6 (less responsive until Austin)

17 Total; 17 Open (100%); 0 Resolved (0%); 0 Verified (0%);


P3 Bugs

Full Query
ID Priority Summary Keywords Assigned to
1358955 P3 stylo: Update SMIL animations that depend on the cascade Brian Birtles (:birtles)
1370604 P3 stylo: Consider preloading the style sharing cache with styled siblings during incremental restyle Boris Zbarsky [:bz] (no decent commit message means r-)
1345688 P3 stylo: align binary representations of computed keyword values and eliminate the match statements Cameron McCormack (:heycam) (away until 3 Jan)
1409183 P3 stylo: Assertion failure: !mInStyleRefresh in [@ mozilla::ServoRestyleManager::ContentStateChanged] assertion, testcase Cameron McCormack (:heycam) (away until 3 Jan)
1395488 P3 stylo: shrink nsStyleDisplay, nsStylePosition and ServoComputedData Emilio Cobos Álvarez [:emilio]
1405899 P3 stylo: Element::Matches using stylo is slower than using Gecko in some cases Emilio Cobos Álvarez [:emilio]
1406875 P3 stylo: Figure out how quirks mode and XBL stylesets should interact Emilio Cobos Álvarez [:emilio]
1388566 P3 stylo: Don't flush throttled animations if the root element has normal dirty descendants bit in PreTraverse() Hiroyuki Ikezoe (:hiro)
1415780 P3 Fix timeout in test_event-dispatch.html with conformant Promise handling and with disabling stylo Hiroyuki Ikezoe (:hiro)
1420928 P3 stylo: animation-name and transition-property probably shouldn't be early properties. Hiroyuki Ikezoe (:hiro)
1398981 P3 186,800 instances of "stylo: Web Components not supported yet" emitted from dom/base/nsDocument.cpp during linux64 debug testing Jessica Jong [:jessica]
1375222 P3 Stylo: Lots of 48-byte stack locals being copied in style::properties::PropertyDeclaration::parse_into
1375225 P3 Stylo: Redundant object copies in style::properties::PropertyDeclaration::parse_into
1376082 P3 stylo: The hover generation is never updated, and we seem to be fine with it.
1395112 P3 Remove the old style system (and use Stylo everywhere)
1397380 P3 stylo: Investigate sources of stylo memory overhead on the html single-page spec
1400510 P3 stylo: Add refcount logging for servo_arc so we can detect reference cycles that cause leaks
1400771 P3 stylo: preshints (mapped attributes) not handled correctly for elements created from non-docshell-associated document
1400915 P3 stylo: Still have a lot of Display, Position, Border structs on the HTML5 page even with STYLO_THREADS=1
1401074 P3 stylo: handle modifications to UA sheets by invalidating UA CascadeData cache
1402212 P3 stylo: display value of non-existent pseudo flex item is not blockified
1403511 P3 stylo: Stack overflow crash in geckoservo::glue::Servo_Element_ClearData crash, regression
1404633 P3 stylo: Crash in OOM | unknown | alloc::oom::oom | style::properties::StyleStructRef<T>::mutate<T> crash, regression
1405633 P3 stylo: Run other stylo tests in rusttests tasks
1406274 P3 stylo: Enable stylo for about:reader
1406693 P3 stylo: Crash in core::result::unwrap_failed<T> | style::custom_properties::substitute_one crash, regression
1407688 P3 stylo: Google Inbox doesn't expand emails steps-wanted
1408323 P3 stylo: consider generating nsStyleConsts.h values from Servo
1408351 P3 Stylo: Crash in style::invalidation::stylesheets::StylesheetInvalidationSet::scan_component crash, regression
1410184 P3 Investigate replacing the JS CSS lexer with Stylo's lexer in WebAssembly
1410784 P3 stylo: scrollbar doesn't show on layout/reftests/bugs/558011-1.xul
1411008 P3 stylo: thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /checkout/src/libcore/option.rs:335:20 assertion, crash, testcase
1411119 P3 stylo: Assertion failure: !preTransformOverflows (GetVisualOverflowRect() won't return the pre-effects rect!), at /builds/worker/workspace/build/src/layout/svg/nsSVGIntegrationUtils.cpp:104 assertion, testcase
1412441 P3 stylo: Merge structs.rs into bindings.rs
1412774 P3 stylo: 1133905-4-v-rtl.html is always failure on Android/styloVsGecko
1413533 P3 stylo: Consider making the bloom filter handle :-moz-any and such.
1413731 P3 stylo: Investigate whether opaquing types more aggressively can help reduce build time
1414902 P3 stylo: Assertion failure: !GetStyleContextInMap(aMap, aContent) (Already have an entry for aContent), at /builds/worker/workspace/build/src/layout/base/nsFrameManager.cpp:205 assertion, testcase
1414941 P3 stylo: Assertion failure: mAllowZoom == aNewData.mAllowZoom (expected mAllowZoom to be the same on both nsStyleFonts) [@ nsStyleFont::CalcDifference] assertion, testcase
1415236 P3 enable-stylo build fails probably when system-nspr is used
1417578 P3 stylo: Audit internal properties that are accidentally exposed.
1417970 P3 stylo: Perf issues with dynamic CSS recascade
1417991 P3 stylo: Worse style system performance than Gecko in https://s.codepen.io/tomhodgins/debug/ggWMpg perf
1418161 P3 stylo: Huge perf hit on painting and MotionMark benchmarks w/ Stylo and uBlock Origin perf
1419943 P3 stylo-chrome: permafailure browser_aboutURLs.js | leaked 2 window(s) until shutdown [url = about:downloads]
1419953 P3 stylo-chrome: M-e10s(ss) on macOS may become permafailure after enabling stylo-chrome
1421310 P3 stylo: Investigate why Stylo fails to skip some restyle which Gecko is able to skip
1424253 P3 stylo: non-default "font.minimum-size." pref value breaks table layout
1424671 P3 stylo: Update the tests of clamping the negative values on background-size and mask-size
1363971 P3 stylo: Different handling of place-{content,items,self} shorthand Anthony Ramine [:nox]
1383868 P3 stylo: Incorrect blockification of kids of display:inline-flex element that is not a flex container Xidorn Quan [:xidorn] UTC-6 (less responsive until Austin)
1417138 P3 stylo: Enable stylo-chrome by default Xidorn Quan [:xidorn] UTC-6 (less responsive until Austin)

52 Total; 52 Open (100%); 0 Resolved (0%); 0 Verified (0%);


Other stylo-nightly bugs:

Full Query
ID Priority Summary Keywords Assigned to
1381147 P5 [Shield] Pref Flip Study: Quantum CSS (Stylo) Chris Peterson [:cpeterson]
1320841 P5 [meta] Pass all mochitests for Stylo meta
1324348 P5 [meta] stylo: Reftest failures meta
1340224 P5 stylo: Test whether Stylo improves terrible restyle performance on cleopatra
1370466 P5 stylo: Pass WPT meta
1356458 -- drive static analysis hazard threshold to zero Steve Fink [:sfink] [:s:]
1321197 P5 [meta] stylo: Have stylo pass all style system mochitests meta Xidorn Quan [:xidorn] UTC-6 (less responsive until Austin)

7 Total; 7 Open (100%); 0 Resolved (0%); 0 Verified (0%);


Other stylo-release bugs:

Full Query
ID Priority Summary Keywords Assigned to
1328497 P5 stylo: Optimize codesize Matt Brubeck (:mbrubeck)
1289864 P5 Tracking bug for Stylo performance issues
1293767 P5 stylo: Memory usage tracking bug
1294570 P4 stylo: Style chrome documents with Servo
1324620 P5 stylo: fix tests marked as fails-if(stylo) and asserts-if(stylo,...) meta
1333171 P5 Fuzz Stylo
1337166 P5 stylo: Make sure we don't unintentionally ship new CSS features when we ship stylo dev-doc-needed
1353472 P5 stylo: Poor parallelism in rebuilding rust crates
1365771 P5 stylo: Tracking bug for behavior changes in stylo dev-doc-needed
1375906 P5 stylo: Metabug for issues affecting real websites meta

10 Total; 10 Open (100%); 0 Resolved (0%); 0 Verified (0%);


Bugzilla Queries

Priority Definitions:

  • P1: Blocks shipping, more urgent. We should be working on these now/ASAP.
  • P2: Blocks shipping, less urgent. We can wait a few weeks to start working on these.
  • P3: Might block shipping. Needs re-evaluation, potentially closer to the deadline.
  • P4: Doesn't block shipping, but nice to have.
  • P5: Don't need to track.

Links