Commit Graph

81 Commits

Author SHA1 Message Date
Xidorn Quan
b6124e6d1e servo: Merge #14330 - Implement access to CSSStyleRule for stylo (from upsuper:bug1307357); r=heycam
<!-- Please describe your changes on the following line: -->
This is the servo part of [bug 1307357](https://bugzilla.mozilla.org/show_bug.cgi?id=1307357) which has been reviewed by @heycam, @Manishearth and @SimonSapin.

r? @heycam

(`./mach test-tidy` reports several issues on bindings.rs... which I don't think is introduced by my patch... so I have no idea what to do here...)

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: c8e39dcdf6fbdc36bed42d3f0d46ad78133d83cf
2016-11-23 15:47:18 -08:00
Manish Goregaokar
ad91ed0527 servo: Merge #14241 - CSSOM: Whole ton of things (from Manishearth:mut-cssom); r=SimonSapin
CSSOM is now starting to be useful!

Based on #14190. Only the <s>last commit</s> last two commits need review.

cc @xidorn . This doesn't change the style API, but adds useful methods.

part of #11420

This adds:
 - `insertRule()` and `deleteRule()` on `CSSStyleSheet`, `CSSGroupingRule`
 - `.style` getters on link and style elements
 - Keyframes-backed `CSSRules` and `CSSKeyframesRule.cssRules`
 - `CSSGroupingRule.cssRules`
 - `prefix` and `namespaceURI` attributes of `CSSNamespaceRule`
 - Fixups regarding parent stylesheets

r? @SimonSapin

Source-Repo: https://github.com/servo/servo
Source-Revision: 996756687cd741ad0d30029022638bdcceecb563
2016-11-23 10:27:49 -08:00
Simon Sapin
ce87984b66 servo: Merge #14320 - Update to selectors 0.15 (from servo:selectorsup); r=nox
<!-- 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
- [x] 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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: f37fc5ea5ef3335ebc0a754dce93872dd5fd85a1
2016-11-22 10:44:03 -06:00
Simon Sapin
174dbcace7 servo: Merge #14232 - CSSOM: Make Stylesheet fields have their own synchronization (from servo:moar-locks); r=upsuper
<!-- Please describe your changes on the following line: -->

r? @upsuper

---
<!-- 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
- [x] These changes fix bug 1314208.

<!-- 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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 30867001d17222cc5d0b18086dca9f5d9bcb3934
2016-11-21 19:33:57 -06:00
Simon Sapin
c839f3f401 servo: Merge #14294 - Rename a few source files (from servo:renames); r=Wafflespeanut
<!-- 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
- [x] 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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 68b1d1d2860ac6c6e8c1c0dfe46af6790ca01dc8

--HG--
rename : servo/components/style/gecko/selector_impl.rs => servo/components/style/gecko/selector_parser.rs
rename : servo/components/style/selector_impl.rs => servo/components/style/selector_parser.rs
rename : servo/components/style/servo/selector_impl.rs => servo/components/style/servo/selector_parser.rs
rename : servo/components/style/selector_matching.rs => servo/components/style/stylist.rs
rename : servo/tests/unit/style/selector_matching.rs => servo/tests/unit/style/stylist.rs
2016-11-20 09:21:52 -06:00
Nazım Can Altınova
3bd7c5ba21 servo: Merge #14238 - Implement ToCss serialization for CSSRules (from canaltinova:cssom-tocss); r=Manishearth
<!-- Please describe your changes on the following line: -->
Implementation of ToCss serialization for CSSRules. It requires #14190 to merge first to uncomment `CssRule::Style` branch in CssRule's ToCss implementation.

r? @Manishearth

---
<!-- 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
- [X] These changes fix #14195 (github issue number if applicable).

- [X] These changes do not require tests because it's serialization changes and I'm not sure there is a test for that.

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 731264f20e1f19687bf0d77fb364568bd1ac034e
2016-11-18 10:15:52 -06:00
Emilio Cobos Álvarez
9747761479 servo: Merge #14246 - Urlmageddon (from emilio:servo-url); r=SimonSapin
<!-- Please describe your changes on the following line: -->

Still needs a bunch of code in net to be converted in order to get more
advantage of this for images and stuff, but meanwhile this should help quite a
bit with #13778.

Still wanted to get this in.

r? @SimonSapin

Source-Repo: https://github.com/servo/servo
Source-Revision: 22aebdf5d41a3509cd6515ccf5edcdf33715a76d
2016-11-17 15:34:47 -06:00
Manish Goregaokar
d8a79aa1af servo: Merge #14190 - Immutable CSSOM (from Manishearth:cssom); r=SimonSapin
This PR is intended to add basic support for all CSSOM interfaces, with the ability to index `document.styleSheets` and css rule lists, and serializing individual css rules. Handling individual interface methods for CSSRule subclasses can probably be done with easy/medium bugs.

Mutation safety isn't dealt with here; if the css rule list is mutated the CSSOM will be in an inconsistent state. I intend to deal with this via zero sized tokens, see https://groups.google.com/forum/#!topic/mozilla.dev.servo/AnxJoVmtMXQ .  I'll handle that when I start making the CSSOM mutable. (Getting the immutable bit landed first opens this up for easy bugs)

This doesn't really change style aside from adding an extra arc in the CSS rule list as discussed in the linked thread. So far this same design can be used by stylo as well when the time comes.

f? @SimonSapin @emilio

cc @upsuper

part of #11420
Todo:

 - [x] Stubs for rest of the CSSRule subclasses
 - [x] <s>ToCSS impls for CSSRules.</s> May make into easy bugs and stub out in this PR https://github.com/servo/servo/issues/14195
 - [x] Cache CSSStyleSheet on the relevant node

Source-Repo: https://github.com/servo/servo
Source-Revision: afc60bee2809059b8b754a1c6d6d10c1d36326fb
2016-11-16 15:05:59 -06:00
Takanori Ishibashi
a69e0fd09a servo: Merge #14199 - Update CSSRule naming from 'CSSRule' to 'CssRule' (from 11Takanori:CSSRule_to_CssRule); r=nox
<!-- Please describe your changes on the following line: -->
Update CSSRule naming from 'CSSRule' to 'CssRule'

---
<!-- 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
- [x] These changes fix https://github.com/servo/servo/issues/14196 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because I just rename CSSRule to CssRule.

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

Source-Repo: https://github.com/servo/servo
Source-Revision: b63c85c31b10e449b7334890becacb08def81f96
2016-11-14 03:36:37 -06:00
Xidorn Quan
306c3d3de4 servo: Merge #14159 - Allow empty media query list (from upsuper:media-query); r=Wafflespeanut
<!-- 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: -->
- [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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: c3dc50b7ac553acc7116a2fca4c4498e8b3a8a72
2016-11-10 01:37:57 -06:00
Xidorn Quan
c8c928d000 servo: Merge #14121 - Rename media_queries::MediaQueryList to MediaList (from upsuper:medialist); r=Wafflespeanut
<!-- Please describe your changes on the following line: -->
`MediaList` is the name of the interface for "collection of media queries" used in [CSSOM spec](https://drafts.csswg.org/cssom/#the-medialist-interface), `MediaQueryList` happens to mean something different in [CSSOM View spec](https://drafts.csswg.org/cssom-view/#the-mediaquerylist-interface), which also leads to naming conflict in dom code. So I think it's better renaming it to `MediaList`.

---
<!-- 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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 56b4065ee83b3afb420fd6119685ba975f143885
2016-11-08 01:46:40 -06:00
Simon Sapin
7cb2f9a2dc servo: Merge #14043 - Update to string-cache 0.3 (from servo:string-cache-up); r=nox
Previously, `string-cache` defined:
*  An string-like `Atom` type,
* An `atom!("foo")` macro that expands to a value of that type, for a set of strings known at compile-time,
* A `struct Namespace(Atom);` type
* A `ns!(html)` macro that maps known prefixed to `Namespace` values with the corresponding namespace URL.

Adding a string to the static set required making a change to the `string-cache` crate.

With 0.3, the `Atom` type is now generic, with a type parameter that provides a set of static strings. We can have multiple such sets, defined in different crates. The `string_cache_codegen` crate, to be used in build scripts, generates code that defines such a set, a new atom type (a type alias for `Atom<_>` with the type parameter set), and an `atom!`-like macro.

The html5ever repository has a new `html5ever_atoms` crate that defines three such types: `Prefix`, `Namespace`, and `LocalName` (with respective `namespace_prefix!`, `namespace_url!`, and `local_name!` macros). It also defines the `ns!` macro like before.

This repository has a new `servo_atoms` crate in `components/atoms` that, for now, defines a single `Atom` type (and `atom!`) macro. (`servo_atoms::Atom` is defined as something like `type Atom = string_cache::Atom<ServoStaticStringSet>;`, so overall there’s now two types named `Atom`.)

In this PR, `servo_atoms::Atom` is used for everything else that was `string_cache::Atom` before. But more atom types can be defined as needed. Two reasons to do this are to auto-generate the set of static strings (I’m planning to do this for CSS property names, which is the motivation for this change), or to have the type system help us avoid mix up unrelated things (this is why we had a `Namespace` type ever before this change).

Introducing new types helped me find a bug: when creating a new attribute `dom::Element::set_style_attr`, would pass `Some(atom!("style"))` instead of `None` (now `Option<html5ever_atoms::Prefix>` instead of `Option<string_cache::Atom>`) to the `prefix` argument of `Attr::new`. I suppose the author of that code confused it with the `local_name` argument.

---

Note that Stylo is not affected by any of this. The `gecko_string_cache` module is unchanged, with a single `Atom` type. The `style` crate conditionally compiles `Prefix` and `LocalName` re-exports for that are both `gecko_string_cache::Atom` on stylo.

---
<!-- 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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 5b4cc9568dbd5c15e5d2fbc62719172f11566ffa
2016-11-03 11:19:44 -05:00
Simon Sapin
8013dbe3f5 servo: Merge #13839 - Add RwLock in more Arc’d things in stylesheets (from servo:locked-style); r=mbrubeck
<!-- Please describe your changes on the following line: -->

CSSOM needs hold potentially multiple references (through `Arc`) to these objects, and then mutate them.

CC @upsuper
r? @mbrubeck

---
<!-- 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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 4e5ad268b15aa222c0d049796dde7c6e7bc0897b
2016-10-20 11:29:27 -05:00
Manish Goregaokar
fbe2016107 servo: Merge #13673 - Don't pref-gate properties in geckolib mode (from Manishearth:no-prefs-geckolib); r=emilio
This led to me wasting a lot of time trying to figure out why my column-count implementation in gecko didn't work.

We might eventually want to hook into the Gecko prefs, but the mechanism would probably be different

r? @emilio

Source-Repo: https://github.com/servo/servo
Source-Revision: 960d884fd4dd2ad5dabfb4dd9d52e50f9d5c292c
2016-10-10 08:11:32 -05:00
Simon Sapin
da3297354f servo: Merge #13459 - Use parking_lot::RwLock for PropertyDeclarationBlock (from servo:no-arc-heapsize); r=emilio
<!-- Please describe your changes on the following line: -->

As discussed in https://bugzilla.mozilla.org/show_bug.cgi?id=1305141

Closes #13176

---

Original PR title: Stop relying on `impl<T: HeapSizeOf> HeapSizeOf for Arc<T>`
https://github.com/servo/heapsize/issues/37#issuecomment-249861171

This builds on top of that.

---
<!-- 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
- [x] These changes do not require tests because refactor

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

Source-Repo: https://github.com/servo/servo
Source-Revision: aea9545e16fd6ea4a6b1234d1b969457313a5fa7

--HG--
rename : servo/components/style/domrefcell.rs => servo/components/script/dom/bindings/cell.rs
2016-10-04 11:58:56 -05:00
UK992
f8cb9971b7 servo: Merge #13205 - Tidy: Fix ordering use statements with braces (from UK992:tidy-sort); r=Wafflespeanut
This hack fixes https://github.com/servo/servo/issues/7412 and matches behavior with rustfmt.

Source-Repo: https://github.com/servo/servo
Source-Revision: 3117787fd2a8b7748cfde1e9b8c5be3c00f2c599
2016-09-08 22:19:19 -05:00
Simon Sapin
26c91514d6 servo: Merge #13190 - Update cssparser (from servo:cssparser-up); r=Manishearth
<!-- 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
- [x] 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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: d99d29e94a886ef2701ce32a6e56e65e35583d7b
2016-09-08 15:50:12 -05:00
Simon Sapin
ec40d2a379 servo: Merge #13134 - Add lots of Arc’s in style, and prepare for using DOMRefCell (from servo:archery); r=emilio
<!-- Please describe your changes on the following line: -->

`DOMRefCell` usage is not there year because of thread-safety questions, but I have this much already that I’d like to land before it bitrots.

r? @emilio

---
<!-- 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
- [x] These changes do not require new tests because refactor

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

Source-Repo: https://github.com/servo/servo
Source-Revision: bbfe38e35f3f6a51009c0411647c89c8b5616357

--HG--
rename : servo/components/script/dom/bindings/cell.rs => servo/components/style/domrefcell.rs
2016-08-31 16:30:56 -05:00
Ms2ger
1bacbe435f servo: Merge #12993 - Move the user agent and user stylesheets to layout_thread (from servo:ua-stylesheets); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: 8e890be2c6c736f503cafe2641cbd869e571ec7f
2016-08-23 08:34:04 -05:00
Simon Sapin
e6c75b7e31 servo: Merge #12924 - Update selectors to 0.10, with ToCss serialization (from servo:selectors-ser); r=nox
<!-- Please describe your changes on the following line: -->
r? @emilio

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 07b217368f6f2ec35450edab9c6c29091aa16433
2016-08-19 13:01:29 -05:00
Emilio Cobos Álvarez
94cb9f101b servo: Merge #12838 - Fix restyling on viewport resize (from emilio:viewport); r=SimonSapin
<!-- Please describe your changes on the following line: -->

Fixes https://github.com/servo/servo/issues/12835

---
<!-- 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

<!-- Either: -->
- [x] There are tests for these changes OR

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 49431be44a7bbc256829463f4ec4658801742bd9
2016-08-16 13:48:20 -05:00
Simon Sapin
c710b104be servo: Merge #12515 - Make the style crate more concrete (from servo:concrete-style); r=bholley
Background:

The changes to Servo code to support Stylo began in the `selectors` crate with making pseudo-elements generic, defined be the user, so that different users (such as Servo and Gecko/Stylo) could have a different set of pseudo-elements supported and parsed. Adding a trait makes sense there since `selectors` is in its own repository and has others users (or at least [one](https://github.com/SimonSapin/kuchiki)).

Then we kind of kept going with the same pattern and added a bunch of traits in the `style` crate to make everything generic, allowing Servo and Gecko/Stylo to do things differently. But we’ve also added a `gecko` Cargo feature to do conditional compilation, at first to enable or disable some CSS properties and values in the Mako templates. Since we’re doing conditional compilation anyway, it’s often easier and simpler to do it more (with `#[cfg(feature = "gecko")]` and `#[cfg(feature = "servo")]`) that to keep adding traits and making everything generic. When a type is generic, any method that we want to call on it needs to be part of some trait.

----

The first several commits move some code around, mostly from `geckolib` to `style` (with `#[cfg(feature = "gecko")]`) but otherwise don’t change much.

The following commits remove some traits and many type parameters through the `style` crate, replacing them with pairs of conditionally-compiled API-compatible items (types, methods, …).

Simplifying code is nice to make it more maintainable, but this is motivated by another change described in https://github.com/servo/servo/pull/12391#issuecomment-232183942. (Porting Servo for that change proved difficult because some code in the `style` crate was becoming generic over `String` vs `Atom`, and this PR will help make that concrete. That change, in turn, is motivated by removing geckolib’s `[replace]` override for string-cache, in order to enable using a single Cargo "workspace" in this repository.)

r? @bholley

---
<!-- 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
- [x] These changes fix #__ (github issue number if applicable).

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

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 2d01d41a506bcbc7f26a2284b9f42390d6ef96ab

--HG--
rename : servo/ports/geckolib/selector_impl.rs => servo/components/style/gecko_selector_impl.rs
rename : servo/ports/geckolib/values.rs => servo/components/style/gecko_values.rs
rename : servo/ports/geckolib/properties.mako.rs => servo/components/style/properties/gecko.mako.rs
2016-07-20 02:58:34 -05:00
Simon Sapin
a7297026ea servo: Merge #12263 - Make geckolib possible to build on stable Rust (from servo:stable-geckolib); r=nox
<!-- Please describe your changes on the following line: -->

More for https://github.com/servo/servo/issues/11815

r? @nox

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 3d557b6f25eb9dbd084cb53bbc9a9cf93bad825b
2016-07-05 15:04:42 -07:00
Corey Farwell
df29454b47 servo: Merge #12178 - Refactor util::prefs operations to be methods on static struct (from frewsxcv:prefs); r=emilio
<!-- 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
- [X] 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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: b0a8ce5341f5148e36523fee0b0fcbc2684c0a68
2016-07-03 08:19:04 -07:00
Emilio Cobos Álvarez
c399260cd8 servo: Merge #11766 - Add @keyframes and animation-* support (from emilio:keyframes-parsing); r=SimonSapin,pcwalton
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [x] There are tests for these changes

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

This adds support for parsing `@keyframes` rules, and animation properties. Stylo will need it sometime soonish, plus I want to make animations work in Servo.

The remaining part is doin the math and trigger the animations correctly from servo. I don't expect it to be *that* hard, but probaby I'll need to learn a bit more about the current animation infra (e.g. why the heck is the `new_animations_sender` guarded by a `Mutex`?).

I'd expect to land this, since this is already a bunch of work, this is the part exclusively required by stylo (at least if we don't use Servo's machinery), the media query parsing is tested, and the properties land after a flag, but if you prefer to wait until I finish this up it's fine for me too.

r? @SimonSapin

cc @pcwalton @bholley

Source-Repo: https://github.com/servo/servo
Source-Revision: d3a81373e44634c30d31da0457e1c1e86c0911ed
2016-06-28 17:31:01 -05:00
Ms2ger
a17272e07f servo: Merge #11834 - Add some documentation to the style crate (from servo:style-docs); r=SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: 3809e4a23dc1423caa78385d2bfa0ea4d6eabbcb
2016-06-27 17:14:55 -05:00
Simon Sapin
993d896521 servo: Merge #11816 - Make the style crate (almost) build with a stable compiler (from servo:stable-style); r=nox
<!-- Please describe your changes on the following line: -->

The bulk of this is adding cargo features to make derived implementations of `heapsize` and `serde` traits optional.

"Almost" because `std::intrinsics::discriminant_value` is currently unstable and doesn’t have any stable replacement that I know of. For now, this PR conditionally replaces it with `unimplemented!()`.

r? @nox

---
<!-- 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
- [x] These changes <s>fix</s> are part of #11815 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not <s>require tests</s> *have tests yet* because that requires https://github.com/servo/servo/issues/11806, but I still want to land this before it bitrots. (Tests should check that the build succeeds with a stable compiler.)

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 0fb5d634a007f3d0424f95569ac3f83d500d054c
2016-06-22 09:43:20 -05:00
Cameron McCormack
723cf0f5c4 servo: Merge #11287 - Support -moz-binding in geckolib (from heycam:moz-binding); r=bholley
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 --faster` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

Either:
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because changes target stylo

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 2a2b88f42c55614f949f218b0444778e8e2bfc78
2016-05-24 14:41:04 -07:00
Per Lundberg
28632dc3a1 servo: Merge #11192 - Removed unused imports (from perlun:remove-unused-imports); r=Manishearth
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #11185
- [X] These changes do not require tests because it only removes dead code.

----

This fixes #11185.

Source-Repo: https://github.com/servo/servo
Source-Revision: 2c674d0397927ef6563feb70e54f46815af55600
2016-05-15 15:41:16 -07:00
Matt Brubeck
96cfbd09cb servo: Merge #9876 - Recompute styles on viewport size change if they contain viewport percentages (from mbrubeck:seen-viewport-percentages); r=SimonSapin
Fixes #8754.  Depends on servo/rust-cssparser#99.  r? @SimonSapin

Source-Repo: https://github.com/servo/servo
Source-Revision: a4251c832d605a02d6c82fc188d1746367599e59
2016-03-20 01:51:54 +05:01
Anthony Ramine
69b87ee72d servo: Merge #9742 - Make use of From<String> for Atom (from nox:atom-from-string); r=ecoal95
Source-Repo: https://github.com/servo/servo
Source-Revision: b3b6f092062eed2f323da88991553d0285da6a16
2016-02-25 08:10:44 +05:01
Emilio Cobos Álvarez
b1dd4fcd79 servo: Merge #9567 - style: Make the whole style crate independent of the implementation (from emilio:general-pseudo-element-parsing); r=bholley,SimonSapin
This allows, among other things, having different implementations for parsing pseudo{elements, classes} in both `ports/geckolib` and in servo.

Source-Repo: https://github.com/servo/servo
Source-Revision: c11844cbf28054784c8d65781cff20045d8ee48b
2016-02-14 03:30:59 +05:01
Anthony Ramine
08f5c3da70 servo: Merge #9532 - Say farewell to in-tree HeapSizeOf (from nox:dedup-heapsize); r=Manishearth
Source-Repo: https://github.com/servo/servo
Source-Revision: 2a6707ce58df27d93e865bffb6b44d396b810c99
2016-02-05 03:11:36 +05:01
Emilio Cobos Álvarez
83aa64a599 servo: Merge #9510 - Update rust-selectors (from nox:bump-selectors); r=SimonSapin
This commits updates rust-selectors to use the generic parser, and as
such it moves the element state into the style crate.

Source-Repo: https://github.com/servo/servo
Source-Revision: ae20f2556bc7807b39b6649ac1f738644abcc26a
2016-02-03 06:35:11 +05:01
Simon Sapin
ec5662344b servo: Merge #9380 - Update cssparser (from servo:cssparserup); r=SimonSapin
https://github.com/servo/rust-cssparser/pull/91

Source-Repo: https://github.com/servo/servo
Source-Revision: 1ba1fb0b7f46472e1f37f4e3f2e7dde025fa9f1f
2016-01-21 22:16:51 +05:01
Bobby Holley
97c1afa558 servo: Merge #9261 - Remove the msg dependency from style (from bholley:geckolib_nomsg); r=Manishearth
This is part of slimming down the dependencies of geckolib.

Source-Repo: https://github.com/servo/servo
Source-Revision: 3680e82cab766a412a969a21c0cdff0c7f97d7bc
2016-01-12 08:54:31 +05:01
Johannes Linke
38405ee47e servo: Merge #9123 - Fix a bunch of clippy lints (from karyon:clippy_cleanup); r=Manishearth
This fixes about 130 clippy lints. Let me know if i should split up the commit.

I wasn't sure about some of the changes, especially map_or instead of map(...).unwrap_or(...) and if let instead of single arm match were not always a strict improvement in my opinion, but i'll leave that decision to the reviewer :)

There are about 150 lints left which i thought were clippy bugs or i didn't know how to fix.

cc @Manishearth

Source-Repo: https://github.com/servo/servo
Source-Revision: 9da739acefc7d1776bf727c8bf782eb79f241028
2016-01-03 08:47:34 +05:01
GauriGNaik
5be1a03fb2 servo: Merge #8971 - Add pipeline information to CSS error reporting (from jdm:expose-css-errors-1); r=jdm
Rebase of #8838.

Source-Repo: https://github.com/servo/servo
Source-Revision: d11f96e27074b0130760a02d39d2da4e003c820e
2015-12-14 21:22:41 +05:01
Tetsuharu OHZEKI
1541b677a4 servo: Merge #8922 - Fix warnings: Use Vec.extend_from_slice instead of Vec.push_all (from saneyuki:warning); r=mbrubeck
Source-Repo: https://github.com/servo/servo
Source-Revision: d01233a7b417c87b18d31f10709ed83141887b94
2015-12-11 04:28:58 +05:01
GauriGNaik
de8f872ba4 servo: Merge #8784 - Make log_css_error in parser.rs take a &ParserContext argument and ca… (from jdm:expose-css-errors-step2); r=jdm
…ll this method.

Rebase of #8472.

Source-Repo: https://github.com/servo/servo
Source-Revision: 765ce074a39f630de3357bc752177abb82833343
2015-12-03 13:55:37 +05:01
GauriGNaik
5b0ca679ad servo: Merge #8682 - Defined new trait ParseErrorReporter and added error_reporter member … (from jdm:css-error-reporter); r=jdm
…to ParserContext.

Rebase of #8210.

Source-Repo: https://github.com/servo/servo
Source-Revision: f5ef2f4f75cd58a3c6f1f123e413dc9d3a24f841
2015-11-27 03:27:08 +05:01
Alan Jeffrey
f4ab2bfdb5 servo: Merge #8667 - Update string cache (from asajeffrey:update-string-cache); r=SimonSapin
Updated string_cache to 0.2, and updated the dependencies that depend on string_cache.
Removed references to string_cache_plugin.
Import atom! and ns! from string_cache.
Replaced ns!("") by ns!().
Replaced ns!(XML) and co by ns!(xml) and co.
Replaced Atom::from_slice by Atom::from.
Replaced atom.as_slice() by &*atom.

r? @SimonSapin

Source-Repo: https://github.com/servo/servo
Source-Revision: 188fa9378c103093f1f8dac24bff0d9d237fd2bc
2015-11-25 23:41:39 +05:01
Brandon Fairchild
4fb6893be4 servo: Merge #8572 - Make Node::is_parent_of and Stylesheet::is_effective_for_device more idiomatic (from nerith:idiomatic); r=frewsxcv
Fixes #8555.

Source-Repo: https://github.com/servo/servo
Source-Revision: 247f586284ff3938430fd2be8de2ba2ac82eadc2
2015-11-18 04:24:17 +05:01
Till Schneidereit
6b102412c1 servo: Merge #8039 - Move Stylesheet loading and ownership from the layout task into HTML elements (from tschneidereit:script-owns-stylesheets); r=jdm
Stylesheets for `HTMLLinkElement`s are now loaded by the resource task, triggered by the element in question. Stylesheets are owned by the elements they're associated with, which can be `HTMLStyleElement`, `HTMLLinkElement`, and `HTMLMetaElement` (for `<meta name="viewport">).

Additionally, the quirks mode stylesheet (just as the user and user agent stylesheets a couple of commits ago), is implemented as a lazy static, loaded once per process and shared between all documents.

This all has various nice consequences:
 - Stylesheet loading becomes a non-blocking operation.
 - Stylesheets are removed when the element they're associated with is removed from the document.
 - It'll be possible to implement the CSSOM APIs that require direct access to the stylesheets (i.e., ~ all of them).
 - Various subtle correctness issues are fixed.

One piece of interesting follow-up work would be to move parsing of external stylesheets to the resource task, too. Right now, it happens in the link element once loading is complete, so blocks the script task. Moving it to the resource task would probably be fairly straight-forward as it doesn't require access to any external state.

Depends on #7979 because without that loading stylesheets asynchronously breaks lots of content.

Source-Repo: https://github.com/servo/servo
Source-Revision: 7ff3a17524e0e703e3ac279441729c185444be24
2015-11-08 00:42:54 +05:01
James Graham
c18b23949d servo: Merge #7651 - Implement resettable and String-valued prefs (from jgraham:prefs_reset); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: e04c2c78ee43ad81f2794d908a13744b6b976443
2015-09-25 08:18:06 -06:00
Ravi Shankar
7d512d50d1 servo: Merge #7698 - sorted the declarations in various files (from Wafflespeanut:sorting); r=frewsxcv
This is a direct extract from my abandoned PR for a lint (#7546), along with some rather clumsy modifications (only on `components/script/dom/mod.rs` and `components/style/lib.rs`), because I had to sort some of the files again to make peace with tidy, which hasn't been educated about sorting yet!

Source-Repo: https://github.com/servo/servo
Source-Revision: a7208869f2903e36f9b2f540b55b50283d7df466
2015-09-23 15:02:56 -06:00
Brandon Fairchild
f7fb1e4b4a servo: Merge #7662 - Check for multiple import blocks separated by whitespace (from nerith:import); r=frewsxcv
Fixes #7381.

Source-Repo: https://github.com/servo/servo
Source-Revision: a0d3c9223f09757124b1520c4f17e94fa8bbe249
2015-09-19 13:34:51 -06:00
James Graham
fbe716c4c1 servo: Merge #7545 - Update prefs API to return an Option<bool> (from jgraham:get_pref_option); r=jdm
This allows for situations where there is no reasonable default
to apply for the pref value e.g. when we are just listing values

Source-Repo: https://github.com/servo/servo
Source-Revision: 9d4217990060b3d2c93a4b39fe391985f01a5979
2015-09-04 11:02:12 -06:00
Manish Goregaokar
f3aaf0f5c3 servo: Merge #7519 - Make style clippy-free (from Manishearth:clippyfix); r=SimonSapin
(except for properties.rs)

I might add more fixes to this PR later.

r? @SimonSapin

Source-Repo: https://github.com/servo/servo
Source-Revision: d01ab617341891bf0c91f1fba0ebcf13df9150a6
2015-09-02 16:11:30 -06:00
Simon Sapin
ea7357b400 servo: Merge #7509 - Upgrade to rustc 1.4.0-dev (cb9323ec0 2015-09-01) (from servo:rustup_2015-09-01); r=Manishearth
Source-Repo: https://github.com/servo/servo
Source-Revision: f49615ca7b5d98ee603cf42f705073fbe4d414fb
2015-09-02 01:31:23 -06:00