Commit graph

43 commits

Author SHA1 Message Date
Boris Zbarsky
7161fff1b8 Add a Stylo API for reparenting a given style.
Servo side of part 4 of the fix for Gecko bug 1324619.  r=emilio
2017-07-28 22:54:06 -04:00
Emilio Cobos Álvarez
9b2d96f7e7
stylo: Honor the relevant link visited pref.
MozReview-Commit-ID: D5NiEJUpONQ
2017-07-23 22:37:47 +02:00
Michael Partheil
b07ebbae6b Replace all uses of the style::stylearc alias with servo_arc.
The alias is left there temporarilly and will be removed completely in a later commit where
also components/style/gecko/generated/structs_{debug|release}.rs are re-generated (they still
use the old alias).
2017-07-19 09:29:05 +02:00
Emilio Cobos Álvarez
07e1c6e75a
stylo: Cleanup the Gecko bits.
MozReview-Commit-ID: dbVDy1u4vp
2017-07-18 17:35:44 +02:00
Manish Goregaokar
808b1f509b stylo: Use ComputedValuesInner instead of ComputedValues when we don't need it 2017-07-17 18:02:25 -07:00
Emilio Cobos Álvarez
1263075776
stylo: Fix StyleSheetInner/Stylesheet mapping
The key of this patch is the split between Stylesheet and StylesheetContents.

Gecko will use StylesheetContents, which maps to a ServoStyleSheetInner.
2017-07-02 15:49:40 +02:00
Emilio Cobos Álvarez
6fefe522a3
style: Assert we never style a root element from another document.
Right now when calling getComputedStyle with an element from another document,
we return the style using the pres context of that document, not of the document
of the window getComputedStyle was called on, so this holds.

But it will stop holding if we ever change this, so assert it doesn't happen.

Bug: 1374062
Reviewed-By: Manishearth
MozReview-Commit-ID: 3g8yQWWdsen
2017-06-21 19:55:02 +02:00
Emilio Cobos Álvarez
dd3bf6f952
Ensure the default computed values are up-to-date before evaluating media queries.
Zoom changes can change the meaning of ems, so we can't re-evaluate media
queries with the old values, because otherwise we may miss a restyle.

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1357461
MozReview-Commit-ID: HQInvR7RPqR
2017-06-03 14:44:12 +02:00
Emilio Cobos Álvarez
ac5872b48c
Bug 1357583: style: Make effective_rules return an iterator, stop refcounting the Device. r=heycam
This makes the code cleaner, and also documents the fact that effective_rules
recurses into imports.

No we're not adding the imported stylesheets twice, and we share code with the
invalidation analysis.

MozReview-Commit-ID: DOF2AViTlmR
2017-05-29 20:27:43 +02:00
Emilio Cobos Álvarez
39e836966e
Bug 1357583: style: Hook up the invalidator in the StyleSheetSet. r=heycam
MozReview-Commit-ID: IhgKAovTJMX
2017-05-29 20:27:36 +02:00
Emilio Cobos Álvarez
bc8382ebe9
style: Use a FnvHashMap for ExtraStyleData, and remove unused stuff from PerDocumentStyleDataImpl. 2017-05-23 14:47:18 +02:00
heyzoos
4196156bb9 Change device and rule_set references to accessors 2017-05-18 22:18:16 -05:00
Xidorn Quan
3e00a91e20 Enable querying counter-style rule on Servo backend. 2017-05-16 14:42:46 +10:00
Nazım Can Altınova
c54d255d07
stylo: Propagate quirks mode information from Gecko to Servo 2017-05-14 01:51:50 +03:00
Emilio Cobos Álvarez
25d39006b6
stylo: Stop cloning the list of stylesheets each flush. 2017-05-12 14:51:01 +02:00
Emilio Cobos Álvarez
677daaabc5
style: Parameterize the update and rebuild methods to take an iterator.
In preparation to avoid cloning the stylesheets while rebuilding in Gecko.
2017-05-12 14:50:59 +02:00
Emilio Cobos Álvarez
50e0c67e2c
style: Stop refcounting the stylist. 2017-05-11 21:05:42 +02:00
Boris Zbarsky
4588664873 Clear the stylist when Gecko stylesheets change, but don't rebuild it until explicitly flushed.
This is the servo part of part 3 of the fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1361843
2017-05-10 16:25:54 -04:00
Bobby Holley
d78ca4c4f9 Use StyleArc in the style system.
MozReview-Commit-ID: flF0fv9E9M
2017-05-02 17:35:44 -07:00
Brad Werth
2b6c494f85 Change StyleSet to track stylesheets by unique ID.
MozReview-Commit-ID: Ky3P53o4Euw
2017-05-02 13:38:13 -07:00
Emilio Cobos Álvarez
4651b94ff0
style: Simplify author_style_disabled handling. 2017-04-19 09:41:37 +02:00
Emilio Cobos Álvarez
97235d0bf7
stylo: Centralize stylesheet handling.
This is needed for both bug 1357461 and bug 1273303, where I plan to add smarter
invalidations than what we have now.

Also, it's cleaner.

Ideally I'll move this onto stylist, though that may require extra work to make
it work fine for Servo, so for now let's just do the obvious thing.
2017-04-19 09:41:36 +02:00
Brad Werth
91a9fb06c7 Add an author_style_disabled flag to stylist.update, and associated structs.
MozReview-Commit-ID: FiXyEN4xVnU
2017-04-14 09:24:20 +08:00
Xidorn Quan
01e986f2e6 Record effective @font-face rules when updating stylist. 2017-03-30 11:41:12 +11:00
Simon Sapin
d5074136e3 Rename ReadGuards to StylesheetGuards 2017-03-19 22:30:42 +01:00
Simon Sapin
aeffca2a59 Replace RwLock<StyleRule> with Locked<StyleRule> 2017-03-19 22:30:37 +01:00
Simon Sapin
d18b1280f2 Move shared lock acquires up the call stack. (Or is it down?) 2017-03-19 22:30:32 +01:00
Emilio Cobos Álvarez
eaf27ccfa0
style: Kill SharedStyleContext::default_computed_values.
Now that cascade() gets a Device, we can use the default computed values from
there to avoid propagating that state all over the place.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-03-14 00:49:16 +01:00
Nathan Froyd
fafcdda16a geckolib: move NUM_THREADS from style to geckolib
This change eliminates some gecko-only configuration in the style
component and moves NUM_THREADS closer to its only uses.
2017-02-22 11:35:08 -05:00
Nathan Froyd
3e81f8431e geckolib: use a global thread pool for styling
By having a single thread pool, rather than one per document, we use
less memory.  This addresses
https://bugzilla.mozilla.org/show_bug.cgi?id=1324250.
2017-02-22 11:25:07 -05:00
Emilio Cobos Álvarez
d29fade4c2
Bug 1332969: stylo: Synchronously do a style update when the device changes.
Ideally this would be lazy, but eventually we're going to need to restyle in
RebuildAllStyleData anyway, which would require us to have the style up to date,
so no need to complicate our lives.

MozReview-Commit-ID: AlmUGRCNm2z
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-01-23 18:55:45 +01:00
Emilio Cobos Álvarez
5b5243b8af
Bug 1331213: Bootstrap a Gecko-side Device, and track it's dirtiness manually in the per-doc data. r=heycam
The setup is quite different to Servo-land, so add a comment about the different
setup.

Also, check viewport rules when flushing stylesheets. I believe that the
previous behavior is plain wrong, though I haven't taken the time to come up
with a test case.

In any case, it doesn't hurt any of both back-ends.

MozReview-Commit-ID: 46gtTkesOsr
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-01-17 14:05:23 +01:00
Boris Zbarsky
369fdddcd9 Bug 1298588 part 13. Make sure Device has a ComputedValues for stylo. r=bholley 2017-01-04 23:13:52 -05:00
Boris Zbarsky
34bb2f1e6c Bug 1298588 part 3, servo piece. Add a default ComputedValues member to PerDocumentStyleData. r=bholley 2017-01-04 23:13:31 -05:00
Boris Zbarsky
8908743719 Bug 1298588 part 2, servo piece. Pass through an nsPresContext to the PerDocumentStyleData constructor. r=bholley 2017-01-04 14:42:15 -05:00
Emilio Cobos Álvarez
dba73dc618
style: Document Gecko's data module. 2017-01-02 12:58:04 +01:00
Bobby Holley
940cda1d15 Remove generation, remove filter pop, and add size tests. 2016-12-22 11:09:55 -08:00
Emilio Cobos Álvarez
3db6514252
stylo: Track the last restyle generation properly.
I couldn't reproduce locally, but I believe this fixes:

https://bugzilla.mozilla.org/show_bug.cgi?id=1323890
2016-12-17 10:48:45 +01:00
Simon Sapin
08066800cd Rename selector_matching.rs to stylist.rs 2016-11-20 15:29:09 +01:00
Emilio Cobos Álvarez
73917cce83
style: Use rayon instead of our custom work queue. 2016-11-14 21:24:19 +01:00
Xidorn Quan
09cbe3bce0 Make style context use parking_lot::RwLock 2016-11-02 10:10:11 +11:00
Bobby Holley
63ac0d2540 Use AtomicRefCell for RawServoStyleSet.
MozReview-Commit-ID: 27JeRluDAo3
2016-10-11 09:31:52 -07:00
Manish Goregaokar
b2e592b121 Move most of geckolib into style::gecko 2016-09-26 09:07:17 +02:00
Renamed from ports/geckolib/data.rs (Browse further)