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

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: 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 side-by-side diff with in-line comments
Download patch
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..aa62071142fcc9df8fcacffe04b5a3a413590236 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -252,6 +252,12 @@ void LayoutTable::removeColumn(const LayoutTableCol*)
setNeedsSectionRecalc();
}
+bool LayoutTable::isLogicalWidthAuto() const
+{
+ Length styleLogicalWidth = style()->logicalWidth();
+ return (!styleLogicalWidth.isSpecified() || !styleLogicalWidth.isPositive()) && !styleLogicalWidth.isIntrinsic();
+}
+
void LayoutTable::updateLogicalWidth()
{
recalcSectionsIfNeeded();
@@ -272,7 +278,7 @@ void LayoutTable::updateLogicalWidth()
LayoutUnit containerWidthInInlineDirection = hasPerpendicularContainingBlock ? perpendicularContainingBlockLogicalHeight() : availableLogicalWidth;
Length styleLogicalWidth = style()->logicalWidth();
- if ((styleLogicalWidth.isSpecified() && styleLogicalWidth.isPositive()) || styleLogicalWidth.isIntrinsic()) {
+ if (!isLogicalWidthAuto()) {
setLogicalWidth(convertStyleLogicalWidthToComputedWidth(styleLogicalWidth, containerWidthInInlineDirection));
} else {
// Subtract out any fixed margins from our available width for auto width tables.

Powered by Google App Engine
This is Rietveld 408576698