Commit graph

25860 commits

Author SHA1 Message Date
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
Simon Sapin
d5074136e3 Rename ReadGuards to StylesheetGuards 2017-03-19 22:30:42 +01:00
Simon Sapin
2952ccfae2 Fix another deadlock 2017-03-19 22:30:41 +01:00
Simon Sapin
d9491187dc Parse stylesheets without acquiring a shared lock. 2017-03-19 22:30:40 +01:00
Simon Sapin
cc046300f0 Remove some indirection. 2017-03-19 22:30:39 +01:00
Simon Sapin
1e38013783 Refactor StylesheetLoader so impls do not need to acquire a shared lock.
This fixes a deadlock:
https://github.com/servo/servo/pull/16014#issuecomment-287527067
2017-03-19 22:30:39 +01:00
Simon Sapin
1bacd0eb15 Move all PropertyDeclarationBlock from RwLock<_> to Locked<_> 2017-03-19 22:30:38 +01:00
Simon Sapin
aeffca2a59 Replace RwLock<StyleRule> with Locked<StyleRule> 2017-03-19 22:30:37 +01:00
Simon Sapin
57724e5a37 Replace RwLock<Keyframe> with Locked<Keyframe> 2017-03-19 22:30:37 +01:00
Simon Sapin
adb97d4cbe Wrap most CSS rules in Locked<_> instead of RwLock<_> 2017-03-19 22:30:36 +01:00
Simon Sapin
f35b4e27b3 Replace RwLock<CssRules> with Locked<CssRules> 2017-03-19 22:30:35 +01:00
Simon Sapin
b213daaa88 Tidy 2017-03-19 22:30:34 +01:00
Simon Sapin
600152bd00 Replace more RwLock<MediaList> with shared_lock::Locked<MediaList> 2017-03-19 22:30:34 +01:00
Simon Sapin
fe4e70c5f8 Introduce a ToCssWithGuard trait 2017-03-19 22:30:33 +01:00
Simon Sapin
3ae2ecbec2 More lock acquire in callers 2017-03-19 22:30:32 +01:00
Simon Sapin
d18b1280f2 Move shared lock acquires up the call stack. (Or is it down?) 2017-03-19 22:30:32 +01:00
Simon Sapin
c5a7294e05 Replace RwLock<MediaList> with shared_lock::Locked<MediaList> 2017-03-19 22:30:31 +01:00
Simon Sapin
8feb9e8047 Add SharedRwLock<T> and Locked<T> 2017-03-19 22:30:24 +01:00
bors-servo
fbd561bc2f Auto merge of #15604 - zploskey:reset_font_shorthand_serialization, r=SimonSapin
serialize font: to empty on non-default subprops

Fixes font shorthand serialization so that it serializes to "" when non-default subproperties are defined. These subproperties are those defined in #15033.

Adds tests:
- font_should_serialize_to_empty_if_there_are_nondefault_subproperties
- font_should_serialize_all_available_properties

The second test was previously commented out and underwent some cleanup to make it run.

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

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

<!-- 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/15604)
<!-- Reviewable:end -->
2017-03-19 08:26:43 -07:00
bors-servo
058b93640f Auto merge of #16029 - servo:dead-code, r=nox
Remove never-sent ReflowWithNewlyLoadedWebFont message, fix #16026

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #16026 (github issue number if applicable).

<!-- 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/16029)
<!-- Reviewable:end -->
2017-03-19 05:48:39 -07:00
Simon Sapin
a8ab65b869 Remove never-sent ReflowWithNewlyLoadedWebFont message, fix #16026 2017-03-19 09:07:54 +01:00
Zach Ploskey
65e2ed7407 Add two font shorthand serialization tests
Adds tests:

- font_should_serialize_to_empty_if_there_are_nondefault_subproperties

Tests that the font subproperty serializes to an empty string when
certain non-default subproperties are defined.

- font_should_serialize_all_available_properties

Verifies that all properties that the font shorthand can display
will be serialized. This test was previously commented out and has
been simplified.
2017-03-19 00:17:00 -07:00
Zach Ploskey
cbaa6e262c Serialize font to "" on some nondefault properties
Fixes font shorthand serialization so that it serializes to "" when
certain subproperties of the font shorthand are set to non-default
values. These subproperties are:
- font-size-adjust
- font-kerning
- font-variant-caps
- font-variant-position
- font-language-override

Additionally, enable the above subproperties in the tests.
2017-03-19 00:16:19 -07:00
bors-servo
a2c33ac6e6 Auto merge of #16028 - canaltinova:pseudos-for-alt, r=Manishearth
Stylo: Add support for -moz-*  pseudo-classes for alt text

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

<!-- Either: -->
- [X] These changes do not require tests because they are stylo 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/16028)
<!-- Reviewable:end -->
2017-03-18 13:45:01 -07:00
bors-servo
e2aecc3ed7 Auto merge of #16024 - Wafflespeanut:gal, r=Wafflespeanut
Add parsing/serialisation for 'grid-auto-flow'

Didn't want the work (and review comments) in #15364 to go wasted. Fixes #15313

<!-- 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/16024)
<!-- Reviewable:end -->
2017-03-18 11:25:03 -07:00
George White
00da1eb810 Add parsing/serialisation for 'grid-auto-flow' 2017-03-18 23:38:31 +05:30
Nazım Can Altınova
d23cbd37b8
Stylo: Add support for -moz-* pseudo-classes for alt text 2017-03-18 19:46:53 +03:00
bors-servo
7fcba10614 Auto merge of #16023 - emilio:nits, r=emilio
style: Fix some nits

I was looking at the code that used Length for #16015, and found these two.

<!-- 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/16023)
<!-- Reviewable:end -->
2017-03-18 07:24:52 -07:00
Emilio Cobos Álvarez
60d340d76f
style: Remove outdated comment. 2017-03-18 15:05:26 +01:00
Emilio Cobos Álvarez
fe9d88326e
style: Fix alignment of the padding properties. 2017-03-18 15:05:25 +01:00
bors-servo
aa8b602f9e Auto merge of #16022 - emilio:stylo-build-log, r=upsuper
stylo: Add a build log mechanism.

This will allow us to debug bindgen problems.

<!-- 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/16022)
<!-- Reviewable:end -->
2017-03-18 06:45:01 -07:00
Emilio Cobos Álvarez
a1930fc554
stylo: Add a build log mechanism.
MozReview-Commit-ID: 4Zo1EveUYkK
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-03-18 13:21:10 +01:00
bors-servo
ae1a7cc7b8 Auto merge of #16015 - bholley:box_more_properties, r=Manishearth
Box more specified values to bring SpecifiedValue/PropertyDeclaration sizes down to 24/32 bytes

I think these properties are generally rare enough that they're not worth adding 8 bytes of memmove overhead on every PropertyDeclaration. There are a _lot_ of 24-byte properties though, so I think that's probably a good sustainable level.

<!-- 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/16015)
<!-- Reviewable:end -->
2017-03-17 22:19:51 -07:00
Bobby Holley
97dd3a1b08 Box more specified values to bring SpecifiedValue/PropertyDeclaration sizes down to 24/32 bytes.
MozReview-Commit-ID: xstAfjVQqi
2017-03-17 22:18:19 -07:00
bors-servo
8f3f8098c3 Auto merge of #16006 - upsuper:box-ordinal-group, r=Manishearth
Implement -moz-box-ordinal-group property

This PR fixes #16000.

<!-- 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/16006)
<!-- Reviewable:end -->
2017-03-17 15:15:01 -07:00
bors-servo
0a3b373a6a Auto merge of #15799 - asajeffrey:script-window-xorigin-parent, r=nox
Implement dissimilar-origin window.parent and window.top

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

This PR implements `window.parent` and `window.top` for dissimilar-origin windows.

This PR builds on #15536, only the last commit is part of this 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 #14996 and fix #11660.
- [X] These changes do not require tests because there's already a parentage test in `mozilla/cross-origin-objects/cross-origin-objects.html`.

<!-- 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/15799)
<!-- Reviewable:end -->
2017-03-17 09:18:38 -07:00
Alan Jeffrey
6bcb5f68be Implement dissimilar-origin window.parent and window.top. 2017-03-17 10:53:20 -05:00
bors-servo
c2f4a59474 Auto merge of #16013 - nox:mio, r=larsbergstrom
Enable the debugger on Android

Apparently mio 0.6.5 now fully supports Android.

<!-- 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/16013)
<!-- Reviewable:end -->
2017-03-17 08:36:27 -07:00
Anthony Ramine
60a7f46350 Enable the debugger on Android
Apparently mio 0.6.5 now fully supports Android.
2017-03-17 16:36:06 +01:00
bors-servo
f873a4aba5 Auto merge of #16011 - mbrubeck:always-be-updating, r=emilio
Upgrade dependencies with minor updates

Closes #16008

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because there are no code changes
2017-03-17 07:41:09 -07:00
Matt Brubeck
8f65463ffa Upgrade dependencies with minor updates 2017-03-17 07:38:27 -07:00
bors-servo
0b590aeed7 Auto merge of #16004 - CJKu:bug-1339674, r=heycam
stylo: Update clip-path and transform-box glue.

<!-- Please describe your changes on the following line: -->
Gecko bug1340044 should be land immediately after this PR been merged.

---
<!-- 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 it changes only the declaration type of mTransformBox

<!-- 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/16004)
<!-- Reviewable:end -->
2017-03-17 05:53:10 -07:00
Xidorn Quan
a1acb29aed Add support for -moz-box-ordinal-group 2017-03-17 23:08:07 +11:00
Xidorn Quan
ab0e5c9d99 Switch column-count to use predefined integer type 2017-03-17 23:08:05 +11:00
Xidorn Quan
9233882d49 Switch z-index to use predefined integer type 2017-03-17 23:08:03 +11:00
Xidorn Quan
b489c4ed90 Make Interpolate impl generic for Either 2017-03-17 23:08:00 +11:00