Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp |
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp |
index 22b69f679c0e5f21ec526f9ac6e97a7168158c83..7e06c7a5103037d730fc2e215b02993b614cf424 100644 |
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp |
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp |
@@ -698,25 +698,24 @@ TEST_P(CompositedLayerMappingTest, |
} |
TEST_P(CompositedLayerMappingTest, InterestRectOfIframeInScrolledDiv) { |
+ setChildFrameHTML( |
+ "<style>body { margin: 0; } #target { width: 200px; height: 200px; " |
+ "will-change: transform}</style><div id=target></div>"); |
+ |
document().setBaseURLOverride(KURL(ParsedURLString, "http://test.com")); |
setBodyInnerHTML( |
"<style>body { margin: 0; }</style>" |
"<div style='width: 200; height: 8000px'></div>" |
- "<iframe id=frame src='http://test.com' width='500' height='500' " |
+ "<iframe src='http://test.com' width='500' height='500' " |
"frameBorder='0'>" |
"</iframe>"); |
- Document& frameDocument = setupChildIframe( |
- "frame", |
- "<style>body { margin: 0; } #target { width: 200px; height: 200px; " |
- "will-change: transform}</style><div id=target></div>"); |
- |
// Scroll 8000 pixels down to move the iframe into view. |
document().view()->layoutViewportScrollableArea()->setScrollOffset( |
ScrollOffset(0.0, 8000.0), ProgrammaticScroll); |
document().view()->updateAllLifecyclePhases(); |
- Element* target = frameDocument.getElementById("target"); |
+ Element* target = childDocument().getElementById("target"); |
ASSERT_TRUE(target); |
EXPECT_RECT_EQ( |
@@ -726,37 +725,41 @@ TEST_P(CompositedLayerMappingTest, InterestRectOfIframeInScrolledDiv) { |
} |
TEST_P(CompositedLayerMappingTest, InterestRectOfScrolledIframe) { |
+ setChildFrameHTML( |
+ "<style>body { margin: 0; } #target { width: 200px; " |
+ "height: 8000px;}</style><div id=target></div>"); |
+ |
document().setBaseURLOverride(KURL(ParsedURLString, "http://test.com")); |
document().frame()->settings()->setPreferCompositingToLCDTextEnabled(true); |
setBodyInnerHTML( |
"<style>body { margin: 0; } ::-webkit-scrollbar { display: none; " |
"}</style>" |
- "<iframe id=frame src='http://test.com' width='500' height='500' " |
+ "<iframe src='http://test.com' width='500' height='500' " |
"frameBorder='0'>" |
"</iframe>"); |
- Document& frameDocument = |
- setupChildIframe("frame", |
- "<style>body { margin: 0; } #target { width: 200px; " |
- "height: 8000px;}</style><div id=target></div>"); |
- |
document().view()->updateAllLifecyclePhases(); |
// Scroll 7500 pixels down to bring the scrollable area to the bottom. |
- frameDocument.view()->layoutViewportScrollableArea()->setScrollOffset( |
+ childDocument().view()->layoutViewportScrollableArea()->setScrollOffset( |
ScrollOffset(0.0, 7500.0), ProgrammaticScroll); |
document().view()->updateAllLifecyclePhases(); |
- ASSERT_TRUE(frameDocument.view()->layoutViewItem().hasLayer()); |
+ ASSERT_TRUE(childDocument().view()->layoutViewItem().hasLayer()); |
EXPECT_RECT_EQ( |
IntRect(0, 3500, 500, 4500), |
- recomputeInterestRect(frameDocument.view() |
+ recomputeInterestRect(childDocument() |
+ .view() |
->layoutViewItem() |
.enclosingLayer() |
->graphicsLayerBackingForScrolling())); |
} |
TEST_P(CompositedLayerMappingTest, InterestRectOfIframeWithContentBoxOffset) { |
+ setChildFrameHTML( |
+ "<style>body { margin: 0; } #target { width: 200px; " |
+ "height: 8000px;}</style> <div id=target></div>"); |
+ |
document().setBaseURLOverride(KURL(ParsedURLString, "http://test.com")); |
document().frame()->settings()->setPreferCompositingToLCDTextEnabled(true); |
// Set a 10px border in order to have a contentBoxOffset for the iframe |
@@ -764,28 +767,24 @@ TEST_P(CompositedLayerMappingTest, InterestRectOfIframeWithContentBoxOffset) { |
setBodyInnerHTML( |
"<style>body { margin: 0; } #frame { border: 10px solid black; } " |
"::-webkit-scrollbar { display: none; }</style>" |
- "<iframe id=frame src='http://test.com' width='500' height='500' " |
+ "<iframe src='http://test.com' width='500' height='500' " |
"frameBorder='0'>" |
"</iframe>"); |
- Document& frameDocument = |
- setupChildIframe("frame", |
- "<style>body { margin: 0; } #target { width: 200px; " |
- "height: 8000px;}</style> <div id=target></div>"); |
- |
document().view()->updateAllLifecyclePhases(); |
// Scroll 3000 pixels down to bring the scrollable area to somewhere in the |
// middle. |
- frameDocument.view()->layoutViewportScrollableArea()->setScrollOffset( |
+ childDocument().view()->layoutViewportScrollableArea()->setScrollOffset( |
ScrollOffset(0.0, 3000.0), ProgrammaticScroll); |
document().view()->updateAllLifecyclePhases(); |
- ASSERT_TRUE(frameDocument.view()->layoutViewItem().hasLayer()); |
+ ASSERT_TRUE(childDocument().view()->layoutViewItem().hasLayer()); |
// The width is 485 pixels due to the size of the scrollbar. |
EXPECT_RECT_EQ( |
IntRect(0, 0, 500, 7500), |
- recomputeInterestRect(frameDocument.view() |
+ recomputeInterestRect(childDocument() |
+ .view() |
->layoutViewItem() |
.enclosingLayer() |
->graphicsLayerBackingForScrolling())); |