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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 m_widthAvailableToChildrenChanged |= oldStyle && diff.needsFullLayout() && n eedsLayout() && borderOrPaddingLogicalDimensionChanged(*oldStyle, newStyle, Logi calWidth); 358 m_widthAvailableToChildrenChanged |= oldStyle && diff.needsFullLayout() && n eedsLayout() && borderOrPaddingLogicalDimensionChanged(*oldStyle, newStyle, Logi calWidth);
359 m_heightAvailableToChildrenChanged |= oldStyle && diff.needsFullLayout() && needsLayout() && borderOrPaddingLogicalDimensionChanged(*oldStyle, newStyle, Log icalHeight); 359 m_heightAvailableToChildrenChanged |= oldStyle && diff.needsFullLayout() && needsLayout() && borderOrPaddingLogicalDimensionChanged(*oldStyle, newStyle, Log icalHeight);
360 } 360 }
361 361
362 void LayoutBlock::updateFromStyle() 362 void LayoutBlock::updateFromStyle()
363 { 363 {
364 LayoutBox::updateFromStyle(); 364 LayoutBox::updateFromStyle();
365 365
366 bool shouldClipOverflow = !styleRef().isOverflowVisible() && allowsOverflowC lip(); 366 bool shouldClipOverflow = !styleRef().isOverflowVisible() && allowsOverflowC lip();
367 if (shouldClipOverflow != hasOverflowClip()) { 367 if (shouldClipOverflow != hasOverflowClip()) {
368 if (!shouldClipOverflow)
369 getScrollableArea()->invalidateAllStickyConstraints();
370
368 // FIXME: This shouldn't be required if we tracked the visual overflow 371 // FIXME: This shouldn't be required if we tracked the visual overflow
369 // generated by positioned children or self painting layers. crbug.com/3 45403 372 // generated by positioned children or self painting layers. crbug.com/3 45403
370 for (LayoutObject* child = firstChild(); child; child = child->nextSibli ng()) 373 for (LayoutObject* child = firstChild(); child; child = child->nextSibli ng())
371 child->setMayNeedPaintInvalidation(); 374 child->setMayNeedPaintInvalidation();
372 } 375 }
373 setHasOverflowClip(shouldClipOverflow); 376 setHasOverflowClip(shouldClipOverflow);
374 } 377 }
375 378
376 bool LayoutBlock::allowsOverflowClip() const 379 bool LayoutBlock::allowsOverflowClip() const
377 { 380 {
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 PaintLayerScrollableArea* scrollableArea = block->layer()->getSc rollableArea(); 836 PaintLayerScrollableArea* scrollableArea = block->layer()->getSc rollableArea();
834 if (scrollMap) 837 if (scrollMap)
835 scrollMap->add(scrollableArea, scrollableArea->scrollPositio nDouble()); 838 scrollMap->add(scrollableArea, scrollableArea->scrollPositio nDouble());
836 childrenMarkedForRelayout |= scrollableArea->updateAfterLayout(l ayoutScope); 839 childrenMarkedForRelayout |= scrollableArea->updateAfterLayout(l ayoutScope);
837 } 840 }
838 } 841 }
839 } 842 }
840 return childrenMarkedForRelayout; 843 return childrenMarkedForRelayout;
841 } 844 }
842 845
843 void LayoutBlock::updateScrollInfoAfterLayout() 846 void LayoutBlock::updateAfterLayout()
844 { 847 {
848 invalidateStickyConstraints();
849
850 // Update our scroll information if we're overflow:auto/scroll/hidden now th at we know if
851 // we overflow or not.
845 if (hasOverflowClip()) { 852 if (hasOverflowClip()) {
846 if (style()->isFlippedBlocksWritingMode()) { 853 if (style()->isFlippedBlocksWritingMode()) {
847 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=97937 854 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=97937
848 // Workaround for now. We cannot delay the scroll info for overflow 855 // Workaround for now. We cannot delay the scroll info for overflow
849 // for items with opposite writing directions, as the contents needs 856 // for items with opposite writing directions, as the contents needs
850 // to overflow in that direction 857 // to overflow in that direction
851 layer()->getScrollableArea()->updateAfterLayout(); 858 layer()->getScrollableArea()->updateAfterLayout();
852 return; 859 return;
853 } 860 }
854 861
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 // For now just always recompute overflow. This is no worse performance- wise than the old code that called rightmostPosition and 1084 // For now just always recompute overflow. This is no worse performance- wise than the old code that called rightmostPosition and
1078 // lowestPosition on every relayout so it's not a regression. 1085 // lowestPosition on every relayout so it's not a regression.
1079 // computeOverflow expects the bottom edge before we clamp our height. S ince this information isn't available during 1086 // computeOverflow expects the bottom edge before we clamp our height. S ince this information isn't available during
1080 // simplifiedLayout, we cache the value in m_overflow. 1087 // simplifiedLayout, we cache the value in m_overflow.
1081 LayoutUnit oldClientAfterEdge = hasOverflowModel() ? m_overflow->layoutC lientAfterEdge() : clientLogicalBottom(); 1088 LayoutUnit oldClientAfterEdge = hasOverflowModel() ? m_overflow->layoutC lientAfterEdge() : clientLogicalBottom();
1082 computeOverflow(oldClientAfterEdge, true); 1089 computeOverflow(oldClientAfterEdge, true);
1083 } 1090 }
1084 1091
1085 updateLayerTransformAfterLayout(); 1092 updateLayerTransformAfterLayout();
1086 1093
1087 updateScrollInfoAfterLayout(); 1094 updateAfterLayout();
1088 1095
1089 clearNeedsLayout(); 1096 clearNeedsLayout();
1090 1097
1091 if (LayoutAnalyzer* analyzer = frameView()->layoutAnalyzer()) 1098 if (LayoutAnalyzer* analyzer = frameView()->layoutAnalyzer())
1092 analyzer->increment(LayoutAnalyzer::LayoutObjectsThatNeedSimplifiedLayou t); 1099 analyzer->increment(LayoutAnalyzer::LayoutObjectsThatNeedSimplifiedLayou t);
1093 1100
1094 return true; 1101 return true;
1095 } 1102 }
1096 1103
1097 void LayoutBlock::markFixedPositionObjectForLayoutIfNeeded(LayoutObject* child, SubtreeLayoutScope& layoutScope) 1104 void LayoutBlock::markFixedPositionObjectForLayoutIfNeeded(LayoutObject* child, SubtreeLayoutScope& layoutScope)
(...skipping 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after
2826 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const 2833 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const
2827 { 2834 {
2828 showLayoutObject(); 2835 showLayoutObject();
2829 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 2836 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
2830 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 2837 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
2831 } 2838 }
2832 2839
2833 #endif 2840 #endif
2834 2841
2835 } // namespace blink 2842 } // namespace blink
OLDNEW
« 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