Commit graph

18335 commits

Author SHA1 Message Date
Anthony Ramine
f89ebf7fe9 Change AnimatedValue for NonNegativeNumber to CSSFloat 2018-02-13 16:12:30 +01:00
Anthony Ramine
da5acc81d2 Change AnimatedValue for NonNegativeLengthOrPercentage to its inner type 2018-02-13 16:12:29 +01:00
Anthony Ramine
b79dc269f7 Change AnimatedValue for PositiveInteger to CSSInteger 2018-02-13 16:12:29 +01:00
bors-servo
e0b38f9c49
Auto merge of #20025 - servo:derive-all-the-things, r=emilio
Merge similar arms in AnimationValue::from_declaration 🐉🐲

This slims that function by 12KB according to bloaty.

<!-- 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/20025)
<!-- Reviewable:end -->
2018-02-12 10:46:42 -05:00
bors-servo
3a42f6f988
Auto merge of #20030 - emilio:useless-return-is-useless, r=nox
style: Remove useless code after #19994

<!-- 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/20030)
<!-- Reviewable:end -->
2018-02-12 08:47:36 -05:00
Emilio Cobos Álvarez
9744840e5a
style: Remove useless code after #19994 2018-02-12 13:52:29 +01:00
bors-servo
889bb012ef
Auto merge of #20027 - emilio:bye-ordermap, r=nox
style: Back out ordermap.

It was worth a shot!

<!-- 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/20027)
<!-- Reviewable:end -->
2018-02-12 07:36:04 -05:00
Emilio Cobos Álvarez
25868beabd
style: Back out ordermap.
It was worth a shot!
2018-02-12 12:20:46 +01:00
bors-servo
63691f01d7
Auto merge of #20026 - emilio:less-stylist-xbl, r=upsuper
style: Use more CascadeData and less Stylist for XBL stuff.

Just some more use-cases that can be converted right away.

I'm trying to make XBL not use a whole Stylist, slowly...

<!-- 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/20026)
<!-- Reviewable:end -->
2018-02-12 06:03:30 -05:00
Emilio Cobos Álvarez
1bb6ce2c88
style: Use more CascadeData and less Stylist for XBL stuff.
Just some more uses of Stylist in XBL that can be converted right away.

I'm trying to make XBL not use a Stylist, slowly...
2018-02-12 11:25:24 +01:00
Anthony Ramine
18b9775173 Merge similar arms in AnimationValue::from_declaration 🐉🐲
This slims that function by 12KB according to bloaty.
2018-02-12 10:34:30 +01:00
bors-servo
9c94fe4279
Auto merge of #20017 - servo:derive-all-the-things, r=emilio
Optimise more AnimationValue methods 🐉🐲

```
__TEXT	__DATA	__OBJC	others	dec	hex
87101440	5226496	0	64122880	156450816	9534000	XUL.old
87072768	5226496	0	64122880	156422144	952d000	XUL.new
```

<!-- 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/20017)
<!-- Reviewable:end -->
2018-02-11 18:43:17 -05:00
Anthony Ramine
e2c674994a Use ascii_case_insensitive_phf_map in TransitionProperty::parse
This divides the size of this method by 30.
2018-02-12 00:42:34 +01:00
bors-servo
0653f3097c
Auto merge of #20019 - paavininanda:deriveToCss, r=emilio
Added derive(ToCss) annotation : WIP

<!-- 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/20019)
<!-- Reviewable:end -->
2018-02-11 14:10:48 -05:00
Nupur Baghel
8116962298 Added derive ToCss for Content and removed manual Impl 2018-02-12 00:35:56 +05:30
Emilio Cobos Álvarez
4913d9c900
style: Handle quirks-mode changes correctly.
The reason why bug 1355721 regressed this is because in non-e10s we definitely
flush before parsing the standards quirks-mode. And bug 1355721 introduced an
unconditional UpdateStylistIfNeeded, unless the counter style / font
equivalents.

That means that the stylist wouldn't remain on its initial state after the first
flush, which itself means that when the compat mode changed, the UA and user
rules were already on the stylist with the quirks mode keys. That makes
class-names be keyed in ascii lowercase.

After that no user style changed, so no rebuild happens for the cascade data in
the user origin, so we keep looking at the wrong keys indefinitely.

We should try to avoid the flush there and ensure that by the time we create a
pres shell the quirks mode is already up-to-date...

Bug: 1394233
Reviewed-by: xidorn
MozReview-Commit-ID: 25dD2bca3tN
2018-02-11 19:16:34 +01:00
Anthony Ramine
c92d0a8902 Implement Clone for AnimationValue by hand 🐉🐲
We use the same trick as in PropertyDeclaration::clone.
2018-02-11 09:47:14 +01:00
Anthony Ramine
b95b6c66f3 Implement PartialEq for AnimationValue by hand 🐉🐲
We use the same trick as in PropertyDeclaration::eq.
2018-02-11 09:38:37 +01:00
Jonathan Kew
81ecc25619 Remove reference to the Gecko pref svg.paint-order.enabled 2018-02-10 21:31:42 +00:00
bors-servo
2f4362e0c1
Auto merge of #20014 - servo:by-the-power-of-void, r=emilio
Optimise some AnimationValue methods for size 🐉🐲

This shaves 40KB off of libxul.

<!-- 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/20014)
<!-- Reviewable:end -->
2018-02-10 10:32:21 -05:00
Anthony Ramine
b9505ae72b Merge similar arms in AnimationValue::compute_squared_distance 🐉🐲
This uses the same trick as in PropertyDeclaration::eq.
2018-02-10 16:31:50 +01:00
Anthony Ramine
fc24cf34c5 Merge similar arms in AnimationValue::animate 🐉🐲
This uses the same trick as in PropertyDeclaration::eq and removes
roughly 10KB off of libxul.
2018-02-10 16:31:49 +01:00
Anthony Ramine
38520af970 Merge similar arms in AnimationValue::uncompute 🐉🐲
This uses the same kind of trick as PropertyDeclaration::clone and
removes 15KB off of libxul according to bloaty.
2018-02-10 16:31:48 +01:00
Anthony Ramine
aa7cc261f8 Determine animated types from specified types 2018-02-10 16:31:48 +01:00
Anthony Ramine
a90e660eac Kill AnimatedValueAsComputed 2018-02-10 16:31:47 +01:00
Anthony Ramine
57daf06c71 Make PropertyDeclaration::id and AnimationValue::id inline 2018-02-10 16:31:46 +01:00
Anthony Ramine
921d1aeeba Make AnimationValue::id be just a pointer cast 🐉🐲
Now that PropertyDeclaration and AnimationValue have the same discriminants,
that means the trick found in PropertyDeclaration::id can be done in
AnimationValue::id.
2018-02-10 16:31:45 +01:00
bors-servo
2cc75a783d
Auto merge of #20010 - emilio:pres-hints-cascade, r=bholley
style: Cascade pres hints after normal user rules.

Per https://drafts.csswg.org/css-cascade/#preshint and
https://html.spec.whatwg.org/#presentational-hints.

This was causing failures in the link color reftests with the preferences sheet
as a User sheet.

Bug: 1436782
Reviewed-by: bholley
MozReview-Commit-ID: 9iwEqPBw4CF

<!-- 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/20010)
<!-- Reviewable:end -->
2018-02-10 07:46:38 -05:00
Emilio Cobos Álvarez
69c018c70d
style: Cascade pres hints after normal user rules.
Per https://drafts.csswg.org/css-cascade/#preshint and
https://html.spec.whatwg.org/multipage/#presentational-hints.

This was causing failures in the link color reftests with the preferences sheet
as a User sheet.

Bug: 1436782
Reviewed-by: bholley
MozReview-Commit-ID: 9iwEqPBw4CF
2018-02-10 13:12:30 +01:00
bors-servo
0098d51903
Auto merge of #20011 - emilio:cleanup-for-declarations-stuff, r=Manishearth
style: Tidy Stylist::compute_for_declarations.

<!-- 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/20011)
<!-- Reviewable:end -->
2018-02-10 06:45:52 -05:00
Anthony Ramine
79775541f2 Make AnimationValue have the same variants as PropertyDeclaration
By making AnimationValue have the same representation as PropertyDeclaration
and Void variants for non-animatable properties, we know by constructions
that all properties have the same discriminant in both.
2018-02-10 12:37:30 +01:00
Xidorn Quan
b9ef2bbdd5 Return whether property was removed from Servo_DeclarationBlock_RemoveProperty. 2018-02-10 19:58:30 +11:00
Emilio Cobos Álvarez
8e3da86636
style: Tidy Stylist::compute_for_declarations. 2018-02-10 03:39:56 +01:00
bors-servo
6b1a74672d
Auto merge of #20004 - emilio:author-sheet-collection, r=nox
style: Add infrastructure to have a standalone author stylesheet collection

Right now Gecko uses a whole `Stylist` for stuff like XBL / Shadow DOM.

That's not great, because it has tons of unrelated logic, and also eats up a lot of memory. Also, it prevents us to optimize style changes in shadow hosts the same way we do for the document.

These patches mostly rejigger stuff around so that you can define a `DocumentStylesheetSet` and then an `AuthorStylesheetSet`, which would contain just the Shadow DOM sheets / XBL resource sheets.

It still doesn't introduce any use for the later, but that will come later.

There's a patch in this PR that requires Gecko changes, posted in https://bugzilla.mozilla.org/show_bug.cgi?id=1436798.

<!-- 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/20004)
<!-- Reviewable:end -->
2018-02-09 17:18:08 -05:00
bors-servo
41fb6ed1ff
Auto merge of #19980 - servo:derive-all-the-things, r=emilio
Merge all keyword arms in Clone for PropertyDeclaration 🐉🐲

<!-- 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/19980)
<!-- Reviewable:end -->
2018-02-09 16:17:01 -05:00
Emilio Cobos Álvarez
f16e699db5
style: Update bindings. 2018-02-09 19:46:26 +01:00
Emilio Cobos Álvarez
88cc2798c4
style: Move more stuff to the place it belongs to.
In particular, `rebuild` is now done entirely by CascadeData, which simplifies
more stuff.

The eventual final state for this is that the data structure we use to store the
XBL / Shadow DOM stuff will be something like:

  struct AuthorStyles { CascadeData, AuthorSheetCollection }

MozReview-Commit-ID: 8TExtP58L4X
2018-02-09 19:45:04 +01:00
Emilio Cobos Álvarez
7edd25890d
style: Introduce AuthorStyleSheetSet.
MozReview-Commit-ID: K3ciocPJuz3
2018-02-09 19:45:03 +01:00
Emilio Cobos Álvarez
5e8dd8a2d4
style: Move the stylesheet set methods under a macro to reuse it soon.
MozReview-Commit-ID: 50Srw4Mjw18
2018-02-09 19:45:02 +01:00
Emilio Cobos Álvarez
a254dc12a4
style: Move author-style-disabled handling to push_applicable_declarations.
This will make it easier to handle it properly for Shadow DOM, though this patch
doesn't do that.

This also makes some method inline and infallible for convenience, since nobody
checks the errors anyway.

Bug: 1436798
Reviewed-by: bholley
MozReview-Commit-ID: Hq3erAUs5tf
2018-02-09 19:44:53 +01:00
bors-servo
e19bab84cf
Auto merge of #20001 - Manishearth:compute-damage, r=mbrubeck
Autogenerate compute_damage

fixes #10622

<!-- 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/20001)
<!-- Reviewable:end -->
2018-02-09 12:02:04 -05:00
Manish Goregaokar
daea6d0f75 Set restyle_damage = reflow for some more properties 2018-02-09 08:48:07 -08:00
Manish Goregaokar
11fb2e644a Use restyle_damage=rebuild_and_reflow for list types 2018-02-09 08:48:06 -08:00
Manish Goregaokar
7e928b02f2 Make individual transform properties have restyle_damage = reflow_out_of_flow 2018-02-09 08:48:05 -08:00
Manish Goregaokar
6ba23fe58a Set damage for min/max width/height to reflow_and_bubble 2018-02-09 08:48:05 -08:00
Manish Goregaokar
8c2b7b41ef Autogenerate compute_damage (fixes #10622) 2018-02-09 08:48:04 -08:00
Emilio Cobos Álvarez
438251cbfc
style: Make AuthorStylesEnabled an enum.
Chances are we need to pass it around in a bit.

Also invert the boolean because I don't want to reason about double negations,
even if they're simple.

MozReview-Commit-ID: KhX4lDKwDoj
2018-02-09 13:27:35 +01:00
Emilio Cobos Álvarez
4cc5717116
style: Save some work if the origin is not dirty.
MozReview-Commit-ID: EGHztVLj9i3
2018-02-09 13:27:34 +01:00
Emilio Cobos Álvarez
bbc6857c06
style: Rename OriginValidity to DataValidity.
MozReview-Commit-ID: FpsYUlWLWTt
2018-02-09 13:27:33 +01:00
Emilio Cobos Álvarez
01915d84db
style: Assert we don't try to do dumb stuff.
MozReview-Commit-ID: 6DpkiwUdccD
2018-02-09 13:27:33 +01:00