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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 "<div style='transform: translateZ(0); background: green;'>" | 257 "<div style='transform: translateZ(0); background: green;'>" |
258 " <p style='background: blue;'>Hello Layer</p>" | 258 " <p style='background: blue;'>Hello Layer</p>" |
259 " <div style='position: relative; background: red;'>Hello World</div>
" | 259 " <div style='position: relative; background: red;'>Hello World</div>
" |
260 "</div>" | 260 "</div>" |
261 ); | 261 ); |
262 | 262 |
263 // Trigger a layout with pending sheets. For example a page could trigger | 263 // Trigger a layout with pending sheets. For example a page could trigger |
264 // this by doing offsetTop in a setTimeout, or by a parent frame executing | 264 // this by doing offsetTop in a setTimeout, or by a parent frame executing |
265 // script that touched offsetTop in the child frame. | 265 // script that touched offsetTop in the child frame. |
266 auto* childFrame = toHTMLIFrameElement(document().getElementById("frame")); | 266 auto* childFrame = toHTMLIFrameElement(document().getElementById("frame")); |
267 childFrame->contentDocument()->updateLayoutIgnorePendingStylesheets(); | 267 childFrame->contentDocument()->updateStyleAndLayoutIgnorePendingStylesheets(
); |
268 | 268 |
269 auto frame2 = compositor().beginFrame(); | 269 auto frame2 = compositor().beginFrame(); |
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 |
(...skipping 58 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 |