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

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

Issue 1682453004: Treat <table> widths of 0 as auto. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename test; factor out isAuto method Created 4 years, 10 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.cpp ('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) 2002 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2002 Lars Knoll (knoll@kde.org)
3 * (C) 2002 Dirk Mueller (mueller@kde.org) 3 * (C) 2002 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2003, 2006, 2008, 2010 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2006, 2008, 2010 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License. 9 * version 2 of the License.
10 * 10 *
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 if ((tw.isAuto() || tw.hasPercent()) && !table->isOutOfFlowPositioned()) { 188 if ((tw.isAuto() || tw.hasPercent()) && !table->isOutOfFlowPositioned()) {
189 LayoutBlock* cb = table->containingBlock(); 189 LayoutBlock* cb = table->containingBlock();
190 while (cb && !cb->isLayoutView() && !cb->isTableCell() 190 while (cb && !cb->isLayoutView() && !cb->isTableCell()
191 && cb->style()->width().isAuto() && !cb->isOutOfFlowPositioned() ) 191 && cb->style()->width().isAuto() && !cb->isOutOfFlowPositioned() )
192 cb = cb->containingBlock(); 192 cb = cb->containingBlock();
193 193
194 table = 0; 194 table = 0;
195 if (cb && cb->isTableCell() 195 if (cb && cb->isTableCell()
196 && (cb->style()->width().isAuto() || cb->style()->width().hasPer cent())) { 196 && (cb->style()->width().isAuto() || cb->style()->width().hasPer cent())) {
197 LayoutTableCell* cell = toLayoutTableCell(cb); 197 LayoutTableCell* cell = toLayoutTableCell(cb);
198 if (cell->colSpan() > 1 || cell->table()->style()->width().isAut o()) 198 if (cell->colSpan() > 1 || cell->table()->isLogicalWidthAuto())
199 scale = false; 199 scale = false;
200 else 200 else
201 table = cell->table(); 201 table = cell->table();
202 } 202 }
203 } else { 203 } else {
204 table = 0; 204 table = 0;
205 } 205 }
206 } 206 }
207 return scale; 207 return scale;
208 } 208 }
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 int reduce = available * minMaxDiff / logicalWidthBeyondMin; 692 int reduce = available * minMaxDiff / logicalWidthBeyondMin;
693 m_layoutStruct[i].computedLogicalWidth += reduce; 693 m_layoutStruct[i].computedLogicalWidth += reduce;
694 available -= reduce; 694 available -= reduce;
695 logicalWidthBeyondMin -= minMaxDiff; 695 logicalWidthBeyondMin -= minMaxDiff;
696 if (available >= 0) 696 if (available >= 0)
697 break; 697 break;
698 } 698 }
699 } 699 }
700 } 700 }
701 } // namespace blink 701 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698