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..7c6a656c6fe4720daee84732aab641ebb046af06 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) |
@@ -97,6 +99,25 @@ void CompositingInputsUpdater::updateRecursive(PaintLayer* layer, UpdateType upd |
if (!layer->childNeedsCompositingInputsUpdate() && updateType != ForceUpdate) |
return; |
+ const PaintLayer* previousOverflowLayer = layer->ancestorOverflowLayer(); |
+ layer->updateAncestorOverflowLayer(info.lastOverflowLayer); |
+ if (layer->needsCompositingInputsUpdate() && layer->layoutObject()->style()->position() == StickyPosition) { |
+ if (info.lastOverflowLayer != previousOverflowLayer) { |
+ // Remove sticky constraints from old ancestor scroller if there was a change. |
+ if (previousOverflowLayer) |
+ previousOverflowLayer->scrollableArea()->stickyConstraintsMap().remove(layer); |
+ |
+ if (info.lastOverflowLayer->isRootLayer()) |
+ layer->layoutObject()->view()->frameView()->addViewportConstrainedObject(layer->layoutObject()); |
+ else if (previousOverflowLayer && previousOverflowLayer->isRootLayer()) |
+ layer->layoutObject()->view()->frameView()->removeViewportConstrainedObject(layer->layoutObject()); |
+ } |
+ layer->layoutObject()->updateStickyPositionConstraints(info.lastOverflowLayer); |
+ |
+ // Layer position needs to be updated before mapping clippedAbsoluteBoundingBox. |
chrishtr
2016/03/09 16:53:08
Why is the layer position not already up-to-date a
flackr
2016/03/14 19:04:26
The overflow layer may have just changed - and the
chrishtr
2016/03/16 21:52:39
But layer positions should be set before the compo
flackr
2016/03/22 21:44:32
Yes, but without correct ancestor information. We
|
+ layer->updateLayerPosition(); |
+ } |
+ |
m_geometryMap.pushMappingsToAncestor(layer, layer->parent()); |
if (layer->hasCompositedLayerMapping()) |
@@ -163,6 +184,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; |