Commit graph

16105 commits

Author SHA1 Message Date
bors-servo
a266e96d28 Auto merge of #18239 - servo:derive-all-the-things, r=emilio
Refactor how we handle trait bounds in style_derive

<!-- 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/18239)
<!-- Reviewable:end -->
2017-08-28 10:13:13 -05:00
bors-servo
96b4e064a1 Auto merge of #18267 - emilio:dirty-on-viewport-size-change, r=SimonSapin
style: Don't look for viewport units in stylesheets.

Use whether we've computed any viewport unit instead.

This is more accurate (we avoid restyling unnecessarily if we've found anything
ever on the stylesheet, but that hasn't matched).

This has the benefit of also matching Gecko, and simplify some code and
fishyness around, and also hopefully speeding up stylesheet parsing.

<!-- 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/18267)
<!-- Reviewable:end -->
2017-08-28 08:48:47 -05:00
bors-servo
94c870726f Auto merge of #18261 - emilio:silly-pseudo-style, r=heycam
style: Really only resolve applicable ::before / ::after.

<!-- 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/18261)
<!-- Reviewable:end -->
2017-08-28 07:01:51 -05:00
Emilio Cobos Álvarez
14d60a7e89
style: Really only resolve applicable ::before / ::after.
MozReview-Commit-ID: 4dIykkUdIxZ
2017-08-28 14:00:43 +02:00
Anthony Ramine
ba4136b5a8 Document how style traits can be derived 2017-08-28 12:26:43 +02:00
Anthony Ramine
41c3be54ea Implement #[distance(fallback)] for #[derive(ComputeSquaredDistance)] 2017-08-28 12:26:42 +02:00
Anthony Ramine
4faadb489f Implement #[css(derive_debug)]
This makes #[derive(ToCss)] derive Debug with a simple call to the to_css method.
2017-08-28 12:26:40 +02:00
Anthony Ramine
1ace6d4c7f Derive Animate for computed::Angle 2017-08-28 12:26:39 +02:00
Anthony Ramine
b543b17cf0 Derive Animate for BackgroundSize<L> 2017-08-28 12:26:38 +02:00
Anthony Ramine
318d8696e5 Derive Animate and ComputeSquaredDistance for computed font-size-adjust 2017-08-28 12:26:37 +02:00
Anthony Ramine
4a4bf89575 Implement #[animate(fallback)] for #[derive(Animate)]
This allows us to derive the Animate trait, providing a fallback function
for when the 2 values aren't similar.
2017-08-28 12:26:36 +02:00
Anthony Ramine
3751fe9fdc Derive ToComputedValue for TrackBreadth<L> 2017-08-28 12:26:35 +02:00
Emilio Cobos Álvarez
15e71c5670
style: Don't look for viewport units in stylesheets.
Use whether we've computed any viewport unit instead.

This is more accurate (we avoid restyling unnecessarily if we've found anything
ever on the stylesheet, but that hasn't matched).

This has the benefit of also matching Gecko, and simplify some code and
fishyness around, and also hopefully speeding up stylesheet parsing.
2017-08-28 12:05:22 +02:00
Anthony Ramine
735e093de7 Implement #[compute(clone)] for #[derive(ToComputedValue)] 2017-08-28 10:39:53 +02:00
Anthony Ramine
efc852f6e3 Improve handling of trait bounds when deriving fmap-like traits 2017-08-28 10:39:50 +02:00
Anthony Ramine
8101887d31 Support #[animation(constant)] when deriving ToAnimatedZero 2017-08-28 10:39:32 +02:00
Anthony Ramine
405e34aa74 Derive a bunch of animation traits for some SVG types 2017-08-28 10:39:17 +02:00
Anthony Ramine
eaf2f1ec33 Introduce #[animation(constant)] for the Animate trait
This allows us to handle fields that should be the same during animations.
2017-08-28 10:39:10 +02:00
bors-servo
ced303b9cb Auto merge of #18176 - rtbo:perf_observer_buffered, r=ferjm
PerformanceObserverInit.buffered

Per #18108, add `buffered` flag in the `PerformanceObserverInit` dict.
Per W3C spec, when `buffered` is set, `PerformanceObserver.observe()` method adds the entries buffered in the `Performance` instance into the observer's entry buffer.
One step is the implementation of the [filter by name and type](https://w3c.github.io/performance-timeline/#filter-buffer-by-name-and-type) algorithm. Don't think that the sort operation is useful in this case, but the spec states that this algorithm is to be used.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #18108
- [X] These changes do not require tests (yet) because the timeline API is not powered.

<!-- 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/18176)
<!-- Reviewable:end -->
2017-08-28 02:20:29 -05:00
bors-servo
478da86bb9 Auto merge of #18265 - hiikezoe:dont-fallback-to-discrete-animation, r=birtles
Don't fallback to discrete animations within animate().

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

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

<!-- 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/18265)
<!-- Reviewable:end -->
2017-08-28 00:29:36 -05:00
Hiroyuki Ikezoe
21db77eb4e Don't fallback to discrete animations within animate(). 2017-08-28 14:16:34 +09:00
Glenn Watson
78f73b6d56 Update WR (debugger, renderer API changes). 2017-08-28 12:08:24 +10:00
Anthony Ramine
e49dbc4dfa Derive Animate for ShapeRadius<L> 2017-08-27 23:31:17 +02:00
Anthony Ramine
af560a8fab Support #[animation(error)] in more cases
The trait ToAnimatedZero now supports it, and it now applies to things with generics,
avoiding the trait bounds for field types of the variant on which it applies.
2017-08-27 23:31:17 +02:00
Anthony Ramine
dc827c14e1 Fix the name of the #[animation] attribute, oops 2017-08-27 23:31:16 +02:00
Anthony Ramine
04ad28b564 Refactor how we handle trait bounds in style_derive
For the traits we derive which methods don't depend on associated types (i.e.
all of them but ToAnimatedValue and ToComputedValue), we now add trait bounds
for the actual field types directly, instead of bounding the type parameters.
2017-08-27 23:31:16 +02:00
Anthony Ramine
13d47ba69a Remove some garbage code from style_derive 2017-08-27 23:31:16 +02:00
bors-servo
08b9588011 Auto merge of #18257 - emilio:debug-stuff-helps, r=bholley
stylo: Make a few functions output more useful debug information.

Reviewed by Bobby on bug 1389645.

<!-- 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/18257)
<!-- Reviewable:end -->
2017-08-26 18:13:40 -05:00
Emilio Cobos Álvarez
97338d0e84
stylo: Make a few functions output more useful debug information. 2017-08-27 00:14:12 +02:00
bors-servo
163f29ff63 Auto merge of #18243 - DominoTree:18224, r=stshine
[18224] Check if line_count is zero to calculate space around line

<!-- Please describe your changes on the following line: -->
Check line_count before attempting to calculate space around 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 #18224 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because changes are minimal and the error was triggered by a test

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/18243)
<!-- Reviewable:end -->
2017-08-26 17:07:28 -05:00
bors-servo
8f7bcdfef3 Auto merge of #18252 - KiChjang:remove-bc-arg, r=emilio
Remove border collapse argument from compute_border_and_padding

<!-- 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/18252)
<!-- Reviewable:end -->
2017-08-26 16:09:16 -05:00
Bobby Holley
994074fca6 Clean up bit clearing. 2017-08-26 10:22:03 -07:00
Nick Price
684816bfb3 Check if line_count is zero to calculate space around line 2017-08-26 12:48:07 -04:00
Keith Yeung
1df72ba935 Remove border collapse argument from compute_border_and_padding 2017-08-25 23:41:55 -07:00
bors-servo
3c42792efa Auto merge of #18248 - bholley:more_stack_limits, r=bholley
stylo: Check stack depth in invalidation machinery and re-enable limits

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

<!-- 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/18248)
<!-- Reviewable:end -->
2017-08-25 23:29:46 -05:00
Bobby Holley
ffc42db030 Reenable tight stacks sizes.
MozReview-Commit-ID: GJkLyigMK34
2017-08-25 21:29:18 -07:00
Bobby Holley
b66111c428 Fix up stack limit sanity assertions.
MozReview-Commit-ID: ILblsins91P
2017-08-25 18:39:25 -07:00
Emilio Cobos Álvarez
8c3cc9ba1f Hook the recursive invalidation traversal up to the stack checker machinery.
MozReview-Commit-ID: 3tX3gHFTBT
2017-08-25 18:39:20 -07:00
bors-servo
8812422bfa Auto merge of #18171 - servo:skip_whitespace, r=emilio
Use Parser::skip_whitespace in a few places to make Parser::try rewind less

**Do not merge yet.** This pulls in unrelated cssparser changes which add a dependency to `dota`, and we’d like to resolve https://github.com/dtolnay/dtoa/pull/9 before landing dtoa in mozilla-central. Also, the dependency change may require manually revendoring in mozilla-central.

Gecko’s CSS parsing microbenchmarks before:

```
  43.437 ±  0.391 ms    Stylo.Servo_StyleSheet_FromUTF8Bytes_Bench
  29.244 ±  0.042 ms    Stylo.Gecko_nsCSSParser_ParseSheet_Bench
 281.884 ±  0.028 ms    Stylo.Servo_DeclarationBlock_SetPropertyById_Bench
 426.242 ±  0.008 ms    Stylo.Servo_DeclarationBlock_SetPropertyById_WithInitialSpace_Bench
```

After:

```
  29.779 ±  0.254 ms    Stylo.Servo_StyleSheet_FromUTF8Bytes_Bench
  28.841 ±  0.031 ms    Stylo.Gecko_nsCSSParser_ParseSheet_Bench
 296.240 ±  4.744 ms    Stylo.Servo_DeclarationBlock_SetPropertyById_Bench
 293.855 ±  4.304 ms    Stylo.Servo_DeclarationBlock_SetPropertyById_WithInitialSpace_Bench
```

<!-- 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/18171)
<!-- Reviewable:end -->
2017-08-25 20:24:58 -05:00
Simon Sapin
dc5dfafbba Use Parser::skip_whitespace in a few places to make Parser::try rewind less.
Gecko’s CSS parsing microbenchmarks before:

```
  43.437 ±  0.391 ms    Stylo.Servo_StyleSheet_FromUTF8Bytes_Bench
  29.244 ±  0.042 ms    Stylo.Gecko_nsCSSParser_ParseSheet_Bench
 281.884 ±  0.028 ms    Stylo.Servo_DeclarationBlock_SetPropertyById_Bench
 426.242 ±  0.008 ms    Stylo.Servo_DeclarationBlock_SetPropertyById_WithInitialSpace_Bench
```

After:

```
  29.779 ±  0.254 ms    Stylo.Servo_StyleSheet_FromUTF8Bytes_Bench
  28.841 ±  0.031 ms    Stylo.Gecko_nsCSSParser_ParseSheet_Bench
 296.240 ±  4.744 ms    Stylo.Servo_DeclarationBlock_SetPropertyById_Bench
 293.855 ±  4.304 ms    Stylo.Servo_DeclarationBlock_SetPropertyById_WithInitialSpace_Bench
```
2017-08-26 01:44:45 +02:00
bors-servo
2136dd2bb7 Auto merge of #18244 - kahsieh:master, r=Manishearth
stylo: Update CSS fallback font when lang changes

r=manishearth in BugZilla.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1367860](https://bugzilla.mozilla.org/show_bug.cgi?id=1367860).

<!-- 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/18244)
<!-- Reviewable:end -->
2017-08-25 17:30:22 -05:00
Kevin Hsieh
cfa98a3ab6 Update CSS fallback font when lang changes 2017-08-25 14:12:34 -07:00
bors-servo
dc8f26432f Auto merge of #18241 - canaltinova:font-feature-values-lookup, r=emilio,xidorn
stylo: Implement font feature values lookup

This PR reviewed by emilio and xidorn on bugzilla. That is backed out because of Windows build problems. Fixed and landing it again.

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

<!-- 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/18241)
<!-- Reviewable:end -->
2017-08-25 15:45:03 -05:00
Bobby Holley
be67bb87d4 Revert rayon stack limits until we sort out the crashtest bustage. 2017-08-25 12:32:24 -07:00
Nazım Can Altınova
d1f5140c2b Update bindings 2017-08-25 12:03:40 -07:00
Nazım Can Altınova
81be90cce2 Implement font feature values lookup for stylo 2017-08-25 12:03:38 -07:00
Nazım Can Altınova
4bdca9a312 Convert the @font-feature-values declarations to lowercase
The @font-feature-values declaration identifiers are asci case insensitive.
We should convert all of them to lowercase to be able to reduce the same
declarations. Also gecko stores them as lowercase in gfxFontFeatureValueSet.
2017-08-25 12:03:32 -07:00
Bobby Holley
707ab455bb Eliminate the sequential/traversal parallel distinction in favor of a unified adaptive driver.
MozReview-Commit-ID: ADVTNJntzmp
2017-08-25 10:00:27 -07:00
Bobby Holley
f7c6b2f04e Switch to an iterator for traverse_nodes.
We can't use a slice anymore, because the input might be the VecDeque from the
sequential traversal, which requires an iterator to handle the ring buffer.

MozReview-Commit-ID: JwH6MtRgMfY
2017-08-25 10:00:21 -07:00
Bobby Holley
2908b52c7b Stop storing depth per-node in the sequential traversal.
This has two advantages:
* It allows us to store nodes in the same format that the parallel traversal uses.
* It allows us to double the size of the sequential work queue without increasing
  the storage, which allows us to have WORK_UNIT_MAX * 2 entries before heap-
  allocating, which is about what we want for adaptive mode.

MozReview-Commit-ID: 6VQwGfTQgct
2017-08-25 10:00:15 -07:00