| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/paint/PaintPropertyTreeBuilderTest.h" | 6 #include "core/paint/PaintPropertyTreeBuilderTest.h" |
| 7 #include "core/paint/PaintPropertyTreePrinter.h" | 7 #include "core/paint/PaintPropertyTreePrinter.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 const ObjectPaintProperties* properties = | 459 const ObjectPaintProperties* properties = |
| 460 target->layoutObject()->paintProperties(); | 460 target->layoutObject()->paintProperties(); |
| 461 EXPECT_TRUE(properties->transform()->hasDirectCompositingReasons()); | 461 EXPECT_TRUE(properties->transform()->hasDirectCompositingReasons()); |
| 462 | 462 |
| 463 // Removing the animation should remove the transform node. | 463 // Removing the animation should remove the transform node. |
| 464 target->removeAttribute(HTMLNames::classAttr); | 464 target->removeAttribute(HTMLNames::classAttr); |
| 465 document().view()->updateAllLifecyclePhases(); | 465 document().view()->updateAllLifecyclePhases(); |
| 466 EXPECT_EQ(nullptr, properties->transform()); | 466 EXPECT_EQ(nullptr, properties->transform()); |
| 467 } | 467 } |
| 468 | 468 |
| 469 TEST_P(PaintPropertyTreeUpdateTest, |
| 470 EffectNodeWithAnimationLosesNodeWhenAnimationRemoved) { |
| 471 setBodyInnerHTML( |
| 472 "<style>" |
| 473 "div {" |
| 474 " width: 100px;" |
| 475 " height: 100px;" |
| 476 " background-color: red;" |
| 477 "} " |
| 478 ".animate {" |
| 479 " animation-name: test;" |
| 480 " animation-duration: 4s;" |
| 481 "}" |
| 482 "@keyframes test {" |
| 483 " from { opacity: 0.0;}" |
| 484 " to { opacity: 1.0;}" |
| 485 "}" |
| 486 "</style>" |
| 487 "<div id='target' class='animate'></div>"); |
| 488 Element* target = document().getElementById("target"); |
| 489 const ObjectPaintProperties* properties = |
| 490 target->layoutObject()->paintProperties(); |
| 491 EXPECT_TRUE(properties->effect()->hasDirectCompositingReasons()); |
| 492 |
| 493 // Removing the animation should remove the effect node. |
| 494 target->removeAttribute(HTMLNames::classAttr); |
| 495 document().view()->updateAllLifecyclePhases(); |
| 496 EXPECT_EQ(nullptr, properties->effect()); |
| 497 } |
| 498 |
| 469 } // namespace blink | 499 } // namespace blink |
| OLD | NEW |