Commit graph

198 commits

Author SHA1 Message Date
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
Emilio Cobos Álvarez
6c3458767b
style: Refactor and add infrastructure for font metrics in style.
This commit itself only moves things around and adds an extra parameter to the
`apply_declarations` function to eventually handle #14079 correctly.

Probably needs a more granular API to query fonts, á la nsFontMetrics, but
that's trivial to do once this is landed.

Then we should make the font provider mandatory, and implement the missing stylo
bits.
2016-11-13 11:54:10 +01:00
Bobby Holley
a2c7a9d0fb Stop using associated types for the concrete TRestyleDamage implementation.
MozReview-Commit-ID: LfaZFCVlIb1
2016-11-07 11:10:48 -08:00
Ravi Shankar
6061985898 Prefer Servo-specific ToCss for all types 2016-11-07 09:14:22 +05:30
Simon Sapin
98bd99b74c rule tree: Remove unsound transmute()
RuleTreeDeclarationsIterator would yield &PropertyDeclaration
with the lifetime of the rule tree, but the reference would only
be valid as long as the iterator was holding the corresponding lock.

The lock would be released when the iterator’s `.next()` method
moves to the next rule tree node, or when  the iterator is dropped.

Also change apply_declaration to not require a `Clone` iterator
(since closures unfortunately don’t implement `Clone`).
Instead have it take a callable that returns a fresh iterator.
2016-11-05 17:29:54 +01:00
Emilio Cobos Álvarez
de4fe6e2b6 Concurrent rule tree, v1
This patch introduces infrastructure for the rule tree, and constructs it.

We don't use it yet, nor have good heuristics for GC'ing it, but this should not
happen anymore once we store the rule node reference in the node.

I haven't messed up with memory orders because I want to do a try run with it,
then mess with them.

Take down the ApplicableDeclarationsCache, use the rule tree for doing the cascade.
2016-11-05 17:29:52 +01:00
Simon Sapin
53b638c0e2 Update to string-cache 0.3 2016-11-03 16:23:05 +01:00
Anthony Ramine
046a97fa13 Remove #![feature(rustc_attrs)] 2016-11-03 11:24:19 +01:00
Anthony Ramine
3bc26d1819 Remove #![feature(structural_match)] 2016-11-03 11:24:18 +01:00
Anthony Ramine
a9767333eb Remove #![feature(custom_attribute)] 2016-11-03 11:24:13 +01:00
Anthony Ramine
c4f27e42b7 Remove #![feature(custom_derive)] 2016-11-03 10:14:21 +01:00
bors-servo
c6e15f8ef2 Auto merge of #14028 - servo:rustup, r=nox,SimonSapin
Update Rust to 1.14.0-nightly (7c69b0d5a 2016-11-01)

<!-- 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/14028)
<!-- Reviewable:end -->
2016-11-02 21:49:08 -05:00
Simon Sapin
5bb4c6c884 Use heapsize_derive instead of heapsize_plugin 2016-11-03 01:10:32 +01:00
bors-servo
6ef46ab9e4 Auto merge of #13453 - metajack:media-query-list, r=jdm
Implement matchMedia and MediaQueryList

<!-- 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 #13376 (github issue number if applicable).

<!-- Either: -->
- [x] 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. -->

Fixes #13376.

<!-- 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/13453)

<!-- Reviewable:end -->
2016-11-02 14:51:12 -05:00
Jack Moffitt
138a0480fe Implement matchMedia and MediaQueryList
Fixes #13376.
2016-11-02 13:40:22 -06:00
Jesse Kipp
06db231f5f 13894 Use Unicode Segmentation's graphemes
Add test with multi-character grapheme

Run cargo update
2016-10-26 18:54:37 -04:00
Bobby Holley
d73047584c Implement OwningHandle in style.
I've also PR-ed this against upstream [1], but I don't want to block on that
in case it takes a while to be merged / published.

[1] https://github.com/Kimundi/owning-ref-rs/pull/15
2016-10-13 16:53:37 -06:00
bors-servo
2bb7cc227b Auto merge of #13722 - Manishearth:test-stylo, r=jdm
Remove test-geckolib, run test-stylo on travis

test-geckolib used to do things, but almost all of geckolib has been moved to the style crate, with the tests in `tests/unit/stylo`. (`./mach test-stylo) Now test-geckolib does nothing.

Fixes #13721
r? @jdm

<!-- 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/13722)
<!-- Reviewable:end -->
2016-10-13 01:50:37 -05:00