diff options
author | Alan Jeffrey <ajeffrey@mozilla.com> | 2017-06-21 12:56:21 -0500 |
---|---|---|
committer | Alan Jeffrey <ajeffrey@mozilla.com> | 2017-06-22 09:51:30 -0500 |
commit | dded87e402707514f4a0627709db95da454912dc (patch) | |
tree | ce7fb18bdc1f862acc6b4f63997a7b5c921a2f10 /components/layout | |
parent | b211664e877a3e4d712314fa7f3002fd19cff549 (diff) | |
download | servo-dded87e402707514f4a0627709db95da454912dc.tar.gz servo-dded87e402707514f4a0627709db95da454912dc.zip |
Paint worklet size should agree with Chrome.
Diffstat (limited to 'components/layout')
-rw-r--r-- | components/layout/display_list_builder.rs | 8 |
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! |