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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.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/compositing/CompositingInputsUpdater.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp
index 92b93ede5558f7ae7b2706123227a683fa50e9b6..808736d1679341dba7e7daf1021f787f94a3a48f 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp
@@ -28,7 +28,7 @@ void CompositingInputsUpdater::update() {
static const PaintLayer* findParentLayerOnClippingContainerChain(
const PaintLayer* layer) {
- LayoutObject* current = layer->layoutObject();
+ LayoutObject* current = &layer->layoutObject();
while (current) {
if (current->style()->position() == EPosition::kFixed) {
for (current = current->parent();
@@ -73,19 +73,19 @@ static bool hasClippedStackingAncestor(const PaintLayer* layer,
if (layer == clippingLayer)
return false;
bool foundInterveningClip = false;
- const LayoutObject* clippingLayoutObject = clippingLayer->layoutObject();
+ const LayoutObject& clippingLayoutObject = clippingLayer->layoutObject();
for (const PaintLayer* current = layer->compositingContainer(); current;
current = current->compositingContainer()) {
if (current == clippingLayer)
return foundInterveningClip;
- if (current->layoutObject()->hasClipRelatedProperty() &&
- !clippingLayoutObject->isDescendantOf(current->layoutObject()))
+ if (current->layoutObject().hasClipRelatedProperty() &&
+ !clippingLayoutObject.isDescendantOf(&current->layoutObject()))
foundInterveningClip = true;
if (const LayoutObject* container = current->clippingContainer()) {
- if (clippingLayoutObject != container &&
- !clippingLayoutObject->isDescendantOf(container))
+ if (&clippingLayoutObject != container &&
+ !clippingLayoutObject.isDescendantOf(container))
foundInterveningClip = true;
}
}
@@ -101,7 +101,7 @@ void CompositingInputsUpdater::updateRecursive(PaintLayer* layer,
const PaintLayer* previousOverflowLayer = layer->ancestorOverflowLayer();
layer->updateAncestorOverflowLayer(info.lastOverflowClipLayer);
if (info.lastOverflowClipLayer && layer->needsCompositingInputsUpdate() &&
- layer->layoutObject()->style()->position() == EPosition::kSticky) {
+ layer->layoutObject().style()->position() == EPosition::kSticky) {
if (info.lastOverflowClipLayer != previousOverflowLayer &&
!RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
// Old ancestor scroller should no longer have these constraints.
@@ -110,18 +110,18 @@ void CompositingInputsUpdater::updateRecursive(PaintLayer* layer,
->stickyConstraintsMap()
.contains(layer));
- if (info.lastOverflowClipLayer->isRootLayer())
+ if (info.lastOverflowClipLayer->isRootLayer()) {
+ layer->layoutObject().view()->frameView()->addViewportConstrainedObject(
+ layer->layoutObject());
+ } else if (previousOverflowLayer &&
+ previousOverflowLayer->isRootLayer()) {
layer->layoutObject()
- ->view()
- ->frameView()
- ->addViewportConstrainedObject(layer->layoutObject());
- else if (previousOverflowLayer && previousOverflowLayer->isRootLayer())
- layer->layoutObject()
- ->view()
+ .view()
->frameView()
->removeViewportConstrainedObject(layer->layoutObject());
+ }
}
- layer->layoutObject()->updateStickyPositionConstraints();
+ layer->layoutObject().updateStickyPositionConstraints();
// Sticky position constraints and ancestor overflow scroller affect
// the sticky layer position, so we need to update it again here.
@@ -176,7 +176,7 @@ void CompositingInputsUpdater::updateRecursive(PaintLayer* layer,
? parent
: parent->filterAncestor();
bool layerIsFixedPosition =
- layer->layoutObject()->style()->position() == EPosition::kFixed;
+ layer->layoutObject().style()->position() == EPosition::kFixed;
properties.nearestFixedPositionLayer =
layerIsFixedPosition ? layer : parent->nearestFixedPositionLayer();
@@ -185,13 +185,13 @@ void CompositingInputsUpdater::updateRecursive(PaintLayer* layer,
findParentLayerOnClippingContainerChain(layer);
const bool parentHasClipRelatedProperty =
parentLayerOnClippingContainerChain->layoutObject()
- ->hasClipRelatedProperty();
+ .hasClipRelatedProperty();
properties.clippingContainer =
parentHasClipRelatedProperty
- ? parentLayerOnClippingContainerChain->layoutObject()
+ ? &parentLayerOnClippingContainerChain->layoutObject()
: parentLayerOnClippingContainerChain->clippingContainer();
- if (layer->layoutObject()->isOutOfFlowPositioned() &&
+ if (layer->layoutObject().isOutOfFlowPositioned() &&
!layer->subtreeIsInvisible()) {
const PaintLayer* clippingLayer =
properties.clippingContainer
@@ -204,7 +204,7 @@ void CompositingInputsUpdater::updateRecursive(PaintLayer* layer,
if (info.lastScrollingAncestor) {
const LayoutObject* containingBlock =
- layer->layoutObject()->containingBlock();
+ layer->layoutObject().containingBlock();
const PaintLayer* parentLayerOnContainingBlockChain =
findParentLayerOnContainingBlockChain(containingBlock);
@@ -215,8 +215,8 @@ void CompositingInputsUpdater::updateRecursive(PaintLayer* layer,
if (layer->stackingNode()->isStacked() &&
properties.ancestorScrollingLayer &&
- !info.ancestorStackingContext->layoutObject()->isDescendantOf(
- properties.ancestorScrollingLayer->layoutObject()))
+ !info.ancestorStackingContext->layoutObject().isDescendantOf(
+ &properties.ancestorScrollingLayer->layoutObject()))
properties.scrollParent = properties.ancestorScrollingLayer;
}
}
@@ -228,16 +228,16 @@ void CompositingInputsUpdater::updateRecursive(PaintLayer* layer,
if (layer->stackingNode()->isStackingContext())
info.ancestorStackingContext = layer;
- if (layer->isRootLayer() || layer->layoutObject()->hasOverflowClip())
+ if (layer->isRootLayer() || layer->layoutObject().hasOverflowClip())
info.lastOverflowClipLayer = layer;
if (layer->scrollsOverflow())
info.lastScrollingAncestor = layer;
- if (layer->layoutObject()->hasClipRelatedProperty())
+ if (layer->layoutObject().hasClipRelatedProperty())
info.hasAncestorWithClipRelatedProperty = true;
- if (layer->layoutObject()->hasClipPath())
+ if (layer->layoutObject().hasClipPath())
info.hasAncestorWithClipPath = true;
for (PaintLayer* child = layer->firstChild(); child;
@@ -253,7 +253,7 @@ void CompositingInputsUpdater::updateRecursive(PaintLayer* layer,
// If the floating object becomes non-self-painting, so some ancestor should
// paint it; if it becomes self-painting, it should paint itself and no
// ancestor should paint it.
- if (layer->layoutObject()->isFloating()) {
+ if (layer->layoutObject().isFloating()) {
LayoutBlockFlow::updateAncestorShouldPaintFloatingObject(
*layer->layoutBox());
}

Powered by Google App Engine
This is Rietveld 408576698