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

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

Issue 2474603002: Don't include LayoutObject-derived headers where not needed. (Closed)
Patch Set: Created 4 years, 1 month 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/PaintLayerPainterTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
index 4f9d8fbd583f4d7e42507ef5392b5955f8ced62f..6cce25b0d4b3b0c3e81e87f5268b321b7a41d05c 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
@@ -2,8 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "core/layout/LayoutBlock.h"
-#include "core/layout/LayoutInline.h"
+#include "core/layout/LayoutBoxModelObject.h"
#include "core/layout/compositing/CompositedLayerMapping.h"
#include "core/paint/PaintControllerPaintTest.h"
#include "platform/graphics/GraphicsContext.h"
@@ -404,7 +403,7 @@ TEST_P(PaintLayerPainterTest, PaintPhaseOutline) {
->setAttribute(HTMLNames::styleAttr, styleWithoutOutline);
document().view()->updateAllLifecyclePhases();
- LayoutBlock& selfPaintingLayerObject = *toLayoutBlock(
+ LayoutBoxModelObject& selfPaintingLayerObject = *toLayoutBoxModelObject(
document().getElementById("self-painting-layer")->layoutObject());
PaintLayer& selfPaintingLayer = *selfPaintingLayerObject.layer();
ASSERT_TRUE(selfPaintingLayer.isSelfPaintingLayer());
@@ -468,7 +467,7 @@ TEST_P(PaintLayerPainterTest, PaintPhaseFloat) {
->setAttribute(HTMLNames::styleAttr, styleWithoutFloat);
document().view()->updateAllLifecyclePhases();
- LayoutBlock& selfPaintingLayerObject = *toLayoutBlock(
+ LayoutBoxModelObject& selfPaintingLayerObject = *toLayoutBoxModelObject(
document().getElementById("self-painting-layer")->layoutObject());
PaintLayer& selfPaintingLayer = *selfPaintingLayerObject.layer();
ASSERT_TRUE(selfPaintingLayer.isSelfPaintingLayer());
@@ -515,12 +514,12 @@ TEST_P(PaintLayerPainterTest, PaintPhaseFloatUnderInlineLayer) {
document().view()->updateAllLifecyclePhases();
LayoutObject& floatDiv = *document().getElementById("float")->layoutObject();
- LayoutInline& span =
- *toLayoutInline(document().getElementById("span")->layoutObject());
+ LayoutBoxModelObject& span = *toLayoutBoxModelObject(
+ document().getElementById("span")->layoutObject());
PaintLayer& spanLayer = *span.layer();
ASSERT_TRUE(&spanLayer == floatDiv.enclosingLayer());
ASSERT_FALSE(spanLayer.needsPaintPhaseFloat());
- LayoutBlock& selfPaintingLayerObject = *toLayoutBlock(
+ LayoutBoxModelObject& selfPaintingLayerObject = *toLayoutBoxModelObject(
document().getElementById("self-painting-layer")->layoutObject());
PaintLayer& selfPaintingLayer = *selfPaintingLayerObject.layer();
ASSERT_TRUE(selfPaintingLayer.isSelfPaintingLayer());
@@ -556,7 +555,7 @@ TEST_P(PaintLayerPainterTest, PaintPhaseBlockBackground) {
->setAttribute(HTMLNames::styleAttr, styleWithoutBackground);
document().view()->updateAllLifecyclePhases();
- LayoutBlock& selfPaintingLayerObject = *toLayoutBlock(
+ LayoutBoxModelObject& selfPaintingLayerObject = *toLayoutBoxModelObject(
document().getElementById("self-painting-layer")->layoutObject());
PaintLayer& selfPaintingLayer = *selfPaintingLayerObject.layer();
ASSERT_TRUE(selfPaintingLayer.isSelfPaintingLayer());
@@ -615,8 +614,8 @@ TEST_P(PaintLayerPainterTest, PaintPhasesUpdateOnLayerRemoval) {
" </div>"
"</div>");
- LayoutBlock& layerDiv =
- *toLayoutBlock(document().getElementById("layer")->layoutObject());
+ LayoutBoxModelObject& layerDiv = *toLayoutBoxModelObject(
+ document().getElementById("layer")->layoutObject());
PaintLayer& layer = *layerDiv.layer();
ASSERT_TRUE(layer.isSelfPaintingLayer());
EXPECT_TRUE(layer.needsPaintPhaseDescendantOutlines());
@@ -624,7 +623,8 @@ TEST_P(PaintLayerPainterTest, PaintPhasesUpdateOnLayerRemoval) {
EXPECT_TRUE(layer.needsPaintPhaseDescendantBlockBackgrounds());
PaintLayer& htmlLayer =
- *toLayoutBlock(document().documentElement()->layoutObject())->layer();
+ *toLayoutBoxModelObject(document().documentElement()->layoutObject())
+ ->layer();
EXPECT_FALSE(htmlLayer.needsPaintPhaseDescendantOutlines());
EXPECT_FALSE(htmlLayer.needsPaintPhaseFloat());
EXPECT_FALSE(htmlLayer.needsPaintPhaseDescendantBlockBackgrounds());
@@ -648,12 +648,13 @@ TEST_P(PaintLayerPainterTest, PaintPhasesUpdateOnLayerAddition) {
" </div>"
"</div>");
- LayoutBlock& layerDiv = *toLayoutBlock(
+ LayoutBoxModelObject& layerDiv = *toLayoutBoxModelObject(
document().getElementById("will-be-layer")->layoutObject());
EXPECT_FALSE(layerDiv.hasLayer());
PaintLayer& htmlLayer =
- *toLayoutBlock(document().documentElement()->layoutObject())->layer();
+ *toLayoutBoxModelObject(document().documentElement()->layoutObject())
+ ->layer();
EXPECT_TRUE(htmlLayer.needsPaintPhaseDescendantOutlines());
EXPECT_TRUE(htmlLayer.needsPaintPhaseFloat());
EXPECT_TRUE(htmlLayer.needsPaintPhaseDescendantBlockBackgrounds());
@@ -679,13 +680,14 @@ TEST_P(PaintLayerPainterTest, PaintPhasesUpdateOnBecomingSelfPainting) {
" </div>"
"</div>");
- LayoutBlock& layerDiv = *toLayoutBlock(
+ LayoutBoxModelObject& layerDiv = *toLayoutBoxModelObject(
document().getElementById("will-be-self-painting")->layoutObject());
ASSERT_TRUE(layerDiv.hasLayer());
EXPECT_FALSE(layerDiv.layer()->isSelfPaintingLayer());
PaintLayer& htmlLayer =
- *toLayoutBlock(document().documentElement()->layoutObject())->layer();
+ *toLayoutBoxModelObject(document().documentElement()->layoutObject())
+ ->layer();
EXPECT_TRUE(htmlLayer.needsPaintPhaseDescendantOutlines());
EXPECT_TRUE(htmlLayer.needsPaintPhaseDescendantBlockBackgrounds());
@@ -710,7 +712,7 @@ TEST_P(PaintLayerPainterTest, PaintPhasesUpdateOnBecomingNonSelfPainting) {
" </div>"
"</div>");
- LayoutBlock& layerDiv = *toLayoutBlock(
+ LayoutBoxModelObject& layerDiv = *toLayoutBoxModelObject(
document().getElementById("will-be-non-self-painting")->layoutObject());
ASSERT_TRUE(layerDiv.hasLayer());
PaintLayer& layer = *layerDiv.layer();
@@ -719,7 +721,8 @@ TEST_P(PaintLayerPainterTest, PaintPhasesUpdateOnBecomingNonSelfPainting) {
EXPECT_TRUE(layer.needsPaintPhaseDescendantBlockBackgrounds());
PaintLayer& htmlLayer =
- *toLayoutBlock(document().documentElement()->layoutObject())->layer();
+ *toLayoutBoxModelObject(document().documentElement()->layoutObject())
+ ->layer();
EXPECT_FALSE(htmlLayer.needsPaintPhaseDescendantOutlines());
EXPECT_FALSE(htmlLayer.needsPaintPhaseDescendantBlockBackgrounds());
@@ -748,7 +751,8 @@ TEST_P(PaintLayerPainterTest,
"green'>Cell</td></tr>"
"</table>");
- LayoutBlock& table = *toLayoutBlock(getLayoutObjectByElementId("table"));
+ LayoutBoxModelObject& table =
+ *toLayoutBoxModelObject(getLayoutObjectByElementId("table"));
ASSERT_TRUE(table.hasLayer());
PaintLayer& layer = *table.layer();
EXPECT_TRUE(layer.isSelfPaintingLayer());
@@ -768,7 +772,8 @@ TEST_P(PaintLayerPainterTest,
"green'>Cell</td></tr>"
"</table>");
- LayoutBlock& table = *toLayoutBlock(getLayoutObjectByElementId("table"));
+ LayoutBoxModelObject& table =
+ *toLayoutBoxModelObject(getLayoutObjectByElementId("table"));
ASSERT_TRUE(table.hasLayer());
PaintLayer& layer = *table.layer();
EXPECT_TRUE(layer.isSelfPaintingLayer());

Powered by Google App Engine
This is Rietveld 408576698