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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2692853016: Change PaintLayer::m_layoutObject to a reference. (Closed)
Patch Set: Added TODO Created 3 years, 10 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/layout/LayoutObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index 35313327dd0657a44781f524fd4e155277da6f9e..68baec2858e10ef18b15fd7e1892c1b891a5824f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -985,10 +985,10 @@ IntRect LayoutObject::absoluteBoundingBoxRectIgnoringTransforms() const {
IntRect LayoutObject::absoluteElementBoundingBoxRect() const {
Vector<LayoutRect> rects;
- const LayoutBoxModelObject* container = enclosingLayer()->layoutObject();
+ const LayoutBoxModelObject& container = enclosingLayer()->layoutObject();
addElementVisualOverflowRects(
- rects, LayoutPoint(localToAncestorPoint(FloatPoint(), container)));
- return container->localToAbsoluteQuad(FloatQuad(FloatRect(unionRect(rects))))
+ rects, LayoutPoint(localToAncestorPoint(FloatPoint(), &container)));
+ return container.localToAbsoluteQuad(FloatQuad(FloatRect(unionRect(rects))))
.enclosingBoundingBox();
}
@@ -1055,7 +1055,7 @@ const LayoutBoxModelObject* LayoutObject::enclosingCompositedContainer() const {
if (PaintLayer* compositingLayer =
paintingLayer
->enclosingLayerForPaintInvalidationCrossingFrameBoundaries())
- container = compositingLayer->layoutObject();
+ container = &compositingLayer->layoutObject();
}
return container;
}
@@ -1185,7 +1185,7 @@ PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(
if (styleRef().hasOutline()) {
PaintLayer& layer = paintInvalidationState.paintingLayer();
- if (layer.layoutObject() != this)
+ if (&layer.layoutObject() != this)
layer.setNeedsPaintPhaseDescendantOutlines();
}
@@ -2362,12 +2362,12 @@ void LayoutObject::computeLayerHitTestRects(
LayoutObject* container = this->container();
currentLayer = container->enclosingLayer();
if (container && currentLayer->layoutObject() != container) {
- layerOffset.move(
- container->offsetFromAncestorContainer(currentLayer->layoutObject()));
+ layerOffset.move(container->offsetFromAncestorContainer(
+ &currentLayer->layoutObject()));
// If the layer itself is scrolled, we have to undo the subtraction of its
// scroll offset since we want the offset relative to the scrolling
// content, not the element itself.
- if (currentLayer->layoutObject()->hasOverflowClip())
+ if (currentLayer->layoutObject().hasOverflowClip())
layerOffset.move(currentLayer->layoutBox()->scrolledContentOffset());
}
}

Powered by Google App Engine
This is Rietveld 408576698