| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/dom/Document.h" | 5 #include "core/dom/Document.h" |
| 6 #include "core/html/HTMLIFrameElement.h" | 6 #include "core/html/HTMLIFrameElement.h" |
| 7 #include "core/layout/api/LayoutViewItem.h" | 7 #include "core/layout/api/LayoutViewItem.h" |
| 8 #include "core/paint/PaintLayer.h" | 8 #include "core/paint/PaintLayer.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "web/tests/sim/SimCompositor.h" | 10 #include "web/tests/sim/SimCompositor.h" |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 | 270 |
| 271 // The child frame still has pending sheets, and the parent frame has no | 271 // The child frame still has pending sheets, and the parent frame has no |
| 272 // invalid paint so we shouldn't draw any text. | 272 // invalid paint so we shouldn't draw any text. |
| 273 EXPECT_FALSE(frame2.contains(SimCanvas::Text)); | 273 EXPECT_FALSE(frame2.contains(SimCanvas::Text)); |
| 274 | 274 |
| 275 LayoutViewItem iframeLayoutViewItem = childFrame->contentDocument()->layoutV
iewItem(); | 275 LayoutViewItem iframeLayoutViewItem = childFrame->contentDocument()->layoutV
iewItem(); |
| 276 const DisplayItemList& displayItemList = iframeLayoutViewItem.layer()->graph
icsLayerBacking()->getPaintController().getDisplayItemList(); | 276 const DisplayItemList& displayItemList = iframeLayoutViewItem.layer()->graph
icsLayerBacking()->getPaintController().getDisplayItemList(); |
| 277 // Check that the DisplayItemList has no subsequene caching markers. These a
re not allowed in pending-style-sheets mode | 277 // Check that the DisplayItemList has no subsequene caching markers. These a
re not allowed in pending-style-sheets mode |
| 278 // since otherwise caching would be incorrect. | 278 // since otherwise caching would be incorrect. |
| 279 ASSERT_EQ(2u, displayItemList.size()); | 279 ASSERT_EQ(2u, displayItemList.size()); |
| 280 EXPECT_EQ(DisplayItem::DocumentBackground, displayItemList[0].getType()); | 280 EXPECT_EQ(DisplayItem::kDocumentBackground, displayItemList[0].getType()); |
| 281 EXPECT_EQ(DisplayItem::BoxDecorationBackground, displayItemList[1].getType()
); | 281 EXPECT_EQ(DisplayItem::kBoxDecorationBackground, displayItemList[1].getType(
)); |
| 282 | 282 |
| 283 // 1 for the main frame background (white), | 283 // 1 for the main frame background (white), |
| 284 // 1 for the iframe background (pink) | 284 // 1 for the iframe background (pink) |
| 285 // 1 for the composited transform layer in the iframe (green). | 285 // 1 for the composited transform layer in the iframe (green). |
| 286 // TODO(esprehn): Why FOUC the background (borders, etc.) of iframes and | 286 // TODO(esprehn): Why FOUC the background (borders, etc.) of iframes and |
| 287 // composited layers? Seems like a bug. | 287 // composited layers? Seems like a bug. |
| 288 EXPECT_EQ(3, frame2.drawCount()); | 288 EXPECT_EQ(3, frame2.drawCount()); |
| 289 EXPECT_TRUE(frame2.contains(SimCanvas::Rect, "white")); | 289 EXPECT_TRUE(frame2.contains(SimCanvas::Rect, "white")); |
| 290 EXPECT_TRUE(frame2.contains(SimCanvas::Rect, "pink")); | 290 EXPECT_TRUE(frame2.contains(SimCanvas::Rect, "pink")); |
| 291 EXPECT_TRUE(frame2.contains(SimCanvas::Rect, "green")); | 291 EXPECT_TRUE(frame2.contains(SimCanvas::Rect, "green")); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 cssBodyResource.complete("a { color: red; }"); | 336 cssBodyResource.complete("a { color: red; }"); |
| 337 EXPECT_TRUE(document().isRenderingReady()); | 337 EXPECT_TRUE(document().isRenderingReady()); |
| 338 | 338 |
| 339 // Finish the load, painting should stay enabled. | 339 // Finish the load, painting should stay enabled. |
| 340 mainResource.finish(); | 340 mainResource.finish(); |
| 341 EXPECT_TRUE(document().isRenderingReady()); | 341 EXPECT_TRUE(document().isRenderingReady()); |
| 342 } | 342 } |
| 343 | 343 |
| 344 | 344 |
| 345 } // namespace blink | 345 } // namespace blink |
| OLD | NEW |