Commit graph

315 commits

Author SHA1 Message Date
Simon Sapin
6c518c89b9 Upgrade to html5ever 0.16 2017-05-02 19:24:28 +02:00
Simon Sapin
797f40b0a3 Add initial style system support for @counter-style rules 2017-04-26 13:02:22 +09:00
Emilio Cobos Álvarez
ccf15c0a26
style: Move all the fixup code into a StyleAdjuster struct.
This will allow reusing it from text styles, which we need for some
corner cases, like text-align: -moz-center and similar stuff.
2017-04-26 03:22:24 +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
Bobby Holley
1663bf6e5d Cache the results of cache entry revalidation and use the bloom filter. 2017-04-12 10:35:42 +08:00
Emilio Cobos Álvarez
e29b84de18
style: Hash less stuff in the bloom filter, using the precomputed hashes we have. 2017-04-08 02:02:11 +02:00
Xidorn Quan
c857878ce9 Remove servo_config dependency for geckolib 2017-04-07 17:20:42 +10:00
Xidorn Quan
3150a92651 Remove servo_url dependency for geckolib
It seems mod attr is not used for geckolib at all, and that is the
only place where servo_url is still referenced for geckolib, so we
can just remove it.
2017-04-07 16:44:38 +10:00
bors-servo
42f58503c0 Auto merge of #16169 - servo:stylo-heapsize, r=emilio
Remove heapsize for Stylo

It doesn’t seem to be used, and is causing compilation trouble for Gecko: https://bugzilla.mozilla.org/show_bug.cgi?id=1350581

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16169)
<!-- Reviewable:end -->
2017-04-05 03:59:26 -05:00
Xidorn Quan
f68e2948d5 Use Gecko nsCSSFontFaceRule for font face rule. 2017-03-30 11:41:09 +11:00
Simon Sapin
94eb159137 Remove heapsize for Stylo 2017-03-28 17:50:52 +02:00
Jeremy Chen
a9e4b9caa6 stylo: Implement gecko glue for font-language-override.
To be aligned with the implementation from Gecko side, we parse
font-language-override as Normal keyword or String. Then, we compute
and store it as a u32. So, as to the stylo glue, we can just pass the
u32 to Gecko.

The extra crate, byteorder, is used to simplify the computing and
serialization.

Since we now implement font-language-override for Gecko, we can remove
the additional branches for font-language-override in font shorthand.

ref: Gecko Bug 1347821
2017-03-28 15:34:08 +08:00
Simon Sapin
7850d3f331 Use AtomicRefCell instead of RwLock inside SharedRwLock for stylo.
MozReview-Commit-ID: 8M6BUqe4pil
2017-03-20 16:36:03 -07:00
Simon Sapin
1bacd0eb15 Move all PropertyDeclarationBlock from RwLock<_> to Locked<_> 2017-03-19 22:30:38 +01:00
Simon Sapin
aeffca2a59 Replace RwLock<StyleRule> with Locked<StyleRule> 2017-03-19 22:30:37 +01:00
Simon Sapin
8feb9e8047 Add SharedRwLock<T> and Locked<T> 2017-03-19 22:30:24 +01:00
Simon Sapin
19c71a9082 Remove rust-encoding from geckolib.
It wasn’t used, gecko always passes UTF-8 for parsing stylesheets.
2017-03-16 20:22:40 +01:00
Simon Sapin
288ef97055 Update cssparser for https://github.com/servo/rust-cssparser/pull/123 2017-02-28 17:16:36 +01:00
Simon Sapin
33ef6f78e5 Update to cssparser 0.11 2017-02-26 11:09:53 +01:00
Anthony Ramine
8a8ee2888c Remove rustc-serialize from style and style_traits 2017-02-23 21:47:23 +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
Marco Concetto Rudilosso
07f04ced2e changed quickersort with pdqsort 2017-01-27 18:42:22 +00:00
Ms2ger
14fe337866 Update rustc to 1.16.0-nightly (7821a9b99 2017-01-23). 2017-01-24 11:02:51 +01:00
Manish Goregaokar
1b0842e228 Support @supports (fixes #14786) 2017-01-07 23:17:50 -08:00
bors-servo
df895cb80c Auto merge of #14889 - servo:rustup, r=jdm
Upgrade to rustc 1.16.0-nightly (6f1ae663e 2017-01-06)

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14889)
<!-- Reviewable:end -->
2017-01-07 08:18:28 -08:00
Emilio Cobos Álvarez
c0cf847043
style: Isolate the soon-to-be style-backend-specific from the media_query module. 2017-01-07 12:34:43 +01:00
Simon Sapin
67aea3bba4 Upgrade to rustc 1.16.0-nightly (6f1ae663e 2017-01-06) 2017-01-06 17:43:31 +01:00
Bobby Holley
b9d99390ad Switch to crates.io for atomic_refcell. 2017-01-03 18:14:27 -08:00
Bobby Holley
c26b4bed60 Reimplement AtomicRefCell as a fork of RefCell. 2017-01-03 12:23:06 -08:00
Emilio Cobos Álvarez
a8fdf5b6b9
style: Require documentation also for a Gecko build. 2017-01-02 12:58:08 +01:00
Emilio Cobos Álvarez
51134b9dc8
style: Disallow new undocumented code by default for Servo.
Still a bunch of Gecko-only code to document.
2017-01-02 12:57:58 +01:00
Emilio Cobos Álvarez
939557260c
style: Allow the attr module to be without documentation, for now. 2017-01-02 12:57:57 +01:00
Emilio Cobos Álvarez
3cd6cba1ee
style: Allow the atomic_refcell module to be undocumented, for now.
Given Bobby is rewriting it as I write this.
2017-01-02 12:57:55 +01:00
Emilio Cobos Álvarez
c9ffd9b429
style: Allow the logical_geometry module to be undocumented, for now. 2017-01-02 12:57:55 +01:00
Emilio Cobos Álvarez
3f7f914e16
style: Allow the lack of documentation for the media_queries module.
I'm rewriting all that stuff soon, so it's kind of pointless to document the
existing stuff right now.
2017-01-02 12:57:54 +01:00
Emilio Cobos Álvarez
b556449a96
style: Require docs in the less-straightforward part of the properties module. 2017-01-02 12:57:48 +01:00
Emilio Cobos Álvarez
277ef70d39
style: Consistently indent stuff, add a bit of documentation driving by. 2016-12-31 12:16:57 +01:00
bors-servo
4052744139 Auto merge of #14671 - servo:style-no-plugins, r=mbrubeck
Remove the unused dependency of style to plugins.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14671)
<!-- Reviewable:end -->
2016-12-22 12:53:33 -08:00
Simon Sapin
6dec4580e6 Remove the unused dependency of style to plugins. 2016-12-22 19:54:04 +01:00
Bobby Holley
b6e948dc5d Hoist bloom filter into scoped TLS and simplify code. 2016-12-22 10:42:53 -08:00
Bobby Holley
c5f01fe3b8 Introduce and use Scoped TLS.
It turns out that it's problematic to embed ThreadLocalStyleContext within
LayoutContext, because parameterizing the former on TElement (which we do
in the next patch) infects all the traversal stuff with the trait parameters,
which we don't really want.

In general, it probably makes sense to use separate scoped TLS types for
the separate DOM and Flow tree passes, so we can add a different ScopedTLS
type for the Flow pass if we ever need it.

We also reorder the |scope| and |shared| parameters in parallel.rs, because
it aligns more with the order in style/parallel.rs. I did this when I was
adding a TLS parameter to all these functions, which I realized we don't need
for now.
2016-12-21 11:10:39 -08:00
Ms2ger
ce0a402bc8 Remove unused style::refcell module. 2016-12-16 14:30:01 +01:00
Alan Jeffrey
9be4fd56ce Removed util. 2016-12-14 18:04:37 -06:00
Simon Sapin
433c33c4df Match on PropertyId (not strings) to parse a declaration. 2016-12-09 17:06:51 -10:00
Simon Sapin
fdc40592de Use rust-phf to map strings to property IDs 2016-12-09 10:56:23 -10:00
Emilio Cobos Álvarez
84a50ed5cb
style: Introduce StyleBloom
The idea is this will fix the bad behavior of the bloom filter in parallel
traversal.
2016-11-27 15:55:10 +01:00
Simon Sapin
b203ab2419 Rename selector_impl.rs to selector_parser.rs
This makes it consistent with an upcoming update of the selectors crate.
2016-11-20 15:30:37 +01:00
Simon Sapin
08066800cd Rename selector_matching.rs to stylist.rs 2016-11-20 15:29:09 +01:00
Emilio Cobos Álvarez
913c874cb5
Urlmageddon: Use refcounted urls more often. 2016-11-17 18:34:23 +01:00
Emilio Cobos Álvarez
73917cce83
style: Use rayon instead of our custom work queue. 2016-11-14 21:24:19 +01:00