diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-08-07 16:54:35 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-07 16:54:35 -0500 |
commit | a624496cc485e4eebe82860ca241cb651d91f54a (patch) | |
tree | fc246e2bc0bf999abd5578b5541c8003a7f976be | |
parent | 82de4c49f378aed7c9497ba6995020fa79dbf942 (diff) | |
parent | a8da777fd1083f0315cb2d4b4319e258e46eaa7b (diff) | |
download | servo-a624496cc485e4eebe82860ca241cb651d91f54a.tar.gz servo-a624496cc485e4eebe82860ca241cb651d91f54a.zip |
Auto merge of #17845 - asajeffrey:script-paint-worklet-background-size, r=glennw
Use CSS background-size property when computing the size of a paint worklet
<!-- Please describe your changes on the following line: -->
The size of a paint worklet should be based on the background-size CSS property.
---
<!-- 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 #17676.
- [X] These changes do not require tests because the existing css-paint-api tests catch this.
<!-- 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/17845)
<!-- Reviewable:end -->
4 files changed, 11 insertions, 13 deletions
diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index 05dee791c93..d3954ad8990 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -1177,7 +1177,17 @@ impl FragmentDisplayListBuilding for Fragment { // https://github.com/w3c/css-houdini-drafts/issues/417 let unbordered_box = self.border_box - style.logical_border_width(); let device_pixel_ratio = state.layout_context.style_context.device_pixel_ratio(); - let size_in_au = unbordered_box.size.to_physical(style.writing_mode); + let unbordered_box_size_in_au = unbordered_box.size.to_physical(style.writing_mode); + let background_size = get_cyclic(&style.get_background().background_size.0, index).clone(); + let size_in_au = match background_size { + BackgroundSize::Explicit { width, height } => { + Size2D::new(MaybeAuto::from_style(width, unbordered_box_size_in_au.width) + .specified_or_default(unbordered_box_size_in_au.width), + MaybeAuto::from_style(height, unbordered_box_size_in_au.height) + .specified_or_default(unbordered_box_size_in_au.height)) + }, + _ => unbordered_box_size_in_au, + }; let size_in_px = TypedSize2D::new(size_in_au.width.to_f32_px(), size_in_au.height.to_f32_px()); // TODO: less copying. diff --git a/tests/wpt/mozilla/meta/mozilla/css-paint-api/geometry-background-image-tiled-001.html.ini b/tests/wpt/mozilla/meta/mozilla/css-paint-api/geometry-background-image-tiled-001.html.ini deleted file mode 100644 index cf86621733e..00000000000 --- a/tests/wpt/mozilla/meta/mozilla/css-paint-api/geometry-background-image-tiled-001.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[geometry-background-image-tiled-001.html] - type: reftest - expected: FAIL - bug: https://github.com/servo/servo/issues/17676 diff --git a/tests/wpt/mozilla/meta/mozilla/css-paint-api/geometry-background-image-tiled-002.html.ini b/tests/wpt/mozilla/meta/mozilla/css-paint-api/geometry-background-image-tiled-002.html.ini deleted file mode 100644 index f6665701f42..00000000000 --- a/tests/wpt/mozilla/meta/mozilla/css-paint-api/geometry-background-image-tiled-002.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[geometry-background-image-tiled-002.html] - type: reftest - expected: FAIL - bug: https://github.com/servo/servo/issues/1767 diff --git a/tests/wpt/mozilla/meta/mozilla/css-paint-api/geometry-background-image-tiled-003.html.ini b/tests/wpt/mozilla/meta/mozilla/css-paint-api/geometry-background-image-tiled-003.html.ini deleted file mode 100644 index 6d63994f2c6..00000000000 --- a/tests/wpt/mozilla/meta/mozilla/css-paint-api/geometry-background-image-tiled-003.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[geometry-background-image-tiled-003.html] - type: reftest - expected: FAIL - bug: https://github.com/servo/servo/issues/1767 |