Commit graph

1527 commits

Author SHA1 Message Date
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
Ravi Shankar
361f372142 Add support for 'font-stretch' 2016-10-04 15:54:01 +05:30
Manish Goregaokar
b416ccfcae Remove Borrowed<T>/BorrowedMut<T>, use Option<&T> instead. 2016-10-04 15:01:49 +05:30
bors-servo
6f8bf29eaf Auto merge of #13566 - Wafflespeanut:consts, r=Manishearth
Add NS_FONT_STRETCH_* consts and regenerate bindings

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

Depends on servo/rust-bindgen#74

---
<!-- 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 do not require tests because they're autogenerated

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

Once that merges, r? @Manishearth

<!-- 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/13566)
<!-- Reviewable:end -->
2016-10-04 02:59:15 -05:00
Ravi Shankar
68d25d908a Regen struct bindings 2016-10-04 13:25:00 +05:30
Ravi Shankar
854258c76e Add NS_FONT_STRETCH_* to bindgen script 2016-10-03 20:40:34 +05:30
Bobby Holley
687e1f701c Rename PrivateStyleData to PersistentStyleData and use AtomicRefCell instead of RefCell as a container.
This allows us to eliminate the unsafe borrows. \o/

MozReview-Commit-ID: 29hpGaWUFQz
2016-10-02 19:19:52 -07:00
Bobby Holley
18d552a1e9 Stop using Ref::map for style().
It's not possible to implement a Ref::map equivalent method on AtomicRefCell
while having AtomicRefCell implemented on top of RwArc. We could potentially
reimplement AtomicRefCell to be more like RefCell and add a Ref::map equivalent
method, but I (and pcwalton) think we should try just cloning a few extra
Arcs at these callsites instead.

MozReview-Commit-ID: 6H8vAWguO3z
2016-10-02 19:19:52 -07: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
bors-servo
7da20f2617 Auto merge of #13541 - canaltinova:origin-clip, r=Manishearth
Fix origin/clip parsing behavior in mask and background shorthands

<!-- Please describe your changes on the following line: -->
We have tests for mask shorthand parsing, but we don't have tests for background parsing. Should I add some for it?
Also deleted inaccessible match arms in serialization function.
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 #13466 (github issue number if applicable).

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

<!-- 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/13541)
<!-- Reviewable:end -->
2016-10-02 14:33:43 -05:00
Nazım Can Altınova
1b35a3d9a8 Fix origin/clip parsing behavior in mask and background shorthands 2016-10-02 19:07:34 +03:00
bors-servo
c4021a6765 Auto merge of #13440 - emilio:no-ool, r=bholley
stylo: Remove a bunch of unneeded ool-calls.

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

<!-- 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/13440)
<!-- Reviewable:end -->
2016-10-02 10:59:25 -05:00
Emilio Cobos Álvarez
bdf1d179ba
layout: Use the fragment's writing mode when computing sizes relevant to that fragment.
Otherwise we might mix writing modes. Not totally sure this change is correct in
the case we're mixing them, we might need to just not checking that operation.
2016-10-02 17:57:07 +02:00
Emilio Cobos Álvarez
eb0c12acaf
stylo: Remove a bunch of out of now-unneeded out-of-line calls.
r? @bholley
2016-10-02 17:51:14 +02:00
Manish Goregaokar
c76e382d80 Update glue for StyleComplexColor values 2016-10-02 09:48:41 +05:30
Manish Goregaokar
3ca53c8a4b Regen bindings for upcoming resync 2016-10-01 22:01:07 +05:30
bors-servo
7914f14caa Auto merge of #13518 - upsuper:patch-1, r=emilio
Move --use-msvc-mangling out from clang flags.

`--use-msvc-mangling` is not a clang flag, but a flag for bindgen.

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/13518)
<!-- Reviewable:end -->
2016-10-01 09:47:00 -05:00
bors-servo
4101260cc0 Auto merge of #13476 - Wafflespeanut:atoms, r=Manishearth,emilio
Refactor geckolib atoms regen script

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

<!-- Either: -->
- [x] These changes do not require tests because it's a 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/13476)
<!-- Reviewable:end -->
2016-09-30 10:32:01 -05:00
Manish Goregaokar
b6fccbf65c Regen bindings 2016-09-30 20:48:37 +05:30
Ravi Shankar
fa06b922c7 Refactor geckolib atoms regen script 2016-09-30 20:48:36 +05:30
bors-servo
f67e5e4004 Auto merge of #13473 - KiChjang:gecko-letter-spacing, r=Manishearth,Wafflespeanut
Support letter-spacing in stylo

Fixes #12823.

r? @Manishearth

**This needs to be tested!**

<!-- 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/13473)
<!-- Reviewable:end -->
2016-09-30 09:38:26 -05:00
bors-servo
c834e57f4d Auto merge of #13477 - Manishearth:regen, r=emilio
Regenerate bindings

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/13477)
<!-- Reviewable:end -->
2016-09-30 08:39:50 -05:00
bors-servo
76092c437c Auto merge of #13450 - Wafflespeanut:border_spacing, r=Manishearth
Make use of Servo's border-spacing in Stylo

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

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

![screenshot](https://cloud.githubusercontent.com/assets/6691262/18867760/1fa46376-84c3-11e6-8e63-9fce042f5bb0.png)

r? @Manishearth

<!-- 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/13450)
<!-- Reviewable:end -->
2016-09-30 00:25:08 -05:00
bors-servo
37c8892b87 Auto merge of #13456 - Wafflespeanut:warnings, r=emilio
Silence some warnings in geckolib

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

<!-- Either: -->
- [x] These changes do not require tests because it's a cleanup

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

We'll be silencing thousands of warnings this way, which would probably help with Travis.

<!-- 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/13456)
<!-- Reviewable:end -->
2016-09-29 22:46:38 -05:00
Xidorn Quan
910853f12a Move --use-msvc-mangling out from clang flags. 2016-09-30 11:09:43 +10:00
bors-servo
c9442346d3 Auto merge of #13414 - flacerdk:master, r=mbrubeck
Implement `word-break: keep-all` (#9673)

<!-- Please describe your changes on the following line: -->
Implement the `keep-all` value for the `word-break` property, as specified in [CSS](https://drafts.csswg.org/css-text-3/#word-break-property).

The relevant CSSWG tests (in `tests/wpt/css-tests/css-text-3_dev/html/word-break-keep-all-*.htm`) do not currently pass. As far as I can tell, this is because the tests use some JavaScript code that is not working properly. (But then, it seems that most tests in this directory are failing at the moment. I'm not sure what can be done here for now.)

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

<!-- 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/13414)
<!-- Reviewable:end -->
2016-09-29 19:20:55 -05:00
bors-servo
495fbef129 Auto merge of #13455 - Wafflespeanut:bindgen, r=emilio
Cleanup the bindgen tools and update their README

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

<!-- Either: -->
- [x] These changes do not require tests because it's just a cleanup

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

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/13455)
<!-- Reviewable:end -->
2016-09-29 17:11:35 -05:00
bors-servo
47fa31562a Auto merge of #13336 - canaltinova:mask, r=Manishearth
Implement parsing for mask shorthand

<!-- Please describe your changes on the following line: -->
Implement parsing for mask shorthand. It doesn't contain tests yet. I'll write and update the PR.

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

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

<!-- 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/13336)
<!-- Reviewable:end -->
2016-09-29 00:22:54 -07:00
Nazım Can Altınova
3b03cd5b31 Implement parsing for mask shorthand 2016-09-29 01:48:38 +03:00