Commit graph

14747 commits

Author SHA1 Message Date
Cameron McCormack
36e4d0a511 style: Adjust display:contents to display:inline for NAC (including ::before/::after). 2017-06-16 09:37:57 +08:00
bors-servo
04935de3ea Auto merge of #17347 - duckinator:fix-issue-17319, r=mbrubeck
Fix setting img src before window.onload causing panic

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

Setting an image source asynchronously (e.g. using `setTimeout` or in the callback of an `XMLHttpRequest`) before `window.onload` fired would cause a panic due to a preexisting load blocker not being terminated before assigning a new one.

This PR fixes that and adds a test for it.

---
<!-- 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 #17319.

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

<!-- 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/17347)
<!-- Reviewable:end -->
2017-06-15 16:58:20 -07:00
bors-servo
8fd7dc80c4 Auto merge of #17340 - hinaria:master, r=jdm
windows: fix line height handling

hi there!

on windows, this change properly scales a font's line height by its size.

previously, line height was not scaled to the font's size at all, which meant line heights become worse and worse the further you scaled away from the font's design size (in either direction, larger or smaller).

this change makes the `line_gap` ratio and size scale with the font size. i've hand checked that the new computed `line_gap` matches the effective heights in chrome and firefox when `line-height = normal` for a bunch of system fonts. (servo's rendering quality on windows is a different story, though).

![demonstration](https://user-images.githubusercontent.com/975570/27185401-8e27023a-5228-11e7-8475-9e4223730d25.png)

i believe this also solves #16476.

---
- [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/17340)
<!-- Reviewable:end -->
2017-06-15 15:42:38 -07:00
Ellen Marie Dash
f2631c2010 Terminate current load blocker before reassignment
Fixes #17319.
2017-06-15 17:06:12 -04: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
0c53ba318a Auto merge of #17323 - ibmandura:issue16057, r=jdm
Avoid panic when reloading a page with mouse event handlers

This PR fixes issue #16057, by nullifying `topmost_mouse_over_target` inside of the `handle_exit_pipeline_msg` method, in case owner document is the same as the pipeline document that is being destroyed.

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

Testing was done manually, by running `./mach run (-r|-d) "http://localhost:8000/minimal.html" `, where `minimal.html` contains `<div onmouseover="location.reload()" onmouseout="this.clientLeft">hi there</div>`.

r?@jdm

<!-- 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/17323)
<!-- Reviewable:end -->
2017-06-15 12:36:19 -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
hinaria
ead828d992 scale line gap by em size 2017-06-15 23:46:17 +10: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
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
budaim
11fb9db7bf Fixing issue #16057 2017-06-14 17:06:11 +02: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
997608f11f Make BaseFlow::stacking_relative_position a vector. 2017-06-14 16:01:01 +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