Commit graph

6718 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
040379208e
style: Implement GeckoElement::assigned_slot.
This allows to selector-match ::slotted, though we still don't parse it.

Bug: 1425755
Reviewed-by: heycam
MozReview-Commit-ID: ItELHkf2PMl
2018-01-08 19:01:41 +01:00
bors-servo
83a8891bd4 Auto merge of #18893 - emilio:bye-can-be-fragmented, r=SimonSapin
style: Remove TNode::set_can_be_fragmented and TNode::can_be_fragmented.

Replace them instead by a computed value flag, the same way as the
IS_IN_DISPLAY_NONE_SUBTREE flag works.

<!-- 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/18893)
<!-- Reviewable:end -->
2018-01-05 05:11:00 -06:00
bors-servo
6131371cc2 Auto merge of #19696 - upsuper:rule-cache-opt, r=emilio
Skip rule node which contains only inherited properties for rule cache

This is one possible fix for [bug 1427681](https://bugzilla.mozilla.org/show_bug.cgi?id=1427681) which tries to skip some rule nodes when using rule cache.

Try push for correctness: https://treeherder.mozilla.org/#/jobs?repo=try&revision=74e3941e2cfc5fba4bce839f2518af8a5a8b7411

It doesn't really show much memory saving on awsy. It only shows several KB save on fresh start memory. But since conceptually it's simple, I guess it's worth taking.

<!-- 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/19696)
<!-- Reviewable:end -->
2018-01-05 03:35:04 -06:00
bors-servo
97e3979741 Auto merge of #19693 - hiikezoe:drop-animation-name-and-transition-property-from-early-properties, r=boris
Drop animation name and transition property from early properties

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

<!-- 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/19693)
<!-- Reviewable:end -->
2018-01-04 22:14:18 -06:00
Xidorn Quan
3593392788 Skip rule node which contains only inherited properties for rule cache. 2018-01-05 11:29:01 +11:00
Hiroyuki Ikezoe
a4e687aedd Drop animation-name and transition-property from early properties
We don't need to calculate computed animation-name or transition-property prior
to other properties any more because we no longer fill out those other
properties values in response to animation-name or transition-property length
at the time when we calculate computed property values.
2018-01-05 07:02:05 +09:00
Hiroyuki Ikezoe
9b6c5da98f Don't fill out deficient animation/transition property values in the style struct 2018-01-05 07:02:05 +09:00
Hiroyuki Ikezoe
9c05bc92f8 Check each animation sub property count in animations_equals
In a subsequent patch, we will no longer fill out deficient property values in
mAnimations.
2018-01-05 07:02:05 +09:00
Hiroyuki Ikezoe
cd56223907 Call transition_combined_duration_at to get combined duration instead of calculating directly 2018-01-05 07:02:05 +09:00
Hiroyuki Ikezoe
18a99e50d8 Make transition_combined_duration_at consider duration and delay value are used by repeating the list of values if the given index is greater than the list length 2018-01-05 07:02:05 +09:00
lizhixun
aa1b9a25f6 style: Make Contain::parse simpler 2018-01-04 13:13:49 -08:00
Emilio Cobos Álvarez
3bbd80d3ab
style: Fix propagation of the can_be_fragmented bit on Servo.
This was bogus before, but seems like the right thing to do.
2018-01-04 14:48:28 +01:00
Emilio Cobos Álvarez
f3ea248188
style: Remove TNode::set_can_be_fragmented and TNode::can_be_fragmented.
Replace them instead by a computed value flag, the same way as the
IS_IN_DISPLAY_NONE_SUBTREE flag works.
2018-01-04 14:45:54 +01:00
Emilio Cobos Álvarez
10a1e1e15f
style: Simplify some ComputedValueFlags setters. 2018-01-04 14:45:38 +01:00
bors-servo
7a9f99eda8 Auto merge of #19682 - stevel98:moveContain, r=emilio
style: Move contain outside of mako

<!-- Please describe your changes on the following line: -->
Sub-PR for #19015.
---
<!-- 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 #19656 (github issue number if applicable).

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

<!-- 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/19682)
<!-- Reviewable:end -->
2018-01-04 04:28:23 -06:00
lizhixun
4c23f09934 style: Move contain outside of mako 2018-01-03 23:13:56 -08:00
bors-servo
f71fb8bddc Auto merge of #19654 - emilio:geckolib-nightly, r=jdm
style: Allow building stylo with rust nightly.

See individual commits for details.

<!-- 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/19654)
<!-- Reviewable:end -->
2018-01-03 12:01:42 -06:00
Emilio Cobos Álvarez
51e2942c25
style: Make GetFlattenedTreeParent more straight-forward.
Now that accessing nsIContent slots is not a blob of virtual function calls, we
should be able to unify logic here, and speed up the not-so-rare case for
chrome, while keeping the usual case fast.

Bug: 1427511
Reviewed-by: smaug
MozReview-Commit-ID: 87iY5Cbhx4T
2018-01-02 16:25:59 +01:00
CYBAI
a764d9065e style: Move display outside of mako 2018-01-01 23:51:08 +08:00
Emilio Cobos Álvarez
bab6077c1c
Revert #19666 since we do create NAC elements and expect them to be inline.
This reverts commit 1970e82b0d, reversing
changes made to e882660ea6.

The reparenting logic is still bogus, but I'll figure out how to deal with that
in a bit.
2017-12-31 17:00:26 +01:00
bors-servo
1970e82b0d Auto merge of #19666 - emilio:root-and-item, r=upsuper
style: Simplify the skip item based display fixup adjustment.

In practice the only NAC that possibly inherits from a grid or flex container
are pseudos.

In Gecko, if the root element is an item container, custom anon content would
also sometimes incorrectly inherit from that (see bug 1405635), but that's fixed
in Stylo.

We remove the IS_ROOT_ELEMENT blockification from the "skip display fixup"
check, since the root element is never NAC or anything like that, so there's no
need for the check.

This also fixes some reparenting fishiness related to pseudo-elements. We were
only skipping the fixup when reparenting anon boxes, not when reparenting normal
element styles, nor when reparenting other pseudo styles which are not anon
boxes.

<!-- 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/19666)
<!-- Reviewable:end -->
2017-12-31 07:01:10 -06:00
Emilio Cobos Álvarez
e464f5b020
style: Simplify the skip item based display fixup adjustment.
In practice the only NAC that possibly inherits from a grid or flex container
are pseudos.

In Gecko, if the root element is an item container, custom anon content would
also sometimes incorrectly inherit from that (see bug 1405635), but that's fixed
in Stylo.

We remove the IS_ROOT_ELEMENT blockification from the "skip display fixup"
check, since the root element is never NAC or anything like that, so there's no
need for the check.

This also fixes some reparenting fishiness related to pseudo-elements. We were
only skipping the fixup when reparenting anon boxes, not when reparenting normal
element styles, nor when reparenting other pseudo styles which are not anon
boxes.
2017-12-31 13:57:49 +01:00
bors-servo
e882660ea6 Auto merge of #19664 - emilio:dupe-slots, r=smaug
style: Stop duplicating slots.

Reland of #19660 since it was backed out for not landing its Gecko changes on time.

Bug: 1427001
Reviewed-by: smaug
MozReview-Commit-ID: Cq647BcOzbe

<!-- 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/19664)
<!-- Reviewable:end -->
2017-12-31 05:13:47 -06:00
Emilio Cobos Álvarez
e6623e23c1
style: Update bindings. 2017-12-31 10:02:47 +01:00
Emilio Cobos Álvarez
bc2ef519ca
style: Renumber CascadeFlags bits. 2017-12-31 09:17:00 +01:00
Emilio Cobos Álvarez
a747de1814
style: Simplify "prohibit display: contents" adjustment.
On top of #19661.

The NAC condition is pointless because NAC don't match author rules unless they
are a pseudo-element too.
2017-12-31 09:17:00 +01:00
Emilio Cobos Álvarez
dd1cef1a6c
style: Stop duplicating slots.
Bug: 1427001
Reviewed-by: smaug
MozReview-Commit-ID: Cq647BcOzbe
2017-12-31 09:01:55 +01:00
Gecko Backout
cf8b8db87d Backed out changeset dda1c7951937 for build bustage force-cargo-library-build. r=backout on a CLOSED TREE
Backs out https://github.com/servo/servo/pull/19660
2017-12-31 01:17:32 +00:00
bors-servo
d3f603ecba Auto merge of #19660 - emilio:dupe-slots, r=smaug
style: Stop duplicating slots.

Bug: 1427001
Reviewed-by: smaug
MozReview-Commit-ID: Cq647BcOzbe

<!-- 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/19660)
<!-- Reviewable:end -->
2017-12-30 17:31:38 -06:00
Emilio Cobos Álvarez
563da3a19c
style: Simplify ::-moz-fieldset-content special-casing.
The style adjuster knows about the pseudo, so there's no reason to thread that
info down.

There are more simplifications that can be done in followups, cleaning a bit the
cascade flags too, those will come later.
2017-12-30 22:08:04 +01:00
Emilio Cobos Álvarez
89e6d1d62e
style: Update bindings. 2017-12-30 20:14:13 +01:00
Emilio Cobos Álvarez
72e0bfa52f
style: Stop duplicating slots.
Bug: 1427001
Reviewed-by: smaug
MozReview-Commit-ID: Cq647BcOzbe
2017-12-30 12:36:52 +01:00
Emilio Cobos Álvarez
99dfc67d60
style: Specify the type of a pointer.
This avoids nightly warnings.
2017-12-29 19:17:29 +01:00
Emilio Cobos Álvarez
20a0d52598
style: Remove pointless assertion.
It's a reference, it's not going to be null, and if it was, it would've already
been UB on the caller.
2017-12-29 19:17:29 +01:00
CYBAI
05b014e720 style: Move touch-action outside of mako 2017-12-28 23:13:39 +08:00
bors-servo
d96fb89c31 Auto merge of #19641 - emilio:christmas-cleanup, r=cybai
style: Some trivial 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/19641)
<!-- Reviewable:end -->
2017-12-24 21:34:21 -06:00
Emilio Cobos Álvarez
a491ccac83
style: Some trivial cleanup. 2017-12-24 19:21:10 +01:00
Jon Leighton
53e868e203 Refactor ListStyleType 2017-12-23 21:24:46 +01:00
Jon Leighton
214b423bbd Move list-style-type outside of mako
Closes issue #19629
2017-12-23 13:01:30 +01:00
Emilio Cobos Álvarez
cdb604ae69
style: Make sure to honor parse_method in transition and animation shorthands.
Reviewed-by: birtles
Bug: 1426312
MozReview-Commit-ID: HY3jtdSdaga
2017-12-21 13:56:57 +01:00
bors-servo
df0f9ad7ae Auto merge of #19618 - upsuper:border-image-repeat, r=emilio
Convert NS_STYLE_BORDER_IMAGE_REPEAT_* to an enum class

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

<!-- 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/19618)
<!-- Reviewable:end -->
2017-12-21 01:34:04 -06:00
Xidorn Quan
11bd1bc38c Convert NS_STYLE_BORDER_IMAGE_REPEAT_* to an enum class. 2017-12-21 18:27:40 +11:00
Emilio Cobos Álvarez
974458cafc
style: Fix inheritance of animation and transition properties of mismatched length.
At least when the animation-name length is bigger than the animation properties,
we mess up inheritance and only set properly the specified counts, then don't
cycle it.

The nicer fix for this is making these vectors properly, and move the cycling
logic at used-value time (bug 1420928). Same for transitions.

Bug: 1426246
Reviewed-by: hiro
MozReview-Commit-ID: 3cguzIvfMFU
2017-12-21 06:14:17 +01:00
Emilio Cobos Álvarez
40b9d78a34
style: Remove needless and bogus bounds-check.
The check should read index >= self.len(). But it doesn't matter anyway since
we're covered by Rust's bound checks by default anyway.
2017-12-21 04:08:44 +01:00
Emilio Cobos Álvarez
79e0f19221
style: Workaround a likely valgrind false-positive. 2017-12-20 23:03:07 +01:00
Emilio Cobos Álvarez
b556ddbf55
style: Don't support a list of selectors in ::slotted yet.
Bug: 1425757
Reviewed-by: xidorn
MozReview-Commit-ID: G0I0gM2sWTh
2017-12-20 15:55:09 +01:00
Emilio Cobos Álvarez
a931789f37
style: Update bindings. 2017-12-19 20:47:16 +01:00
neerpancholi
9bea4baf6f
Bug 1417725 - (Servo) Add -moz-column-span alias for column-span property. 2017-12-19 10:33:46 +01:00
Manish Goregaokar
82e024913b stylo: Correctly handle interpolation where optional second argument for translate(), skew(), scale() exists in one but not the other
MozReview-Commit-ID: 59rNRAXBEN9
2017-12-18 18:45:25 -08:00
Emilio Cobos Álvarez
f6d0a14246
style: Don't adjust :visited styles.
As the comment says those are not interesting, and it matches what we do for
text and placeholders in Servo_ComputedValues_Inherit.

This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1425893
2017-12-18 22:48:02 +01:00