Commit graph

834 commits

Author SHA1 Message Date
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
Jon Leighton
fe583fc5d0 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.
2018-01-28 10:59:45 +01:00
bors-servo
c9ba16f9fb Auto merge of #19868 - CYBAI:specific-assertion, r=emilio
Use specific assertions

Similar to #19865
r? jdm

Note: Should I squash all the commits into one commit?

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because it should not break anything

<!-- 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/19868)
<!-- Reviewable:end -->
2018-01-25 18:06:33 -06:00
CYBAI
e4799cc997 Use specific assertion for specified text 2018-01-26 01:18:59 +08:00
bors-servo
5355265c74 Auto merge of #19854 - emilio:try-match, r=nox
style: make the try_match_ident_ignore_ascii_case macro actually return the error.

This allows it to be used as an expression, which I'd like to do very soon.

<!-- 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/19854)
<!-- Reviewable:end -->
2018-01-25 10:18:24 -06:00
Emilio Cobos Álvarez
e978645a52
style: make the try_match_ident_ignore_ascii_case macro actually return the error.
This allows it to be used as an expression, which I'd like to do very soon.
2018-01-24 16:12:30 +01:00
Emilio Cobos Álvarez
711ea51d7b
style: Rename AlignJustifySelf to SelfAlignment.
This matches the spec term and, again, the two properties will have different
grammars soon.

MozReview-Commit-ID: 8f8JXj2NnCi
2018-01-24 14:34:04 +01:00
Emilio Cobos Álvarez
d4a44de928
style: Rename AlignJustifyContent to ContentDistribution.
align-content and justify-content will have different types in a second.

MozReview-Commit-ID: 5JDeR5kXZNP
2018-01-24 14:34:03 +01:00
Emilio Cobos Álvarez
da56bdecc6
style: Minor nits on the alignment properties.
I'm going to touch this in a bit, let's do it a bit less painful.

MozReview-Commit-ID: LhBNMkUXlUK
2018-01-24 12:14:23 +01:00
Anthony Ramine
42c8dc983f Derive ToCss for TransformOperation
Now that SequenceWriter<W> does not monomorphise excessively, we can actually
type check a derived ToCss without too much type recursion.
2018-01-23 11:02:34 +01:00
Anthony Ramine
cd8f96cc9e Change ToCss to take a CssWriter<W>
This more concrete wrapper type can write a prefix the very first time something
is written to it. This allows removing plenty of useless monomorphisations caused
by the former W/SequenceWriter<W> pair of types.
2018-01-23 10:41:42 +01:00
Anthony Ramine
6d2018ae38 Use Image::to_css in <Image as Debug>::fmt 2018-01-23 09:25:16 +01:00
Igor Gutorov
4ee9eb8563 style: Move cursor property out of mako 2018-01-20 19:06:29 +02:00
Emilio Cobos Álvarez
212b2f56c7
style: Make the Gecko font-size calc() code do what it means to do.
It makes no sense to pass a custom base size of zero in presence of rem, ex, or
ch units.

Bug: 1431031
Reviewed-by: Manishearth
MozReview-Commit-ID: 7ZZwRzQKREX
2018-01-18 15:11:08 +01:00
Emilio Cobos Álvarez
49535d6987
style: Cleanup a bit the calc code.
I happened to be looking at it.

MozReview-Commit-ID: Ketot34XtOX
2018-01-17 15:26:13 +01:00
Emilio Cobos Álvarez
404148c82e
style: Don't allow fallback alignment in place-content shorthand.
Bug: 1430622
Reviewed-by: xidorn,mats
MozReview-Commit-ID: sALBFJeqvr
2018-01-16 17:51:24 +01:00
bors-servo
2ff3e119fa Auto merge of #19749 - gootorov:move_-moz-context-properties_from_mako, r=emilio
style: Move -moz-context-properties outside of mako.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [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/19749)
<!-- Reviewable:end -->
2018-01-15 06:04:30 -06:00
bors-servo
f2036e7661 Auto merge of #19757 - emilio:bye-custom-cascade, r=nox
style: Remove -servo-text-decorations-in-effect

It is bogus, because it depends on the display property as it's cascaded, but
the display property can change afterwards, for example, if we get blockified
because we're the root element or a flex item.

Replace it with a normal field instead.

Also, it carries some weight, because it's the last property that uses this
concept of "derived" property, and "custom cascade". So we can remove some code
after this.

Compute it after the cascade process in StyleAdjuster.

<!-- 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/19757)
<!-- Reviewable:end -->
2018-01-15 05:14:49 -06:00
bors-servo
ec34023d7a Auto merge of #19766 - jonleighton:issue-19765, r=emilio
Move image-orientation property outside of mako

Fixes https://github.com/servo/servo/issues/19765

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/19766)
<!-- Reviewable:end -->
2018-01-14 16:55:15 -06:00
Jon Leighton
bd55639d01 Move image-orientation property outside of mako
Fixes https://github.com/servo/servo/issues/19765
2018-01-14 21:19:12 +01:00
Emilio Cobos Álvarez
8732a1d7de
style: Remove -servo-text-decorations-in-effect.
It is bogus, because it depends on the display property as it's cascaded, but
the display property can change afterwards, for example, if we get blockified
because we're the root element or a flex item.

Replace it with a normal field instead.

Also, it carries some weight, because it's the last property that uses this
concept of "derived" property, and "custom cascade". So we can remove some code
after this.

Compute it after the cascade process in StyleAdjuster.
2018-01-14 17:10:44 +01:00
bors-servo
1b46e2e759 Auto merge of #19709 - CYBAI:servo-display-out-of-mako, r=emilio
style: Remove -servo-display-for-hypothetical-box from longhand

This is a sub-PR of #19015
r? emilio

For the `fn set_original_display` inside `properties.mako.rs`, I removed `is_item_or_root` first to see how the tests result is. If it's needed, I'll add it back.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #19697
- [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/19709)
<!-- Reviewable:end -->
2018-01-14 08:27:14 -06:00
Igor Gutorov
90978c1777 Make MozContextProperties a different type 2018-01-13 22:29:52 +02:00
Bobby Holley
f858ce91e8 Avoid entraining various Debug impls in release builds.
MozReview-Commit-ID: Lp9i9EI5qdU
2018-01-13 09:51:46 -08:00
CYBAI
0291a75b3c style: Remove -servo-display-for-hypothetical-box from longhand 2018-01-13 20:54:50 +08:00
Igor Gutorov
c72066af2d style: Move -moz-context-properties outside of mako 2018-01-12 17:46:02 +02:00
CYBAI
2bc02bc78d style: Move paint-order outside of mako 2018-01-10 21:26:33 +08:00
lizhixun
aa1b9a25f6 style: Make Contain::parse simpler 2018-01-04 13:13:49 -08:00
lizhixun
4c23f09934 style: Move contain outside of mako 2018-01-03 23:13:56 -08:00
CYBAI
a764d9065e style: Move display outside of mako 2018-01-01 23:51:08 +08: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
bors-servo
a9c17970c1 Auto merge of #19576 - canaltinova:text-align, r=Manishearth,emilio
style: Move text-align outside of the mako file.

I will need this refactoring before my next job. I didn't actually fix the FIXME's along the way. My other PR probably will cover these.

---
- [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/19576)
<!-- Reviewable:end -->
2017-12-18 12:12:52 -06:00
Nazım Can Altınova
9882d0bae5 style: Move text-align outside of the mako file. 2017-12-18 11:58:06 -06:00
CYBAI
2eb396613b
style: Move will-change outside of mako 2017-12-16 21:47:59 +01:00
bors-servo
a31fd24ce9 Auto merge of #19581 - emilio:grid-line-serialize, r=canaltinova
style: Fix grid line serialization to avoid redundant spacing.

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

<!-- 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/19581)
<!-- Reviewable:end -->
2017-12-16 09:13:48 -06:00
Emilio Cobos Álvarez
de4dd638eb
style: Fix grid line serialization to avoid redundant spacing.
This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1425227.
2017-12-16 01:26:18 +01:00
Brian Birtles
150db42ef6 Update references to Web Animations spec 2017-12-15 16:21:26 -06:00
Emilio Cobos Álvarez
8fbdbc8f95
style: Use derive(Parse) for X and Y. 2017-12-15 20:15:32 +01:00
Emilio Cobos Álvarez
4abd1dc819
style: Use derive(Parse) for RepeatKeyword. 2017-12-15 20:15:31 +01:00
Felipe Nakandakari
eb88a298f6 style: move list-style-image out of mako
cleaner way to set boxed param

redefine get_initial_value to none

make parse method clearer

remove some extra lines
2017-12-15 16:23:53 +11:00
Emilio Cobos Álvarez
03f3521216
style: Use more Box<[]> and Box<str> for quotes. 2017-12-14 04:05:25 +01:00