Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(663)

Unified Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp

Issue 2173363002: Improve code readibility of PaintPropertyTreeBuilder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extra "const" (might be a typo) Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 d395791a105a5efec3ad2866942af51b150265db..fba8378d174c0247d5513c8cd9c679415116e29f 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
@@ -78,7 +78,7 @@ TEST_F(PaintPropertyTreeBuilderTest, FixedPosition)
// target1 is a fixed-position element inside an absolute-position scrolling element.
// It should be attached under the viewport to skip scrolling and offset of the parent.
Element* target1 = document().getElementById("target1");
- ObjectPaintProperties* target1Properties = target1->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* target1Properties = target1->layoutObject()->objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate(200, 150), target1Properties->paintOffsetTranslation()->matrix());
EXPECT_EQ(frameView->preTranslation(), target1Properties->paintOffsetTranslation()->parent());
EXPECT_EQ(target1Properties->paintOffsetTranslation(), target1Properties->overflowClip()->localTransformSpace());
@@ -89,9 +89,9 @@ TEST_F(PaintPropertyTreeBuilderTest, FixedPosition)
// target2 is a fixed-position element inside a transformed scrolling element.
// It should be attached under the scrolled box of the transformed element.
Element* target2 = document().getElementById("target2");
- ObjectPaintProperties* target2Properties = target2->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* target2Properties = target2->layoutObject()->objectPaintProperties();
Element* scroller = document().getElementById("scroller");
- ObjectPaintProperties* scrollerProperties = scroller->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* scrollerProperties = scroller->layoutObject()->objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate(200, 150), target2Properties->paintOffsetTranslation()->matrix());
EXPECT_EQ(scrollerProperties->scrollTranslation(), target2Properties->paintOffsetTranslation()->parent());
EXPECT_EQ(target2Properties->paintOffsetTranslation(), target2Properties->overflowClip()->localTransformSpace());
@@ -109,7 +109,7 @@ TEST_F(PaintPropertyTreeBuilderTest, PositionAndScroll)
scroller->scrollTo(0, 100);
FrameView* frameView = document().view();
frameView->updateAllLifecyclePhases();
- ObjectPaintProperties* scrollerProperties = scroller->layoutObject()->objectPaintProperties();
+ const 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());
@@ -119,7 +119,7 @@ TEST_F(PaintPropertyTreeBuilderTest, PositionAndScroll)
// The relative-positioned element should have accumulated box offset (exclude scrolling),
// and should be affected by ancestor scroll transforms.
Element* relPos = document().getElementById("rel-pos");
- ObjectPaintProperties* relPosProperties = relPos->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* relPosProperties = relPos->layoutObject()->objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate(680, 1120), relPosProperties->paintOffsetTranslation()->matrix());
EXPECT_EQ(scrollerProperties->scrollTranslation(), relPosProperties->paintOffsetTranslation()->parent());
EXPECT_EQ(relPosProperties->transform(), relPosProperties->overflowClip()->localTransformSpace());
@@ -128,7 +128,7 @@ TEST_F(PaintPropertyTreeBuilderTest, PositionAndScroll)
// The absolute-positioned element should not be affected by non-positioned scroller at all.
Element* absPos = document().getElementById("abs-pos");
- ObjectPaintProperties* absPosProperties = absPos->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* absPosProperties = absPos->layoutObject()->objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate(123, 456), absPosProperties->paintOffsetTranslation()->matrix());
EXPECT_EQ(frameView->scrollTranslation(), absPosProperties->paintOffsetTranslation()->parent());
EXPECT_EQ(absPosProperties->transform(), absPosProperties->overflowClip()->localTransformSpace());
@@ -155,7 +155,7 @@ TEST_F(PaintPropertyTreeBuilderTest, FrameScrollingTraditional)
EXPECT_EQ(nullptr, frameView->rootClip()->parent());
LayoutViewItem layoutViewItem = document().layoutViewItem();
- ObjectPaintProperties* layoutViewProperties = layoutViewItem.objectPaintProperties();
+ const ObjectPaintProperties* layoutViewProperties = layoutViewItem.objectPaintProperties();
EXPECT_EQ(nullptr, layoutViewProperties->scrollTranslation());
}
@@ -179,7 +179,7 @@ TEST_F(PaintPropertyTreeBuilderTest, DISABLED_FrameScrollingRootLayerScrolls)
EXPECT_EQ(frameView->preTranslation(), frameView->scrollTranslation()->parent());
LayoutViewItem layoutViewItem = document().layoutViewItem();
- ObjectPaintProperties* layoutViewProperties = layoutViewItem.objectPaintProperties();
+ const ObjectPaintProperties* layoutViewProperties = layoutViewItem.objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate(0, -100), layoutViewProperties->scrollTranslation()->matrix());
EXPECT_EQ(frameView->scrollTranslation(), layoutViewProperties->scrollTranslation()->parent());
}
@@ -189,7 +189,7 @@ TEST_F(PaintPropertyTreeBuilderTest, Perspective)
loadTestData("perspective.html");
Element* perspective = document().getElementById("perspective");
- ObjectPaintProperties* perspectiveProperties = perspective->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* perspectiveProperties = perspective->layoutObject()->objectPaintProperties();
EXPECT_EQ(TransformationMatrix().applyPerspective(100), perspectiveProperties->perspective()->matrix());
// The perspective origin is the center of the border box plus accumulated paint offset.
EXPECT_EQ(FloatPoint3D(250, 250, 0), perspectiveProperties->perspective()->origin());
@@ -197,7 +197,7 @@ TEST_F(PaintPropertyTreeBuilderTest, Perspective)
// Adding perspective doesn't clear paint offset. The paint offset will be passed down to children.
Element* inner = document().getElementById("inner");
- ObjectPaintProperties* innerProperties = inner->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* innerProperties = inner->layoutObject()->objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate(50, 100), innerProperties->paintOffsetTranslation()->matrix());
EXPECT_EQ(perspectiveProperties->perspective(), innerProperties->paintOffsetTranslation()->parent());
}
@@ -207,7 +207,7 @@ TEST_F(PaintPropertyTreeBuilderTest, Transform)
loadTestData("transform.html");
Element* transform = document().getElementById("transform");
- ObjectPaintProperties* transformProperties = transform->layoutObject()->objectPaintProperties();
+ const 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());
@@ -220,7 +220,7 @@ TEST_F(PaintPropertyTreeBuilderTest, RelativePositionInline)
loadTestData("relative-position-inline.html");
Element* inlineBlock = document().getElementById("inline-block");
- ObjectPaintProperties* inlineBlockProperties = inlineBlock->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* inlineBlockProperties = inlineBlock->layoutObject()->objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate(135, 490), inlineBlockProperties->paintOffsetTranslation()->matrix());
EXPECT_EQ(document().view()->scrollTranslation(), inlineBlockProperties->paintOffsetTranslation()->parent());
}
@@ -237,11 +237,11 @@ TEST_F(PaintPropertyTreeBuilderTest, NestedOpacityEffect)
"</div>");
LayoutObject& nodeWithoutOpacity = *document().getElementById("nodeWithoutOpacity")->layoutObject();
- ObjectPaintProperties* nodeWithoutOpacityProperties = nodeWithoutOpacity.objectPaintProperties();
+ const ObjectPaintProperties* nodeWithoutOpacityProperties = nodeWithoutOpacity.objectPaintProperties();
EXPECT_NE(nullptr, nodeWithoutOpacityProperties);
LayoutObject& childWithOpacity = *document().getElementById("childWithOpacity")->layoutObject();
- ObjectPaintProperties* childWithOpacityProperties = childWithOpacity.objectPaintProperties();
+ const ObjectPaintProperties* childWithOpacityProperties = childWithOpacity.objectPaintProperties();
EXPECT_EQ(0.5f, childWithOpacityProperties->effect()->opacity());
// childWithOpacity is the root effect node.
EXPECT_NE(nullptr, childWithOpacityProperties->effect()->parent());
@@ -250,7 +250,7 @@ TEST_F(PaintPropertyTreeBuilderTest, NestedOpacityEffect)
EXPECT_NE(nullptr, grandChildWithoutOpacity.objectPaintProperties());
LayoutObject& greatGrandChildWithOpacity = *document().getElementById("greatGrandChildWithOpacity")->layoutObject();
- ObjectPaintProperties* greatGrandChildWithOpacityProperties = greatGrandChildWithOpacity.objectPaintProperties();
+ const ObjectPaintProperties* greatGrandChildWithOpacityProperties = greatGrandChildWithOpacity.objectPaintProperties();
EXPECT_EQ(0.2f, greatGrandChildWithOpacityProperties->effect()->opacity());
EXPECT_EQ(childWithOpacityProperties->effect(), greatGrandChildWithOpacityProperties->effect()->parent());
}
@@ -265,18 +265,18 @@ TEST_F(PaintPropertyTreeBuilderTest, TransformNodeDoesNotAffectEffectNodes)
"</div>");
LayoutObject& nodeWithOpacity = *document().getElementById("nodeWithOpacity")->layoutObject();
- ObjectPaintProperties* nodeWithOpacityProperties = nodeWithOpacity.objectPaintProperties();
+ const ObjectPaintProperties* nodeWithOpacityProperties = nodeWithOpacity.objectPaintProperties();
EXPECT_EQ(0.6f, nodeWithOpacityProperties->effect()->opacity());
EXPECT_NE(nullptr, nodeWithOpacityProperties->effect()->parent());
EXPECT_EQ(nullptr, nodeWithOpacityProperties->transform());
LayoutObject& childWithTransform = *document().getElementById("childWithTransform")->layoutObject();
- ObjectPaintProperties* childWithTransformProperties = childWithTransform.objectPaintProperties();
+ const ObjectPaintProperties* childWithTransformProperties = childWithTransform.objectPaintProperties();
EXPECT_EQ(nullptr, childWithTransformProperties->effect());
EXPECT_EQ(TransformationMatrix().translate(10, 10), childWithTransformProperties->transform()->matrix());
LayoutObject& grandChildWithOpacity = *document().getElementById("grandChildWithOpacity")->layoutObject();
- ObjectPaintProperties* grandChildWithOpacityProperties = grandChildWithOpacity.objectPaintProperties();
+ const ObjectPaintProperties* grandChildWithOpacityProperties = grandChildWithOpacity.objectPaintProperties();
EXPECT_EQ(0.4f, grandChildWithOpacityProperties->effect()->opacity());
EXPECT_EQ(nodeWithOpacityProperties->effect(), grandChildWithOpacityProperties->effect()->parent());
EXPECT_EQ(nullptr, grandChildWithOpacityProperties->transform());
@@ -292,18 +292,18 @@ TEST_F(PaintPropertyTreeBuilderTest, EffectNodesAcrossStackingContext)
"</div>");
LayoutObject& nodeWithOpacity = *document().getElementById("nodeWithOpacity")->layoutObject();
- ObjectPaintProperties* nodeWithOpacityProperties = nodeWithOpacity.objectPaintProperties();
+ const ObjectPaintProperties* nodeWithOpacityProperties = nodeWithOpacity.objectPaintProperties();
EXPECT_EQ(0.6f, nodeWithOpacityProperties->effect()->opacity());
EXPECT_NE(nullptr, nodeWithOpacityProperties->effect()->parent());
EXPECT_EQ(nullptr, nodeWithOpacityProperties->transform());
LayoutObject& childWithStackingContext = *document().getElementById("childWithStackingContext")->layoutObject();
- ObjectPaintProperties* childWithStackingContextProperties = childWithStackingContext.objectPaintProperties();
+ const ObjectPaintProperties* childWithStackingContextProperties = childWithStackingContext.objectPaintProperties();
EXPECT_EQ(nullptr, childWithStackingContextProperties->effect());
EXPECT_EQ(nullptr, childWithStackingContextProperties->transform());
LayoutObject& grandChildWithOpacity = *document().getElementById("grandChildWithOpacity")->layoutObject();
- ObjectPaintProperties* grandChildWithOpacityProperties = grandChildWithOpacity.objectPaintProperties();
+ const ObjectPaintProperties* grandChildWithOpacityProperties = grandChildWithOpacity.objectPaintProperties();
EXPECT_EQ(0.4f, grandChildWithOpacityProperties->effect()->opacity());
EXPECT_EQ(nodeWithOpacityProperties->effect(), grandChildWithOpacityProperties->effect()->parent());
EXPECT_EQ(nullptr, grandChildWithOpacityProperties->transform());
@@ -323,28 +323,28 @@ TEST_F(PaintPropertyTreeBuilderTest, EffectNodesInSVG)
"</svg>");
LayoutObject& groupWithOpacity = *document().getElementById("groupWithOpacity")->layoutObject();
- ObjectPaintProperties* groupWithOpacityProperties = groupWithOpacity.objectPaintProperties();
+ const ObjectPaintProperties* groupWithOpacityProperties = groupWithOpacity.objectPaintProperties();
EXPECT_EQ(0.6f, groupWithOpacityProperties->effect()->opacity());
EXPECT_NE(nullptr, groupWithOpacityProperties->effect()->parent());
LayoutObject& rectWithoutOpacity = *document().getElementById("rectWithoutOpacity")->layoutObject();
- ObjectPaintProperties* rectWithoutOpacityProperties = rectWithoutOpacity.objectPaintProperties();
+ const ObjectPaintProperties* rectWithoutOpacityProperties = rectWithoutOpacity.objectPaintProperties();
EXPECT_EQ(nullptr, rectWithoutOpacityProperties);
LayoutObject& rectWithOpacity = *document().getElementById("rectWithOpacity")->layoutObject();
- ObjectPaintProperties* rectWithOpacityProperties = rectWithOpacity.objectPaintProperties();
+ const ObjectPaintProperties* rectWithOpacityProperties = rectWithOpacity.objectPaintProperties();
EXPECT_EQ(0.4f, rectWithOpacityProperties->effect()->opacity());
EXPECT_EQ(groupWithOpacityProperties->effect(), rectWithOpacityProperties->effect()->parent());
// Ensure that opacity nodes are created for LayoutSVGText which inherits from LayoutSVGBlock instead of LayoutSVGModelObject.
LayoutObject& textWithOpacity = *document().getElementById("textWithOpacity")->layoutObject();
- ObjectPaintProperties* textWithOpacityProperties = textWithOpacity.objectPaintProperties();
+ const ObjectPaintProperties* textWithOpacityProperties = textWithOpacity.objectPaintProperties();
EXPECT_EQ(0.2f, textWithOpacityProperties->effect()->opacity());
EXPECT_EQ(groupWithOpacityProperties->effect(), textWithOpacityProperties->effect()->parent());
// Ensure that opacity nodes are created for LayoutSVGTSpan which inherits from LayoutSVGInline instead of LayoutSVGModelObject.
LayoutObject& tspanWithOpacity = *document().getElementById("tspanWithOpacity")->layoutObject();
- ObjectPaintProperties* tspanWithOpacityProperties = tspanWithOpacity.objectPaintProperties();
+ const ObjectPaintProperties* tspanWithOpacityProperties = tspanWithOpacity.objectPaintProperties();
EXPECT_EQ(0.1f, tspanWithOpacityProperties->effect()->opacity());
EXPECT_EQ(textWithOpacityProperties->effect(), tspanWithOpacityProperties->effect()->parent());
}
@@ -359,17 +359,17 @@ TEST_F(PaintPropertyTreeBuilderTest, EffectNodesAcrossHTMLSVGBoundary)
"</div>");
LayoutObject& divWithOpacity = *document().getElementById("divWithOpacity")->layoutObject();
- ObjectPaintProperties* divWithOpacityProperties = divWithOpacity.objectPaintProperties();
+ const ObjectPaintProperties* divWithOpacityProperties = divWithOpacity.objectPaintProperties();
EXPECT_EQ(0.2f, divWithOpacityProperties->effect()->opacity());
EXPECT_NE(nullptr, divWithOpacityProperties->effect()->parent());
LayoutObject& svgRootWithOpacity = *document().getElementById("svgRootWithOpacity")->layoutObject();
- ObjectPaintProperties* svgRootWithOpacityProperties = svgRootWithOpacity.objectPaintProperties();
+ const ObjectPaintProperties* svgRootWithOpacityProperties = svgRootWithOpacity.objectPaintProperties();
EXPECT_EQ(0.3f, svgRootWithOpacityProperties->effect()->opacity());
EXPECT_EQ(divWithOpacityProperties->effect(), svgRootWithOpacityProperties->effect()->parent());
LayoutObject& rectWithOpacity = *document().getElementById("rectWithOpacity")->layoutObject();
- ObjectPaintProperties* rectWithOpacityProperties = rectWithOpacity.objectPaintProperties();
+ const ObjectPaintProperties* rectWithOpacityProperties = rectWithOpacity.objectPaintProperties();
EXPECT_EQ(0.4f, rectWithOpacityProperties->effect()->opacity());
EXPECT_EQ(svgRootWithOpacityProperties->effect(), rectWithOpacityProperties->effect()->parent());
}
@@ -386,17 +386,17 @@ TEST_F(PaintPropertyTreeBuilderTest, EffectNodesAcrossSVGHTMLBoundary)
"</svg>");
LayoutObject& svgRootWithOpacity = *document().getElementById("svgRootWithOpacity")->layoutObject();
- ObjectPaintProperties* svgRootWithOpacityProperties = svgRootWithOpacity.objectPaintProperties();
+ const ObjectPaintProperties* svgRootWithOpacityProperties = svgRootWithOpacity.objectPaintProperties();
EXPECT_EQ(0.3f, svgRootWithOpacityProperties->effect()->opacity());
EXPECT_NE(nullptr, svgRootWithOpacityProperties->effect()->parent());
LayoutObject& foreignObjectWithOpacity = *document().getElementById("foreignObjectWithOpacity")->layoutObject();
- ObjectPaintProperties* foreignObjectWithOpacityProperties = foreignObjectWithOpacity.objectPaintProperties();
+ const ObjectPaintProperties* foreignObjectWithOpacityProperties = foreignObjectWithOpacity.objectPaintProperties();
EXPECT_EQ(0.4f, foreignObjectWithOpacityProperties->effect()->opacity());
EXPECT_EQ(svgRootWithOpacityProperties->effect(), foreignObjectWithOpacityProperties->effect()->parent());
LayoutObject& spanWithOpacity = *document().getElementById("spanWithOpacity")->layoutObject();
- ObjectPaintProperties* spanWithOpacityProperties = spanWithOpacity.objectPaintProperties();
+ const ObjectPaintProperties* spanWithOpacityProperties = spanWithOpacity.objectPaintProperties();
EXPECT_EQ(0.5f, spanWithOpacityProperties->effect()->opacity());
EXPECT_EQ(foreignObjectWithOpacityProperties->effect(), spanWithOpacityProperties->effect()->parent());
}
@@ -425,7 +425,7 @@ TEST_F(PaintPropertyTreeBuilderTest, TransformNodesInSVG)
"</svg>");
LayoutObject& svgRootWith3dTransform = *document().getElementById("svgRootWith3dTransform")->layoutObject();
- ObjectPaintProperties* svgRootWith3dTransformProperties = svgRootWith3dTransform.objectPaintProperties();
+ const ObjectPaintProperties* svgRootWith3dTransformProperties = svgRootWith3dTransform.objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate3d(1, 2, 3), svgRootWith3dTransformProperties->transform()->matrix());
EXPECT_EQ(FloatPoint3D(50, 50, 0), svgRootWith3dTransformProperties->transform()->origin());
EXPECT_EQ(svgRootWith3dTransformProperties->paintOffsetTranslation(), svgRootWith3dTransformProperties->transform()->parent());
@@ -433,7 +433,7 @@ TEST_F(PaintPropertyTreeBuilderTest, TransformNodesInSVG)
EXPECT_EQ(document().view()->scrollTranslation(), svgRootWith3dTransformProperties->paintOffsetTranslation()->parent());
LayoutObject& rectWith2dTransform = *document().getElementById("rectWith2dTransform")->layoutObject();
- ObjectPaintProperties* rectWith2dTransformProperties = rectWith2dTransform.objectPaintProperties();
+ const ObjectPaintProperties* rectWith2dTransformProperties = rectWith2dTransform.objectPaintProperties();
TransformationMatrix matrix;
matrix.translate(100, 100);
matrix.rotate(45);
@@ -465,13 +465,13 @@ TEST_F(PaintPropertyTreeBuilderTest, SVGViewBoxTransform)
"</svg>");
LayoutObject& svgWithViewBox = *document().getElementById("svgWithViewBox")->layoutObject();
- ObjectPaintProperties* svgWithViewBoxProperties = svgWithViewBox.objectPaintProperties();
+ const ObjectPaintProperties* svgWithViewBoxProperties = svgWithViewBox.objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate3d(1, 2, 3), svgWithViewBoxProperties->transform()->matrix());
EXPECT_EQ(TransformationMatrix().translate(-50, -50), svgWithViewBoxProperties->svgLocalToBorderBoxTransform()->matrix());
EXPECT_EQ(svgWithViewBoxProperties->svgLocalToBorderBoxTransform()->parent(), svgWithViewBoxProperties->transform());
LayoutObject& rect = *document().getElementById("rect")->layoutObject();
- ObjectPaintProperties* rectProperties = rect.objectPaintProperties();
+ const ObjectPaintProperties* rectProperties = rect.objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate(100, 100), rectProperties->transform()->matrix());
EXPECT_EQ(svgWithViewBoxProperties->svgLocalToBorderBoxTransform(), rectProperties->transform()->parent());
}
@@ -483,7 +483,7 @@ 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* svgProperties = svg.objectPaintProperties();
+ const 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());
@@ -502,7 +502,7 @@ TEST_F(PaintPropertyTreeBuilderTest, SVGRootLocalToBorderBoxTransformNode)
"</svg>");
LayoutObject& svg = *document().getElementById("svg")->layoutObject();
- ObjectPaintProperties* svgProperties = svg.objectPaintProperties();
+ const ObjectPaintProperties* svgProperties = svg.objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate(2, 3), svgProperties->paintOffsetTranslation()->matrix());
EXPECT_EQ(TransformationMatrix().translate(5, 7), svgProperties->transform()->matrix());
EXPECT_EQ(TransformationMatrix().translate(11, 11).scale(100.0 / 13.0), svgProperties->svgLocalToBorderBoxTransform()->matrix());
@@ -511,7 +511,7 @@ TEST_F(PaintPropertyTreeBuilderTest, SVGRootLocalToBorderBoxTransformNode)
// Ensure the rect's transform is a child of the local to border box transform.
LayoutObject& rect = *document().getElementById("rect")->layoutObject();
- ObjectPaintProperties* rectProperties = rect.objectPaintProperties();
+ const ObjectPaintProperties* rectProperties = rect.objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate(17, 19), rectProperties->transform()->matrix());
EXPECT_EQ(svgProperties->svgLocalToBorderBoxTransform(), rectProperties->transform()->parent());
}
@@ -527,18 +527,18 @@ TEST_F(PaintPropertyTreeBuilderTest, SVGNestedViewboxTransforms)
"</svg>");
LayoutObject& svg = *document().getElementById("svg")->layoutObject();
- ObjectPaintProperties* svgProperties = svg.objectPaintProperties();
+ const ObjectPaintProperties* svgProperties = svg.objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate(11, 11), svgProperties->transform()->matrix());
EXPECT_EQ(TransformationMatrix().scale(2), svgProperties->svgLocalToBorderBoxTransform()->matrix());
LayoutObject& nestedSvg = *document().getElementById("nestedSvg")->layoutObject();
- ObjectPaintProperties* nestedSvgProperties = nestedSvg.objectPaintProperties();
+ const ObjectPaintProperties* nestedSvgProperties = nestedSvg.objectPaintProperties();
EXPECT_EQ(TransformationMatrix().scale(10), nestedSvgProperties->transform()->matrix());
EXPECT_EQ(nullptr, nestedSvgProperties->svgLocalToBorderBoxTransform());
EXPECT_EQ(svgProperties->svgLocalToBorderBoxTransform(), nestedSvgProperties->transform()->parent());
LayoutObject& rect = *document().getElementById("rect")->layoutObject();
- ObjectPaintProperties* rectProperties = rect.objectPaintProperties();
+ const ObjectPaintProperties* rectProperties = rect.objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate(13, 13), rectProperties->transform()->matrix());
EXPECT_EQ(nestedSvgProperties->transform(), rectProperties->transform()->parent());
}
@@ -556,11 +556,11 @@ TEST_F(PaintPropertyTreeBuilderTest, TransformNodesAcrossSVGHTMLBoundary)
"</svg>");
LayoutObject& svgWithTransform = *document().getElementById("svgWithTransform")->layoutObject();
- ObjectPaintProperties* svgWithTransformProperties = svgWithTransform.objectPaintProperties();
+ const ObjectPaintProperties* svgWithTransformProperties = svgWithTransform.objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate3d(1, 2, 3), svgWithTransformProperties->transform()->matrix());
LayoutObject& divWithTransform = *document().getElementById("divWithTransform")->layoutObject();
- ObjectPaintProperties* divWithTransformProperties = divWithTransform.objectPaintProperties();
+ const ObjectPaintProperties* divWithTransformProperties = divWithTransform.objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate3d(3, 4, 5), divWithTransformProperties->transform()->matrix());
// Ensure the div's transform node is a child of the svg's transform node.
EXPECT_EQ(svgWithTransformProperties->transform(), divWithTransformProperties->transform()->parent());
@@ -581,16 +581,16 @@ TEST_F(PaintPropertyTreeBuilderTest, FixedTransformAncestorAcrossSVGHTMLBoundary
"</svg>");
LayoutObject& svg = *document().getElementById("svg")->layoutObject();
- ObjectPaintProperties* svgProperties = svg.objectPaintProperties();
+ const ObjectPaintProperties* svgProperties = svg.objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate3d(1, 2, 3), svgProperties->transform()->matrix());
LayoutObject& container = *document().getElementById("container")->layoutObject();
- ObjectPaintProperties* containerProperties = container.objectPaintProperties();
+ const ObjectPaintProperties* containerProperties = container.objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate(20, 30), containerProperties->transform()->matrix());
EXPECT_EQ(svgProperties->transform(), containerProperties->transform()->parent());
Element* fixed = document().getElementById("fixed");
- ObjectPaintProperties* fixedProperties = fixed->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* fixedProperties = fixed->layoutObject()->objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate(200, 150), fixedProperties->paintOffsetTranslation()->matrix());
// Ensure the fixed position element is rooted at the nearest transform container.
EXPECT_EQ(containerProperties->transform(), fixedProperties->paintOffsetTranslation()->parent());
@@ -612,7 +612,7 @@ TEST_F(PaintPropertyTreeBuilderTest, ControlClip)
FrameView* frameView = document().view();
LayoutObject& button = *document().getElementById("button")->layoutObject();
- ObjectPaintProperties* buttonProperties = button.objectPaintProperties();
+ const ObjectPaintProperties* buttonProperties = button.objectPaintProperties();
EXPECT_EQ(frameView->scrollTranslation(), buttonProperties->overflowClip()->localTransformSpace());
EXPECT_EQ(FloatRoundedRect(5, 5, 335, 113), buttonProperties->overflowClip()->clipRect());
EXPECT_EQ(frameView->contentClip(), buttonProperties->overflowClip()->parent());
@@ -640,7 +640,7 @@ TEST_F(PaintPropertyTreeBuilderTest, BorderRadiusClip)
FrameView* frameView = document().view();
LayoutObject& div = *document().getElementById("div")->layoutObject();
- ObjectPaintProperties* divProperties = div.objectPaintProperties();
+ const ObjectPaintProperties* divProperties = div.objectPaintProperties();
EXPECT_EQ(frameView->scrollTranslation(), 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)
@@ -674,11 +674,11 @@ TEST_F(PaintPropertyTreeBuilderTest, TransformNodesAcrossSubframes)
document().view()->updateAllLifecyclePhases();
LayoutObject& divWithTransform = *document().getElementById("divWithTransform")->layoutObject();
- ObjectPaintProperties* divWithTransformProperties = divWithTransform.objectPaintProperties();
+ const ObjectPaintProperties* divWithTransformProperties = divWithTransform.objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate3d(1, 2, 3), divWithTransformProperties->transform()->matrix());
LayoutObject* innerDivWithTransform = frameDocument.getElementById("transform")->layoutObject();
- ObjectPaintProperties* innerDivWithTransformProperties = innerDivWithTransform->objectPaintProperties();
+ const ObjectPaintProperties* innerDivWithTransformProperties = innerDivWithTransform->objectPaintProperties();
auto* innerDivTransform = innerDivWithTransformProperties->transform();
EXPECT_EQ(TransformationMatrix().translate3d(4, 5, 6), innerDivTransform->matrix());
@@ -751,9 +751,9 @@ TEST_F(PaintPropertyTreeBuilderTest, TreeContextClipByNonStackingContext)
);
LayoutObject& scroller = *document().getElementById("scroller")->layoutObject();
- ObjectPaintProperties* scrollerProperties = scroller.objectPaintProperties();
+ const ObjectPaintProperties* scrollerProperties = scroller.objectPaintProperties();
LayoutObject& child = *document().getElementById("child")->layoutObject();
- ObjectPaintProperties* childProperties = child.objectPaintProperties();
+ const ObjectPaintProperties* childProperties = child.objectPaintProperties();
EXPECT_EQ(scrollerProperties->overflowClip(), childProperties->localBorderBoxProperties()->propertyTreeState.clip);
EXPECT_EQ(scrollerProperties->scrollTranslation(), childProperties->localBorderBoxProperties()->propertyTreeState.transform);
@@ -776,9 +776,9 @@ TEST_F(PaintPropertyTreeBuilderTest, TreeContextUnclipFromParentStackingContext)
FrameView* frameView = document().view();
LayoutObject& scroller = *document().getElementById("scroller")->layoutObject();
- ObjectPaintProperties* scrollerProperties = scroller.objectPaintProperties();
+ const ObjectPaintProperties* scrollerProperties = scroller.objectPaintProperties();
LayoutObject& child = *document().getElementById("child")->layoutObject();
- ObjectPaintProperties* childProperties = child.objectPaintProperties();
+ const ObjectPaintProperties* childProperties = child.objectPaintProperties();
EXPECT_EQ(frameView->contentClip(), childProperties->localBorderBoxProperties()->propertyTreeState.clip);
EXPECT_EQ(frameView->scrollTranslation(), childProperties->localBorderBoxProperties()->propertyTreeState.transform);
@@ -819,7 +819,7 @@ TEST_F(PaintPropertyTreeBuilderTest, TableCellLayoutLocation)
FrameView* frameView = document().view();
LayoutObject& target = *document().getElementById("target")->layoutObject();
- ObjectPaintProperties* targetProperties = target.objectPaintProperties();
+ const ObjectPaintProperties* targetProperties = target.objectPaintProperties();
EXPECT_EQ(LayoutPoint(170, 170), targetProperties->localBorderBoxProperties()->paintOffset);
EXPECT_EQ(frameView->scrollTranslation(), targetProperties->localBorderBoxProperties()->propertyTreeState.transform);
@@ -854,13 +854,13 @@ TEST_F(PaintPropertyTreeBuilderTest, CSSClipFixedPositionDescendant)
FrameView* frameView = document().view();
LayoutObject& clip = *document().getElementById("clip")->layoutObject();
- ObjectPaintProperties* clipProperties = clip.objectPaintProperties();
+ const ObjectPaintProperties* clipProperties = clip.objectPaintProperties();
EXPECT_EQ(frameView->contentClip(), clipProperties->cssClip()->parent());
EXPECT_EQ(frameView->scrollTranslation(), clipProperties->cssClip()->localTransformSpace());
EXPECT_EQ(FloatRoundedRect(FloatRect(absoluteClipRect)), clipProperties->cssClip()->clipRect());
LayoutObject& fixed = *document().getElementById("fixed")->layoutObject();
- ObjectPaintProperties* fixedProperties = fixed.objectPaintProperties();
+ const ObjectPaintProperties* fixedProperties = fixed.objectPaintProperties();
EXPECT_EQ(clipProperties->cssClip(), fixedProperties->localBorderBoxProperties()->propertyTreeState.clip);
EXPECT_EQ(frameView->preTranslation(), fixedProperties->localBorderBoxProperties()->propertyTreeState.transform->parent());
EXPECT_EQ(TransformationMatrix().translate(654, 321), fixedProperties->localBorderBoxProperties()->propertyTreeState.transform->matrix());
@@ -905,12 +905,12 @@ TEST_F(PaintPropertyTreeBuilderTest, CSSClipFixedPositionDescendantNonShared)
FrameView* frameView = document().view();
LayoutObject& overflow = *document().getElementById("overflow")->layoutObject();
- ObjectPaintProperties* overflowProperties = overflow.objectPaintProperties();
+ const ObjectPaintProperties* overflowProperties = overflow.objectPaintProperties();
EXPECT_EQ(frameView->contentClip(), overflowProperties->overflowClip()->parent());
EXPECT_EQ(frameView->scrollTranslation(), overflowProperties->scrollTranslation()->parent());
LayoutObject& clip = *document().getElementById("clip")->layoutObject();
- ObjectPaintProperties* clipProperties = clip.objectPaintProperties();
+ const ObjectPaintProperties* clipProperties = clip.objectPaintProperties();
EXPECT_EQ(overflowProperties->overflowClip(), clipProperties->cssClip()->parent());
EXPECT_EQ(overflowProperties->scrollTranslation(), clipProperties->cssClip()->localTransformSpace());
EXPECT_EQ(FloatRoundedRect(FloatRect(absoluteClipRect)), clipProperties->cssClip()->clipRect());
@@ -919,7 +919,7 @@ TEST_F(PaintPropertyTreeBuilderTest, CSSClipFixedPositionDescendantNonShared)
EXPECT_EQ(FloatRoundedRect(FloatRect(absoluteClipRect)), clipProperties->cssClipFixedPosition()->clipRect());
LayoutObject& fixed = *document().getElementById("fixed")->layoutObject();
- ObjectPaintProperties* fixedProperties = fixed.objectPaintProperties();
+ const ObjectPaintProperties* fixedProperties = fixed.objectPaintProperties();
EXPECT_EQ(clipProperties->cssClipFixedPosition(), fixedProperties->localBorderBoxProperties()->propertyTreeState.clip);
EXPECT_EQ(frameView->preTranslation(), fixedProperties->localBorderBoxProperties()->propertyTreeState.transform->parent());
EXPECT_EQ(TransformationMatrix().translate(654, 321), fixedProperties->localBorderBoxProperties()->propertyTreeState.transform->matrix());
@@ -952,11 +952,11 @@ TEST_F(PaintPropertyTreeBuilderTest, FractionalPaintOffset)
"</div>"
);
- ObjectPaintProperties* aProperties = document().getElementById("a")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* aProperties = document().getElementById("a")->layoutObject()->objectPaintProperties();
LayoutPoint aPaintOffset = LayoutPoint(FloatPoint(0.1, 0.3));
EXPECT_EQ(aPaintOffset, aProperties->localBorderBoxProperties()->paintOffset);
- ObjectPaintProperties* bProperties = document().getElementById("b")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* bProperties = document().getElementById("b")->layoutObject()->objectPaintProperties();
LayoutPoint bPaintOffset = aPaintOffset + LayoutPoint(FloatPoint(0.5, 11.1));
EXPECT_EQ(bPaintOffset, bProperties->localBorderBoxProperties()->paintOffset);
}
@@ -975,7 +975,7 @@ TEST_F(PaintPropertyTreeBuilderTest, PaintOffsetWithBasicPixelSnapping)
"</div>"
);
- ObjectPaintProperties* bProperties = document().getElementById("b")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* bProperties = document().getElementById("b")->layoutObject()->objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate3d(0, 0, 0), bProperties->transform()->matrix());
// The paint offset transform should be snapped from (0.3,0.3) to (0,0).
EXPECT_EQ(TransformationMatrix().translate(0, 0), bProperties->transform()->parent()->matrix());
@@ -985,7 +985,7 @@ TEST_F(PaintPropertyTreeBuilderTest, PaintOffsetWithBasicPixelSnapping)
// c should be painted starting at subpixelAccumulation + (0.1,0.1) = (0.4,0.4).
LayoutPoint cPaintOffset = subpixelAccumulation + LayoutPoint(FloatPoint(0.1, 0.1));
- ObjectPaintProperties* cProperties = document().getElementById("c")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* cProperties = document().getElementById("c")->layoutObject()->objectPaintProperties();
EXPECT_EQ(cPaintOffset, cProperties->localBorderBoxProperties()->paintOffset);
}
@@ -1003,7 +1003,7 @@ TEST_F(PaintPropertyTreeBuilderTest, PaintOffsetWithPixelSnappingThroughTransfor
"</div>"
);
- ObjectPaintProperties* bProperties = document().getElementById("b")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* bProperties = document().getElementById("b")->layoutObject()->objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate3d(0, 0, 0), bProperties->transform()->matrix());
// The paint offset transform should be snapped from (0.7,0.7) to (1,1).
EXPECT_EQ(TransformationMatrix().translate(1, 1), bProperties->transform()->parent()->matrix());
@@ -1013,7 +1013,7 @@ TEST_F(PaintPropertyTreeBuilderTest, PaintOffsetWithPixelSnappingThroughTransfor
// c should be painted starting at subpixelAccumulation + (0.7,0.7) = (0.4,0.4).
LayoutPoint cPaintOffset = subpixelAccumulation + LayoutPoint(FloatPoint(0.7, 0.7));
- ObjectPaintProperties* cProperties = document().getElementById("c")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* cProperties = document().getElementById("c")->layoutObject()->objectPaintProperties();
EXPECT_EQ(cPaintOffset, cProperties->localBorderBoxProperties()->paintOffset);
}
@@ -1033,7 +1033,7 @@ TEST_F(PaintPropertyTreeBuilderTest, PaintOffsetWithPixelSnappingThroughMultiple
"</div>"
);
- ObjectPaintProperties* bProperties = document().getElementById("b")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* bProperties = document().getElementById("b")->layoutObject()->objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate3d(5, 7, 0), bProperties->transform()->matrix());
// The paint offset transform should be snapped from (0.7,0.7) to (1,1).
EXPECT_EQ(TransformationMatrix().translate(1, 1), bProperties->transform()->parent()->matrix());
@@ -1041,7 +1041,7 @@ TEST_F(PaintPropertyTreeBuilderTest, PaintOffsetWithPixelSnappingThroughMultiple
LayoutPoint subpixelAccumulation = LayoutPoint(LayoutPoint(FloatPoint(0.7, 0.7)) - LayoutPoint(1, 1));
EXPECT_EQ(subpixelAccumulation, bProperties->localBorderBoxProperties()->paintOffset);
- ObjectPaintProperties* cProperties = document().getElementById("c")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* cProperties = document().getElementById("c")->layoutObject()->objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate3d(11, 13, 0), cProperties->transform()->matrix());
// The paint offset should be (-0.3,-0.3) but the paint offset transform should still be at
// (0,0) because it should be snapped.
@@ -1051,7 +1051,7 @@ TEST_F(PaintPropertyTreeBuilderTest, PaintOffsetWithPixelSnappingThroughMultiple
// d should be painted starting at subpixelAccumulation + (0.7,0.7) = (0.4,0.4).
LayoutPoint dPaintOffset = subpixelAccumulation + LayoutPoint(FloatPoint(0.7, 0.7));
- ObjectPaintProperties* dProperties = document().getElementById("d")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* dProperties = document().getElementById("d")->layoutObject()->objectPaintProperties();
EXPECT_EQ(dPaintOffset, dProperties->localBorderBoxProperties()->paintOffset);
}
@@ -1070,7 +1070,7 @@ TEST_F(PaintPropertyTreeBuilderTest, PaintOffsetWithPixelSnappingWithFixedPos)
"</div>"
);
- ObjectPaintProperties* bProperties = document().getElementById("b")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* bProperties = document().getElementById("b")->layoutObject()->objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate(0, 0), bProperties->transform()->matrix());
// The paint offset transform should be snapped from (0.7,0) to (1,0).
EXPECT_EQ(TransformationMatrix().translate(1, 0), bProperties->transform()->parent()->matrix());
@@ -1078,13 +1078,13 @@ TEST_F(PaintPropertyTreeBuilderTest, PaintOffsetWithPixelSnappingWithFixedPos)
LayoutPoint subpixelAccumulation = LayoutPoint(LayoutPoint(FloatPoint(0.7, 0)) - LayoutPoint(1, 0));
EXPECT_EQ(subpixelAccumulation, bProperties->localBorderBoxProperties()->paintOffset);
- ObjectPaintProperties* fixedProperties = document().getElementById("fixed")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* fixedProperties = document().getElementById("fixed")->layoutObject()->objectPaintProperties();
// The residual subpixel adjustment should still be (-0.3,0).
EXPECT_EQ(subpixelAccumulation, fixedProperties->localBorderBoxProperties()->paintOffset);
// d should be painted starting at subpixelAccumulation + (0.7,0) = (0.4,0).
LayoutPoint dPaintOffset = subpixelAccumulation + LayoutPoint(FloatPoint(0.7, 0));
- ObjectPaintProperties* dProperties = document().getElementById("d")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* dProperties = document().getElementById("d")->layoutObject()->objectPaintProperties();
EXPECT_EQ(dPaintOffset, dProperties->localBorderBoxProperties()->paintOffset);
}
@@ -1096,13 +1096,13 @@ TEST_F(PaintPropertyTreeBuilderTest, SvgPixelSnappingShouldResetPaintOffset)
"</svg>");
LayoutObject& svgWithTransform = *document().getElementById("svg")->layoutObject();
- ObjectPaintProperties* svgWithTransformProperties = svgWithTransform.objectPaintProperties();
+ const ObjectPaintProperties* svgWithTransformProperties = svgWithTransform.objectPaintProperties();
EXPECT_EQ(TransformationMatrix(), svgWithTransformProperties->transform()->matrix());
EXPECT_EQ(LayoutPoint(FloatPoint(0.1, 0)), svgWithTransformProperties->localBorderBoxProperties()->paintOffset);
EXPECT_EQ(nullptr, svgWithTransformProperties->svgLocalToBorderBoxTransform());
LayoutObject& rectWithTransform = *document().getElementById("rect")->layoutObject();
- ObjectPaintProperties* rectWithTransformProperties = rectWithTransform.objectPaintProperties();
+ const ObjectPaintProperties* rectWithTransformProperties = rectWithTransform.objectPaintProperties();
EXPECT_EQ(TransformationMatrix().translate(1, 1), rectWithTransformProperties->transform()->matrix());
// Ensure there is no PaintOffset transform between the rect and the svg's transform.
@@ -1113,7 +1113,7 @@ TEST_F(PaintPropertyTreeBuilderTest, NoRenderingContextByDefault)
{
setBodyInnerHTML("<div style=\"transform: translateZ(0)\"></div>");
- ObjectPaintProperties* properties = document().body()->firstChild()->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* properties = document().body()->firstChild()->layoutObject()->objectPaintProperties();
ASSERT_TRUE(properties->transform());
EXPECT_FALSE(properties->transform()->hasRenderingContext());
}
@@ -1126,8 +1126,8 @@ TEST_F(PaintPropertyTreeBuilderTest, Preserve3DCreatesSharedRenderingContext)
" <div id=\"b\" style=\"transform: translateZ(0)\"></div>"
"</div>");
- ObjectPaintProperties* aProperties = document().getElementById("a")->layoutObject()->objectPaintProperties();
- ObjectPaintProperties* bProperties = document().getElementById("b")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* aProperties = document().getElementById("a")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* bProperties = document().getElementById("b")->layoutObject()->objectPaintProperties();
ASSERT_TRUE(aProperties->transform() && bProperties->transform());
EXPECT_NE(aProperties->transform(), bProperties->transform());
EXPECT_TRUE(aProperties->transform()->hasRenderingContext());
@@ -1145,8 +1145,8 @@ TEST_F(PaintPropertyTreeBuilderTest, FlatTransformStyleEndsRenderingContext)
"</div>");
ASSERT_FALSE(document().getElementById("a")->layoutObject()->styleRef().preserves3D());
- ObjectPaintProperties* aProperties = document().getElementById("a")->layoutObject()->objectPaintProperties();
- ObjectPaintProperties* bProperties = document().getElementById("b")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* aProperties = document().getElementById("a")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* bProperties = document().getElementById("b")->layoutObject()->objectPaintProperties();
ASSERT_TRUE(aProperties->transform() && bProperties->transform());
// #a should participate in a rendering context (due to its parent), but its
@@ -1167,8 +1167,8 @@ TEST_F(PaintPropertyTreeBuilderTest, NestedRenderingContexts)
"</div>");
ASSERT_FALSE(document().getElementById("a")->layoutObject()->styleRef().preserves3D());
- ObjectPaintProperties* aProperties = document().getElementById("a")->layoutObject()->objectPaintProperties();
- ObjectPaintProperties* bProperties = document().getElementById("b")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* aProperties = document().getElementById("a")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* bProperties = document().getElementById("b")->layoutObject()->objectPaintProperties();
ASSERT_TRUE(aProperties->transform() && bProperties->transform());
// #a should participate in a rendering context (due to its parent). Its
@@ -1249,8 +1249,8 @@ TEST_F(PaintPropertyTreeBuilderTest, PerspectiveIsNotFlattened)
" <div id=\"b\" style=\"transform: translateZ(0)\"></div>"
"</div>");
- ObjectPaintProperties* aProperties = document().getElementById("a")->layoutObject()->objectPaintProperties();
- ObjectPaintProperties* bProperties = document().getElementById("b")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* aProperties = document().getElementById("a")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* bProperties = document().getElementById("b")->layoutObject()->objectPaintProperties();
const TransformPaintPropertyNode* aPerspective = aProperties->perspective();
ASSERT_TRUE(aPerspective);
const TransformPaintPropertyNode* bTransform = bProperties->transform();
@@ -1269,8 +1269,8 @@ TEST_F(PaintPropertyTreeBuilderTest, PerspectiveDoesNotEstablishRenderingContext
" <div id=\"b\" style=\"transform: translateZ(0)\"></div>"
"</div>");
- ObjectPaintProperties* aProperties = document().getElementById("a")->layoutObject()->objectPaintProperties();
- ObjectPaintProperties* bProperties = document().getElementById("b")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* aProperties = document().getElementById("a")->layoutObject()->objectPaintProperties();
+ const ObjectPaintProperties* bProperties = document().getElementById("b")->layoutObject()->objectPaintProperties();
const TransformPaintPropertyNode* aPerspective = aProperties->perspective();
ASSERT_TRUE(aPerspective);
EXPECT_FALSE(aPerspective->hasRenderingContext());
@@ -1289,18 +1289,18 @@ TEST_F(PaintPropertyTreeBuilderTest, CachedProperties)
"</div>");
Element* a = document().getElementById("a");
- ObjectPaintProperties* aProperties = a->layoutObject()->objectPaintProperties();
- TransformPaintPropertyNode* aTransformNode = aProperties->transform();
+ const ObjectPaintProperties* aProperties = a->layoutObject()->objectPaintProperties();
+ const TransformPaintPropertyNode* aTransformNode = aProperties->transform();
EXPECT_EQ(TransformationMatrix().translate(33, 44), aTransformNode->matrix());
Element* b = document().getElementById("b");
- ObjectPaintProperties* bProperties = b->layoutObject()->objectPaintProperties();
- TransformPaintPropertyNode* bTransformNode = bProperties->transform();
+ const ObjectPaintProperties* bProperties = b->layoutObject()->objectPaintProperties();
+ const TransformPaintPropertyNode* bTransformNode = bProperties->transform();
EXPECT_EQ(TransformationMatrix().translate(55, 66), bTransformNode->matrix());
Element* c = document().getElementById("c");
- ObjectPaintProperties* cProperties = c->layoutObject()->objectPaintProperties();
- TransformPaintPropertyNode* cTransformNode = cProperties->transform();
+ const ObjectPaintProperties* cProperties = c->layoutObject()->objectPaintProperties();
+ const TransformPaintPropertyNode* cTransformNode = cProperties->transform();
EXPECT_EQ(TransformationMatrix().translate(77, 88), cTransformNode->matrix());
// Change transform of b. B's transform node should be a new node with the new value,

Powered by Google App Engine
This is Rietveld 408576698