servo/components/layout
bors-servo 5357f05ff7 Auto merge of #14509 - canaltinova:position, r=Manishearth
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 -->
2016-12-15 12:15:06 -08:00
..
animation.rs Make Restyle tracking more granular. 2016-12-09 14:46:40 -10:00
block.rs Removed util. 2016-12-14 18:04:37 -06:00
Cargo.toml Removed util. 2016-12-14 18:04:37 -06:00
construct.rs Removed util. 2016-12-14 18:04:37 -06:00
context.rs Removed util. 2016-12-14 18:04:37 -06:00
data.rs Move children_to_process to layout. 2016-10-08 18:20:45 -07:00
display_list_builder.rs Auto merge of #14509 - canaltinova:position, r=Manishearth 2016-12-15 12:15:06 -08:00
flex.rs Rename the MinMaxConstraint to SizeConstraint and enhancement 2016-12-11 00:54:00 +08:00
floats.rs Migrated -Z trace-layout to serde_json 2016-11-07 15:54:07 +08:00
flow.rs Make Restyle tracking more granular. 2016-12-09 14:46:40 -10:00
flow_list.rs Migrated -Z trace-layout to serde_json 2016-11-07 15:54:07 +08:00
flow_ref.rs Migrated -Z trace-layout to serde_json 2016-11-07 15:54:07 +08:00
fragment.rs Various fixes 2016-12-12 18:10:39 +08:00
generated_content.rs Make Restyle tracking more granular. 2016-12-09 14:46:40 -10:00
incremental.rs Make Restyle tracking more granular. 2016-12-09 14:46:40 -10:00
inline.rs Remove unused replaced size calculation methods 2016-12-12 18:10:36 +08:00
layout_debug.rs Migrated -Z trace-layout to serde_json 2016-11-07 15:54:07 +08:00
lib.rs Removed util. 2016-12-14 18:04:37 -06:00
linked_list.rs Move util::linked_list to layout 2016-06-29 17:23:04 +02:00
list_item.rs Remove unused replaced size calculation methods 2016-12-12 18:10:36 +08:00
model.rs Add new methods to Fragment for size calculation of replaced element 2016-12-12 15:37:12 +08:00
multicol.rs Update layout component and helper to use LengthOrNormal 2016-12-11 08:50:06 -05:00
opaque_node.rs Introduce LayoutJS<Node>::opaque() to replace OpaqueNodeMethods::from_jsmanaged(). 2016-06-20 19:08:02 +02:00
parallel.rs Removed util. 2016-12-14 18:04:37 -06:00
persistent_list.rs Move util::persistent_list to layout 2016-02-20 19:20:38 +01:00
query.rs Use PropertyId instead of Atom for CSSStyleDeclaration::get_computed_style 2016-12-09 17:06:50 -10:00
sequential.rs Removed util. 2016-12-14 18:04:37 -06:00
table.rs Remove unnecessary Flow::column_sizes methods 2016-11-30 09:38:27 -08:00
table_caption.rs Use a new id type for tracking scrolling areas 2016-10-30 21:10:04 +01:00
table_cell.rs Migrated -Z trace-layout to serde_json 2016-11-07 15:54:07 +08:00
table_colgroup.rs Use a new id type for tracking scrolling areas 2016-10-30 21:10:04 +01:00
table_row.rs Remove unnecessary Flow::column_sizes methods 2016-11-30 09:38:27 -08:00
table_rowgroup.rs Remove unnecessary Flow::column_sizes methods 2016-11-30 09:38:27 -08:00
table_wrapper.rs Remove unnecessary Flow::column_sizes methods 2016-11-30 09:38:27 -08:00
text.rs Use word-break to decide how glyph runs should be created 2016-09-27 11:25:21 +02:00
traversal.rs Removed util. 2016-12-14 18:04:37 -06:00
webrender_helpers.rs Update WR (typed units, glyph cache, various features). 2016-12-15 12:11:51 +10:00
wrapper.rs Bug 1317016 - Basic infrastructure for RestyleHint-driven traversal. 2016-11-24 17:07:38 -08:00