Commit graph

6718 commits

Author SHA1 Message Date
Anthony Ramine
335cb4c9f4 Whitelist Copy types when generating PropertyDeclaration 2018-02-07 22:49:15 +01:00
Anthony Ramine
8b9b3617a2 Merge all keyword arms in Clone for PropertyDeclaration 🐉🐲
We further partition the variants to retrieve all properties that are
defined as simple keywords, and we clone them by copying the value
as a smaller enum made of only the keyword variants.
2018-02-07 20:50:00 +01:00
bors-servo
a0e4ea9f56
Auto merge of #19974 - emilio:atom-serialization, r=nox
style: Optimize serialization of identifiers of length <= 16 🐉🐲

Much like we optimize to_ascii_lowercase.

<!-- 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/19974)
<!-- Reviewable:end -->
2018-02-07 13:33:36 -05:00
Emilio Cobos Álvarez
e41d724694
style: Derive ToCss for FontFamilyList.
The extra reference in to_css is needed because the family list iterator returns
by value in Gecko.
2018-02-07 17:44:15 +01:00
Emilio Cobos Álvarez
f4c9c598a3
style: Optimize serialization of identifiers of length <= 16 🐉🐲
Much like we optimize to_ascii_lowercase.

This also fixes a bug in Servo where attr() rules with an unknown namespace
prefix are parsed, which is wrong.
2018-02-07 17:34:22 +01:00
bors-servo
e57319a734
Auto merge of #19973 - emilio:media-feature-change, r=xidorn
style: Rework how media feature changes are handled for XBL.

Bug: 1435939
Reviewed-by: xidorn

<!-- 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/19973)
<!-- Reviewable:end -->
2018-02-07 08:02:34 -05:00
Emilio Cobos Álvarez
091a97e092
style: Update bindings. 2018-02-07 13:30:23 +01:00
Emilio Cobos Álvarez
0907c21600
style: Process all the MediumFeatureChanges at the same time.
This avoids resetting the computed values all the time, and paves the way to
avoid using a StyleSet on XBL bindings / Shadow DOM, which we should really
really do because it's super overkill.

There are some XBL bits that are kind of hacky, in particular the mStylistDirty,
but they'll go away soon, since I want to redo how we store styles in XBL.

The alternative, which was returning an array of indices or something was even
more hacky I think.

Bug: 1435939
Reviewed-by: xidorn
MozReview-Commit-ID: 6tEl5gebXVF
2018-02-07 13:29:58 +01:00
bors-servo
5d209a70ab
Auto merge of #19970 - janczer:change_debug_assertions, r=emilio
Change debug assertions to specific ones

<!-- 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 #19962 (github issue number if applicable).

<!-- 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/19970)
<!-- Reviewable:end -->
2018-02-07 06:20:36 -05:00
janczer
661d234c3c Change debug assertions to specific ones 2018-02-07 09:21:24 +01:00
Emilio Cobos Álvarez
d9ae47cb13
style: Fix interpolation of the gecko-size properties.
Followup to #19966 because, well...

The animation code should probably be more obvious.
2018-02-07 07:02:48 +01:00
bors-servo
dc446198a7
Auto merge of #19966 - emilio:bye-gecko-size, r=nox
style: Get rid of gecko_size_type.

It's a hack, should die.

<!-- 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/19966)
<!-- Reviewable:end -->
2018-02-06 21:15:07 -05:00
Emilio Cobos Álvarez
ed2ba30261
style: Sprinkle some comments. 2018-02-07 03:11:14 +01:00
Emilio Cobos Álvarez
32c409d5aa
style: Get rid of gecko_size_type.
This also fixes a style sharing issue with MaxLength, anecdotally.
2018-02-07 02:05:30 +01:00
bors-servo
804b4b3db6
Auto merge of #19957 - gootorov:move-counter-from-mako, r=emilio
style: Move content property out of mako.

<!-- Please describe your changes on the following line: -->
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 build-geckolib` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #19936 (github issue number if applicable).

<!-- 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/19957)
<!-- Reviewable:end -->
2018-02-06 17:39:03 -05:00
Igor Gutorov
7a00066477 style: Move content property out of mako. 2018-02-07 00:11:57 +02:00
Emilio Cobos Álvarez
100f4cd7c3
style: "%s" % foo is pointless. 2018-02-06 23:06:08 +01:00
Emilio Cobos Álvarez
a0d0769998
style: Move flex-basis out of gecko_size_type. 2018-02-06 23:06:07 +01:00
Emilio Cobos Álvarez
45ba167030
style: Make MozLength / MaxLength a bit more clear and do a bit less work. 2018-02-06 23:06:06 +01:00
bors-servo
dde15d8d65
Auto merge of #19964 - emilio:font-shorthand, r=nox
style: Don't serialize default values of the font shorthand.

This makes us consistent with the old style system and Blink / WebKit.

Not adding a test because shorthands serialization is a mess... :(

Anyway, nothing like fixing bugs by removing code.

Bug: 1436031

<!-- 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/19964)
<!-- Reviewable:end -->
2018-02-06 16:42:23 -05:00
Emilio Cobos Álvarez
173c9aee61
style: Don't serialize default values of the font shorthand.
This makes us consistent with the old style system and Blink / WebKit.

Not adding a test because shorthands serialization is a mess... :(

Anyway, nothing like fixing bugs by removing code.

Bug: 1436031
2018-02-06 21:42:42 +01:00
bors-servo
9faf0cdce5
Auto merge of #19956 - servo:derive-all-the-things, r=emilio
Generate some PropertyDeclaration methods by hand 🐉🐲

We rely on https://github.com/rust-lang/rfcs/pull/2195 to make some enums share the same discriminants by definition.

This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1428285.

<!-- 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/19956)
<!-- Reviewable:end -->
2018-02-06 08:12:33 -05:00
Anthony Ramine
1f0a1267bb Implement MallocSizeOf for PropertyDeclaration by hand
We merge arms with identical field types.
2018-02-06 14:11:20 +01:00
Anthony Ramine
456c18f767 Implement PartialEq for PropertyDeclaration by hand 🐉🐲
We first check that the discriminants are equal, then we pattern match only
on `*self` and use `PropertyDeclarationVariantRepr` to look into `other` directly.
2018-02-06 14:11:19 +01:00
Anthony Ramine
8ebf0f057f Merge common arms in PropertyDeclaration::to_css 2018-02-06 14:11:18 +01:00
Anthony Ramine
42ea822edf Make LonghandId just be the discriminants of PropertyDeclaration 🐉🐲
This relies on the fact that `#[repr(u16)]` on enums ensure the discriminant will
be the very first field of the enum value. This has always been the case, but it
has been formally defined only since https://github.com/rust-lang/rfcs/pull/2195.

https://bugzilla.mozilla.org/show_bug.cgi?id=1428285
2018-02-06 14:11:14 +01:00
Anthony Ramine
1ec5164900 Generate PropertyDeclaration just after processing all the Mako files 2018-02-06 13:46:33 +01:00
Anthony Ramine
7f98d8e017 Implement Clone for PropertyDeclaration by hand 🐉🐲
This makes the enum `#[repr(u16)]` and generate code that shares the same
Clone::clone call for all variants sharing the same field type.
2018-02-06 13:45:52 +01:00
Anthony Ramine
5195eb38f2 Make all PropertyDeclaration variants have only one field 2018-02-06 13:45:18 +01:00
bors-servo
3a3a7cdc22
Auto merge of #19955 - emilio:number-pseudos-chrome, r=jwatt
style: Make input[type=number] pseudo-elements accessible to chrome.

Bug: 1433389
Reviewed-by: jwatt
MozReview-Commit-ID: 2ycajPYd3CV

<!-- 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/19955)
<!-- Reviewable:end -->
2018-02-05 09:50:35 -05:00
Emilio Cobos Álvarez
1221e9eb30
style: Update bindings. 2018-02-05 13:28:53 +01:00
bors-servo
575fecf810
Auto merge of #19953 - emilio:cleanup, r=wafflespeanut
style: Various cleanups

See each commit 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/19953)
<!-- Reviewable:end -->
2018-02-05 07:17:54 -05:00
Emilio Cobos Álvarez
b76bbdf501
style: Make input[type=number] pseudo-elements accessible to chrome.
Bug: 1433389
Reviewed-by: jwatt
MozReview-Commit-ID: 2ycajPYd3CV
2018-02-05 13:05:26 +01:00
Emilio Cobos Álvarez
2090371203
style: Cleanup indentation of Position::parse_quirky. 2018-02-05 13:02:56 +01:00
Emilio Cobos Álvarez
a03aa1b4b9
style: Cleanup the indentation of a function. 2018-02-05 13:02:55 +01:00
Emilio Cobos Álvarez
d4b238bada
style: Cleanup shape-outside code. 2018-02-05 13:02:54 +01:00
Emilio Cobos Álvarez
57ebb2c8af
style: Use debug_assert_eq!. 2018-02-05 13:02:54 +01:00
Emilio Cobos Álvarez
7178e9bf69
style: Remove stray space. 2018-02-05 13:02:53 +01:00
Emilio Cobos Álvarez
412f0133ca
style: Remove unneeded impl block. 2018-02-05 13:02:52 +01:00
Emilio Cobos Álvarez
c72a5623b1
style: Avoid double hash lookup when inserting in OrderMap. 2018-02-05 13:02:52 +01:00
Emilio Cobos Álvarez
001653080d
style: Update bindings. 2018-02-05 11:54:02 +01:00
Emilio Cobos Álvarez
1804f135ec
style: Optimize @keyframes rule insertions.
Bug: 1435214
Reviewed-by: xidorn,hiro
MozReview-Commit-ID: AHwhZynLBv
2018-02-05 11:54:01 +01:00
Emilio Cobos Álvarez
9c66b07b67
style: Make insertion of @font-face rules not necessarily restyle the whole document.
Bug: 1435214
Reviewed-by: xidorn
MozReview-Commit-ID: 5ewKiShUHNi
2018-02-05 11:24:40 +01:00
Anthony Ramine
3918c983e1 Use LonghandId::is_animatable in PropertyDeclaration::is_animatable 2018-02-04 23:23:21 +01:00
Anthony Ramine
90b37cfa21 Use less type aliases from longhands in PropertyDeclaration
This will help us reuse code between different variants in a later patch,
to implement Clone by hand to optimise it.
2018-02-04 22:57:53 +01:00
Anthony Ramine
df11a7fec7 Simplify counter CSS properties 2018-02-04 14:52:38 +01:00
bors-servo
2f8cd0fe22
Auto merge of #19941 - emilio:cleanup-style-builder, r=emilio
style: Handle correctly nested links.

Followup to #19935, since I'm dumb and missed some orange in my try run.

<!-- 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/19941)
<!-- Reviewable:end -->
2018-02-03 15:28:58 -05:00
Emilio Cobos Álvarez
2e08ab1492
style: Handle correctly nested links.
Followup to #19935, since I'm dumb and missed that orange.
2018-02-03 20:45:56 +01:00
bors-servo
bad455138f
Auto merge of #19938 - servo:single-keyword, r=emilio
Simplify single_keyword

<!-- 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/19938)
<!-- Reviewable:end -->
2018-02-03 14:27:18 -05:00
Anthony Ramine
70a99cef15 Derive ToComputedValue for keywords without extra specified values 2018-02-03 18:44:56 +01:00