| Index: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
|
| index 1daaebdc8248f68d9e943eae140e41c3dc7d5f58..4d9dca5822ad4775cda657d282f8ea78d5a832fc 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
|
| @@ -109,12 +109,14 @@ TEST_F(PaintPropertyTreeBuilderTest, PositionAndScroll)
|
| scroller->scrollTo(0, 100);
|
| FrameView* frameView = document().view();
|
| frameView->updateAllLifecyclePhases();
|
| + ObjectPaintProperties* htmlProperties = document().documentElement()->layoutObject()->objectPaintProperties();
|
| +
|
| ObjectPaintProperties* scrollerProperties = scroller->layoutObject()->objectPaintProperties();
|
| EXPECT_EQ(TransformationMatrix().translate(0, -100), scrollerProperties->scrollTranslation()->matrix());
|
| - EXPECT_EQ(frameView->scrollTranslation(), scrollerProperties->scrollTranslation()->parent());
|
| - EXPECT_EQ(frameView->scrollTranslation(), scrollerProperties->overflowClip()->localTransformSpace());
|
| + EXPECT_EQ(htmlProperties->paintOffsetTranslation(), scrollerProperties->scrollTranslation()->parent());
|
| + EXPECT_EQ(htmlProperties->paintOffsetTranslation(), scrollerProperties->overflowClip()->localTransformSpace());
|
| EXPECT_EQ(FloatRoundedRect(120, 340, 400, 300), scrollerProperties->overflowClip()->clipRect());
|
| - EXPECT_EQ(frameView->contentClip(), scrollerProperties->overflowClip()->parent());
|
| + EXPECT_EQ(htmlProperties->overflowClip(), scrollerProperties->overflowClip()->parent());
|
|
|
| // The relative-positioned element should have accumulated box offset (exclude scrolling),
|
| // and should be affected by ancestor scroll transforms.
|
| @@ -144,6 +146,7 @@ TEST_F(PaintPropertyTreeBuilderTest, FrameScrollingTraditional)
|
|
|
| FrameView* frameView = document().view();
|
| frameView->updateAllLifecyclePhases();
|
| +
|
| EXPECT_EQ(TransformationMatrix(), frameView->preTranslation()->matrix());
|
| EXPECT_EQ(frameView->rootTransform(), frameView->preTranslation()->parent());
|
| EXPECT_EQ(nullptr, frameView->rootTransform()->parent());
|
| @@ -206,23 +209,25 @@ TEST_F(PaintPropertyTreeBuilderTest, Transform)
|
| {
|
| loadTestData("transform.html");
|
|
|
| + ObjectPaintProperties* htmlProperties = document().documentElement()->layoutObject()->objectPaintProperties();
|
| Element* transform = document().getElementById("transform");
|
| ObjectPaintProperties* transformProperties = transform->layoutObject()->objectPaintProperties();
|
| EXPECT_EQ(TransformationMatrix().translate3d(123, 456, 789), transformProperties->transform()->matrix());
|
| EXPECT_EQ(FloatPoint3D(200, 150, 0), transformProperties->transform()->origin());
|
| EXPECT_EQ(transformProperties->paintOffsetTranslation(), transformProperties->transform()->parent());
|
| EXPECT_EQ(TransformationMatrix().translate(50, 100), transformProperties->paintOffsetTranslation()->matrix());
|
| - EXPECT_EQ(document().view()->scrollTranslation(), transformProperties->paintOffsetTranslation()->parent());
|
| + EXPECT_EQ(htmlProperties->paintOffsetTranslation(), transformProperties->paintOffsetTranslation()->parent());
|
| }
|
|
|
| TEST_F(PaintPropertyTreeBuilderTest, RelativePositionInline)
|
| {
|
| loadTestData("relative-position-inline.html");
|
|
|
| + ObjectPaintProperties* htmlProperties = document().documentElement()->layoutObject()->objectPaintProperties();
|
| Element* inlineBlock = document().getElementById("inline-block");
|
| ObjectPaintProperties* inlineBlockProperties = inlineBlock->layoutObject()->objectPaintProperties();
|
| EXPECT_EQ(TransformationMatrix().translate(135, 490), inlineBlockProperties->paintOffsetTranslation()->matrix());
|
| - EXPECT_EQ(document().view()->scrollTranslation(), inlineBlockProperties->paintOffsetTranslation()->parent());
|
| + EXPECT_EQ(htmlProperties->paintOffsetTranslation(), inlineBlockProperties->paintOffsetTranslation()->parent());
|
| }
|
|
|
| TEST_F(PaintPropertyTreeBuilderTest, NestedOpacityEffect)
|
| @@ -243,7 +248,6 @@ TEST_F(PaintPropertyTreeBuilderTest, NestedOpacityEffect)
|
| LayoutObject& childWithOpacity = *document().getElementById("childWithOpacity")->layoutObject();
|
| ObjectPaintProperties* childWithOpacityProperties = childWithOpacity.objectPaintProperties();
|
| EXPECT_EQ(0.5f, childWithOpacityProperties->effect()->opacity());
|
| - // childWithOpacity is the root effect node.
|
| EXPECT_NE(nullptr, childWithOpacityProperties->effect()->parent());
|
|
|
| LayoutObject& grandChildWithoutOpacity = *document().getElementById("grandChildWithoutOpacity")->layoutObject();
|
| @@ -272,13 +276,14 @@ TEST_F(PaintPropertyTreeBuilderTest, TransformNodeDoesNotAffectEffectNodes)
|
|
|
| LayoutObject& childWithTransform = *document().getElementById("childWithTransform")->layoutObject();
|
| ObjectPaintProperties* childWithTransformProperties = childWithTransform.objectPaintProperties();
|
| - EXPECT_EQ(nullptr, childWithTransformProperties->effect());
|
| + EXPECT_TRUE(childWithTransformProperties->effect()->isIsolationNode());
|
| + EXPECT_EQ(nodeWithOpacityProperties->effect(), childWithTransformProperties->effect()->parent());
|
| EXPECT_EQ(TransformationMatrix().translate(10, 10), childWithTransformProperties->transform()->matrix());
|
|
|
| LayoutObject& grandChildWithOpacity = *document().getElementById("grandChildWithOpacity")->layoutObject();
|
| ObjectPaintProperties* grandChildWithOpacityProperties = grandChildWithOpacity.objectPaintProperties();
|
| EXPECT_EQ(0.4f, grandChildWithOpacityProperties->effect()->opacity());
|
| - EXPECT_EQ(nodeWithOpacityProperties->effect(), grandChildWithOpacityProperties->effect()->parent());
|
| + EXPECT_EQ(childWithTransformProperties->effect(), grandChildWithOpacityProperties->effect()->parent());
|
| EXPECT_EQ(nullptr, grandChildWithOpacityProperties->transform());
|
| }
|
|
|
| @@ -291,21 +296,23 @@ TEST_F(PaintPropertyTreeBuilderTest, EffectNodesAcrossStackingContext)
|
| " </div>"
|
| "</div>");
|
|
|
| + ObjectPaintProperties* htmlProperties = document().documentElement()->layoutObject()->objectPaintProperties();
|
| LayoutObject& nodeWithOpacity = *document().getElementById("nodeWithOpacity")->layoutObject();
|
| ObjectPaintProperties* nodeWithOpacityProperties = nodeWithOpacity.objectPaintProperties();
|
| EXPECT_EQ(0.6f, nodeWithOpacityProperties->effect()->opacity());
|
| - EXPECT_NE(nullptr, nodeWithOpacityProperties->effect()->parent());
|
| + EXPECT_EQ(htmlProperties->effect(), nodeWithOpacityProperties->effect()->parent());
|
| EXPECT_EQ(nullptr, nodeWithOpacityProperties->transform());
|
|
|
| LayoutObject& childWithStackingContext = *document().getElementById("childWithStackingContext")->layoutObject();
|
| ObjectPaintProperties* childWithStackingContextProperties = childWithStackingContext.objectPaintProperties();
|
| - EXPECT_EQ(nullptr, childWithStackingContextProperties->effect());
|
| + EXPECT_TRUE(childWithStackingContextProperties->effect()->isIsolationNode());
|
| + EXPECT_EQ(nodeWithOpacityProperties->effect(), childWithStackingContextProperties->effect()->parent());
|
| EXPECT_EQ(nullptr, childWithStackingContextProperties->transform());
|
|
|
| LayoutObject& grandChildWithOpacity = *document().getElementById("grandChildWithOpacity")->layoutObject();
|
| ObjectPaintProperties* grandChildWithOpacityProperties = grandChildWithOpacity.objectPaintProperties();
|
| EXPECT_EQ(0.4f, grandChildWithOpacityProperties->effect()->opacity());
|
| - EXPECT_EQ(nodeWithOpacityProperties->effect(), grandChildWithOpacityProperties->effect()->parent());
|
| + EXPECT_EQ(childWithStackingContextProperties->effect(), grandChildWithOpacityProperties->effect()->parent());
|
| EXPECT_EQ(nullptr, grandChildWithOpacityProperties->transform());
|
| }
|
|
|
| @@ -483,11 +490,12 @@ TEST_F(PaintPropertyTreeBuilderTest, SVGRootPaintOffsetTransformNode)
|
| "<svg id='svg' style='margin-left: 50px; margin-top: 25px; width: 100px; height: 100px;' />");
|
|
|
| LayoutObject& svg = *document().getElementById("svg")->layoutObject();
|
| + ObjectPaintProperties* htmlProperties = document().documentElement()->layoutObject()->objectPaintProperties();
|
| ObjectPaintProperties* svgProperties = svg.objectPaintProperties();
|
| // Ensure that a paint offset transform is not unnecessarily emitted.
|
| EXPECT_EQ(nullptr, svgProperties->paintOffsetTranslation());
|
| EXPECT_EQ(TransformationMatrix().translate(50, 25), svgProperties->svgLocalToBorderBoxTransform()->matrix());
|
| - EXPECT_EQ(document().view()->scrollTranslation(), svgProperties->svgLocalToBorderBoxTransform()->parent());
|
| + EXPECT_EQ(htmlProperties->paintOffsetTranslation(), svgProperties->svgLocalToBorderBoxTransform()->parent());
|
| }
|
|
|
| TEST_F(PaintPropertyTreeBuilderTest, SVGRootLocalToBorderBoxTransformNode)
|
| @@ -610,12 +618,12 @@ TEST_F(PaintPropertyTreeBuilderTest, ControlClip)
|
| "</style>"
|
| "<input id='button' type='button' style='width:345px; height:123px' value='some text'/>");
|
|
|
| - FrameView* frameView = document().view();
|
| + ObjectPaintProperties* htmlProperties = document().documentElement()->layoutObject()->objectPaintProperties();
|
| LayoutObject& button = *document().getElementById("button")->layoutObject();
|
| ObjectPaintProperties* buttonProperties = button.objectPaintProperties();
|
| - EXPECT_EQ(frameView->scrollTranslation(), buttonProperties->overflowClip()->localTransformSpace());
|
| + EXPECT_EQ(htmlProperties->paintOffsetTranslation(), buttonProperties->overflowClip()->localTransformSpace());
|
| EXPECT_EQ(FloatRoundedRect(5, 5, 335, 113), buttonProperties->overflowClip()->clipRect());
|
| - EXPECT_EQ(frameView->contentClip(), buttonProperties->overflowClip()->parent());
|
| + EXPECT_EQ(htmlProperties->overflowClip(), buttonProperties->overflowClip()->parent());
|
| }
|
|
|
| TEST_F(PaintPropertyTreeBuilderTest, BorderRadiusClip)
|
| @@ -638,15 +646,15 @@ TEST_F(PaintPropertyTreeBuilderTest, BorderRadiusClip)
|
| "</style>"
|
| "<div id='div'></div>");
|
|
|
| - FrameView* frameView = document().view();
|
| + ObjectPaintProperties* htmlProperties = document().documentElement()->layoutObject()->objectPaintProperties();
|
| LayoutObject& div = *document().getElementById("div")->layoutObject();
|
| ObjectPaintProperties* divProperties = div.objectPaintProperties();
|
| - EXPECT_EQ(frameView->scrollTranslation(), divProperties->overflowClip()->localTransformSpace());
|
| + EXPECT_EQ(htmlProperties->paintOffsetTranslation(), divProperties->overflowClip()->localTransformSpace());
|
| // The overflow clip rect includes only the padding box.
|
| // padding box = border box(500+60+50, 400+45+55) - border outset(60+50, 45+55) - scrollbars(15, 15)
|
| EXPECT_EQ(FloatRoundedRect(60, 45, 500, 400), divProperties->overflowClip()->clipRect());
|
| const ClipPaintPropertyNode* borderRadiusClip = divProperties->overflowClip()->parent();
|
| - EXPECT_EQ(frameView->scrollTranslation(), borderRadiusClip->localTransformSpace());
|
| + EXPECT_EQ(htmlProperties->paintOffsetTranslation(), borderRadiusClip->localTransformSpace());
|
| // The border radius clip is the area enclosed by inner border edge, including the scrollbars.
|
| // As the border-radius is specified in outer radius, the inner radius is calculated by:
|
| // inner radius = max(outer radius - border width, 0)
|
| @@ -660,7 +668,7 @@ TEST_F(PaintPropertyTreeBuilderTest, BorderRadiusClip)
|
| FloatSize(18, 23), // (bottom left) = max((78, 78) - (60, 55), (0, 0))
|
| FloatSize(6, 1)), // (bottom right) = max((56, 56) - (50, 55), (0, 0))
|
| borderRadiusClip->clipRect());
|
| - EXPECT_EQ(frameView->contentClip(), borderRadiusClip->parent());
|
| + EXPECT_EQ(htmlProperties->overflowClip(), borderRadiusClip->parent());
|
| }
|
|
|
| TEST_F(PaintPropertyTreeBuilderTest, TransformNodesAcrossSubframes)
|
| @@ -688,8 +696,11 @@ TEST_F(PaintPropertyTreeBuilderTest, TransformNodesAcrossSubframes)
|
| // Transform transform=translation=1.000000,2.000000,3.000000
|
| // PreTranslation transform=translation=2.000000,2.000000,0.000000
|
| // ScrollTranslation transform=translation=0.000000,0.000000,0.000000
|
| - // Transform transform=translation=4.000000,5.000000,6.000000
|
| - auto* innerDocumentScrollTranslation = innerDivTransform->parent();
|
| + // PaintOffsetTransform transform=translation=0.000000,0.000000,0.000000
|
| + // Transform transform=translation=4.000000,5.000000,6.000000
|
| + auto* innerDocumentHtmlTranslation = innerDivTransform->parent();
|
| + EXPECT_EQ(TransformationMatrix().translate3d(0, 0, 0), innerDocumentHtmlTranslation->matrix());
|
| + auto* innerDocumentScrollTranslation = innerDocumentHtmlTranslation->parent();
|
| EXPECT_EQ(TransformationMatrix().translate3d(0, 0, 0), innerDocumentScrollTranslation->matrix());
|
| auto* iframePreTranslation = innerDocumentScrollTranslation->parent();
|
| EXPECT_EQ(TransformationMatrix().translate3d(2, 2, 0), iframePreTranslation->matrix());
|
| @@ -713,8 +724,9 @@ TEST_F(PaintPropertyTreeBuilderTest, TransformNodesInTransformedSubframes)
|
| // Transform transform=translation=4.000000,5.000000,6.000000
|
| // PreTranslation transform=translation=42.000000,42.000000,0.000000
|
| // ScrollTranslation transform=translation=0.000000,0.000000,0.000000
|
| - // PaintOffsetTranslation transform=translation=31.000000,31.000000,0.000000
|
| - // Transform transform=translation=7.000000,8.000000,9.000000
|
| + // PaintOffssetTransform transform=0.000000,0.000000,0.000000
|
| + // PaintOffsetTranslation transform=translation=31.000000,31.000000,0.000000
|
| + // Transform transform=translation=7.000000,8.000000,9.000000
|
|
|
| LayoutObject* innerDivWithTransform = frameDocument.getElementById("transform")->layoutObject();
|
| auto* innerDivTransform = innerDivWithTransform->objectPaintProperties()->transform();
|
| @@ -722,7 +734,9 @@ TEST_F(PaintPropertyTreeBuilderTest, TransformNodesInTransformedSubframes)
|
|
|
| auto* innerDocumentPaintOffsetTranslation = innerDivTransform->parent();
|
| EXPECT_EQ(TransformationMatrix().translate3d(31, 31, 0), innerDocumentPaintOffsetTranslation->matrix());
|
| - auto* innerDocumentScrollTranslation = innerDocumentPaintOffsetTranslation->parent();
|
| + auto* innerDocumentHtmlTranslation = innerDocumentPaintOffsetTranslation->parent();
|
| + EXPECT_EQ(TransformationMatrix().translate3d(0, 0, 0), innerDocumentHtmlTranslation->matrix());
|
| + auto* innerDocumentScrollTranslation = innerDocumentHtmlTranslation->parent();
|
| EXPECT_EQ(TransformationMatrix().translate3d(0, 0, 0), innerDocumentScrollTranslation->matrix());
|
| auto* iframePreTranslation = innerDocumentScrollTranslation->parent();
|
| EXPECT_EQ(TransformationMatrix().translate3d(42, 42, 0), iframePreTranslation->matrix());
|
| @@ -781,8 +795,14 @@ TEST_F(PaintPropertyTreeBuilderTest, TreeContextUnclipFromParentStackingContext)
|
| ObjectPaintProperties* childProperties = child.objectPaintProperties();
|
|
|
| EXPECT_EQ(frameView->contentClip(), childProperties->localBorderBoxProperties()->propertyTreeState.clip);
|
| - EXPECT_EQ(frameView->scrollTranslation(), childProperties->localBorderBoxProperties()->propertyTreeState.transform);
|
| - EXPECT_EQ(scrollerProperties->effect(), childProperties->localBorderBoxProperties()->propertyTreeState.effect);
|
| +
|
| + EXPECT_EQ(childProperties->paintOffsetTranslation(), childProperties->localBorderBoxProperties()->propertyTreeState.transform);
|
| + EXPECT_TRUE(childProperties->paintOffsetTranslation()->isIsolationNode());
|
| + EXPECT_EQ(frameView->scrollTranslation(), childProperties->paintOffsetTranslation()->parent());
|
| +
|
| + EXPECT_EQ(childProperties->effect(), childProperties->localBorderBoxProperties()->propertyTreeState.effect);
|
| + EXPECT_TRUE(childProperties->effect()->isIsolationNode());
|
| + EXPECT_EQ(scrollerProperties->effect(), childProperties->effect()->parent());
|
| }
|
|
|
| TEST_F(PaintPropertyTreeBuilderTest, TableCellLayoutLocation)
|
| @@ -817,12 +837,12 @@ TEST_F(PaintPropertyTreeBuilderTest, TableCellLayoutLocation)
|
| "</table>"
|
| );
|
|
|
| - FrameView* frameView = document().view();
|
| + ObjectPaintProperties* htmlProperties = document().documentElement()->layoutObject()->objectPaintProperties();
|
| LayoutObject& target = *document().getElementById("target")->layoutObject();
|
| ObjectPaintProperties* targetProperties = target.objectPaintProperties();
|
|
|
| EXPECT_EQ(LayoutPoint(170, 170), targetProperties->localBorderBoxProperties()->paintOffset);
|
| - EXPECT_EQ(frameView->scrollTranslation(), targetProperties->localBorderBoxProperties()->propertyTreeState.transform);
|
| + EXPECT_EQ(htmlProperties->paintOffsetTranslation(), targetProperties->localBorderBoxProperties()->propertyTreeState.transform);
|
| }
|
|
|
| TEST_F(PaintPropertyTreeBuilderTest, CSSClipFixedPositionDescendant)
|
| @@ -852,11 +872,11 @@ TEST_F(PaintPropertyTreeBuilderTest, CSSClipFixedPositionDescendant)
|
| absoluteClipRect.move(123, 456);
|
|
|
| FrameView* frameView = document().view();
|
| -
|
| LayoutObject& clip = *document().getElementById("clip")->layoutObject();
|
| ObjectPaintProperties* clipProperties = clip.objectPaintProperties();
|
| EXPECT_EQ(frameView->contentClip(), clipProperties->cssClip()->parent());
|
| - EXPECT_EQ(frameView->scrollTranslation(), clipProperties->cssClip()->localTransformSpace());
|
| + EXPECT_EQ(clipProperties->paintOffsetTranslation(), clipProperties->cssClip()->localTransformSpace());
|
| + EXPECT_EQ(frameView->scrollTranslation(), clipProperties->paintOffsetTranslation()->parent());
|
| EXPECT_EQ(FloatRoundedRect(FloatRect(absoluteClipRect)), clipProperties->cssClip()->clipRect());
|
|
|
| LayoutObject& fixed = *document().getElementById("fixed")->layoutObject();
|
| @@ -903,19 +923,22 @@ TEST_F(PaintPropertyTreeBuilderTest, CSSClipFixedPositionDescendantNonShared)
|
| absoluteClipRect.move(123, 456);
|
|
|
| FrameView* frameView = document().view();
|
| + ObjectPaintProperties* htmlProperties = document().documentElement()->layoutObject()->objectPaintProperties();
|
|
|
| LayoutObject& overflow = *document().getElementById("overflow")->layoutObject();
|
| ObjectPaintProperties* overflowProperties = overflow.objectPaintProperties();
|
| - EXPECT_EQ(frameView->contentClip(), overflowProperties->overflowClip()->parent());
|
| - EXPECT_EQ(frameView->scrollTranslation(), overflowProperties->scrollTranslation()->parent());
|
| + EXPECT_EQ(htmlProperties->overflowClip(), overflowProperties->overflowClip()->parent());
|
| + EXPECT_EQ(htmlProperties->paintOffsetTranslation(), overflowProperties->scrollTranslation()->parent());
|
|
|
| LayoutObject& clip = *document().getElementById("clip")->layoutObject();
|
| ObjectPaintProperties* clipProperties = clip.objectPaintProperties();
|
| EXPECT_EQ(overflowProperties->overflowClip(), clipProperties->cssClip()->parent());
|
| - EXPECT_EQ(overflowProperties->scrollTranslation(), clipProperties->cssClip()->localTransformSpace());
|
| + EXPECT_EQ(clipProperties->paintOffsetTranslation(), clipProperties->cssClip()->localTransformSpace());
|
| + EXPECT_EQ(overflowProperties->scrollTranslation(), clipProperties->paintOffsetTranslation()->parent());
|
| EXPECT_EQ(FloatRoundedRect(FloatRect(absoluteClipRect)), clipProperties->cssClip()->clipRect());
|
| EXPECT_EQ(frameView->contentClip(), clipProperties->cssClipFixedPosition()->parent());
|
| - EXPECT_EQ(overflowProperties->scrollTranslation(), clipProperties->cssClipFixedPosition()->localTransformSpace());
|
| + EXPECT_EQ(clipProperties->paintOffsetTranslation(), clipProperties->cssClipFixedPosition()->localTransformSpace());
|
| + EXPECT_EQ(overflowProperties->scrollTranslation(), clipProperties->paintOffsetTranslation()->parent());
|
| EXPECT_EQ(FloatRoundedRect(FloatRect(absoluteClipRect)), clipProperties->cssClipFixedPosition()->clipRect());
|
|
|
| LayoutObject& fixed = *document().getElementById("fixed")->layoutObject();
|
| @@ -1184,4 +1207,64 @@ TEST_F(PaintPropertyTreeBuilderTest, CachedProperties)
|
| EXPECT_EQ(bTransformNode, cTransformNode->parent());
|
| }
|
|
|
| +TEST_F(PaintPropertyTreeBuilderTest, CachedPropertiesStackingContext)
|
| +{
|
| + setBodyInnerHTML(
|
| + "<div id='transform' style='transform: translate(33px, 44px)'>"
|
| + " <div id='stacking-context' style='position: absolute; z-index: 0'>Stacking-context</div>"
|
| + "</div>");
|
| +
|
| + Element* transform = document().getElementById("transform");
|
| + ObjectPaintProperties* transformProperties = transform->layoutObject()->objectPaintProperties();
|
| + TransformPaintPropertyNode* transformTransformNode = transformProperties->transform();
|
| + ASSERT_TRUE(transformTransformNode);
|
| + EXPECT_EQ(TransformationMatrix().translate(33, 44), transformTransformNode->matrix());
|
| +
|
| + ClipPaintPropertyNode* transformClipNode = transformProperties->overflowClip();
|
| + ASSERT_TRUE(transformClipNode);
|
| + EXPECT_TRUE(transformClipNode->isIsolationNode());
|
| +
|
| + EffectPaintPropertyNode* transformEffectNode = transformProperties->effect();
|
| + ASSERT_TRUE(transformEffectNode);
|
| + EXPECT_EQ(1.0, transformEffectNode->opacity());
|
| +
|
| + // The stacking context should have no-op isolation paint property nodes.
|
| + Element* stackingContext = document().getElementById("stacking-context");
|
| + ObjectPaintProperties* stackingContextProperties = stackingContext->layoutObject()->objectPaintProperties();
|
| + TransformPaintPropertyNode* stackingContextPaintOffsetTranslationNode = stackingContextProperties->paintOffsetTranslation();
|
| + ASSERT_TRUE(stackingContextPaintOffsetTranslationNode);
|
| + EXPECT_EQ(transformTransformNode, stackingContextPaintOffsetTranslationNode->parent());
|
| + EXPECT_TRUE(stackingContextPaintOffsetTranslationNode->isIsolationNode());
|
| +
|
| + EffectPaintPropertyNode* stackingContextEffectNode = stackingContextProperties->effect();
|
| + ASSERT_TRUE(stackingContextEffectNode);
|
| + EXPECT_EQ(transformEffectNode, stackingContextEffectNode->parent());
|
| + EXPECT_EQ(1.0, stackingContextEffectNode->opacity());
|
| +
|
| + ClipPaintPropertyNode* stackingContextClipNode = stackingContextProperties->overflowClip();
|
| + ASSERT_TRUE(stackingContextClipNode);
|
| + EXPECT_EQ(transformClipNode, stackingContextClipNode->parent());
|
| + EXPECT_TRUE(stackingContextClipNode->isIsolationNode());
|
| +
|
| + // Change transform. The 'transform' element's transform node should be a new node with the new value,
|
| + // and 'stacking-context's nodes should be unchanged (with parent adjusted).
|
| + transform->setAttribute(HTMLNames::styleAttr, "transform: translate(111px, 222px)");
|
| + document().view()->updateAllLifecyclePhases();
|
| +
|
| + EXPECT_EQ(transformProperties, transform->layoutObject()->objectPaintProperties());
|
| + EXPECT_NE(transformTransformNode, transformProperties->transform());
|
| + transformTransformNode = transformProperties->transform();
|
| + EXPECT_EQ(TransformationMatrix().translate(111, 222), transformTransformNode->matrix());
|
| + EXPECT_EQ(transformClipNode, transformProperties->overflowClip());
|
| + EXPECT_EQ(transformEffectNode, transformProperties->effect());
|
| +
|
| + EXPECT_EQ(stackingContextProperties, stackingContext->layoutObject()->objectPaintProperties());
|
| + EXPECT_EQ(stackingContextPaintOffsetTranslationNode, stackingContextProperties->paintOffsetTranslation());
|
| + EXPECT_EQ(transformTransformNode, stackingContextPaintOffsetTranslationNode->parent());
|
| + EXPECT_EQ(stackingContextClipNode, stackingContextProperties->overflowClip());
|
| + EXPECT_EQ(transformClipNode, stackingContextClipNode->parent());
|
| + EXPECT_EQ(stackingContextEffectNode, stackingContextProperties->effect());
|
| + EXPECT_EQ(transformEffectNode, stackingContextEffectNode->parent());
|
| +}
|
| +
|
| } // namespace blink
|
|
|