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

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

Issue 766223004: Blocks should be aligned by style of parents (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« Source/core/rendering/RenderBox.cpp ('K') | « 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 df9a9aec096035c33130814be2ff2e569aa95ab6..8bd25f589f18f3b45cf677ca78448c5553d8e523 100644
--- a/Source/core/rendering/RenderTable.cpp
+++ b/Source/core/rendering/RenderTable.cpp
@@ -300,8 +300,10 @@ void RenderTable::updateLogicalWidth()
// Finally, with our true width determined, compute our margins for real.
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);
+
+ bool hasInvertedDirection = cb->style()->isLeftToRightDirection() == style()->isLeftToRightDirection();
+ setMarginStart(hasInvertedDirection ? marginValues.m_start : marginValues.m_end);
+ setMarginEnd(hasInvertedDirection ? marginValues.m_end : marginValues.m_start);
// 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.
« Source/core/rendering/RenderBox.cpp ('K') | « Source/core/rendering/RenderBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698