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

Side by Side Diff: Source/core/rendering/RenderBox.cpp

Issue 24365011: Position absolute is not working properly in RTL mode for vertical scroll contents (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: NeedsRebaseLine for Win Created 7 years, 2 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/virtual/gpu/compositedscrolling/scrollbars/rtl/div-absolute-expected.txt ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 3311 matching lines...) Expand 10 before | Expand all | Expand 10 after
3322 LayoutUnit logicalLeftValue = 0; 3322 LayoutUnit logicalLeftValue = 0;
3323 3323
3324 const LayoutUnit containerRelativeLogicalWidth = containingBlockLogicalWidth ForPositioned(containerBlock, 0, false); 3324 const LayoutUnit containerRelativeLogicalWidth = containingBlockLogicalWidth ForPositioned(containerBlock, 0, false);
3325 3325
3326 bool logicalWidthIsAuto = logicalWidth.isIntrinsicOrAuto(); 3326 bool logicalWidthIsAuto = logicalWidth.isIntrinsicOrAuto();
3327 bool logicalLeftIsAuto = logicalLeft.isAuto(); 3327 bool logicalLeftIsAuto = logicalLeft.isAuto();
3328 bool logicalRightIsAuto = logicalRight.isAuto(); 3328 bool logicalRightIsAuto = logicalRight.isAuto();
3329 RenderView* renderView = view(); 3329 RenderView* renderView = view();
3330 LayoutUnit& marginLogicalLeftValue = style()->isLeftToRightDirection() ? com putedValues.m_margins.m_start : computedValues.m_margins.m_end; 3330 LayoutUnit& marginLogicalLeftValue = style()->isLeftToRightDirection() ? com putedValues.m_margins.m_start : computedValues.m_margins.m_end;
3331 LayoutUnit& marginLogicalRightValue = style()->isLeftToRightDirection() ? co mputedValues.m_margins.m_end : computedValues.m_margins.m_start; 3331 LayoutUnit& marginLogicalRightValue = style()->isLeftToRightDirection() ? co mputedValues.m_margins.m_end : computedValues.m_margins.m_start;
3332
3333 if (!logicalLeftIsAuto && !logicalWidthIsAuto && !logicalRightIsAuto) { 3332 if (!logicalLeftIsAuto && !logicalWidthIsAuto && !logicalRightIsAuto) {
3334 /*---------------------------------------------------------------------- -*\ 3333 /*---------------------------------------------------------------------- -*\
3335 * If none of the three is 'auto': If both 'margin-left' and 'margin- 3334 * If none of the three is 'auto': If both 'margin-left' and 'margin-
3336 * right' are 'auto', solve the equation under the extra constraint that 3335 * right' are 'auto', solve the equation under the extra constraint that
3337 * the two margins get equal values, unless this would make them negativ e, 3336 * the two margins get equal values, unless this would make them negativ e,
3338 * in which case when direction of the containing block is 'ltr' ('rtl') , 3337 * in which case when direction of the containing block is 'ltr' ('rtl') ,
3339 * set 'margin-left' ('margin-right') to zero and solve for 'margin-righ t' 3338 * set 'margin-left' ('margin-right') to zero and solve for 'margin-righ t'
3340 * ('margin-left'). If one of 'margin-left' or 'margin-right' is 'auto', 3339 * ('margin-left'). If one of 'margin-left' or 'margin-right' is 'auto',
3341 * solve the equation for that value. If the values are over-constrained , 3340 * solve the equation for that value. If the values are over-constrained ,
3342 * ignore the value for 'left' (in case the 'direction' property of the 3341 * ignore the value for 'left' (in case the 'direction' property of the
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
3479 if (containerBlock->isRenderInline() && !containerBlock->style()->isLeftToRi ghtDirection()) { 3478 if (containerBlock->isRenderInline() && !containerBlock->style()->isLeftToRi ghtDirection()) {
3480 const RenderInline* flow = toRenderInline(containerBlock); 3479 const RenderInline* flow = toRenderInline(containerBlock);
3481 InlineFlowBox* firstLine = flow->firstLineBox(); 3480 InlineFlowBox* firstLine = flow->firstLineBox();
3482 InlineFlowBox* lastLine = flow->lastLineBox(); 3481 InlineFlowBox* lastLine = flow->lastLineBox();
3483 if (firstLine && lastLine && firstLine != lastLine) { 3482 if (firstLine && lastLine && firstLine != lastLine) {
3484 computedValues.m_position = logicalLeftValue + marginLogicalLeftValu e + lastLine->borderLogicalLeft() + (lastLine->logicalLeft() - firstLine->logica lLeft()); 3483 computedValues.m_position = logicalLeftValue + marginLogicalLeftValu e + lastLine->borderLogicalLeft() + (lastLine->logicalLeft() - firstLine->logica lLeft());
3485 return; 3484 return;
3486 } 3485 }
3487 } 3486 }
3488 3487
3488 if (containerBlock->isBox() && toRenderBox(containerBlock)->scrollsOverflowY () && containerBlock->style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft() ) {
3489 logicalLeftValue = logicalLeftValue + toRenderBox(containerBlock)->verti calScrollbarWidth();
3490 }
3491
3489 computedValues.m_position = logicalLeftValue + marginLogicalLeftValue; 3492 computedValues.m_position = logicalLeftValue + marginLogicalLeftValue;
3490 computeLogicalLeftPositionedOffset(computedValues.m_position, this, computed Values.m_extent, containerBlock, containerLogicalWidth); 3493 computeLogicalLeftPositionedOffset(computedValues.m_position, this, computed Values.m_extent, containerBlock, containerLogicalWidth);
3491 } 3494 }
3492 3495
3493 static void computeBlockStaticDistance(Length& logicalTop, Length& logicalBottom , const RenderBox* child, const RenderBoxModelObject* containerBlock) 3496 static void computeBlockStaticDistance(Length& logicalTop, Length& logicalBottom , const RenderBox* child, const RenderBoxModelObject* containerBlock)
3494 { 3497 {
3495 if (!logicalTop.isAuto() || !logicalBottom.isAuto()) 3498 if (!logicalTop.isAuto() || !logicalBottom.isAuto())
3496 return; 3499 return;
3497 3500
3498 // FIXME: The static distance computation has not been patched for mixed wri ting modes. 3501 // FIXME: The static distance computation has not been patched for mixed wri ting modes.
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after
4762 return 0; 4765 return 0;
4763 4766
4764 if (!layoutState && !flowThreadContainingBlock()) 4767 if (!layoutState && !flowThreadContainingBlock())
4765 return 0; 4768 return 0;
4766 4769
4767 RenderBlock* containerBlock = containingBlock(); 4770 RenderBlock* containerBlock = containingBlock();
4768 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); 4771 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop();
4769 } 4772 }
4770 4773
4771 } // namespace WebCore 4774 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/virtual/gpu/compositedscrolling/scrollbars/rtl/div-absolute-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698