Commit graph

16155 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
1572bd0948
style: Don't use SmallVec::into_iter to move into another vector.
See bug 1374848 for why.
2017-06-21 01:39:15 +02:00
Hiroyuki Ikezoe
6c69771ea5 Use FnvHashmap instead of HashMap for AnimationValueMap. 2017-06-21 08:36:48 +09:00
Emilio Cobos Álvarez
8a9949f929
style: Update bindings. 2017-06-21 01:27:16 +02:00
Emilio Cobos Álvarez
e8db09766d
style: Update bindgen. 2017-06-21 01:27:14 +02:00
Glenn Watson
206fb3eb7f Update WR (z-buffer fix, border-image fill support). 2017-06-21 06:21:08 +10:00
Brad Werth
c617649e67 Add an update_stylesheet method to StylesheetSet.
MozReview-Commit-ID: KlRkApYL8wk
2017-06-20 12:24:39 -07:00
Bobby Holley
1c7f2a9f09 Account for left-to-right rather than right-to-left precedence of classes in selector maps.
MozReview-Commit-ID: 8qIl4k3RxaC
2017-06-20 11:59:12 -07:00
Simon Sapin
7f4c846321 Less unsafe in selectors::builder.
MozReview-Commit-ID: 7IIyio8WAa7
2017-06-20 11:59:11 -07:00
Bobby Holley
1104cdc580 Invert the order of each compound selector.
MozReview-Commit-ID: JkBjqyYgbrB
2017-06-20 11:59:11 -07:00
Bobby Holley
1fc1d64e80 Hoist specificity computation into a new private builder module.
This patch doesn't modify any of the code because making a few things pub. I
did this first to make the next patch easier to audit.

MozReview-Commit-ID: 7PYxoS5bVGN
2017-06-20 11:59:11 -07:00
Bobby Holley
1d242ad760 Store selectors in matching order, rather than parse order.
We add a slow in-place reverse during parsing to achieve this for now, which
gets fixed up later on.

MozReview-Commit-ID: 42QkOzSgV3T
2017-06-20 11:59:10 -07:00
Bobby Holley
fac5aeb092 Stop creating unnecessarily-large SmallVecs for specific tasks.
MozReview-Commit-ID: IM9aAjSeJI9
2017-06-20 11:59:10 -07:00
Bobby Holley
db8f59407f Hoist sink into selectors.
It probably makes more sense (eventually) to put it in SmallVec.

MozReview-Commit-ID: AIBKCLiMNN2
2017-06-20 11:59:10 -07:00
Bobby Holley
2159d48382 Stop using parse_compound_selector for negation parsing.
This makes the code easier to work with, and fixes a bug where we don't currently
reject pseudo-elements within :not().

MozReview-Commit-ID: Cgl9w0PBsN3
2017-06-20 11:59:09 -07:00
Connor Brewster
2ccf729aa3 Fix crash when id attribute is set via SetAttributeNode 2017-06-20 10:34:33 -06:00
bors-servo
b50cf33efd Auto merge of #17431 - emilio:restyle-hints-xbl, r=emilio
style: Cleanup after #17427, and remove extra-optimistic optimization added in #17429.

This just addresses my review comments in #17427, and removes a wrong optimization I added in #17429 thinking it was correct.

<!-- 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/17431)
<!-- Reviewable:end -->
2017-06-20 08:13:05 -07:00
Emilio Cobos Álvarez
ce9cd802de
style: Clean up after #17427. 2017-06-20 15:42:23 +02:00
Emilio Cobos Álvarez
84a8bbc8a6
style: Remove extra-optimistic optimization.
We can't really do this :(
2017-06-20 15:36:16 +02:00
Fernando Jiménez Moreno
632c5571a9 stylo: make font-weight descriptor in @font-face preserve keyword values 2017-06-20 15:28:39 +02:00
bors-servo
fc2c5b7ef4 Auto merge of #17402 - servo:derive-all-the-things, r=emilio
Use generics for the filter property

<!-- 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/17402)
<!-- Reviewable:end -->
2017-06-20 06:23:17 -07:00
Pyfisch
a34d8c7fa9 Make background gradient cover padding
CSS-gradients should not only cover the content of an
element but also the padding (but not the border).

Add a reftest.
2017-06-20 14:35:02 +02:00
bors-servo
b2549bb6c4 Auto merge of #17427 - CJKu:cku-master, r=emilio
Stylo: Correct style match for element instances under a use-element …

<!-- Please describe your changes on the following line: -->
This patch is the last one of bug 265894.
It fixes two things:
1. Do not cross shadow tree boundary while matching rules.
2. Change display value to 'inline' while cloning a root symbol element instance.

Bugzilla link:
https://bugzilla.mozilla.org/show_bug.cgi?id=265894
---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] 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/17427)
<!-- Reviewable:end -->
2017-06-20 05:17:45 -07:00
Anthony Ramine
6f4061d4ad Use generics for the filter property
This introduces an additional shadow type for drop-shadow().
2017-06-20 13:48:53 +02:00
bors-servo
f5a61684f4 Auto merge of #17429 - emilio:restyle-hints-xbl, r=heycam
style: Get restyle hints right in presence of XBL.

Fixes bug 1371130.

<!-- 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/17429)
<!-- Reviewable:end -->
2017-06-20 04:15:57 -07:00
Emilio Cobos Álvarez
59a0d6616e
style: Update bindings. 2017-06-20 13:09:38 +02:00
Emilio Cobos Álvarez
ae5a6c9c69
style: Get restyle hints right in presence of XBL.
Bug: 1371130
Reviewed-By: heycam
MozReview-Commit-ID: 56lMyXEYT1I
2017-06-20 13:09:36 +02:00
Emilio Cobos Álvarez
459b22a985
style: Invalidate style using the DOM tree, and scan pseudo-elements and NAC separately.
Bug: 1371130
Reviewed-By: heycam
MozReview-Commit-ID: IU1TbVf4Zz9
2017-06-20 12:17:54 +02:00
Emilio Cobos Álvarez
b894c361e0
style: expose methods to get ::before, ::after, and the other NAC.
Reviewed-By: heycam
Bug: 1371130

MozReview-Commit-ID: JVeQevmjI3j
2017-06-20 12:16:31 +02:00
bors-servo
40a3826dd6 Auto merge of #17414 - jyc:space-separator, r=nox
style: Have OneOrMoreSeparated replace OneOrMoreCommaSeparated.

**NOTE** The alternative for me is just to duplicate the ToCss code, which is not bad and is less code changed! Don't know what others would think, though. Looking for feedback!

A future patch series has some values that should be separated by spaces. This
allows us to re-use the code for serialization, but the types do get a little
clunky. The separator is now indicated with an associated type.

<!-- Please describe your changes on the following 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
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because they shoudl be tested by existing serialization code

<!-- 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/17414)
<!-- Reviewable:end -->
2017-06-20 03:08:11 -07:00
cku
727725ac3d Stylo: Correct style match for element instances under a use-element tree. 2017-06-20 18:07:36 +08:00
Shing Lyu
f6c652dd9c Convert -webkit-linear-gradient coordinate system for Stylo 2017-06-20 16:46:21 +08:00
Ting-Yu Lin
945c3e4a2b stylo: Fix has_author_specified_rules() for rules in XBL stylesheets (bug 1372062)
MozReview-Commit-ID: GBFgr5pqROk
2017-06-20 15:58:00 +08:00
KuoE0
436f112359 Bug 1370797 - Expose -moz-context-properties on stylo
MozReview-Commit-ID: 2yYuHuKe3Yu
2017-06-20 14:48:45 +08:00
bors-servo
4d997f0d0c Auto merge of #17422 - BorisChiou:stylo/animation/stop_flood_lighting_colors, r=hiro
stylo: Bug 1369625 - Make stop-color, flood-color, lighting-color animatable.

This is an interdependent patch of Bug 1369625. We make stop-color, flood-color, and lighting-color animatable by using IntermediateRGBA as the animation value type, just like 'color'
attribute. On the Gecko-side, we enable/add the reftest of them and update WPT expectations for these properties.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1369625](https://bugzilla.mozilla.org/show_bug.cgi?id=1369625).
- [X] These changes do not require tests because we have tests already in Gekco.

<!-- 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/17422)
<!-- Reviewable:end -->
2017-06-19 23:12:19 -07:00
bors-servo
546c9db7a7 Auto merge of #17400 - hiikezoe:dont-do-normal-traversal-for-animation-only-restyle-element, r=heycam
Don't run normal traversal for animation only restyle element

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

---
<!-- 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/17400)
<!-- Reviewable:end -->
2017-06-19 20:19:16 -07:00
Boris Chiou
785ef82251 Make stop-color, flood-color, lighting-color animatable.
Use IntermediateRGBA as the animation value type, just like 'color'
attribute.
2017-06-20 10:43:50 +08:00
Glenn Watson
6c9e305442 Ensure that rAF callbacks which don't mutate the DOM, but aren't
yet considered spurious force a reflow / composite / animation tick cycle.
2017-06-20 12:42:14 +10:00
bors-servo
27add56298 Auto merge of #17418 - bzbarsky:dir-pseudo-classes, r=emilio
Add pseudo-classes to match on the state of the "dir" attribute.

Fixes the servo parts of Gecko bug 1373798 <https://bugzilla.mozilla.org/show_bug.cgi?id=1373798>

<!-- Please describe your changes on the following 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 https://bugzilla.mozilla.org/show_bug.cgi?id=1373798
<!-- Either: -->
- [ ] 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/17418)
<!-- Reviewable:end -->
2017-06-19 19:25:45 -07:00
Boris Zbarsky
0527190c8f Add pseudo-classes to match on the state of the "dir" attribute.
Fixes the servo parts of Gecko bug 1373798 <https://bugzilla.mozilla.org/show_bug.cgi?id=1373798>
2017-06-19 22:09:03 -04:00
bors-servo
154186f420 Auto merge of #17413 - est31:master, r=cbrewster
Update clipboard to 0.4

Fixes #17271
Fixes #16459

<!-- 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/17413)
<!-- Reviewable:end -->
2017-06-19 18:22:25 -07:00
bors-servo
fa72cd04d9 Auto merge of #17415 - KWierso:backout17409, r=jdm
Revert "Add pseudo-classes to match on the state of the "dir" attribute." for preventing me from backing out a gecko-side patch

The gecko patches in bug 1373798 broke some gecko-side tests, but they also fixed a stylo build failure that started when this commit merged from servo to autoland, so this needs to get reverted so I can cleanly back out those gecko patches.

This reverts commit e4660c2b5b.

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

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] 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/17415)
<!-- Reviewable:end -->
2017-06-19 17:21:29 -07:00
Jonathan Chan
26179b3660 style: Have OneOrMoreSeparated replace OneOrMoreCommaSeparated.
A future patch series has some values that should be separated by spaces. This
allows us to re-use the code for serialization, but the types do get a little
clunky. The separator is now indicated with an associated type.
2017-06-19 16:09:37 -07:00
Glenn Watson
c8255922a9 Improve decisions in compositor over when to draw a frame.
This patch fixes a couple of issues in the compositor:

1) Remove the delayed composition code. Previously, this would schedule
   a composite for 12ms in the future. This doesn't really make any sense
   with WR. There's no point in doing a composite unless WR has provided
   a new frame to be drawn. This fixes issues in several benchmarks where
   we were doing multiple composite / renders per rAF, which is a waste
   of CPU time. This *does* make the framerate slower in some cases (such
   as a slow rAF callback) but it's more correct - otherwise we were just
   compositing the same frame multiple times for no real benefit.

2) Inform the window of the current animation state of the compositor.
   Specifically, if an animation (or rAF) is currently active, the
   window system switches to use event polling, and does not block on
   the OS-level event loop. In the case of active animation, we just
   assume that we want to be running as the vsync interval and not
   blocking. This means the compositor thread only sleeps on vsync
   during animation, which reduces OS scheduling and results in much
   smoother animation.
2017-06-20 08:47:14 +10:00
Wes Kocher
10917ce73f Revert "Add pseudo-classes to match on the state of the "dir" attribute." for preventing me from backing out a gecko-side patch
This reverts commit e4660c2b5b.
2017-06-19 15:44:00 -07:00
bors-servo
d700a301d3 Auto merge of #17404 - zuwow:shrink-rulenode, r=bholley
Shrink rulenode

This shrinks rulenode by one word by removing the Option wrapper around the StyleSource and adding None to StyleSource as an additional variant. The issue mentions shrinking by two words but the free_count one was taken care of in #17368.

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

Also tested with `./mach test-unit` and `./mach test-stylo` with no errors reported from either.

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

r? @bholley

<!-- 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/17404)
<!-- Reviewable:end -->
2017-06-19 15:30:21 -07:00
est31
a1e9843d5a Update clipboard to 0.4
Fixes #17271
Fixes #16459
2017-06-20 00:29:28 +02:00
bors-servo
5f10a25ead Auto merge of #17410 - asajeffrey:compositor-nested-rAF-with-reftest-wait, r=jdm
Support nested requestAnimationFrame in the presence of reftest-wait

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

Currently, nested rAF callbacks don't get called in the presence of reftest-wait. This PR fixes that.

---
<!-- 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 #17408
- [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/17410)
<!-- Reviewable:end -->
2017-06-19 13:25:36 -07:00
Alan Jeffrey
eb0eceb16c Support nested requestAnimationFrame in the presence of reftest-wait. 2017-06-19 15:25:02 -05:00
Brian Lewis
0fe381d774 Remove Option wrapper from RuleNode's StyleSource to save one word, add
a None variant to StyleSource as an indicator for a lack of style
source, and refactor all uses with this new form
2017-06-19 21:50:56 +02:00
Pyfisch
284cb8aae8 Fix several bugs related to scrolling
* scrollLeft/scrollTop returned values of parent or even document root
   Only the scroll of the node itself is returned. Otherwise 0.0.
* Scrolling via script had set viewport.
   This resulted in other nodes appearing scrolled.
   Now scroll_offsets are updated with correct node id.

These bugs caused other odd behavior like both body and
document.documentElement being scrolled or the view for scrolled
elements jumping.
2017-06-19 21:43:35 +02:00