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

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

Issue 1308273010: Adapt and reland old position sticky implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove redundant invalidation in LayoutBlock::tryLayoutDoingPositionedMovementOnly Created 4 years, 9 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/LayoutBlock.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
index 59cfb15c9fe7ae6491e9f2a619bbfef1ca5d89cd..cb709a686658b2b00f4b368e427f28a7d9fe6dd7 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
@@ -365,6 +365,9 @@ void LayoutBlock::updateFromStyle()
bool shouldClipOverflow = !styleRef().isOverflowVisible() && allowsOverflowClip();
if (shouldClipOverflow != hasOverflowClip()) {
+ if (!shouldClipOverflow)
+ getScrollableArea()->invalidateAllStickyConstraints();
+
// FIXME: This shouldn't be required if we tracked the visual overflow
// generated by positioned children or self painting layers. crbug.com/345403
for (LayoutObject* child = firstChild(); child; child = child->nextSibling())
@@ -880,8 +883,10 @@ bool LayoutBlock::finishDelayUpdateScrollInfo(SubtreeLayoutScope* layoutScope)
return childrenMarkedForRelayout;
}
-void LayoutBlock::updateScrollInfoAfterLayout()
+void LayoutBlock::updateAfterLayout()
{
+ invalidateStickyConstraints();
+
if (hasOverflowClip()) {
if (style()->isFlippedBlocksWritingMode()) {
// FIXME: https://bugs.webkit.org/show_bug.cgi?id=97937
@@ -1125,7 +1130,7 @@ bool LayoutBlock::simplifiedLayout()
updateLayerTransformAfterLayout();
- updateScrollInfoAfterLayout();
+ updateAfterLayout();
clearNeedsLayout();

Powered by Google App Engine
This is Rietveld 408576698