diff options
author | Martin Robinson <mrobinson@igalia.com> | 2014-09-23 18:41:06 -0700 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2014-09-29 16:42:26 -0700 |
commit | a75594d7cf9bc1862c6a5f408ba60cabdcee89f4 (patch) | |
tree | 0b233b0195c43ae7ae8dfc2e5477c7720ffc1eb9 | |
parent | 01b4100756ec0ae1ff61d0bee5ea065396bed855 (diff) | |
download | servo-a75594d7cf9bc1862c6a5f408ba60cabdcee89f4.tar.gz servo-a75594d7cf9bc1862c6a5f408ba60cabdcee89f4.zip |
Mask root layer rectangles to their boundaries
This prevents iframes contents from overflowing their root layers.
-rw-r--r-- | components/compositing/compositor.rs | 1 | ||||
-rw-r--r-- | tests/ref/basic.list | 2 | ||||
-rw-r--r-- | tests/ref/iframe/overflow.html | 8 | ||||
-rw-r--r-- | tests/ref/iframe/overflow_ref.html | 6 |
4 files changed, 17 insertions, 0 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 0eff68b45e1..4103b0ca6d0 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -456,6 +456,7 @@ impl IOCompositor { match frame_rect { Some(ref frame_rect) => { + *root_layer.masks_to_bounds.borrow_mut() = true; *root_layer.bounds.borrow_mut() = frame_rect * self.device_pixels_per_page_px(); } None => {} diff --git a/tests/ref/basic.list b/tests/ref/basic.list index d116a17e5dc..7fe47f610ba 100644 --- a/tests/ref/basic.list +++ b/tests/ref/basic.list @@ -122,6 +122,8 @@ flaky_linux == acid2_noscroll.html acid2_ref_broken.html == iframe/simple.html iframe/simple_ref.html == iframe/multiple_external.html iframe/multiple_external_ref.html +== iframe/overflow.html iframe/overflow_ref.html + == floated_generated_content_a.html floated_generated_content_b.html == inline_block_margin_a.html inline_block_margin_ref.html == inline_block_img_a.html inline_block_img_ref.html diff --git a/tests/ref/iframe/overflow.html b/tests/ref/iframe/overflow.html new file mode 100644 index 00000000000..64456f1b418 --- /dev/null +++ b/tests/ref/iframe/overflow.html @@ -0,0 +1,8 @@ +<html> + <body> + <iframe src="data:text/html,%3Cdiv%20style%3D%22background%3Agreen%3B%20width%3A%20200px%3B%20height%3A%20200px%3B%22%3E%3C%2Fdiv%3E" + style="display: block; width: 108px; height: 108px;"> + </iframe> + </div> +</body> +</html> diff --git a/tests/ref/iframe/overflow_ref.html b/tests/ref/iframe/overflow_ref.html new file mode 100644 index 00000000000..97aad733fa8 --- /dev/null +++ b/tests/ref/iframe/overflow_ref.html @@ -0,0 +1,6 @@ +<html> + <body style="margin: 16px;"> + <div style="background: green; width: 100px; height: 100px;"></div> + </div> +</body> +</html> |