Commit graph

783 commits

Author SHA1 Message Date
Igor Gutorov
7a00066477 style: Move content property out of mako. 2018-02-07 00:11:57 +02:00
Anthony Ramine
df11a7fec7 Simplify counter CSS properties 2018-02-04 14:52:38 +01:00
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
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
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
09e304adb3 Rename FillRule variants to follow the same rules as other enums 2018-02-01 12:43:29 +01:00
Anthony Ramine
1f8777bb0b Move TransformStyle out of Mako files 2018-02-01 12:40:36 +01: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
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
CYBAI
9004ffff46 Implement GridTemplateAreas with reference counting 2018-01-31 09:53:34 +08:00
Emilio Cobos Álvarez
c4ae2148f0
style: Remove -moz-border-*-colors.
Bug: 1429723
Reviewed-by: xidorn
MozReview-Commit-ID: 3P6f7rFcDa6
2018-01-22 16:12:35 +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
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
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
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
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
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
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
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
CYBAI
2eb396613b
style: Move will-change outside of mako 2017-12-16 21:47:59 +01:00
Emilio Cobos Álvarez
03f3521216
style: Use more Box<[]> and Box<str> for quotes. 2017-12-14 04:05:25 +01:00
CYBAI
b9b91b33be style: Move outline-style outside of mako 2017-12-13 11:41:59 +08:00
Emilio Cobos Álvarez
af879523ea
style: Make all keywords CamelCase for consistency.
This prevents confusion and paves the ground for derive(Parse) of them.
2017-12-06 02:35:10 +01:00
Emilio Cobos Álvarez
35d0e7cf0f
style: use the same type for overflow-clip-box longhands.
Needed to add the hacky padding_box scheme, will fix it up later.
2017-12-05 19:00:14 +01:00
bors-servo
fa3f3896d3 Auto merge of #19412 - CYBAI:grid-template-areas-out-of-mako, r=emilio
style: Move grid-template-areas outside of mako

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

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #19409
- [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/19412)
<!-- Reviewable:end -->
2017-11-29 15:24:33 -06:00
CYBAI
003ddfc945 style: Move grid-template-areas outside of mako 2017-11-29 22:36:55 +08:00
Ting-Yu Lin
923ffcf2cc style: Support shape-image: <image>
MozReview-Commit-ID: GSCZIMEpCS2
2017-11-29 11:27:31 +08:00
Emilio Cobos Álvarez
d61c9a8d31
style: Bring back the optimization to avoid traversing XBL subtrees that will likely change.
We need to get rid of BindingHolder to handle properly the case of an invalid
binding URL.

Bug: 1420496
Reviewed-by: heycam
MozReview-Commit-ID: 3sIGtcVOt0r
2017-11-26 16:36:13 +01:00
Gecko Backout
9651a5572e Backed out changeset 1fdcd69d2524 for Build Bustage. r=backout on a CLOSED TREE
Backs out https://github.com/servo/servo/pull/19376
2017-11-26 11:00:42 +00:00
Ting-Yu Lin
f3dbaad222 style: Support shape-image: <image>
MozReview-Commit-ID: GSCZIMEpCS2
2017-11-26 17:07:52 +08:00
bors-servo
8f61fde390 Auto merge of #19366 - CYBAI:font-family-out-of-mako, r=emilio
style: Move font-family outside of mako

This is a sub-PR of #19015
Besides, this is the last PR for `font.mako.rs`! 🎉
r? emilio

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #19355
- [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/19366)
<!-- Reviewable:end -->
2017-11-25 13:06:31 -06:00
CYBAI
a470ebd501 style: Move font-family outside of mako 2017-11-26 00:36:00 +08:00