servo/components/layout
bors-servo 691bff86b6 Auto merge of #19651 - pyfisch:background-placement, r=emilio
Unify background placement code

Merges the implementations for background-image placement
from gradients and images. Add missing parts and fix bugs.

Now supported are the CSS properties:

* background-attachment (except for local value, see #19650)
* background-clip
* background-origin
* background-position-x/y
* background-repeat
* background-size

It should be noted that backgrounds are not clipped to
rounded border corners.
(This was done before but worked only in simple cases)
See: #19649

This solves the following issues:
closes #19626
closes #16657
closes #19482 (examples from http://lea.verou.me/css3patterns/ are rendered perfectly but the round border is completely ignored now)
closes #19577

- `./mach build -d` does not report any errors
- `./mach test-tidy` does not report any errors

I enabled a few tests with the first commit but I have written about a dozen manual tests I will try to turn into ref tests either before or after this patch lands.

@bors-servo try

The relationship between the different inputs is visualized in this flowchart:
![flowchart-background](https://user-images.githubusercontent.com/2781017/34394430-5a06c72c-eb59-11e7-9d51-3d23e2215f07.png)

<!-- 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/19651)
<!-- Reviewable:end -->
2018-01-02 08:47:24 -06:00
..
animation.rs Turn flow::base and friends into methods 2017-12-14 12:16:45 -06:00
block.rs pretty print tree 2017-12-23 14:40:06 +08:00
Cargo.toml layout: background-origin attribute for gradients 2017-12-15 22:16:58 +01:00
construct.rs Turn flow::base and friends into methods 2017-12-14 12:16:45 -06:00
context.rs Replace all uses of the heapsize crate with malloc_size_of. 2017-10-18 22:20:37 +11:00
data.rs Bump bitflags to 1.0 in every servo crate 2017-10-30 23:36:06 +01:00
display_list_builder.rs Auto merge of #19651 - pyfisch:background-placement, r=emilio 2018-01-02 08:47:24 -06:00
flex.rs Turn flow::base and friends into methods 2017-12-14 12:16:45 -06:00
floats.rs Turn flow::base and friends into methods 2017-12-14 12:16:45 -06:00
flow.rs pretty print tree 2017-12-23 14:40:06 +08:00
flow_list.rs Remove usage of unstable feature conservative_impl_trait in layout 2017-10-13 11:11:06 +02:00
flow_ref.rs order derivable traits lists 2017-08-23 21:38:44 +02:00
fragment.rs Auto merge of #19651 - pyfisch:background-placement, r=emilio 2018-01-02 08:47:24 -06:00
generated_content.rs Turn flow::base and friends into methods 2017-12-14 12:16:45 -06:00
incremental.rs Turn flow::base and friends into methods 2017-12-14 12:16:45 -06:00
inline.rs Turn flow::base and friends into methods 2017-12-14 12:16:45 -06:00
layout_debug.rs Turn flow::base and friends into methods 2017-12-14 12:16:45 -06:00
lib.rs Replace all uses of the heapsize crate with malloc_size_of. 2017-10-18 22:20:37 +11:00
linked_list.rs Move util::linked_list to layout 2016-06-29 17:23:04 +02:00
list_item.rs style: Make all keywords CamelCase for consistency. 2017-12-06 02:35:10 +01:00
model.rs Update WR to use the new sticky positioning API 2017-10-30 10:15:30 +01:00
multicol.rs Turn flow::base and friends into methods 2017-12-14 12:16:45 -06:00
opaque_node.rs Introduce LayoutJS<Node>::opaque() to replace OpaqueNodeMethods::from_jsmanaged(). 2016-06-20 19:08:02 +02:00
parallel.rs Turn flow::base and friends into methods 2017-12-14 12:16:45 -06:00
persistent_list.rs Use try syntax for Option where appropriate 2017-10-20 08:25:35 -07:00
query.rs Turn flow::base and friends into methods 2017-12-14 12:16:45 -06:00
sequential.rs Turn flow::base and friends into methods 2017-12-14 12:16:45 -06:00
table.rs Turn flow::base and friends into methods 2017-12-14 12:16:45 -06:00
table_caption.rs Introduce an unsafe HasBaseFlow trait for base()/base_mut() casts. 2017-10-14 00:03:57 +02:00
table_cell.rs Turn flow::base and friends into methods 2017-12-14 12:16:45 -06:00
table_colgroup.rs Wait as late as possible to assign ClipIds 2017-10-24 16:28:07 +02:00
table_row.rs Turn flow::base and friends into methods 2017-12-14 12:16:45 -06:00
table_rowgroup.rs Remove border_collapse field in InternalTable 2017-12-08 04:51:58 -08:00
table_wrapper.rs style: Make all keywords CamelCase for consistency. 2017-12-06 02:35:10 +01:00
text.rs style: Make all keywords CamelCase for consistency. 2017-12-06 02:35:10 +01:00
traversal.rs Turn flow::base and friends into methods 2017-12-14 12:16:45 -06:00
webrender_helpers.rs Unify background placement code 2017-12-28 20:14:31 +01:00
wrapper.rs layout: Fixup indentation of ThreadSafeLayoutNodeHelpers::flags. 2017-11-10 13:13:19 +01:00