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

Unified Diff: Source/core/rendering/RenderTable.cpp

Issue 298563002: Simplify Writing-Mode Related Calculation of Margins (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 6 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 | « Source/core/rendering/RenderBox.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderTable.cpp
diff --git a/Source/core/rendering/RenderTable.cpp b/Source/core/rendering/RenderTable.cpp
index ed3892362d30ddeb5e3e9d87e7bcf9755b5f2edc..4cda7a0e2ceb97def940500bd2b13a2d2cec026c 100644
--- a/Source/core/rendering/RenderTable.cpp
+++ b/Source/core/rendering/RenderTable.cpp
@@ -302,20 +302,10 @@ void RenderTable::updateLogicalWidth()
}
// Finally, with our true width determined, compute our margins for real.
- setMarginStart(0);
- setMarginEnd(0);
- if (!hasPerpendicularContainingBlock) {
- ComputedMarginValues marginValues;
- bool hasInvertedDirection = cb->style()->isLeftToRightDirection() == style()->isLeftToRightDirection();
- computeInlineDirectionMargins(cb, availableLogicalWidth, logicalWidth(),
- hasInvertedDirection ? marginValues.m_start : marginValues.m_end,
- hasInvertedDirection ? marginValues.m_end : marginValues.m_start);
- setMarginStart(marginValues.m_start);
- setMarginEnd(marginValues.m_end);
- } else {
- setMarginStart(minimumValueForLength(style()->marginStart(), availableLogicalWidth));
- setMarginEnd(minimumValueForLength(style()->marginEnd(), availableLogicalWidth));
- }
+ ComputedMarginValues marginValues;
+ computeMarginsForDirection(InlineDirection, cb, availableLogicalWidth, logicalWidth(), marginValues.m_start, marginValues.m_end, style()->marginStart(), style()->marginEnd());
+ setMarginStart(marginValues.m_start);
+ setMarginEnd(marginValues.m_end);
// We should NEVER shrink the table below the min-content logical width, or else the table can't accomodate
// its own content which doesn't match CSS nor what authors expect.
« no previous file with comments | « Source/core/rendering/RenderBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698