| 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/paint/PaintPropertyTreeBuilderTest.h" | 5 #include "core/paint/PaintPropertyTreeBuilderTest.h" |
| 6 | 6 |
| 7 #include "core/html/HTMLIFrameElement.h" | 7 #include "core/html/HTMLIFrameElement.h" |
| 8 #include "core/layout/LayoutTreeAsText.h" | 8 #include "core/layout/LayoutTreeAsText.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 3288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3299 EXPECT_EQ(SkBlendMode::kDstIn, properties->mask()->blendMode()); | 3299 EXPECT_EQ(SkBlendMode::kDstIn, properties->mask()->blendMode()); |
| 3300 EXPECT_EQ(outputClip, properties->mask()->outputClip()); | 3300 EXPECT_EQ(outputClip, properties->mask()->outputClip()); |
| 3301 | 3301 |
| 3302 const ObjectPaintProperties* properties2 = | 3302 const ObjectPaintProperties* properties2 = |
| 3303 paintPropertiesForElement("overflowing"); | 3303 paintPropertiesForElement("overflowing"); |
| 3304 EXPECT_EQ(outputClip, properties2->localBorderBoxProperties()->clip()); | 3304 EXPECT_EQ(outputClip, properties2->localBorderBoxProperties()->clip()); |
| 3305 EXPECT_EQ(properties->effect(), | 3305 EXPECT_EQ(properties->effect(), |
| 3306 properties2->localBorderBoxProperties()->effect()); | 3306 properties2->localBorderBoxProperties()->effect()); |
| 3307 } | 3307 } |
| 3308 | 3308 |
| 3309 TEST_P(PaintPropertyTreeBuilderTest, MaskClipNodeInvalidation) { |
| 3310 // This test verifies the clip node generated for mask's implicit clip |
| 3311 // is correctly invalidated when a box resizes. |
| 3312 setBodyInnerHTML( |
| 3313 "<style>" |
| 3314 "#mask {" |
| 3315 " width: 100px;" |
| 3316 " height:100px;" |
| 3317 " -webkit-mask:linear-gradient(red,red);" |
| 3318 "}" |
| 3319 "</style>" |
| 3320 "<div id='mask'>" |
| 3321 " <div style='width:500px; height:500px; background:green;'></div>" |
| 3322 "</div>"); |
| 3323 const ObjectPaintProperties* properties = paintPropertiesForElement("mask"); |
| 3324 const ClipPaintPropertyNode* maskClip = properties->maskClip(); |
| 3325 EXPECT_EQ(FloatRoundedRect(8, 8, 100, 100), maskClip->clipRect()); |
| 3326 |
| 3327 Element* mask = document().getElementById("mask"); |
| 3328 mask->setAttribute(HTMLNames::styleAttr, "height: 200px"); |
| 3329 document().view()->updateAllLifecyclePhases(); |
| 3330 |
| 3331 ASSERT_EQ(properties, paintPropertiesForElement("mask")); |
| 3332 ASSERT_EQ(maskClip, properties->maskClip()); |
| 3333 EXPECT_EQ(FloatRoundedRect(8, 8, 100, 200), maskClip->clipRect()); |
| 3334 } |
| 3335 |
| 3309 } // namespace blink | 3336 } // namespace blink |
| OLD | NEW |