Commit graph

3993 commits

Author SHA1 Message Date
Anthony Ramine
bc9bc1d340 Rename LengthOrPercentageOrAutoOrContent to FlexBasis 2017-06-17 13:46:35 +02:00
Anthony Ramine
a568f7752f Derive ToCss for some shorthand properties 2017-06-17 13:46:34 +02:00
Anthony Ramine
3a2e79274a Derive ToCss for keyword structs 2017-06-17 13:46:33 +02:00
Anthony Ramine
b0bc1d05a9 Derive ToCss for media query qualifiers 2017-06-17 13:46:32 +02:00
Anthony Ramine
3217d1404e Derive ToCss for font-face sources 2017-06-17 13:46:30 +02:00
Anthony Ramine
3ee6598abb Derive ToCss for some counter-style descriptors 2017-06-17 12:29:57 +02:00
Bobby Holley
ea81f36b1d Assert against permanently-leaked rule nodes.
MozReview-Commit-ID: CK5iEWWHFSr
2017-06-16 14:12:09 -07:00
Bobby Holley
e93b7fb3e8 Reuse the prev_sibling slot for free_count to save a word.
MozReview-Commit-ID: 9jVkDM4P8mC
2017-06-16 14:11:58 -07:00
Bobby Holley
65fc5a9bd5 Actually increment the counter when adding rule nodes to the free list.
MozReview-Commit-ID: 1uipYlIF8fv
2017-06-16 14:11:53 -07:00
bors-servo
81275234aa Auto merge of #17284 - jyc:custom-properties-cascade, r=emilio
Propagate changes in custom properties' computed values to descendants

If ComputedValues.custom_properties differs between the old and new
ComputedValues, indicate that we have to propogate changes to
descendants by setting child_cascade_requirement to
MustCascadeDescendants in cascade_primary.

style::matching::TElement::cascade_primary already calls
accumulate_damage, which eventually calls
ServoRestyleDamage::compute_style_difference in order to check if other
properties' computed values changed. If any of those change, we signal
that we need to propogate changes for inherited properties.

With Properties & Values, some custom properties will not be inherited,
and we will need to revisit this.

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

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/17284)
<!-- Reviewable:end -->
2017-06-16 11:04:51 -07:00
Simon Sapin
b83afdedc8 Upgrade cssparser to 0.15 2017-06-16 15:05:46 +02:00
Simon Sapin
605ef8b7ec Remove explicit dependencies on serde_derive 2017-06-16 13:58:21 +02:00
Bastien Orivel
76d8573393 Bump serde to 1.0 2017-06-16 13:31:18 +02:00
bors-servo
32f82959f8 Auto merge of #17353 - upsuper:counter-style-disc, r=dbaron
Make counter style 'disc' not overridable

This is the Servo side change for [bug 1372488](https://bugzilla.mozilla.org/show_bug.cgi?id=1372488).

<!-- 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/17353)
<!-- Reviewable:end -->
2017-06-15 23:51:16 -07:00
Xidorn Quan
38a0824ccd Bug 1372488 - Make counter style 'disc' not overridable. 2017-06-16 16:39:52 +10:00
bors-servo
4d54f2c9bb Auto merge of #17351 - heycam:nit, r=emilio
style: Tweak an import.

<!-- 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/17351)
<!-- Reviewable:end -->
2017-06-15 22:50:53 -07:00
Cameron McCormack
4315cecdf4 style: Tweak an import. 2017-06-16 11:31:45 +08:00
bors-servo
33766b2714 Auto merge of #17348 - emilio:bup, r=bholley
style: Inline RestyleData.

Bug: 1368236
MozReview-Commit-ID: 49s3SO0PMHf

<!-- 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/17348)
<!-- Reviewable:end -->
2017-06-15 20:28:56 -07:00
Cameron McCormack
36e4d0a511 style: Adjust display:contents to display:inline for NAC (including ::before/::after). 2017-06-16 09:37:57 +08:00
Emilio Cobos Álvarez
ffc45e9aaa
style: Inline RestyleData.
Bug: 1368236
MozReview-Commit-ID: 49s3SO0PMHf
2017-06-16 03:36:18 +02:00
bors-servo
0142d193a3 Auto merge of #17338 - servo:derive-all-the-things, r=emilio,waffles
Derive ToCss for computed LengthOrPercentage types

<!-- 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/17338)
<!-- Reviewable:end -->
2017-06-15 13:37:04 -07:00
bors-servo
d903bd883e Auto merge of #17341 - emilio:bup, r=bholley
style: Bindgen bump.

To grab https://github.com/servo/rust-bindgen/pull/752.

<!-- 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/17341)
<!-- Reviewable:end -->
2017-06-15 11:34:12 -07:00
Emilio Cobos Álvarez
33466fe914
style: Bindgen bump. 2017-06-15 19:54:38 +02:00
bors-servo
6ec95ecb9f Auto merge of #17334 - bholley:breadth_first_traversal, r=emilio
Make the traversal work better with the style sharing cache

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

<!-- 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/17334)
<!-- Reviewable:end -->
2017-06-15 10:34:49 -07:00
Anthony Ramine
16afa6ea58 Derive ToCss for computed LengthOrPercentage types 2017-06-15 16:59:04 +02:00
Anthony Ramine
608e7f71a2 Make computed types hold Percentage instead of bare CSSFloat 2017-06-15 16:59:03 +02:00
Anthony Ramine
9f03553ed5 Use CustomIdent in GridLine 2017-06-15 14:15:19 +02:00
Anthony Ramine
ad79a19587 Derive ToCss for TransitionProperty 2017-06-15 13:08:31 +02:00
Anthony Ramine
51a4481388 Use CustomIdent for transition-property 2017-06-15 13:03:23 +02:00
Anthony Ramine
cdcc8157c6 Use CustomIdent in will-change 2017-06-15 13:00:59 +02:00
bors-servo
b0392dbf39 Auto merge of #17324 - ferjm:bug1371393.column, r=SimonSapin
stylo: set location for NestedRuleParser during prelude parsing

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

<!-- 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/17324)
<!-- Reviewable:end -->
2017-06-15 01:36:22 -07:00
Fernando Jiménez Moreno
7334298f30 stylo: set location for NestedRuleParser during prelude parsing 2017-06-15 10:26:42 +02:00
Bobby Holley
fe7191568c Use ArrayVec and tweak the SmallVec sizes.
MozReview-Commit-ID: 1tEZiPdp9WQ
2017-06-14 22:50:44 -07:00
Bobby Holley
c6d0ef5e9f Eliminate an unnecessary heap allocation.
MozReview-Commit-ID: 4cleAH0JsKK
2017-06-14 22:50:39 -07:00
Bobby Holley
f04c25c33c Don't do recursive tail calls if there's work in the queue.
MozReview-Commit-ID: 8JEdjqAIYmQ
2017-06-14 22:50:33 -07:00
Bobby Holley
ce19c949db Enable breadth-first traversal.
MozReview-Commit-ID: KJA2drcLTb5
2017-06-14 22:50:27 -07:00
bors-servo
09b8f124f5 Auto merge of #17331 - birtles:animate-display, r=hiro
Support animation of the display property

These are the Servo-side changes of [Mozilla bug 1371518](https://bugzilla.mozilla.org/show_bug.cgi?id=1371518).

These changes have been reviewed by @hiikezoe.

<!-- 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/17331)
<!-- Reviewable:end -->
2017-06-14 20:17:47 -07:00
bors-servo
e0820c8654 Auto merge of #17332 - bholley:bump_rayon_0_8, r=glennw
Bump rayon to 0.8

<!-- 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/17332)
<!-- Reviewable:end -->
2017-06-14 19:12:30 -07:00
Bobby Holley
d5fb93d487 Bump rayon to 0.8.
MozReview-Commit-ID: 8OFE5PghMzl
2017-06-14 18:52:05 -07:00
Brian Birtles
e6bd750702 Make 'display' animatable
But not by CSS animations or Web Animations.
2017-06-15 10:21:08 +09:00
Brian Birtles
d249c61c0d Add IsTransitionable FFI 2017-06-15 10:20:46 +09:00
Brian Birtles
479c3e4528 Move nscssproperty_id_is_animatable together with the other animatable-related code
Now we have AnimatableLonghand (to do with animatability) and
TransitionProperty (to do with transitionability), we should move
nscssproperty_id_is_animatable to be part of the former group.
2017-06-15 10:20:16 +09:00
Brian Birtles
e74f7792f5 Make TransitionProperty treat all properties that are not transitionable as unsupported
Currently properties that are discretely animated cannot be
transitioned. Now that TransitionProperty should only be used for
transitions, we can redefine it to treat non-transitionable properties
as unsupported. This should allow us to simplify the code and make it
more self-documenting (e.g. making TransitionProperty actually relate to
transitions).
2017-06-15 10:19:48 +09:00
Brian Birtles
5ce7b1cc55 Move is_discrete from TransitionProperty to AnimatableLonghand 2017-06-15 10:19:22 +09:00
Brian Birtles
a2307adf46 Convert AnimationValue::from_computed_values to take an AnimatableLonghand 2017-06-15 10:18:55 +09:00
Brian Birtles
8f3dad598f Use AnimatableLonghand for AnimationValueMap and related code
In the next few patches we move all non-transition related code over to
using AnimatableLonghand instead of TransitionProperty. This will allow
us to re-purpose TransitionProperty to represent only properties that
can be transitioned (i.e. excluding discrete properties) as well as
simplifying the code by removing the need to deal with shorthands and
the "all" value in places that do not need to handle those values.
2017-06-15 10:18:18 +09:00
Emilio Cobos Álvarez
b41f741f5b
style: Avoid some branches in common RuleIterator::next cases.
I saw this function appear in the profiles at #17329.

It was under set_device, which isn't a Stylo path, but probably worth there
anyway.

This reduces the reported overhead of RulesIterator::next in perf from ~8% to
0.46%
2017-06-15 03:14:08 +02:00
Brian Birtles
9c3c954aa2 Introduce AnimatableLonghand type
This type, which we will use in the next patch in this series, can
represent only longhands whose animation type is not "none". By
introducing this type, we can later restrict the meaning of
TransitionProperty to only cover properties whose animation type is not
"none" OR "discrete" (since currently CSS transitions should not animate
properties whose animation type is discrete).  Doing so will also mean
that CSS transitions ignore the 'display' property by default.

Furthermore, introducing this type will allow the animation code to
clearly document when a property is allowed to be a shorthand or
unanimatable property and when it is expected to be an animatable
longhand. This, in turn, will allow us to remove a few
no-longer-necessary checks and simplify the code.
2017-06-15 10:13:04 +09:00
Brian Birtles
c1bf6d3efc Only include shorthands with at least one animatable component in TransitionProperty
This allows simplifying the code somewhat and means we can ignore
unanimated shorthands a little sooner. Furthermore, it removes the odd
inconsistency where TransitionProperty only included animatable
longhands but allowed all shorthands regardless of whether or not they
were animatable.
2017-06-15 10:12:03 +09:00
Brian Birtles
09c2b1b930 Move definition of animatable for shorthands to Shorthand object
By moving this definition to the Shorthand object we can more easily
re-use it in subsequent patches in this series.
2017-06-15 10:11:34 +09:00