From a75594d7cf9bc1862c6a5f408ba60cabdcee89f4 Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Tue, 23 Sep 2014 18:41:06 -0700 Subject: [PATCH] Mask root layer rectangles to their boundaries This prevents iframes contents from overflowing their root layers. --- components/compositing/compositor.rs | 1 + tests/ref/basic.list | 2 ++ tests/ref/iframe/overflow.html | 8 ++++++++ tests/ref/iframe/overflow_ref.html | 6 ++++++ 4 files changed, 17 insertions(+) create mode 100644 tests/ref/iframe/overflow.html create mode 100644 tests/ref/iframe/overflow_ref.html 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 @@ + + + + + + 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 @@ + + +
+ + +