-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Move CSS longhands outside of mako #19015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yes! I'm currently doing transform stuff though I may not do the extra step of predefined typing it. |
Before we go through every property and move code around, maybe we could talk a little bit about what design we want? For example, maybe instead of the pattern of having modules that are expected to define a few items of certain kinds with certain names, we could rely on the hot new language feature of associated types. That kind of things. |
After clarifying on IRC, it turns out that the changes I had in mind are mostly orthogonal with what this issue is about. So, carry on :) |
style: Move -x-text-zoom outside of mako Sub-PR for #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 #19020 . <!-- 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/19030) <!-- Reviewable:end -->
style: Move table -x-span outisde of mako <!-- 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 are apart of #19015 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because refactoring. <!-- 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/19036) <!-- Reviewable:end -->
style: Move text-overflow outside of mako <!-- 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 are apart of #19015 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because refactoring. <!-- 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/19044) <!-- Reviewable:end -->
style: Move text-overflow outside of mako <!-- 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 are apart of #19015 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because refactoring. <!-- 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/19044) <!-- Reviewable:end -->
style: Move text-overflow outside of mako <!-- 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 are apart of #19015 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because refactoring. <!-- 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/19044) <!-- Reviewable:end -->
style: Move text-overflow outside of mako <!-- 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 are apart of #19015 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because refactoring. <!-- 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/19044) <!-- Reviewable:end -->
…naltinova style: Move font -moz-script-min-size outside of mako This is a sub-PR for #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 #19034 (github issue number if applicable). - [X] These changes do not require tests because _____ <!-- 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/19051) <!-- Reviewable:end -->
style: Move text-overflow outside of mako <!-- 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 are apart of #19015 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because refactoring. <!-- 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/19044) <!-- Reviewable:end -->
…naltinova style: Move font -moz-script-min-size outside of mako This is a sub-PR for #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 #19034 (github issue number if applicable). - [X] These changes do not require tests because _____ <!-- 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/19051) <!-- Reviewable:end -->
style: Move font-weight outside of mako <!-- 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 are apart of #19015 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because refactoring <!-- 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/19086) <!-- Reviewable:end -->
We should also split up gecko.mako.rs into gecko.rs + gecko.mako.rs or something. All the manual impls go in gecko.rs. You can have multiple impl blocks for a type so that's fine. |
Ideally, when debugging code it would be nice to never/rarely have to look at an autogenerated file and map its contents back to the "real" source. |
@emilio Hi.I want to try this issue:) |
Hi @chansuke! This issue spans a few multiple sub-issues, are you interested in any of the list that don't have a PR or issue open already? If you don't want to choose one yourself, just let me know and I can choose one that is easy and assign it to you. Thanks a lot! |
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 -->
I'll work on |
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 -->
…o, 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 -->
style: Move cursor property out of mako <!-- Please describe your changes on the following line: --> Sub-PR of #19015 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 #19775 (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/19798) <!-- Reviewable:end -->
style: Move cursor property out of mako <!-- Please describe your changes on the following line: --> Sub-PR of #19015 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 #19775 (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/19798) <!-- Reviewable:end -->
style: Move cursor property out of mako <!-- Please describe your changes on the following line: --> Sub-PR of #19015 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 #19775 (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/19798) <!-- Reviewable:end -->
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 -->
Hello I'd like to work on |
@gloverdonovan Go ahead and file an issue for it; you're welcome to work on it! |
…psuper Extract text emphasis style <!-- Please describe your changes on the following line: --> Extracted the text-emphasis-style property out of the inherited_text.mako.rs. This is a part 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] `./mach cargo-geckolib check` does not report any errors - [X] These changes fix #19940 (github issue number if applicable). <!-- Either: --> - [X] These changes do not require tests because it's a refactoring <!-- 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/20252) <!-- Reviewable:end -->
I would like to take |
style: Move `clear` CSS property outside mako This is part of issue #19015. - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #21155 <!-- 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/21156) <!-- Reviewable:end -->
@emilio @Manishearth is this done now? |
I'm going to go ahead and claim it's done. We can file specific issues for anything remaining. |
Uh oh!
There was an error while loading. Please reload this page.
We use the mako template system to autogenerate code.
Ideally, we'd like to use a manifest and use Rust to generate it instead. For that, we need to move all the remaining CSS properties (most of them have been moved already) outside of Mako. That is the same as saying: We should make all those use
${helpers.predefined_type(..)}
.This is mostly moving and cleaning up code in the same way as #19002 and #19005, but there are probably bugs along the way that may need fixing (like the calc() bug I added a test for in #19005).
If you want to help out with this, please comment on this issue or reach out on IRC (
#servo
inirc.mozilla.org
) and we'll find one which is interesting to you.Or, you can also file an issue and mention this one and I'll get it assigned to you.
Known properties still using mako:
text.mako.rs
:text-overflow
(style: Move text-overflow outside of mako #19044)text-decoration-line
(Move text-decoration-line out of mako #19211)inherited_text.mako.rs
:text-align
(style: Move text-align outside of the mako file. #19576)-servo-text-decorations-in-effect
(style: Remove -servo-text-decorations-in-effect #19757)text-emphasis-style
(Move text-emphasis-style outside of mako #19940)text-emphasis-position
(Movetext-emphasis-position
outside of mako #19961)inherited_svg.mako.rs
:paint-order
(Move paint-order outside of mako. #19736)-moz-context-properties
(style: Move -moz-context-properties outside of mako #19742)box.mako.rs
:display
(Move display outside of mako. #19658)-servo-display-for-hypothetical-box
(Move -servo-display-for-hypothetical-box outside of mako. #19697)overflow-y
(Move overflow-y outside of Mako #19183)transform
(I think @Manishearth was doing stuff with this one)scroll-snap-type-y
(style: Cleanup a bit the scroll-snap-type properties. #19018)contain
(Movecontain
outside of mako. #19656)will-change
(Move will-change outside of mako. #19582)touch-action
(Move touch-action outside of mako. #19645)list.mako.rs
:list-style-type
(Move list-style-type outside of mako #19629)list-style-image
(Move list-style-image outside of mako. #19557)quotes
(Move list quotes out of mako. #19556)inherited_box.mako.rs
:image-orientation
(Move image-orientation outside of mako #19765)ui.mako.rs
:-moz-force-broken-image-icon
(style: Move -moz-force-broken-image-icon out of mako #19279)pointing.mako.rs
:cursor
(style: Move cursor property from mako #19775)outline.mako.rs
:outline-style
(Move outline-style outside of mako. #19546)border.mako.rs
:-moz-border-*-colors
(Move -moz-border-*-colors outside of mako. #19671)border-image-repeat
(Move border-image-repeat outside of mako. #19142, presumably a great first bug, should be mostly like style: Move background-repeat and mask-repeat outside of mako. #19002)position.mako.rs
:grid-auto-flow
(Move grid-auto-flow outside of mako. #19375)grid-template-areas
(Move grid-template-areas outside of mako. #19409)table.mako.rs
:-x-span
(style: Move table -x-span outisde of mako #19036)svg.mako.rs
:mask-size
(Move mask-size outside of mako. #19467)counters.mako.rs
:content
(style: Move content property out of Mako. #19936)counter-increment
(style: moved css longhand counter-reset out of mako #19529)counter-reset
(Move counter-reset outside of mako #19387)font.mako.rs
:font-family
(Move font-family outside of mako. #19355)font-weight
(style: Move font-weight outside of mako #19086)font-size
(Move font-size outside of mako. #19111)font-size-adjust
(Move font-size-adjust outside of mako. #19151)font-synthesis
(Move font-synthesis outside of mako. #19160)font-variant-alternates
(Move font-variant-alternates outside of mako. #19166)font-variant-east-asian
(Move font-variant-east-asian outside of mako. #19216)font-variant-ligatures
(Move font-variant-ligatures outside of mako. #19246)font-variant-numeric
(Move font-variant-numeric outside of mako. #19276)font-feature-settings
(Move font-feature-settings outside of mako. #19290)font-variation-settings
(Move font-variation-settings outside of mako. #19208)font-language-override
(Move font-language-override outside of mako. #19187)-x-lang
(Move -x-lang outside of mako. #19320)-moz-script-size-multiplier
(Move -moz-script-size-multiplier outside of mako. #19333)-moz-script-level
(Move -moz-script-level outside of mako. #19068)-moz-script-min-size
(Move -moz-script-min-size outside of mako. #19034)-x-text-zoom
(Move -x-text-zoom outside of mako. #19020)FAQ
How do I get started? How can I make any sense of the code?
This code lives in
compontents/style/properties/longhands
. Note that some of the code is Firefox-specific (properties marked withproducts="gecko"
, so you may need to do./mach build-geckolib
or./mach cargo-geckolib check
in order to build and see).Please ask here, in
#servo
, or open an issue like #19020 and say that you want to work on it.Ask questions! I (or any of the other Servo members and contributors) are happy to help :)
What's the general setup?
Each CSS property has two different representations: The "specified" one (the one people write in the stylesheets), and the "computed" one. Sometimes they are the same, sometimes they're different.
So for example if you write
width: 1em
in a CSS style sheet, the "specified" value is1em
, but the "computed" value could be, for example,10px
, if the parent font-size is10px
.So the way this is organized is roughly as follows: We have two rust modules inside
compontents/style/values
. Thecomputed
and thespecified
(there are others, but those shouldn't worry you).The first argument for
predefined_type
is the CSS property name.The second argument is the name of the type that becomes
computed::$name
orspecified::$name
, depending on the appropriate context. For example, in #19018, both are the same (computed::ScrollSnapType
just re-exportsspecified::ScrollSnapType
).The third argument is the initial computed value of the property. The rest of the arguments are key-value pairs with various meanings, that we should probably preserve intact. If there are any questions about a particular argument feel free to ask though!
Which ones are easier? Which ones are harder?
In general, the level of difficulty relates with the amount that lies inside the mako section of that property.
For example,
transform
is huge, and is fairly non-trivial, while probably others likeoverflow-y
are easy to refactor like #19018.But again, please ask if you're unsure and we'll try to answer! :)
The text was updated successfully, but these errors were encountered: