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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTable.cpp

Issue 1682453004: Treat <table> widths of 0 as auto. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/table/zero-width-on-table-is-auto-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutTable.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.cpp b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
index ae3e5c0d4391dc2582f8f17f34240e74cad2ecce..c61d0bef9600995c74882a0d6e3d181840186eb5 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -271,8 +271,12 @@ void LayoutTable::updateLogicalWidth()
bool hasPerpendicularContainingBlock = cb->style()->isHorizontalWritingMode() != style()->isHorizontalWritingMode();
LayoutUnit containerWidthInInlineDirection = hasPerpendicularContainingBlock ? perpendicularContainingBlockLogicalHeight() : availableLogicalWidth;
+ ASSERT(!style()->logicalWidth().isNegative());
+ if (style()->logicalWidth().isSpecified() && style()->logicalWidth().isZero()) {
+ mutableStyle()->setLogicalWidth(Length());
dgrogan 2016/02/09 03:27:19 I'm not sure how much of a no-no this is, to mutat
mstensho (USE GERRIT) 2016/02/09 10:52:45 I think this is bad. We should really leave comput
dgrogan 2016/02/10 02:47:56 No, we don't have negative widths, which is why I
+ }
Length styleLogicalWidth = style()->logicalWidth();
- if ((styleLogicalWidth.isSpecified() && styleLogicalWidth.isPositive()) || styleLogicalWidth.isIntrinsic()) {
dgrogan 2016/02/09 03:27:19 With the above change this clause is always true.
+ if (styleLogicalWidth.isSpecified() || styleLogicalWidth.isIntrinsic()) {
setLogicalWidth(convertStyleLogicalWidthToComputedWidth(styleLogicalWidth, containerWidthInInlineDirection));
} else {
// Subtract out any fixed margins from our available width for auto width tables.
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/table/zero-width-on-table-is-auto-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698