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/html/HTMLIFrameElement.h" | 5 #include "core/html/HTMLIFrameElement.h" |
6 #include "core/layout/LayoutTestHelper.h" | 6 #include "core/layout/LayoutTestHelper.h" |
7 #include "core/layout/LayoutTreeAsText.h" | 7 #include "core/layout/LayoutTreeAsText.h" |
8 #include "core/layout/api/LayoutViewItem.h" | 8 #include "core/layout/api/LayoutViewItem.h" |
9 #include "core/paint/ObjectPaintProperties.h" | 9 #include "core/paint/ObjectPaintProperties.h" |
10 #include "core/paint/PaintPropertyTreePrinter.h" | 10 #include "core/paint/PaintPropertyTreePrinter.h" |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 transform->setAttribute( | 397 transform->setAttribute( |
398 HTMLNames::styleAttr, | 398 HTMLNames::styleAttr, |
399 "margin-left: 50px; margin-top: 100px; width: 400px; height: 300px; " | 399 "margin-left: 50px; margin-top: 100px; width: 400px; height: 300px; " |
400 "transform: translate3D(123px, 456px, 789px)"); | 400 "transform: translate3D(123px, 456px, 789px)"); |
401 document().view()->updateAllLifecyclePhases(); | 401 document().view()->updateAllLifecyclePhases(); |
402 EXPECT_EQ( | 402 EXPECT_EQ( |
403 TransformationMatrix().translate3d(123, 456, 789), | 403 TransformationMatrix().translate3d(123, 456, 789), |
404 transform->layoutObject()->paintProperties()->transform()->matrix()); | 404 transform->layoutObject()->paintProperties()->transform()->matrix()); |
405 } | 405 } |
406 | 406 |
| 407 TEST_P(PaintPropertyTreeBuilderTest, |
| 408 TransformNodeWithActiveAnimationHasDirectCompositingReason) { |
| 409 setBodyInnerHTML( |
| 410 "<style>" |
| 411 "@keyframes test {" |
| 412 " 0% { transform: translate(1em, 1em) } " |
| 413 " 100% { transform: translate(2em, 2em) } " |
| 414 "} " |
| 415 "</style>" |
| 416 "<div id='transform' " |
| 417 " style='animation-name: test; animation-duration: 1s'>" |
| 418 "</div>"); |
| 419 |
| 420 Element* transform = document().getElementById("transform"); |
| 421 const ObjectPaintProperties* transformProperties = |
| 422 transform->layoutObject()->paintProperties(); |
| 423 EXPECT_TRUE(transformProperties->transform()->hasDirectCompositingReasons()); |
| 424 } |
| 425 |
407 TEST_P(PaintPropertyTreeBuilderTest, WillChangeTransform) { | 426 TEST_P(PaintPropertyTreeBuilderTest, WillChangeTransform) { |
408 setBodyInnerHTML( | 427 setBodyInnerHTML( |
409 "<style> body { margin: 0 } </style>" | 428 "<style> body { margin: 0 } </style>" |
410 "<div id='transform' style='margin-left: 50px; margin-top: 100px;" | 429 "<div id='transform' style='margin-left: 50px; margin-top: 100px;" |
411 " width: 400px; height: 300px;" | 430 " width: 400px; height: 300px;" |
412 " will-change: transform'>" | 431 " will-change: transform'>" |
413 "</div>"); | 432 "</div>"); |
414 | 433 |
415 Element* transform = document().getElementById("transform"); | 434 Element* transform = document().getElementById("transform"); |
416 const ObjectPaintProperties* transformProperties = | 435 const ObjectPaintProperties* transformProperties = |
(...skipping 2860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3277 | 3296 |
3278 auto* iframeContainer = document().getElementById("iframeContainer"); | 3297 auto* iframeContainer = document().getElementById("iframeContainer"); |
3279 iframeContainer->setAttribute(HTMLNames::styleAttr, "visibility: hidden;"); | 3298 iframeContainer->setAttribute(HTMLNames::styleAttr, "visibility: hidden;"); |
3280 frameView->updateAllLifecyclePhases(); | 3299 frameView->updateAllLifecyclePhases(); |
3281 | 3300 |
3282 EXPECT_EQ(nullptr, frameScroll(frameView)); | 3301 EXPECT_EQ(nullptr, frameScroll(frameView)); |
3283 EXPECT_EQ(nullptr, frameScroll(childFrameView)); | 3302 EXPECT_EQ(nullptr, frameScroll(childFrameView)); |
3284 } | 3303 } |
3285 | 3304 |
3286 } // namespace blink | 3305 } // namespace blink |
OLD | NEW |