Commit graph

329 commits

Author SHA1 Message Date
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
Manish Goregaokar
bfee89a690 Fix unused crate error 2016-10-12 19:14:27 +05:30
Manish Goregaokar
398a6343b3 Vendor m-c's nsstring in-tree
It is called nsstring_vendor since libgkrust already depends on nsstring, and
we can't have two crates with the same name in-tree. We can't directly depend
on the in-tree one since this will stop independent `./mach build-geckolib` builds from working.

MozReview-Commit-ID: CR4tHgzXWFZ
2016-10-12 18:12:52 +05:30
Bobby Holley
226e4cf7c0 Deny warnings in stylo crates.
MozReview-Commit-ID: 3lQNUzX77PX
2016-10-11 14:05:31 +05:30
Bobby Holley
8abc1bd275 Eliminate warning about unsafe references to extern static variables.
MozReview-Commit-ID: 7UJNBaEWnH7
2016-10-11 14:05:27 +05:30
Anthony Ramine
1854566683 Update to Rust 1.14.0-nightly (19ac57926 2016-10-08)
A cargo bump and a switch to serde_derive is needed to do this rustup.
2016-10-09 18:53:47 +02:00
Simon Sapin
c831369e3e Move DOMRefCell back into script.
We’re not using it in style after all.
2016-10-04 18:35:00 +02:00
Bobby Holley
518324cff6 Implement AtomicRefCell.
MozReview-Commit-ID: 9LZ1WPQADav
2016-10-02 19:19:52 -07:00
Bobby Holley
8c14533e7f Add a dependency on parking_lot to style.
MozReview-Commit-ID: 5zXmrdQ0fjU
2016-10-02 19:19:52 -07:00
Manish Goregaokar
b2e592b121 Move most of geckolib into style::gecko 2016-09-26 09:07:17 +02:00
Manish Goregaokar
bc9cbc87ba Move gecko_* into style::gecko
Prepping for the next stage where most of geckolib/ is popped in here
2016-09-24 19:25:59 +05:30
Manish Goregaokar
c6787458d9 Move gecko_bindings and gecko_string_cache into the style crate 2016-09-24 19:25:55 +05:30
Simon Sapin
c87180a2fb Move DOMRefCell to style. 2016-08-31 02:34:05 +02:00
bors-servo
c5e81f8361 Auto merge of #12945 - Manishearth:bgarray, r=SimonSapin
Support multiple backgrounds in both servo and stylo

(Commits do not build individually, but split up for review)

These patches make all of the background- properties accept multiple values, and add the layout code to display them.

Still needs some cleanup, and some testing, but it seems to work.

r? @SimonSapin

<!-- 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/12945)
<!-- Reviewable:end -->
2016-08-22 22:09:23 -05:00
Manish Goregaokar
979a2798d5 Make Position a gecko-only vector longhand 2016-08-22 22:42:40 +05:30
Ms2ger
307d1ced3c Move thread_state to style. 2016-08-22 16:08:56 +02:00
Simon Sapin
4062899fd8 Import SelectorMap back from the selectors crate.
Nobody else uses it, and I want to make breaking changes to it.
2016-08-21 03:40:30 +02:00
Manish Goregaokar
0d4d1b539e Add safer bindings for refcounted types across ffi 2016-08-17 12:30:31 +05:30
Emilio Cobos Álvarez
9e88a495c8
style: Introduce a generic way of gathering information from the cascade, and use it for viewport units. 2016-08-16 10:58:16 -07:00
Simon Sapin
fdb2071b2d Update to selectors 0.8.2 2016-08-09 18:18:38 +02:00