mirror of
https://github.com/servo/servo.git
synced 2025-10-17 16:59:27 +01:00
Implement background-position-x/y <!-- Please describe your changes on the following line: --> This is a WIP PR. Just HorizontalPosition / VerticalPosition implementations are complete. I would like to get early feedbacks about this architecture. Here's some architectural topics to consider: - I created `HorizontalPosition` and `VerticalPosition` structs for this and used them in `Position` as well. We have decided to split `Keyword` enum, but we need them as unified for `PositionComponent` enum. So I didn't split but I can split it if we prefer to change PositionComponent as well. - If we prefer Keyword enum like this, we can create a SubPosition(or something like this) instead of HorizontalPosition/VerticalPosition enums since only difference is 2 lines in `parse` functions. We can create a `parse_horizontal` and `parse_vertical` instead and a lot of code duplication can be cleared. - I couldn't find a good way to use HorizontalPosition/VerticalPosition's parse functions in `Position`'s parse function. It is a bit more complicated. I'm open to suggestions :) - I don't know much about logical keywords so do I need to do something different? I placed some comments where logical keywords are processing. Any advice about these? --- <!-- 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 #14458 (github issue number if applicable). <!-- Either: --> - [X] There are tests for these changes <!-- 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/14509) <!-- Reviewable:end --> |
||
---|---|---|
.. | ||
helpers | ||
longhand | ||
shorthand | ||
build.py | ||
data.py | ||
declaration_block.rs | ||
gecko.mako.rs | ||
helpers.mako.rs | ||
Mako-0.9.1.zip | ||
properties.html.mako | ||
properties.mako.rs |