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

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

Issue 1480233007: Don't update the logical width when a scrollbar gets added (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 | « 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();
892 ScrollInfo scrollInfo; 890 ScrollInfo scrollInfo;
893 layer()->scrollableArea()->updateScrollDimensions(scrollInfo.scrollO ffset, scrollInfo.autoHorizontalScrollBarChanged, scrollInfo.autoVerticalScrollB arChanged); 891 layer()->scrollableArea()->updateScrollDimensions(scrollInfo.scrollO ffset, scrollInfo.autoHorizontalScrollBarChanged, scrollInfo.autoVerticalScrollB arChanged);
894 DelayedUpdateScrollInfoMap::AddResult scrollInfoIterator = gDelayedU pdateScrollInfoMap->add(this, scrollInfo); 892 DelayedUpdateScrollInfoMap::AddResult scrollInfoIterator = gDelayedU pdateScrollInfoMap->add(this, scrollInfo);
895 if (!scrollInfoIterator.isNewEntry) 893 if (!scrollInfoIterator.isNewEntry)
896 scrollInfoIterator.storedValue->value.merge(scrollInfo); 894 scrollInfoIterator.storedValue->value.merge(scrollInfo);
897 if (scrollInfo.autoHorizontalScrollBarChanged)
898 setLogicalHeight(logicalHeightExcludingScrollbar + scrollbarLogi calHeight());
899 if (scrollInfo.autoVerticalScrollBarChanged)
900 setLogicalWidth(logicalWidthExcludingScrollbar + scrollbarLogica lWidth());
901 } else { 895 } else {
902 layer()->scrollableArea()->updateAfterLayout(); 896 layer()->scrollableArea()->updateAfterLayout();
903 } 897 }
904 } 898 }
905 } 899 }
906 900
907 void LayoutBlock::layout() 901 void LayoutBlock::layout()
908 { 902 {
909 LayoutAnalyzer::Scope analyzer(*this); 903 LayoutAnalyzer::Scope analyzer(*this);
910 904
(...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 2891 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const
2898 { 2892 {
2899 showLayoutObject(); 2893 showLayoutObject();
2900 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 2894 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
2901 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 2895 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
2902 } 2896 }
2903 2897
2904 #endif 2898 #endif
2905 2899
2906 } // namespace blink 2900 } // 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