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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlock.cpp

Issue 1532923004: Before finalizing scroll dimensions, check again whether we need scrollbars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2564
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 // This map keeps track of the descendants whose 'height' is percentage associat ed 104 // This map keeps track of the descendants whose 'height' is percentage associat ed
105 // with a containing block. Like |gPositionedDescendantsMap|, it is also recompu ted 105 // with a containing block. Like |gPositionedDescendantsMap|, it is also recompu ted
106 // for every layout (see the comment above about why). 106 // for every layout (see the comment above about why).
107 static TrackedDescendantsMap* gPercentHeightDescendantsMap = nullptr; 107 static TrackedDescendantsMap* gPercentHeightDescendantsMap = nullptr;
108 108
109 static TrackedContainerMap* gPositionedContainerMap = nullptr; 109 static TrackedContainerMap* gPositionedContainerMap = nullptr;
110 static TrackedContainerMap* gPercentHeightContainerMap = nullptr; 110 static TrackedContainerMap* gPercentHeightContainerMap = nullptr;
111 111
112 struct ScrollInfo { 112 struct ScrollInfo {
113 ScrollInfo() : autoHorizontalScrollBarChanged(false), autoVerticalScrollBarC hanged(false) {}
113 DoubleSize scrollOffset; 114 DoubleSize scrollOffset;
114 bool autoHorizontalScrollBarChanged; 115 bool autoHorizontalScrollBarChanged;
115 bool autoVerticalScrollBarChanged; 116 bool autoVerticalScrollBarChanged;
116 bool hasOffset() const { return scrollOffset != DoubleSize(); } 117 bool hasOffset() const { return scrollOffset != DoubleSize(); }
117 bool scrollBarsChanged() const { return autoHorizontalScrollBarChanged || au toVerticalScrollBarChanged; } 118 bool scrollBarsChanged() const { return autoHorizontalScrollBarChanged || au toVerticalScrollBarChanged; }
118 void merge(const ScrollInfo& other) 119 void merge(const ScrollInfo& other)
119 { 120 {
120 // We always keep the first scrollOffset we saw for this block, so don't copy that field. 121 // We always keep the first scrollOffset we saw for this block, so don't copy that field.
121 autoHorizontalScrollBarChanged |= other.autoHorizontalScrollBarChanged; 122 autoHorizontalScrollBarChanged |= other.autoHorizontalScrollBarChanged;
122 autoVerticalScrollBarChanged |= other.autoVerticalScrollBarChanged; 123 autoVerticalScrollBarChanged |= other.autoVerticalScrollBarChanged;
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 if (gDelayUpdateScrollInfo == 0) { 862 if (gDelayUpdateScrollInfo == 0) {
862 ASSERT(gDelayedUpdateScrollInfoMap); 863 ASSERT(gDelayedUpdateScrollInfoMap);
863 864
864 OwnPtr<DelayedUpdateScrollInfoMap> infoMap(adoptPtr(gDelayedUpdateScroll InfoMap)); 865 OwnPtr<DelayedUpdateScrollInfoMap> infoMap(adoptPtr(gDelayedUpdateScroll InfoMap));
865 gDelayedUpdateScrollInfoMap = nullptr; 866 gDelayedUpdateScrollInfoMap = nullptr;
866 867
867 for (auto block : *infoMap) { 868 for (auto block : *infoMap) {
868 if (block.key->hasOverflowClip()) { 869 if (block.key->hasOverflowClip()) {
869 PaintLayerScrollableArea* scrollableArea = block.key->layer()->s crollableArea(); 870 PaintLayerScrollableArea* scrollableArea = block.key->layer()->s crollableArea();
870 ScrollInfo& scrollInfo = block.value; 871 ScrollInfo& scrollInfo = block.value;
872 scrollableArea->updateScrollDimensions(scrollInfo.scrollOffset, scrollInfo.autoHorizontalScrollBarChanged, scrollInfo.autoVerticalScrollBarChang ed);
871 scrollableArea->finalizeScrollDimensions(scrollInfo.scrollOffset , scrollInfo.autoHorizontalScrollBarChanged, scrollInfo.autoVerticalScrollBarCha nged); 873 scrollableArea->finalizeScrollDimensions(scrollInfo.scrollOffset , scrollInfo.autoHorizontalScrollBarChanged, scrollInfo.autoVerticalScrollBarCha nged);
872 } 874 }
873 } 875 }
874 } 876 }
875 } 877 }
876 878
877 void LayoutBlock::updateScrollInfoAfterLayout() 879 void LayoutBlock::updateScrollInfoAfterLayout()
878 { 880 {
879 if (hasOverflowClip()) { 881 if (hasOverflowClip()) {
880 if (style()->isFlippedBlocksWritingMode()) { 882 if (style()->isFlippedBlocksWritingMode()) {
(...skipping 2011 matching lines...) Expand 10 before | Expand all | Expand 10 after
2892 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const 2894 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const
2893 { 2895 {
2894 showLayoutObject(); 2896 showLayoutObject();
2895 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 2897 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
2896 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 2898 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
2897 } 2899 }
2898 2900
2899 #endif 2901 #endif
2900 2902
2901 } // namespace blink 2903 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698