mirror of
https://github.com/servo/servo.git
synced 2025-06-17 21:04:28 +00: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 --> |
||
---|---|---|
.. | ||
docs | ||
dom | ||
task_source | ||
body.rs | ||
build.rs | ||
Cargo.toml | ||
clipboard_provider.rs | ||
CMakeLists.txt | ||
devtools.rs | ||
document_loader.rs | ||
fetch.rs | ||
layout_wrapper.rs | ||
lib.rs | ||
mem.rs | ||
network_listener.rs | ||
origin.rs | ||
script_runtime.rs | ||
script_thread.rs | ||
serviceworker_manager.rs | ||
serviceworkerjob.rs | ||
textinput.rs | ||
timers.rs | ||
unpremultiplytable.rs | ||
webdriver_handlers.rs |