Commit graph

1256 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
b79689361b
Introduce AnimationValue to manage animated properties in Gecko. 2016-10-12 10:31:22 +02:00
bors-servo
abcc4aeaf2 Auto merge of #13656 - bholley:existing_style, r=emilio
Refactor style logic to avoid direct access to the node data during the cascade

The new restyle architecture doesn't store these things in consistent places, so we need a more abstract API.

<!-- 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/13656)
<!-- Reviewable:end -->
2016-10-10 23:22:05 -05:00
Bobby Holley
bfbbef6ecd Remove borrow_data and mutate_data from TNode.
The new restyle architecture doesn't store these things in consistent
places, so we need a more abstract API.
2016-10-10 20:36:31 -07:00
bors-servo
ef7423bf00 Auto merge of #13676 - servo:no-siphasher, r=pcwalton
Remove usage of deprecated `SipHasher`.

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

<s>Hashing in `SimpleHashCache` is not randomized anymore. Does this matter?</s>

r? @pcwalton

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

<!-- 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/13676)
<!-- Reviewable:end -->
2016-10-10 11:39:06 -05:00
Simon Sapin
33c7915032 Remove usage of deprecated SipHasher. 2016-10-10 18:35:07 +02:00
Manish Goregaokar
4271167f82 Implement column-count for stylo 2016-10-10 20:07:16 +05:30
bors-servo
960d884fd4 Auto merge of #13673 - Manishearth:no-prefs-geckolib, r=emilio
Don't pref-gate properties in geckolib mode

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

<!-- 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/13673)
<!-- Reviewable:end -->
2016-10-10 08:11:32 -05:00
Manish Goregaokar
3772b4881b Don't pref-gate properties in geckolib mode 2016-10-10 17:55:59 +05:30
bors-servo
37340d0c26 Auto merge of #13672 - Manishearth:regen, r=emilio
Regen bindings

From https://hg.mozilla.org/mozilla-central/rev/d72cf6ecebaf

<!-- 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/13672)
<!-- Reviewable:end -->
2016-10-10 06:21:18 -05:00
Manish Goregaokar
9812034b96 Regen bindings 2016-10-10 15:34:49 +05:30
Emilio Cobos Álvarez
72d7732937
stylo: Fix GeckoNode::is_element implementation.
Because I'm stupid.
2016-10-10 10:58:08 +02:00
bors-servo
b110eb394e Auto merge of #13663 - shubheksha:fix/13657, r=Manishearth
changed set_value() to set() in gecko.mako.rs

<!-- Please describe your changes on the following line: -->
Changed `set_value()` to `set()` in gecko.mako.rs

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because just the `set_value()` call was changed to `set()`

<!-- 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/13663)
<!-- Reviewable:end -->
2016-10-09 21:15:28 -05:00
bors-servo
39d3fce1af Auto merge of #13649 - servo:rustup, r=larsbergstrom
Update to Rust 1.14.0-nightly (19ac57926 2016-10-08)

<!-- 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/13649)
<!-- Reviewable:end -->
2016-10-09 20:12:38 -05:00
bors-servo
fe6fac4ee2 Auto merge of #13604 - canaltinova:gradient, r=Manishearth
Implement all gradients

<!-- Please describe your changes on the following line: -->
Implementation of all gradients.
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 #13549 (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/13604)
<!-- Reviewable:end -->
2016-10-09 16:40:18 -05:00
Bobby Holley
ddbc016f51 Refactor cascade to limit and clarify the mutability of the old style.
The current semantics make it very difficult to figure out when the existing
style is mutated and what code depends on it. This is problematic for the
new incremental restyle architecture, where the cascade logic no longer has
direct access to |data|.
2016-10-09 14:19:16 -07:00
Nazım Can Altınova
7300d9ab54 Implement all gradients in stylo 2016-10-09 22:53:17 +03:00
Nazım Can Altınova
26c98edd68 Implement parsing of all gradients 2016-10-09 22:53:15 +03:00
Shubheksha Jalan
3ece937184 changed set_value() to set() in gecko.mako.rs 2016-10-10 01:15:46 +05:30
Ravi Shankar
664db1b5fa Regen bindings to include the constants 2016-10-10 00:10:58 +05:30
Ravi Shankar
2b4d301fbf Import NS_FONT_* constants for font-* glue 2016-10-09 22:40:51 +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
bors-servo
804317c885 Auto merge of #13553 - birtles:animvalues, r=Manishearth
Support creating StyleAnimationValue objects from Servo

These are the servo-side changes for [bug 1302949](https://bugzilla.mozilla.org/show_bug.cgi?id=1302949#c59). @Manishearth has already reviewed them there.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [bug 1302949](https://bugzilla.mozilla.org/show_bug.cgi?id=1302949#c59)
- [X] These changes do not require tests because there are existing tests for this in mozilla-central

<!-- 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/13553)
<!-- Reviewable:end -->
2016-10-09 08:53:28 -05:00
Brian Birtles
45e0b90d63 Bug 1302949 - Add a method to restyle with an added declaration; r=Manishearth
MozReview-Commit-ID: AbX0PCjjEM6
2016-10-09 18:33:52 +05:30
Brian Birtles
1c78e1cb20 Bug 1302949 - Add a method to serialize a declaration block as a single value; r=Manishearth
MozReview-Commit-ID: 59CCT0P4CBm
2016-10-09 18:33:51 +05:30
Brian Birtles
61bcc3a2ef Bug 1302949 - Add a method to Gecko bindings for comparing declaration blocks; r=Manishearth
MozReview-Commit-ID: EtX2oLXdGNm
2016-10-09 18:33:50 +05:30
Brian Birtles
56e70aec51 Bug 1302949 - Add a method to parse a property-value pair into a declaration block; r=Manishearth
The property may be a shorthand property in which case the declaration block
will contain the expanded longhand properties and values.

MozReview-Commit-ID: KxqlYgbIZqL
2016-10-09 18:33:49 +05:30
bors-servo
5955f4a754 Auto merge of #13651 - Manishearth:au-togeckostyle, r=emilio
impl GeckoStyleCoordConvertible for Au

r? @heycam

<!-- 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/13651)
<!-- Reviewable:end -->
2016-10-09 07:52:51 -05:00
bors-servo
a0e404c79e Auto merge of #13620 - Manishearth:type-assert, r=emilio
Test that Servo_* functions have the right signatures

Fixes #12992

Needs #13617

Not very happy with this solution (and perhaps it should be done in pure Rust, though that can be split out as another easy bug).

But it works. The bindings changes are from running a regen on [bug 1308234](https://bugzilla.mozilla.org/show_bug.cgi?id=1308234)

r? @emilio

<!-- 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/13620)
<!-- Reviewable:end -->
2016-10-09 03:56:34 -05:00
Manish Goregaokar
af57a98694 Test that Servo_* functions have the right signatures
Fixes #12992
2016-10-09 09:59:00 +05:30
Bobby Holley
c72fffa8f8 Move children_to_process to layout.
We don't need this for Gecko, and it's hard to implement in that case because
there's nowhere obvious to put it (we don't plan to create TSDs for non-dirty
nodes, and non-dirty nodes can have dirty children which require the
children_to_process atomic). There are various solutions here, but punting is
the easiest.

We'll need to rethink this if/when we need to do a bottom-up traversal for
Gecko.
2016-10-08 18:20:45 -07:00
Manish Goregaokar
cb157b568f impl GeckoStyleCoordConvertible for Au 2016-10-09 00:36:34 +05:30
bors-servo
a25e0670b3 Auto merge of #13636 - Wafflespeanut:properties, r=Manishearth
Add 'image-rendering' support and some cleanup

<!-- 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-geckolib` does not report any errors
- [x] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [x] These changes have been tested manually

![screenshot](https://cloud.githubusercontent.com/assets/6691262/19195866/eb46ffce-8cd0-11e6-8642-a9525da8bf38.png)

r? @Manishearth

<!-- 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/13636)
<!-- Reviewable:end -->
2016-10-07 16:30:29 -05:00
Ravi Shankar
e7a9e46c27 Make use of existing helper for font-stretch 2016-10-07 23:36:06 +05:30
Ravi Shankar
710157c617 Add support for 'image-rendering' in geckolib 2016-10-07 23:35:57 +05:30
Ravi Shankar
5fd398ec06 Change 'image_rendering' enum variants to snake cases 2016-10-07 23:31:30 +05:30
Simon Sapin
ea97e9850b Blind attempt to fix #13626
The error message was:

```
error: unknown character escape: d
  --> C:\projects\servo\target\debug\build\style-9b556a6c7bb4f044\out/properties.rs:44:55
   |
44 | #[path="C:/projects/servo/components/style/properties\declaration_block.rs"]
   |
```

Use `repr()` to get a Python string literal (whose character escaping
is compatible enough with Rust’s) and `[1:-1]` to remove the single quotes.
2016-10-07 14:58:54 +02:00
bors-servo
03cd936639 Auto merge of #13617 - Rafagd:my_changes, r=Manishearth
Script-generated tests for Servo_* gecko bindings

All changes done in https://github.com/servo/servo/pull/13603, but this time I understand why I should have created a branch instead of doing everything on master.
---
<!-- 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 #13598 (github issue number if applicable).

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

<!-- 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/13617)
<!-- Reviewable:end -->
2016-10-06 22:46:55 -05:00
Rafael Gomes Dantas
5be551e10e Script-generated tests for Servo_* gecko bindings 2016-10-06 16:18:54 +01:00
Simon Sapin
540ba90bab Move PropertyDeclarationBlock into its own module. 2016-10-06 15:57:52 +02:00
bors-servo
cbc857bb78 Auto merge of #13569 - Manishearth:simpliffi, r=emilio
Start simplifying FFI ownership sugar

This is step one of a series of changes planned to make the ownership sugar easier to use. This was blocked on #13038

*very* unsure about second commit. Don't like the thought of accepting types with destructors over FFI. Probably will revert it. Leaving it in for now in case you have some insight.

Eventually at least for the borrowed stuff I want to use T directly (because the crates are merged now), instead of the fake void types. Perhaps for the others too. I might include those changes in this PR -- was originally planning to but I realized that these steps could be split out.

Tentative plan for `Owned` (assuming it's not removed) is to have `Owned<T> <-> Box<T>` (same `T`, no "FFI type") conversions. We will only use ownership wrapper types for things with destructors, and try to keep the conversion simple. I'm envisioning a couple methods for arc/strong and a few more for box/owned. We may need to introduce new wrapper types for gecko-side managed objects (`RefPtr<T>`, `UniquePtr<T>`) but that should be all the wrapper types we have in the ownership sugar.

This PR relies on the guarantee that `Option<&T>` and `Option<Box<T>>` are pointer-sized via the `NonZero` optimization. I am now less unconvinced that this is a good idea 😉.

r? @emilio

cc @mystor

<!-- 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/13569)
<!-- Reviewable:end -->
2016-10-05 00:59:56 -05:00
bors-servo
34a23b343c Auto merge of #13556 - Manishearth:serialize-one, r=emilio
Add to_css_single_value for serializing a single PropertyDeclarationBlock

(fixes #13423)

r? @birtles

This needs to take the name of the property in question as input so that it can figure out which shorthand to serialize to (if any), since some props are part of multiple shorthands (and you need a way to distinguish between the lone value and the shorthand). I can tweak this to accept an `Option<Shorthand>` in case you only want to pass in the property name for shorthands.

In case you don't want to handle shorthands at all, we probably don't need this method at all, since you can just assert that there's a single field and serialize that.

Also, is `!important` involved here?

<!-- 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/13556)
<!-- Reviewable:end -->
2016-10-04 23:34:03 -05:00
bors-servo
19a5a30113 Auto merge of #13387 - emilio:debug-assertions, r=aneeshusa,jdm,pcwalton
Honor SERVO_ENABLE_DEBUG_ASSERTIONS on the build machines.

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

As part of #13127.

cc @aneeshusa

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

<!-- 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/13387)
<!-- Reviewable:end -->
2016-10-04 14:01:49 -05:00
bors-servo
aea9545e16 Auto merge of #13459 - servo:no-arc-heapsize, r=emilio
Use parking_lot::RwLock for PropertyDeclarationBlock

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

<!-- 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/13459)
<!-- Reviewable:end -->
2016-10-04 11:58:56 -05:00
Simon Sapin
fbde392c3d Revert "Make DOMRefCell use style’s copy of RefCell"
This reverts commit ec723057b2.
2016-10-04 18:35:01 +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
Simon Sapin
89a29a7f12 Use parking_lot::RwLock instead of DOMRefCell for PropertyDeclarationBlock 2016-10-04 18:34:59 +02:00
Simon Sapin
d986fd2d2f Use PropertyDeclarationBlock in a DOMRefCell everywhere. 2016-10-04 18:34:57 +02:00
Simon Sapin
d4f704cad2 Disable applicable declarations cache for elements with a style attribute.
The cache is never effective in this case since a style attribute
adds to the set of applicable declarations.

This also avoid avoids the cache giving out-dated (incorrect) results
when `PropertyDeclarationBlock` becomes mutable in a later commit.
This is sufficient for now since CSSOM is only implemented for
`Element.style`. When StyleRule mutation is added,
some additional mechanism (such as evicting the cache) will be needed.
2016-10-04 18:34:56 +02:00
Manish Goregaokar
c9efa6e2a2 Add to_css_single_value for serializing a single PropertyDeclarationBlock (fixes #13423) 2016-10-04 19:58:11 +05:30
Simon Sapin
29c72d15a9 Make style build without impl<T: HeapSizeOf> HeapSizeOf for Arc<T>.
The removal of this impl is not included in this commit.
CC https://github.com/servo/heapsize/issues/37#issuecomment-249861171
2016-10-04 13:45:57 +02:00