Commit graph

3509 commits

Author SHA1 Message Date
bors-servo
b428a94326 Auto merge of #16962 - hiikezoe:prefixed-intrinsic-size-value, r=Manishearth
Prefixed intrinsic size value

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

This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1355402
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #16788
- [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/16962)
<!-- Reviewable:end -->
2017-05-22 01:46:01 -05:00
Hiroyuki Ikezoe
36a87bc19d Update bindings. 2017-05-22 07:30:47 +09:00
Hiroyuki Ikezoe
e7b777384c Drop initial values of properties other than font-size and font-family in serialization of canvas font attribute.
According to the canvas spec [1], we must drop initial values other than
font-size and font-family when we serialize canvas font attribute.
As for font-size and font-family, the default values, '10px sans-serif' [2]
are not dropped at all.

[1] https://html.spec.whatwg.org/multipage/scripting.html#dom-context-2d-font
[2] https://html.spec.whatwg.org/multipage/scripting.html#canvastextdrawingstyles
2017-05-22 07:16:23 +09:00
Hiroyuki Ikezoe
7330dab51f Factor out PropertyDeclaration only iterator. 2017-05-22 07:16:23 +09:00
bors-servo
d40b26202d Auto merge of #16988 - emilio:backout, r=emilio
Revert "Auto merge of #16976 - upsuper:bug1366247, r=nox" for breaking the world.

This reverts commit 3d40b516c8, reversing
changes made to 255387a915.

<!-- 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/16988)
<!-- Reviewable:end -->
2017-05-21 15:40:41 -05:00
Emilio Cobos Álvarez
1f7d48f564
Revert "Auto merge of #16976 - upsuper:bug1366247, r=nox"
This reverts commit 3d40b516c8, reversing
changes made to 255387a915.
2017-05-21 21:29:50 +02:00
bors-servo
460c90af8d Auto merge of #16956 - mbrubeck:cleanup, r=Manishearth
stylo: Use correct counts when copying from image layers.

---

- [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 they are code cleanup.

<!-- 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/16956)
<!-- Reviewable:end -->
2017-05-21 14:09:52 -05:00
bors-servo
0566c60157 Auto merge of #16984 - emilio:lop-parsing-mode, r=canaltinova
Bug 1365629: Respect parsing mode in LengthOrPercentage. r=canaltinova

<!-- 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/16984)
<!-- Reviewable:end -->
2017-05-21 10:36:54 -05:00
Emilio Cobos Álvarez
911d307f8f
Bug 1365629: Respect parsing mode in LengthOrPercentage. r=canaltinova 2017-05-21 17:02:42 +02:00
bors-servo
a25b1e5fe3 Auto merge of #16973 - servo:derive-all-the-things, r=emilio
Derive ToComputedValue

<!-- 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/16973)
<!-- Reviewable:end -->
2017-05-21 08:48:10 -05:00
Anthony Ramine
07c0456cfd Derive ToComputedValue
For now, only impls for types like in style::values::generics can be derived.

This also needed a few ToComputedValueAsSpecified impls that I would like to
replace by some #[to_computed_value(clone)] attribute, but I think it is ok
to keep it like this for now.
2017-05-21 15:31:17 +02:00
bors-servo
3d40b516c8 Auto merge of #16976 - upsuper:bug1366247, r=nox
Add sugar for already_AddRefed

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

<!-- 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/16976)
<!-- Reviewable:end -->
2017-05-21 05:28:58 -05:00
bors-servo
255387a915 Auto merge of #16945 - hiikezoe:update-css-animations-by-css-rule-changes, r=birtles,heycam
Update css animations by css rule changes

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

- [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/16945)
<!-- Reviewable:end -->
2017-05-21 03:07:47 -05:00
Xidorn Quan
e30e676658 Update binding file. 2017-05-21 18:03:48 +10:00
Xidorn Quan
2b1f7f6081 Add sugar for already_AddRefed and use it for conversion between Atom and nsIAtom pointer. 2017-05-21 18:03:47 +10:00
Hiroyuki Ikezoe
9f0964fe1b Update bindings. 2017-05-21 15:50:41 +09:00
Hiroyuki Ikezoe
6a72b66e7b Create a SequentialTask for updating CSS animations in the case where the traversal is triggered by CSS rule changes. 2017-05-21 15:18:15 +09:00
Hiroyuki Ikezoe
dd29fc1f68 Add a new TraversalRestyleBehavior that represents the traversal is triggered by CSS rule changes.
And propagate the new flag to servo if mRestyleForCSSRuleChanges is set.
2017-05-21 15:18:15 +09:00
bors-servo
f14eeb00c0 Auto merge of #16971 - bholley:fix_parallelism, r=emilio
Rewrite parallel.rs

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

<!-- 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/16971)
<!-- Reviewable:end -->
2017-05-21 01:12:22 -05:00
Bobby Holley
a182ae46f6 Rewrite parallel.rs to be not slow. 2017-05-21 07:45:39 +02:00
bors-servo
1602edb04a Auto merge of #16975 - emilio:bindgenupagain, r=upsuper
style: Bump bindgen version.

This should fix bug 1365488, and also the template instantiation test noise
reported at https://github.com/servo/rust-bindgen/issues/619.

<!-- 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/16975)
<!-- Reviewable:end -->
2017-05-20 23:03:53 -05:00
bors-servo
03fbea4ec8 Auto merge of #16972 - emilio:sanity-is-important-most-of-the-time, r=bholley
style: Move all the style sharing code outside matching.rs

This is just a code health change. I want to move it away to keep matching.rs as
simple as possible.

<!-- 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/16972)
<!-- Reviewable:end -->
2017-05-20 21:11:38 -05:00
Emilio Cobos Álvarez
6b5beb389c
style: Bump bindgen version.
This should fix bug 1365488, and also the template instantiation test noise
reported at https://github.com/servo/rust-bindgen/issues/619.
2017-05-21 04:05:16 +02:00
Emilio Cobos Álvarez
311c403522
style: Move all the style sharing code outside matching.rs
This is just a code health change. I want to move it away to keep matching.rs as
simple as possible.
2017-05-21 02:30:51 +02:00
bors-servo
dbd4adf3b2 Auto merge of #16950 - servo:warn, r=nox
Fix warning in a future compiler version.

(Do not upgrade yet because of https://github.com/rust-lang/rust/issues/42101)

<!-- 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/16950)
<!-- Reviewable:end -->
2017-05-20 19:28:59 -05:00
Hiroyuki Ikezoe
d06af8971d Support prefixed intrinsic size value for flex-basis.
auto() and zero() are used in the parser for flex shorthand property.
2017-05-21 08:33:12 +09:00
Hiroyuki Ikezoe
3a3bc03eb8 Support prefixed intrinsic size value for {width,height,{inline,block}-size}}. 2017-05-21 08:33:12 +09:00
Hiroyuki Ikezoe
aba0db0943 Factor out implemantations for {min,max} size properties as a macro. 2017-05-21 08:33:12 +09:00
Hiroyuki Ikezoe
57c27e5d35 Rename MinLength to MozLength.
So that we can reuse this for non-min-prefixed properties (e.g. width).
2017-05-21 08:33:12 +09:00
Hiroyuki Ikezoe
95bda2dff9 Combine LengthOrPercentage and Auto into LengthOrPercentageOrAuto for {Min,Max}Length. 2017-05-21 08:33:12 +09:00
Emilio Cobos Álvarez
a12996f030
style: Make a bloom filter arrive to restyle hint computation. 2017-05-21 00:12:16 +02:00
Emilio Cobos Álvarez
1cea4e7942
style: Use a SmallVec for common ancestors in the bloom filter. 2017-05-21 00:08:00 +02:00
Anthony Ramine
cb2e04acf6 Remove style::values::HasViewportPercentage reexport 2017-05-20 22:00:05 +02:00
bors-servo
05a26a2996 Auto merge of #16967 - emilio:after, r=heycam,emilio
Bug 1366144: Correctly diff ::before and ::after pseudo-element styles if there's no generated content. r=heycam

<!-- 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/16967)
<!-- Reviewable:end -->
2017-05-20 13:44:31 -05:00
bors-servo
4f0b24ac0c Auto merge of #16960 - servo:derive-all-the-things, r=emilio
Derive HasViewportPercentage 🍷

<!-- 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/16960)
<!-- Reviewable:end -->
2017-05-20 11:34:36 -05:00
Cameron McCormack
b46e196fa9
style: Generate RestyleHints to selector match at specific descendant depths. 2017-05-20 16:28:12 +02:00
Cameron McCormack
178939d8ce
style: Record in RestyleHints how far down the tree selector matching must be re-run. 2017-05-20 16:28:11 +02:00
Cameron McCormack
a397590838
style: Refactor RestyleHint to be a struct.
Later PRs will add additional data to it that is not so easy to
represent using bitflags.
2017-05-20 16:28:09 +02:00
Cameron McCormack
c13be5cd13
style: List the matched rules with trace-level logging is enabled. 2017-05-20 16:27:06 +02:00
Cameron McCormack
8b7a414b1c
style: Use RestyleDamage to determine whether we must continue cascading style changes to children. 2017-05-20 16:25:39 +02:00
Cameron McCormack
715d18d377
style: Add an outparam to Gecko_CalcStyleDifference that returns whether any style data changed. 2017-05-20 16:21:00 +02:00
Emilio Cobos Álvarez
605974a112
Bug 1366144: Correctly diff ::before and ::after pseudo-element styles if there's no generated content. r=heycam
MozReview-Commit-ID: BHSxMJd0G0O
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-20 16:20:59 +02:00
bors-servo
3ca7f4fc92 Auto merge of #16961 - emilio:bloom-simplify, r=heycam
style: Move some bloom filter code outside of matching.rs

Also simplify it, while we're at 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/16961)
<!-- Reviewable:end -->
2017-05-20 09:15:27 -05:00
Anthony Ramine
00bfc6b172 Remove a lot of unused imports 2017-05-20 15:23:19 +02:00
Anthony Ramine
90bae7f802 Derive HasViewportPercentage 🍷 2017-05-20 14:48:04 +02:00
bors-servo
5a012cc9b1 Auto merge of #16963 - BorisChiou:stylo/animation/omta, r=emilio
stylo: Bug 1334036 - Enable animations running on compositor.

These are interdependent patches of Bug 1334036, which enables off-main thread animations. We add one FFI to get the property id set which overriding animations, so we can make sure the cascade result is correct for off-main thread animations.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1334036](https://bugzilla.mozilla.org/show_bug.cgi?id=1334036)
- [X] These changes do not require tests because we support off-main thread animation only on Gecko, and there are enough test cases there.

<!-- 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/16963)
<!-- Reviewable:end -->
2017-05-20 07:24:21 -05:00
Boris Chiou
10a1b8281d Trigger animation-only restyle without normal restyle.
In some cases, e.g. mouse event, we need to request an animation-only restyle
to force flush all throttled animations when we handle an event with
coordinates. This restyle shouldn't trigger a normal restyle, and add a
different traversal flag, TraversalRestyleBehavior::ForAnimationOnly, to check.
2017-05-20 20:05:08 +08:00
Boris Chiou
fe028e045a Use &[ComputedOperation] as the argument type of convert_transform.
Therefore, we don't need to clone the vector.
2017-05-20 20:05:07 +08:00
Boris Chiou
013b4a7fd0 Handle None transform properly.
If the transform is None, we should return a valid None transform.
2017-05-20 20:05:05 +08:00
Boris Chiou
63dc43648e Trigger restyle if important rules are changed.
If we add/remove important rules, we may need to update a list of all important
rules (in Gecko) which overrides animation properties. Therefore, we need to
set a flag if we update the primary rules which includes important ones.

If we have animations on this element, we update its effect properties, and
also send a task to update cascade results.

Calling get_properties_overriding_animations() might cases some impact
on performance because we need to walk the rule tree, so if possible, we could
just store this set into TNode to avoid finding the properties for both old
and new rules each time. This could be a future work if necessary.
2017-05-20 20:04:56 +08:00