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

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

Issue 1459743002: Don't update the logical width when a scrollbar gets added (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | « third_party/WebKit/LayoutTests/css3/flexbox/overflow-auto-resizes-correctly-expected.txt ('k') | no next file » | 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 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 if (style()->isFlippedBlocksWritingMode()) { 880 if (style()->isFlippedBlocksWritingMode()) {
881 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=97937 881 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=97937
882 // Workaround for now. We cannot delay the scroll info for overflow 882 // Workaround for now. We cannot delay the scroll info for overflow
883 // for items with opposite writing directions, as the contents needs 883 // for items with opposite writing directions, as the contents needs
884 // to overflow in that direction 884 // to overflow in that direction
885 layer()->scrollableArea()->updateAfterLayout(); 885 layer()->scrollableArea()->updateAfterLayout();
886 return; 886 return;
887 } 887 }
888 888
889 if (gDelayUpdateScrollInfo) { 889 if (gDelayUpdateScrollInfo) {
890 LayoutUnit logicalWidthExcludingScrollbar = logicalWidth() - scrollb arLogicalWidth();
891 LayoutUnit logicalHeightExcludingScrollbar = logicalHeight() - scrol lbarLogicalHeight(); 890 LayoutUnit logicalHeightExcludingScrollbar = logicalHeight() - scrol lbarLogicalHeight();
892 ScrollInfo scrollInfo; 891 ScrollInfo scrollInfo;
893 layer()->scrollableArea()->updateScrollDimensions(scrollInfo.scrollO ffset, scrollInfo.autoHorizontalScrollBarChanged, scrollInfo.autoVerticalScrollB arChanged); 892 layer()->scrollableArea()->updateScrollDimensions(scrollInfo.scrollO ffset, scrollInfo.autoHorizontalScrollBarChanged, scrollInfo.autoVerticalScrollB arChanged);
894 DelayedUpdateScrollInfoMap::AddResult scrollInfoIterator = gDelayedU pdateScrollInfoMap->add(this, scrollInfo); 893 DelayedUpdateScrollInfoMap::AddResult scrollInfoIterator = gDelayedU pdateScrollInfoMap->add(this, scrollInfo);
895 if (!scrollInfoIterator.isNewEntry) 894 if (!scrollInfoIterator.isNewEntry)
896 scrollInfoIterator.storedValue->value.merge(scrollInfo); 895 scrollInfoIterator.storedValue->value.merge(scrollInfo);
897 if (scrollInfo.autoHorizontalScrollBarChanged) 896 if (scrollInfo.autoHorizontalScrollBarChanged)
898 setLogicalHeight(logicalHeightExcludingScrollbar + scrollbarLogi calHeight()); 897 setLogicalHeight(logicalHeightExcludingScrollbar + scrollbarLogi calHeight());
skobes 2015/11/18 22:45:24 Is the setLogicalHeight call wrong for the same re
cbiesinger 2015/11/18 22:52:51 So, that is a very good question and I was wonderi
skobes 2015/11/18 23:01:55 Width and height are both outputs of layout, and i
899 if (scrollInfo.autoVerticalScrollBarChanged)
900 setLogicalWidth(logicalWidthExcludingScrollbar + scrollbarLogica lWidth());
901 } else { 898 } else {
902 layer()->scrollableArea()->updateAfterLayout(); 899 layer()->scrollableArea()->updateAfterLayout();
903 } 900 }
904 } 901 }
905 } 902 }
906 903
907 void LayoutBlock::layout() 904 void LayoutBlock::layout()
908 { 905 {
909 LayoutAnalyzer::Scope analyzer(*this); 906 LayoutAnalyzer::Scope analyzer(*this);
910 907
(...skipping 1986 matching lines...) Expand 10 before | Expand all | Expand 10 after
2897 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
2898 { 2895 {
2899 showLayoutObject(); 2896 showLayoutObject();
2900 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 2897 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
2901 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 2898 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
2902 } 2899 }
2903 2900
2904 #endif 2901 #endif
2905 2902
2906 } // namespace blink 2903 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/css3/flexbox/overflow-auto-resizes-correctly-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698