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

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

Issue 1870663002: Reland main thread position sticky implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only descend into children which have an ancestor overflow layer. Created 4 years, 8 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 24154469a213ee910a2faf91521f742e44581f37..5b1bf91dd065a1c214c59c753fc35394dc74636c 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())
@@ -840,8 +843,12 @@ bool LayoutBlock::finishDelayUpdateScrollInfo(SubtreeLayoutScope* layoutScope, S
return childrenMarkedForRelayout;
}
-void LayoutBlock::updateScrollInfoAfterLayout()
+void LayoutBlock::updateAfterLayout()
{
+ invalidateStickyConstraints();
+
+ // Update our scroll information if we're overflow:auto/scroll/hidden now that we know if
+ // we overflow or not.
if (hasOverflowClip()) {
if (style()->isFlippedBlocksWritingMode()) {
// FIXME: https://bugs.webkit.org/show_bug.cgi?id=97937
@@ -1084,7 +1091,7 @@ bool LayoutBlock::simplifiedLayout()
updateLayerTransformAfterLayout();
- updateScrollInfoAfterLayout();
+ updateAfterLayout();
clearNeedsLayout();
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.h ('k') | third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698