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

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

Issue 306923003: Use webkit-margin-end for details element to get same margin for both ltr and rtl (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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 | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/InlineFlowBox.cpp
diff --git a/Source/core/rendering/InlineFlowBox.cpp b/Source/core/rendering/InlineFlowBox.cpp
index 23a96ab2fa953521d336002ae387b4e1279448af..533de8ed1e31dbb77587dc96eb96b4e0bd603c72 100644
--- a/Source/core/rendering/InlineFlowBox.cpp
+++ b/Source/core/rendering/InlineFlowBox.cpp
@@ -417,17 +417,26 @@ float InlineFlowBox::placeBoxRangeInInlineDirection(InlineBox* firstChild, Inlin
} else if (!curr->renderer().isListMarker() || toRenderListMarker(curr->renderer()).isInside()) {
// The box can have a different writing-mode than the overall line, so this is a bit complicated.
// Just get all the physical margin and overflow values by hand based off |isVertical|.
+ TextDirection dir = renderer().style()->direction();
+ bool isDetailsMarker = curr->renderer().isDetailsMarker();
+
LayoutUnit logicalLeftMargin = isHorizontal() ? curr->boxModelObject()->marginLeft() : curr->boxModelObject()->marginTop();
LayoutUnit logicalRightMargin = isHorizontal() ? curr->boxModelObject()->marginRight() : curr->boxModelObject()->marginBottom();
- logicalLeft += logicalLeftMargin;
+ if (isDetailsMarker)
eseidel 2014/05/30 00:33:25 I don't understand why details markers are special
Habib Virji 2014/06/03 14:23:46 @eseidel: RenderListItem::updateMarkerLocation (ht
leviw_travelin_and_unemployed 2014/06/05 22:25:43 I'd either expect the list and details code to be
+ logicalLeft += (dir == LTR) ? logicalLeftMargin : logicalRightMargin;
+ else
+ logicalLeft += logicalLeftMargin;
curr->setLogicalLeft(logicalLeft);
if (knownToHaveNoOverflow())
minLogicalLeft = min(logicalLeft, minLogicalLeft);
logicalLeft += curr->logicalWidth();
if (knownToHaveNoOverflow())
maxLogicalRight = max(logicalLeft, maxLogicalRight);
- logicalLeft += logicalRightMargin;
+ if (isDetailsMarker)
+ logicalLeft += (dir == LTR) ? logicalRightMargin : logicalLeftMargin;
+ else
+ logicalLeft += logicalRightMargin;
// If we encounter any space after this inline block then ensure it is treated as the space between two words.
needsWordSpacing = true;
}
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698