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

Side by Side 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, 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 unified diff | Download patch
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 logicalLeft += flow->marginLogicalLeft(); 410 logicalLeft += flow->marginLogicalLeft();
411 if (knownToHaveNoOverflow()) 411 if (knownToHaveNoOverflow())
412 minLogicalLeft = min(logicalLeft, minLogicalLeft); 412 minLogicalLeft = min(logicalLeft, minLogicalLeft);
413 logicalLeft = flow->placeBoxesInInlineDirection(logicalLeft, nee dsWordSpacing, textBoxDataMap); 413 logicalLeft = flow->placeBoxesInInlineDirection(logicalLeft, nee dsWordSpacing, textBoxDataMap);
414 if (knownToHaveNoOverflow()) 414 if (knownToHaveNoOverflow())
415 maxLogicalRight = max(logicalLeft, maxLogicalRight); 415 maxLogicalRight = max(logicalLeft, maxLogicalRight);
416 logicalLeft += flow->marginLogicalRight(); 416 logicalLeft += flow->marginLogicalRight();
417 } else if (!curr->renderer().isListMarker() || toRenderListMarker(cu rr->renderer()).isInside()) { 417 } else if (!curr->renderer().isListMarker() || toRenderListMarker(cu rr->renderer()).isInside()) {
418 // The box can have a different writing-mode than the overall li ne, so this is a bit complicated. 418 // The box can have a different writing-mode than the overall li ne, so this is a bit complicated.
419 // Just get all the physical margin and overflow values by hand based off |isVertical|. 419 // Just get all the physical margin and overflow values by hand based off |isVertical|.
420 TextDirection dir = renderer().style()->direction();
421 bool isDetailsMarker = curr->renderer().isDetailsMarker();
422
420 LayoutUnit logicalLeftMargin = isHorizontal() ? curr->boxModelOb ject()->marginLeft() : curr->boxModelObject()->marginTop(); 423 LayoutUnit logicalLeftMargin = isHorizontal() ? curr->boxModelOb ject()->marginLeft() : curr->boxModelObject()->marginTop();
421 LayoutUnit logicalRightMargin = isHorizontal() ? curr->boxModelO bject()->marginRight() : curr->boxModelObject()->marginBottom(); 424 LayoutUnit logicalRightMargin = isHorizontal() ? curr->boxModelO bject()->marginRight() : curr->boxModelObject()->marginBottom();
422 425
423 logicalLeft += logicalLeftMargin; 426 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
427 logicalLeft += (dir == LTR) ? logicalLeftMargin : logicalRig htMargin;
428 else
429 logicalLeft += logicalLeftMargin;
424 curr->setLogicalLeft(logicalLeft); 430 curr->setLogicalLeft(logicalLeft);
425 if (knownToHaveNoOverflow()) 431 if (knownToHaveNoOverflow())
426 minLogicalLeft = min(logicalLeft, minLogicalLeft); 432 minLogicalLeft = min(logicalLeft, minLogicalLeft);
427 logicalLeft += curr->logicalWidth(); 433 logicalLeft += curr->logicalWidth();
428 if (knownToHaveNoOverflow()) 434 if (knownToHaveNoOverflow())
429 maxLogicalRight = max(logicalLeft, maxLogicalRight); 435 maxLogicalRight = max(logicalLeft, maxLogicalRight);
430 logicalLeft += logicalRightMargin; 436 if (isDetailsMarker)
437 logicalLeft += (dir == LTR) ? logicalRightMargin : logicalLe ftMargin;
438 else
439 logicalLeft += logicalRightMargin;
431 // If we encounter any space after this inline block then ensure it is treated as the space between two words. 440 // If we encounter any space after this inline block then ensure it is treated as the space between two words.
432 needsWordSpacing = true; 441 needsWordSpacing = true;
433 } 442 }
434 } 443 }
435 } 444 }
436 return logicalLeft; 445 return logicalLeft;
437 } 446 }
438 447
439 bool InlineFlowBox::requiresIdeographicBaseline(const GlyphOverflowAndFallbackFo ntsMap& textBoxDataMap) const 448 bool InlineFlowBox::requiresIdeographicBaseline(const GlyphOverflowAndFallbackFo ntsMap& textBoxDataMap) const
440 { 449 {
(...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1656 ASSERT(child->prevOnLine() == prev); 1665 ASSERT(child->prevOnLine() == prev);
1657 prev = child; 1666 prev = child;
1658 } 1667 }
1659 ASSERT(prev == m_lastChild); 1668 ASSERT(prev == m_lastChild);
1660 #endif 1669 #endif
1661 } 1670 }
1662 1671
1663 #endif 1672 #endif
1664 1673
1665 } // namespace WebCore 1674 } // namespace WebCore
OLDNEW
« 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