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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp

Issue 1308273010: Adapt and reland old position sticky implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: WIP - fix on release, still hits CHECK in LayoutGeometryMap.cpp:156 Created 4 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 5fe741f854763cfcd01ec40b6d637b6c10f2e528..52fc69583cee0420e45c17c314428c8d8f4420e4 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp
@@ -4,7 +4,9 @@
#include "core/layout/compositing/CompositingInputsUpdater.h"
+#include "core/frame/FrameView.h"
#include "core/layout/LayoutBlock.h"
+#include "core/layout/LayoutView.h"
#include "core/layout/compositing/CompositedLayerMapping.h"
#include "core/layout/compositing/PaintLayerCompositor.h"
#include "core/paint/PaintLayer.h"
@@ -25,7 +27,7 @@ CompositingInputsUpdater::~CompositingInputsUpdater()
void CompositingInputsUpdater::update()
{
TRACE_EVENT0("blink", "CompositingInputsUpdater::update");
- updateRecursive(m_rootLayer, DoNotForceUpdate, AncestorInfo());
+ updateRecursive(m_rootLayer, DoNotForceUpdate, AncestorInfo(m_rootLayer));
}
static const PaintLayer* findParentLayerOnClippingContainerChain(const PaintLayer* layer)
@@ -136,9 +138,14 @@ void CompositingInputsUpdater::updateRecursive(PaintLayer* layer, UpdateType upd
properties.clippingContainer = parentHasClipRelatedProperty ? parentLayerOnClippingContainerChain->layoutObject() : parentLayerOnClippingContainerChain->clippingContainer();
}
+ const LayoutObject* containingBlock = layer->layoutObject()->containingBlock();
+ const PaintLayer* parentLayerOnContainingBlockChain = findParentLayerOnContainingBlockChain(containingBlock);
+
+ rareProperties.ancestorOverflowLayer = parentLayerOnContainingBlockChain->ancestorOverflowLayer();
+ if (parentLayerOnContainingBlockChain->layoutObject()->hasOverflowClip())
+ rareProperties.ancestorOverflowLayer = parentLayerOnContainingBlockChain;
+
if (info.lastScrollingAncestor) {
- const LayoutObject* containingBlock = layer->layoutObject()->containingBlock();
- const PaintLayer* parentLayerOnContainingBlockChain = findParentLayerOnContainingBlockChain(containingBlock);
rareProperties.ancestorScrollingLayer = parentLayerOnContainingBlockChain->ancestorScrollingLayer();
if (parentLayerOnContainingBlockChain->scrollsOverflow())
@@ -155,6 +162,16 @@ void CompositingInputsUpdater::updateRecursive(PaintLayer* layer, UpdateType upd
&& !info.ancestorStackingContext->layoutObject()->isDescendantOf(rareProperties.ancestorScrollingLayer->layoutObject()))
rareProperties.scrollParent = rareProperties.ancestorScrollingLayer;
}
+
+ if (layer->layoutObject()->style()->position() == StickyPosition) {
+ if (info.lastOverflowLayer->isRootLayer())
+ layer->layoutObject()->view()->frameView()->addViewportConstrainedObject(layer->layoutObject());
+ else
+ layer->layoutObject()->view()->frameView()->removeViewportConstrainedObject(layer->layoutObject());
+ layer->layoutObject()->updateStickyPositionConstraints(info.lastOverflowLayer);
+ }
+ } else {
+ rareProperties.ancestorOverflowLayer = info.lastOverflowLayer;
}
layer->updateAncestorDependentCompositingInputs(properties, rareProperties, info.hasAncestorWithClipPath);
@@ -163,6 +180,9 @@ void CompositingInputsUpdater::updateRecursive(PaintLayer* layer, UpdateType upd
if (layer->stackingNode()->isStackingContext())
info.ancestorStackingContext = layer;
+ if (layer->layoutObject()->hasOverflowClip())
+ info.lastOverflowLayer = layer;
+
if (layer->scrollsOverflow())
info.lastScrollingAncestor = layer;

Powered by Google App Engine
This is Rietveld 408576698