Commit graph

3960 commits

Author SHA1 Message Date
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
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
Brian Birtles
f8e2f85cdc Drop Servo_AnimationValueMap_Push 2017-06-15 10:10:51 +09:00
Emilio Cobos Álvarez
b741df3525
style: update bindgen. 2017-06-15 00:56:53 +02:00
bors-servo
d3cc41ceec Auto merge of #17315 - emilio:quadratic-serialization, r=SimonSapin
style: Avoid quadratic time serialization of a declaration block.

At least when the longhands aren't custom properties.

We should also look into not serializing the style attribute eagerly when it's
not needed... But a lot of code currently rely on attribute values being
dereferenciables to &str, so that's harder to fix.

We should really look into all those vectors around too, but that's probably
less urgent.

<!-- 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/17315)
<!-- Reviewable:end -->
2017-06-14 08:32:27 -07:00
Emilio Cobos Álvarez
5fbaf6da5f
style: Speed up LonghandId::is_longhand_of.
By looking at the shorthands, not the other way around, given a longhand uses to
not appear in multiple longhands.

This makes the testcase go to 430ms on my machine.

This could be even faster having a static LonghandIdSet per shorthand, I guess,
but this is not done in this PR.
2017-06-14 16:13:00 +02:00
Nicolas Silva
8617320500 Bump euclid to 0.14. 2017-06-14 16:00:59 +02:00
Emilio Cobos Álvarez
6e85601858
style: Avoid extra allocations in serialization of a property declaration block.
Concretely we avoid allocating and scanning a temporary vector of longhands not
yet serialized for each shorthand.

This doesn't save a lot of time in Linux, but I bet it's somewhat important on
OSX.
2017-06-14 15:39:28 +02:00
bors-servo
5dce166266 Auto merge of #17318 - aethanyc:fix-pseudo-xbl-stylesheet, r=emilio
stylo: Fix pseudo element matching for XBL stylesheets (Bug 1371577)

This change is reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1371577#c9

<!-- 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/17318)
<!-- Reviewable:end -->
2017-06-14 05:11:31 -07:00
bors-servo
8837c80540 Auto merge of #17317 - emilio:die-storedrestylehint-die, r=bholley
Kill StoredRestyleHint, and shrink RestyleData.

These are the already-reviewed parts of bug 1368236.
2017-06-14 04:16:24 -07:00
Emilio Cobos Álvarez
dc521b2799
style: Remove damage_handled, and use a reconstructed_ancestor bit instead.
Reviewed-By: bholley
Bug: 1368236
MozReview-Commit-ID: 8KK0YfhiS2
2017-06-14 13:15:00 +02:00
Emilio Cobos Álvarez
f9c268922d
style: Kill StoredRestyleHint.
Reviewed-By: bholley
Bug: 1368236
MozReview-Commit-ID: 43Cf0rJyhzO
2017-06-14 13:11:10 +02:00
bors-servo
63a5ab154e Auto merge of #17316 - upsuper:bug1371976, r=heycam
Resolve counter style during parallel traversal when possible

This is the Servo side change of [bug 1371976](https://bugzilla.mozilla.org/show_bug.cgi?id=1371976).
2017-06-14 03:07:27 -07:00
Xidorn Quan
08c12062c7 Resolve counter style during parallel traversal when possible. 2017-06-14 20:05:38 +10:00
Ting-Yu Lin
e80cb09be3 stylo: Fix pseudo element matching for XBL stylesheets (Bug 1371577)
MozReview-Commit-ID: GzWbztqW0V1
2017-06-14 17:58:15 +08:00
Emilio Cobos Álvarez
8b20d7a982
style: Avoid quadratic time serialization of a declaration block.
At least when the longhands aren't custom properties.

We should also look into not serializing the style attribute eagerly when it's
not needed... But a lot of code currently rely on attribute values being
dereferenciables to &str, so that's harder to fix.

We should really look into all those vectors around too, but that's probably
less urgent.
2017-06-14 11:41:01 +02:00
bors-servo
c6da6ba060 Auto merge of #17310 - chenpighead:stylo-font-variant, r=xidorn
stylo: support font-variant shorthand

From gecko bug: [Bug 1356134](https://bugzilla.mozilla.org/show_bug.cgi?id=1356134)

<!-- 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/17310)
<!-- Reviewable:end -->
2017-06-13 22:23:21 -07:00
Jeremy Chen
c7c753867b stylo: support font-variant shorthand.
We still count on Bug 1356124 to fix font-variant-alternates longhand, so we
can get font-variant shorthand work properly.

Some comments about Bug 1356124 have been removed, since this shorthand code
should just work once we fix Bug 1356124.

From gecko bug: Bug 1356134 (https://bugzilla.mozilla.org/show_bug.cgi?id=1356134)
2017-06-14 12:42:10 +08:00
bors-servo
3e0d70ba37 Auto merge of #17306 - mantaroh:paced, r=birtles
Return zero when computing distance of Option with both value is none.

<!-- Please describe your changes on the following line: -->
This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1371480

---
<!-- 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: -->
There are tests for these changes, a test case will be landed in reftests in https://bugzilla.mozilla.org/show_bug.cgi?id=1371480

<!-- 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/17288)
<!-- Reviewable:end -->
2017-06-13 21:28:48 -07:00
Jeremy Chen
97ef40ee88 stylo: make font-variant-* longhands parsing more tolerant.
Avoid early returning Err() in parsers, so we could let the the caller
of the parsers to handle the rest of input, and return error if it requires
parsing entirely.

The point is let returning Err() stay inside input.try(), so we can count
on input.try() to restore the position when parsing invalid idents.

From gecko bug: Bug 1356134 (https://bugzilla.mozilla.org/show_bug.cgi?id=1356134)
2017-06-14 12:22:37 +08:00
bors-servo
5b3fb62b09 Auto merge of #17305 - hiikezoe:restyle-kind-fix, r=emilio
Don't process RestyleKind::MatchAndCascade during animation-only rest…

…yle.

<!-- Please describe your changes on the following line: -->
https://bugzilla.mozilla.org/show_bug.cgi?id=1372335

---
- [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 it's for stylo

<!-- 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/17305)
<!-- Reviewable:end -->
2017-06-13 20:28:18 -07:00
Mantaroh Yoshinaga
95b272d9aa Return zero when computing distance of Option with both value is none. 2017-06-14 11:03:53 +09:00
Hiroyuki Ikezoe
8d519011d8 Don't process RestyleKind::MatchAndCascade during animation-only restyle. 2017-06-14 10:51:53 +09:00
Hiroyuki Ikezoe
6c5915068a AllowedNumericType.is_ok() takes ParingMode as well.
And it returns true if ParsingMode.allows_all_numeric_values is true regardless
of AllowedNumericType itself.
2017-06-14 09:52:06 +09:00
Hiroyuki Ikezoe
7341574b66 Make AllowedLengthType.is_ok() returning true if parsing mode allows all numeric values.
Even if the type is NonNegative and the given value is a negative.
2017-06-14 09:51:54 +09:00
Hiroyuki Ikezoe
8bfed4cb3c Move ParsingMode into style_traits. 2017-06-14 09:51:36 +09:00
bors-servo
849bdc958c Auto merge of #17294 - emilio:less-refcount-churn, r=bholley
style: Less refcount churn while inserting in the rule tree.

There's no need for it since we know no GC is happening while we're doing it.

<!-- 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/17294)
<!-- Reviewable:end -->
2017-06-13 13:01:16 -07:00
Emilio Cobos Álvarez
46d4128d1f
style: Less refcount churn while inserting in the rule tree.
There's no need for it since we know no GC is happening while we're doing it.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-06-13 22:00:22 +02:00
bors-servo
fe573c1ce9 Auto merge of #17299 - servo:derive-all-the-things, r=emilio
Revert "Derive ToCss for MozImageRect"

This reverts commit fe19c3810c.

<!-- 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/17299)
<!-- Reviewable:end -->
2017-06-13 09:31:19 -07:00
Anthony Ramine
8eec24cd46 Revert "Derive ToCss for MozImageRect"
This reverts commit fe19c3810c.
2017-06-13 18:00:29 +02:00
bors-servo
c4d7a3d95c Auto merge of #17296 - canaltinova:pseudo-quirk, r=bholley
Handle PseudoElement cases in :active and :hover quirk

Reviewed by bholley in bugzilla bug.

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

<!-- 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/17296)
<!-- Reviewable:end -->
2017-06-13 08:34:04 -07:00
Nazım Can Altınova
57d02dc0e9
Handle PseudoElement case in :active and :hover quirk 2017-06-13 17:22:39 +03:00
bors-servo
682af8bb19 Auto merge of #17293 - servo:derive-all-the-things, r=emilio
Derive two more ToCss impls

<!-- 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/17293)
<!-- Reviewable:end -->
2017-06-13 06:36:12 -07:00
bors-servo
07f6e11485 Auto merge of #17292 - emilio:better-style-invalidation, r=heycam
style: Implement a more fine-grained invalidation method.

<!-- 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/17292)
<!-- Reviewable:end -->
2017-06-13 04:56:09 -07:00