aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/display_list_builder.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout/display_list_builder.rs')
-rw-r--r--components/layout/display_list_builder.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs
index 69242321c7e..8828994c056 100644
--- a/components/layout/display_list_builder.rs
+++ b/components/layout/display_list_builder.rs
@@ -1154,10 +1154,14 @@ impl FragmentDisplayListBuilding for Fragment {
paint_worklet: &PaintWorklet,
index: usize)
{
- // TODO: check that this is the servo equivalent of "concrete object size".
+ // This should be the "concrete object size" of the fragment.
// https://drafts.css-houdini.org/css-paint-api/#draw-a-paint-image
// https://drafts.csswg.org/css-images-3/#concrete-object-size
- let size = self.content_box().size.to_physical(style.writing_mode);
+ // Experimentally, chrome is using the size in px of the box,
+ // including padding, but not border or margin, so we follow suit.
+ // https://github.com/w3c/css-houdini-drafts/issues/417
+ let unbordered_box = self.border_box - style.logical_border_width();
+ let size = unbordered_box.size.to_physical(style.writing_mode);
let name = paint_worklet.name.clone();
// If the script thread has not added any paint worklet modules, there is nothing to do!