Commit graph

6718 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
349d6e7167
style: Cleanup StyleBuilder.
This is in preparation of a cascade optimization for custom properties.

This fixes various fishiness around our StyleBuilder stuff. In particular,
StyleBuilder::for_derived_style (renamed to for_animation) is only used to
compute specified values, and thus doesn't need to know about rules, visited
style, or other things like that.

The flag propagation that was done in StyleAdjuster is now done in StyleBuilder,
since we know beforehand which ones are always inherited, and it simplified the
callers and the StyleAdjuster code. It also fixed some fishiness wrt which flags
were propagated to anon boxes and text.

The text-decoration-lines bit is interesting, because the way it was implemented
in #17722 meant that display: contents elements did get HAS_DECORATION_LINES
flags only if its parent also had it, so in practice the Contents check
preserves behavior, but it's only an optimization looking at Gecko's call-sites,
so we can remove it too.

MozReview-Commit-ID: 6BHCyEO2U8c
2018-02-03 18:07:25 +01:00
Emilio Cobos Álvarez
7fb470c373
style: Remove some uses of StyleBuilder::for_derived_style.
for_derived_style(default_values) is effectively for_inheritance(default_values).

MozReview-Commit-ID: DfTeD49uTlp
2018-02-03 17:40:35 +01:00
Anthony Ramine
ccc932ad10 Don't duplicate specified and computed keywords
The previous code would generate two distinct types for specified and
computed values if some variants had aliases.
2018-02-03 15:22:08 +01:00
bors-servo
0a8c58dce9
Auto merge of #19927 - bholley:sheet_flush_optimization, r=emilio
Avoid stylist flushes when sheets are appended and then removed again before flusing layout

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

<!-- 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/19927)
<!-- Reviewable:end -->
2018-02-01 12:59:35 -06:00
Bobby Holley
1d6841b9fd Avoid stylist flushes when sheets are appended and then removed again before flushing layout.
MozReview-Commit-ID: CHgbqfHnjwI
2018-02-01 09:14:07 -08:00
bors-servo
a07002a0f0
Auto merge of #19923 - emilio:less-crappy-code, r=nox
style: Cleanup and remove unused / dubious Length stuff.

On top of #19918, turns out that the parse_numbers_are_pixels stuff is unused.

<!-- 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/19923)
<!-- Reviewable:end -->
2018-02-01 10:27:57 -06:00
bors-servo
38ef515463
Auto merge of #19529 - DonatJR:counter-reset-out-of-mako, r=emilio
style: moved css longhand counter-reset out of mako

<!-- Please describe your changes on the following line: -->
This is a sub-PR of #19015
Code does not yet compile with `build-geckolib`.
r? emilio

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

<!-- Either: -->
- [x] These changes do not require tests

<!-- 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/19529)
<!-- Reviewable:end -->
2018-02-01 09:42:40 -06:00
Jonas Reinwald
d24301b7a0
moved css longhand counter-reset out of mako 2018-02-01 15:43:40 +01:00
Emilio Cobos Álvarez
deac051cb9
style: Cleanup and remove unused / dubious Length stuff.
On top of #19918, turns out that the parse_numbers_are_pixels stuff is unused.
2018-02-01 15:27:39 +01:00
bors-servo
d222c9501b
Auto merge of #19924 - emilio:bim, r=emilio
style: Move border-image-repeat outside of mako.

This is a rebased / nitpick-addressed / bug-fixed version of #19021, and with a commit from #19668 renaming the two `RepeatKeyword`s to different names.

<!-- 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/19924)
<!-- Reviewable:end -->
2018-02-01 08:24:12 -06:00
Mauricio Collares
8e411105ce
style: Rename background::RepeatKeyword and border::RepeatKeyword. 2018-02-01 15:23:41 +01:00
chansuke
50b517d0db
style: Move border-image-repeat outside of mako. 2018-02-01 13:59:10 +01:00
bors-servo
dcd13b857c
Auto merge of #19918 - emilio:font-stuff-is-a-mess, r=nox
style: Refactor font-feature-settings and font-variation-settings.

This fixes all known issues with serialization and parsing of these two
properties, and in particular calc handling and such:

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

Also does a fair amount of cleanup and all that, which was needed, this code
was a mess.

There are further cleanups that can be done, like renaming the
font-variation-settings animation stuff.

<!-- 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/19918)
<!-- Reviewable:end -->
2018-02-01 06:45:20 -06:00
Emilio Cobos Álvarez
3b34d734e6
style: Refactor font-feature-settings and font-variation-settings.
This fixes all known issues with serialization and parsing of these two
properties, and in particular calc handling and such:

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

Also does a fair amount of cleanup and all that, which was needed.
2018-02-01 12:54:45 +01:00
Anthony Ramine
3d99a4489c Don't use define_css_keyword_enum in style anymore 2018-02-01 12:43:48 +01:00
Anthony Ramine
09e304adb3 Rename FillRule variants to follow the same rules as other enums 2018-02-01 12:43:29 +01:00
Anthony Ramine
bac8781cc7 Kill define_numbered_css_keyword_enum 2018-02-01 12:43:28 +01:00
Anthony Ramine
1f8777bb0b Move TransformStyle out of Mako files 2018-02-01 12:40:36 +01:00
Anthony Ramine
579cef6a69 Rename #[parse(aliases)] to #[css(aliases)] 2018-02-01 10:36:14 +01:00
Anthony Ramine
3fba02a0d6 Fix naming of ExtremumLength variants 2018-02-01 10:04:27 +01:00
bors-servo
e6d9c251d1
Auto merge of #19912 - emilio:ordermap, r=Manishearth
style: Temporarily use OrderMap on Gecko.

This will allow us to discard std hash map as a source of crashes.

<!-- 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/19912)
<!-- Reviewable:end -->
2018-01-31 21:33:36 -06:00
Emilio Cobos Álvarez
09398d42af
style: Move a bunch of font stuff living under generics to the proper module.
FontSettingsTagInt and such shouldn't be in the generic module, I know...

But that will change in a bit.
2018-02-01 02:35:33 +01:00
Emilio Cobos Álvarez
1380f1a14f
style: Remove the stupid space serialization on font-settings. 2018-02-01 02:35:32 +01:00
Emilio Cobos Álvarez
190e9b9715
style: Tidy and sprinkle some comments. 2018-02-01 02:35:31 +01:00
CJ Ku
8a4661b829 Implement Animate trait for individual transforms 2018-01-31 22:15:31 +00:00
CJ Ku
9a62c0bf02 Implement interpolation of Quaternions
So that we can reuse the code in ComputedRotate.
2018-01-31 22:12:35 +00:00
CJ Ku
174f5f7128 Implement scale property styling 2018-01-31 22:12:34 +00:00
CJ Ku
de3e8c9a8b Implement translate property styling 2018-01-31 22:12:33 +00:00
CJ Ku
62c0c6feee Implement rotate property styling 2018-01-31 22:12:26 +00:00
Brian Birtles
a8c133d07e Update bindings 2018-01-31 21:10:10 +00:00
bors-servo
4bd0590117
Auto merge of #19915 - emilio:color-errors-whee, r=jdm
stylo: Fix missing null terminator in error reporting code.

This was causing the patch in bug 1420026 to fail.

<!-- 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/19915)
<!-- Reviewable:end -->
2018-01-31 12:37:33 -06:00
Emilio Cobos Álvarez
d82c54bd30
stylo: Fix missing null terminators in error reporting code.
This was causing the patch in bug 1420026 to fail.
2018-01-31 17:49:15 +01:00
Simon Sapin
cace4fc6eb Remove #![deny(warnings)]
We already have https://github.com/servo/servo/pull/19612
to deny warnings at the time of landing into master.
But it’s not useful to break the build when later compiler
with a more recent Rust version that has introduced new warnings:

https://bugzilla.mozilla.org/show_bug.cgi?id=1434619
2018-01-31 17:00:27 +01:00
Emilio Cobos Álvarez
4d9ce6b880
style: Temporarily use OrderMap on Gecko.
This will allow us to discard std hash map as a source of crashes.
2018-01-31 16:29:35 +01:00
bors-servo
12a596654b Auto merge of #19465 - CYBAI:refcount-template-area, r=emilio
Implement GridTemplateAreas with reference counting

Use `Arc` to implement refcounting for `GridTemplateAreas`
r? emilio

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #19428
- [x] These changes do not require tests

<!-- 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/19465)
<!-- Reviewable:end -->
2018-01-31 07:28:04 -06:00
bors-servo
c88dc51d03 Auto merge of #19911 - emilio:has-class, r=xidorn
style: Make GeckoElement::has_class more specialized

Bug: 1431421
Reviewed-by: xidorn
MozReview-Commit-ID: 7LiSEamTCkX

<!-- 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/19911)
<!-- Reviewable:end -->
2018-01-31 04:45:07 -06:00
Emilio Cobos Álvarez
4d84200c8b
style: Update bindings. 2018-01-31 11:28:06 +01:00
Emilio Cobos Álvarez
0466e0b2bc
style: Make GeckoElement::has_class more specialized.
Bug: 1431421
Reviewed-by: xidorn
MozReview-Commit-ID: 7LiSEamTCkX
2018-01-31 11:26:13 +01:00
bors-servo
6101bdf72b Auto merge of #19906 - emilio:justify-self-whoops, r=nox
style: justify-self does accept a <baseline-position>.

Unlike justify-content, as weird as it is.

<!-- 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/19906)
<!-- Reviewable:end -->
2018-01-31 03:53:13 -06:00
CYBAI
9004ffff46 Implement GridTemplateAreas with reference counting 2018-01-31 09:53:34 +08:00
Emilio Cobos Álvarez
5abaadf006
style: justify-self does accept a <baseline-position>.
Unlike justify-content, as weird as it is.
2018-01-30 17:16:33 +01:00
Emilio Cobos Álvarez
125f275b5a
style: Fix sheet invalidation in quirks mode documents.
Bug: 1433589
2018-01-30 16:08:53 +01:00
bors-servo
82922c97dc Auto merge of #19878 - emilio:slotted-slot, r=nox
selectors: Never match ::slotted on <slot>s.

This fixes the test from https://github.com/w3c/web-platform-tests/pull/9212 in
Gecko.

<!-- 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/19878)
<!-- Reviewable:end -->
2018-01-29 11:45:11 -06:00
Emilio Cobos Álvarez
b7238c43cd
style: Properly compare the value of the alignment flags.
What this did before happens to be ok for these constants, but it's not great,
because it depends on their particular value.
2018-01-29 10:45:13 +01:00
Emilio Cobos Álvarez
8d7a3f4f3d
style: Update align-self / justify-self to the spec too.
MozReview-Commit-ID: 8JKF5ucCbYm
2018-01-29 10:37:17 +01:00
Emilio Cobos Álvarez
4c773a1424
style: Fix the position of the <overflow-position> in content distribution shorthands, and remove fallback.
MozReview-Commit-ID: 4rPICzZ5gMn
2018-01-29 10:37:17 +01:00
Emilio Cobos Álvarez
fd47a93b9c
style: Restrict <baseline-position> and <content-position> depending on the axis in content distribution properties.
This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1430817, and updates us
to the current version of the css-align spec.

MozReview-Commit-ID: LtBcdqYJeK
2018-01-29 10:37:16 +01:00
Emilio Cobos Álvarez
7497720081
style: Make content distribution parsing know the axis it's parsed for.
MozReview-Commit-ID: LMPXVtKU1mq
2018-01-29 10:37:16 +01:00
Emilio Cobos Álvarez
0aee33081f
style: Serialize <overflow-position> before other align bits.
Otherwise the serialisation wouldn't roundtrip with the new syntax, which fixes
the position of <overflow-position>.

Also make Servo and Gecko agree on whether to serialize "unsafe".

Bug: 1430817
MozReview-Commit-ID: L3GSMk5pZ3F
2018-01-29 10:37:15 +01:00
bors-servo
2a46067587 Auto merge of #19881 - jonleighton:issue-19811, r=emilio
Add layout RPC query for getting an element's style

This enables us to implement Element::has_css_layout_box() in a more
direct way, and also enables us to remove some of the existing more
specific queries.

Fixes #19811.

r? @emilio

<!-- 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/19881)
<!-- Reviewable:end -->
2018-01-28 05:52:56 -06:00