Commit graph

24502 commits

Author SHA1 Message Date
Gregory Terzian
5c4f0be048 support structured cloning for Blob 2017-03-22 09:52:35 +08:00
Xidorn Quan
f53e2ff0e1 Factor out read/write locked arc 2017-03-22 12:34:16 +11:00
Martin Robinson
9d72e89ce3 Stop splitting scroll roots
Now that WebRender can handle splitting scrolling layers on its own, we
don't need to do any work to split up scroll roots. This should also
make it possible to handle overflow:scroll and containing block scroll
roots in the future.
2017-03-21 16:42:31 -07:00
Manish Goregaokar
f2f832d1d9 stylo: Support all non-ts pseudos with an argument 2017-03-21 12:33:57 -07:00
Nazım Can Altınova
ea1e405500
Implement gecko glue for will-change 2017-03-21 21:10:07 +03:00
Nazım Can Altınova
a3862780ac
Add flags to longhands for gecko glue
The flags are creates_stacking_context, fixpos_cb and abspos_cb. These will be needed in will-change glue.
2017-03-21 21:10:01 +03:00
Nazım Can Altınova
56b8c1d8b7
Implement parsing/serialization of will-change 2017-03-21 21:09:57 +03:00
bors-servo
2f6cf2e9c8 Auto merge of #16061 - methyl:master, r=Manishearth
Use servo_config::opts only on linux target.

It's not used for other architectures and triggers warnings.

<!-- 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
- [x] These changes fix #16058
- [x] These changes do not require tests because it's purely refactoring task

<!-- 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/16061)
<!-- Reviewable:end -->
2017-03-21 10:18:25 -07:00
bors-servo
d790973fb4 Auto merge of #16062 - BorisChiou:stylo/animation/parse_number, r=emilio
stylo: Make specified::parse_number() return finite f32.

We need to clamp the float numbers to avoid positive/negative infinity in timing functions, transform functions, and other possible css values to avoid undefined behaviors and assertions.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1343153](https://bugzilla.mozilla.org/show_bug.cgi?id=1343153) and [Bug 1336769](https://bugzilla.mozilla.org/show_bug.cgi?id=1336769)
- [X] These changes do not require tests because gecko has related tests

<!-- 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/16062)
<!-- Reviewable:end -->
2017-03-21 09:22:37 -07:00
Boris Chiou
f3a99baeac Make specified::parse_number() return finite f32. 2017-03-22 00:20:55 +08:00
Lucjan Suski
9a059b49c5 Use servo_config::opts only on linux target.
It's not used for other architectures and triggers warnings.
2017-03-21 15:55:45 +01:00
bors-servo
6d3f166671 Auto merge of #16056 - emilio:nsstring-vendor, r=mystor
Revendor rust nsstring bindings.

r? @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/16056)
<!-- Reviewable:end -->
2017-03-21 07:13:28 -07:00
bors-servo
cea1760eb7 Auto merge of #16034 - jonathandturner:fix_font, r=metajack
Fix Windows UI and font squishing

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

This PR:

* updates the browserhtml dep (fixes https://github.com/servo/servo/issues/15255)
* updates the Windows font metric calculation (fixes https://github.com/servo/servo/issues/15698, based on codec-abc https://github.com/servo/servo/pull/15937#issuecomment-286513712)
* may address https://github.com/servo/servo/issues/15933.  With this PR, I was not able to repro

---
<!-- 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 tests because change are to UI/visual results of font drawing

<!-- 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/16034)
<!-- Reviewable:end -->
2017-03-21 03:15:10 -07:00
Emilio Cobos Álvarez
6c1153ab28
Revendor rust nsstring bindings. 2017-03-21 10:26:45 +01:00
bors-servo
5a656cfa54 Auto merge of #16055 - BorisChiou:stylo/animation/parse_easing, r=emilio
stylo: Bug 1343153 - Use servo css-parser for ParseEasing

These patches fix [Bug 1343153](https://bugzilla.mozilla.org/show_bug.cgi?id=1343153).

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix Bug 1343153
- [X] These changes do not require tests because gecko has enough test cases for web animations.

<!-- 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/16055)
<!-- Reviewable:end -->
2017-03-21 01:36:49 -07:00
Boris Chiou
30f44da11c Bug 1343153 - Replace pointer to const with immutable reference for nsTimingFunction. 2017-03-21 16:35:07 +08:00
Boris Chiou
708f446364 Bug 1343153 - Support Servo_ParseEasing. 2017-03-21 16:34:58 +08:00
bors-servo
9ea46920ff Auto merge of #16052 - tobbi:fix-linux-deps-instructions, r=Wafflespeanut
Fix Debian dependencies instructions

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

<!-- 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/16052)
<!-- Reviewable:end -->
2017-03-21 00:03:21 -07:00
bors-servo
3b15efd2ba Auto merge of #16054 - vypr:master, r=Wafflespeanut
Making a few lines in layout_wrapper.rs a bit nicer, fixing #15811.

<!-- 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/16054)
<!-- Reviewable:end -->
2017-03-20 20:15:31 -07:00
Elliott Pardee
fd42e3575a Making a few lines in layout_wrapper.rs a bit nicer. 2017-03-20 23:10:00 -04:00
bors-servo
32ca5f3540 Auto merge of #16053 - bholley:shared_lock_atomic_refcell, r=bholley
Use AtomicRefCell instead of RwLock inside SharedRwLock for stylo

@SimonSapin wrote the original patch in [1], and I tweaked it to conditionally compile. Just waiting for the try run to come back green before landing.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1348587

<!-- 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/16053)
<!-- Reviewable:end -->
2017-03-20 17:00:31 -07:00
Simon Sapin
7850d3f331 Use AtomicRefCell instead of RwLock inside SharedRwLock for stylo.
MozReview-Commit-ID: 8M6BUqe4pil
2017-03-20 16:36:03 -07:00
bors-servo
315e2dd161 Auto merge of #16047 - canaltinova:eventstate-bindings, r=emilio
Stylo: Update bindings for ServoType

This is needed for https://bugzilla.mozilla.org/show_bug.cgi?id=1348873

---
<!-- 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 1348873](https://bugzilla.mozilla.org/show_bug.cgi?id=1348873)

<!-- 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/16047)
<!-- Reviewable:end -->
2017-03-20 15:17:48 -07:00
Tobias Markus
e24af4d8ba Fix Debian dependencies instructions 2017-03-20 21:36:05 +01:00
bors-servo
22d40e3680 Auto merge of #16051 - methyl:master, r=jdm
Make ImageData::new return Fallible instead of unwrapping a result

Instead of unwrapping `new_with_jsobject` result, `ImageData::new` will just pass the error along.

It required tweaking `canvasrenderingcontext2d` as it no longer needs to assume the result is `Ok`.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #16043

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because this is small and purely refactoring change

<!-- 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/16051)
<!-- Reviewable:end -->
2017-03-20 13:25:20 -07:00
Lucjan Suski
c83ac31e71 Make ImageData::new return Fallible instead of panic 2017-03-20 21:16:55 +01:00
Nazım Can Altınova
260e919f7b
Stylo: Update bindings for ServoType 2017-03-20 21:18:59 +03:00
Benjamin Dahse
8db0fcaa29 Make writing-mode affect computed display
If a box has a different writing-mode than its containing block, and has a specified display of inline, change the computed display to inline-block.
Also adds the second manual testcase from #15754 as a WPT to assert that the computed display does in fact change.
2017-03-20 18:20:15 +01:00
bors-servo
17098ddc8f Auto merge of #16045 - mbrubeck:any, r=emilio
Bug 1348487 - stylo: Don't allow combinators in :-moz-any.

https://bugzilla.mozilla.org/show_bug.cgi?id=1348487
2017-03-20 08:31:25 -07:00
Matt Brubeck
b8dead37f6 Bug 1348487 - stylo: Don't allow combinators in :-moz-any. 2017-03-20 08:28:56 -07:00
bors-servo
4fa40c7703 Auto merge of #15890 - emilio:bloom, r=heycam
selectors: Check the bloom filter at most once per complex selector.

Fixes https://github.com/servo/rust-selectors/issues/107

<!-- 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/15890)
<!-- Reviewable:end -->
2017-03-20 06:26:38 -07:00
bors-servo
e8b3647934 Auto merge of #16040 - Wafflespeanut:tidy, r=Manishearth
Cleanup tidy

fixes #16039

<!-- 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/16040)
<!-- Reviewable:end -->
2017-03-20 05:28:12 -07:00
bors-servo
4a63581fad Auto merge of #15918 - munyari:whitespace, r=emilio
PropertyDeclaration with CSSWideKeyword is parsed

Addresses #15401

<!-- 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/15918)
<!-- Reviewable:end -->
2017-03-20 04:23:28 -07:00
Emilio Cobos Álvarez
2772419ad8
selectors: Check the bloom filter at most once per complex selector.
Fixes https://github.com/servo/rust-selectors/issues/107
2017-03-20 12:09:34 +01:00
bors-servo
9fdebf0934 Auto merge of #16035 - emilio:parallel-log-no-fun, r=upsuper
stylo: Sequentialize binding generation if logging is enabled.

Otherwise the log is useless, and it's even slower than in parallel mode due to
the high lock contention.

<!-- 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/16035)
<!-- Reviewable:end -->
2017-03-20 03:43:26 -07:00
Emilio Cobos Álvarez
e348940296
stylo: Sequentialize binding generation if logging is enabled.
Otherwise the log is useless, and it's even slower than in parallel mode due to
the high lock contention.
2017-03-20 11:42:41 +01:00
bors-servo
50fd39f068 Auto merge of #16016 - Manishearth:graft-font-size, r=upsuper
Add separate specified value for keyword font sizes

In Gecko, these keywords compute to different values depending on the
font.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1341775

<!-- 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/16016)
<!-- Reviewable:end -->
2017-03-20 00:28:46 -07:00
Manish Goregaokar
c9198d92d5 Add separate specified value for keyword font sizes
In Gecko, these keywords compute to different values depending on the
font.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1341775
2017-03-20 00:06:04 -07:00
Ravi Shankar
841a3abef6 Tidy: Prefer monkey patching sys.path over addsitedir (and some cleanup) 2017-03-20 12:23:05 +05:30
bors-servo
103e827948 Auto merge of #16036 - chenpighead:text-size-adjust, r=upsuper
Stylo: Add support for text-size-adjust property

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

Gecko supports -{moz,webkit}-text-size-adjust properties, but it only supports auto and none value.
Implement parsing/serialization for text-size-adjust property and its gecko glue.

---
<!-- 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 #16002 (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/16036)
<!-- Reviewable:end -->
2017-03-19 20:56:00 -07:00
Jeremy Chen
615c8cb5e6 stylo: Add support for text-size-adjust property 2017-03-20 11:34:48 +08:00
bors-servo
8d25dcb8b5 Auto merge of #16033 - servo:per-document-locks, r=emilio
Per-document shared lock for author-origin stylesheets

Fix #16027

<!-- 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/16033)
<!-- Reviewable:end -->
2017-03-19 18:22:23 -07:00
Jonathan Turner
f38bab454a Update browserhtml dep 2017-03-20 14:14:19 +13:00
bors-servo
bea126fb73 Auto merge of #16030 - paulrouget:toggle-wr-profiler, r=glennw
Expose a method to toggle wr profiler

<!-- 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/16030)
<!-- Reviewable:end -->
2017-03-19 17:42:16 -07:00
Paul Rouget
b8cd715b3e Expose a method to toggle wr profiler 2017-03-20 01:40:38 +01:00
Jonathan Turner
cf911cef28 Change windows font metrics 2017-03-20 11:57:39 +13:00
Panashe M. Fundira
ec87545774
PropertyDeclaration with CSSWideKeyword is parsed
Addresses #15401

The desired result is for `CSSWideKeyword`s to return false (they are
parsed) and other Custom declaration values to return true (they are unparsed).
2017-03-19 18:37:40 -04:00
Simon Sapin
643545b87f Per-document shared lock for author-origin stylesheets.
Fix #16027
2017-03-19 23:12:15 +01:00
Simon Sapin
02dc8b286a No-op refactor: root_flow param for perform_post_style_recalc_layout_passes
This whole method was a large `if let` block:

```rust
if let Some(mut root_flow) = self.root_flow.clone() {
   // ...
}
```

Move that `if let` to callers to make it clear that the method
doesn’t need to be called when `self.root_flow` is `None`.

By itself, this commit doesn’t change anything.
But it enables the next one.
2017-03-19 23:12:14 +01:00
bors-servo
bb54f0a429 Auto merge of #16014 - servo:style-ref, r=emilio
Per-process lock for CSSOM objects

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

Before this PR, every object reflected in CSSOM is in `Arc<RwLock<_>>` to enable safe (synchronized) mutable aliasing. Acquiring all these locks has significant cost during selector matching:

* https://bugzilla.mozilla.org/show_bug.cgi?id=1311469
* https://bugzilla.mozilla.org/show_bug.cgi?id=1335941
* https://bugzilla.mozilla.org/show_bug.cgi?id=1339703

This PR introduce a mechanism to protect many objects with the same `RwLock` that only needs to be acquired once.

In Stylo, there is one such lock per process (in a `lazy_static`), used for everything.

I non-Stylo Servo, I originally intended to have one such lock per document (for author-origin stylesheets, and one per process for user-agent and user sytlesheets since they’re shared across documents, and never mutated anyway). However I failed to have the same document-specific (or pipeline-specific) `Arc` reachable from both `Document` nodes and `LayoutThread`. Recursively following callers lead me to include this `Arc` in `UnprivilegedPipelineContent`, but that needs to be serializable. So there is a second process-wide lock.

This was previously #15998, closed accidentally.

---
<!-- 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/16014)
<!-- Reviewable:end -->
2017-03-19 14:31:19 -07:00