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

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

Issue 629143005: Remove RenderObject::isMarquee() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
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 2020 matching lines...) Expand 10 before | Expand all | Expand 10 after
2031 return true; 2031 return true;
2032 2032
2033 // We don't stretch multiline flexboxes because they need to apply line spac ing (align-content) first. 2033 // We don't stretch multiline flexboxes because they need to apply line spac ing (align-content) first.
2034 if (parent->isFlexibleBox() && parent->style()->flexWrap() == FlexNoWrap && parent->style()->isColumnFlexDirection() && columnFlexItemHasStretchAlignment(fl exitem)) 2034 if (parent->isFlexibleBox() && parent->style()->flexWrap() == FlexNoWrap && parent->style()->isColumnFlexDirection() && columnFlexItemHasStretchAlignment(fl exitem))
2035 return true; 2035 return true;
2036 return false; 2036 return false;
2037 } 2037 }
2038 2038
2039 bool RenderBox::sizesLogicalWidthToFitContent(const Length& logicalWidth) const 2039 bool RenderBox::sizesLogicalWidthToFitContent(const Length& logicalWidth) const
2040 { 2040 {
2041 // Marquees in WinIE are like a mixture of blocks and inline-blocks. They s ize as though they're blocks, 2041 // Marquees in WinIE are like a mixture of blocks and inline-blocks. They s ize as though they're blocks,
mstensho (USE GERRIT) 2014/10/06 20:00:34 This comment about marquees is no longer valid.
Hajime Morrita 2014/10/06 20:22:10 Done.
2042 // but they allow text to sit on the same line as the marquee. 2042 // but they allow text to sit on the same line as the marquee.
2043 if (isFloating() || (isInlineBlockOrInlineTable() && !isMarquee())) 2043 if (isFloating() || (isInlineBlockOrInlineTable()))
mstensho (USE GERRIT) 2014/10/06 20:00:34 Extraneous set of parentheses.
Hajime Morrita 2014/10/06 20:22:10 Done.
2044 return true; 2044 return true;
2045 2045
2046 if (logicalWidth.type() == Intrinsic) 2046 if (logicalWidth.type() == Intrinsic)
2047 return true; 2047 return true;
2048 2048
2049 // Children of a horizontal marquee do not fill the container by default.
2050 // FIXME: Need to deal with MAUTO value properly. It could be vertical.
2051 // FIXME: Think about block-flow here. Need to find out how marquee directi on relates to
2052 // block-flow (as well as how marquee overflow should relate to block flow).
2053 // https://bugs.webkit.org/show_bug.cgi?id=46472
2054 if (parent()->isMarquee()) {
2055 EMarqueeDirection dir = parent()->style()->marqueeDirection();
2056 if (dir == MAUTO || dir == MFORWARD || dir == MBACKWARD || dir == MLEFT || dir == MRIGHT)
2057 return true;
2058 }
2059
2060 // Flexible box items should shrink wrap, so we lay them out at their intrin sic widths. 2049 // Flexible box items should shrink wrap, so we lay them out at their intrin sic widths.
2061 // In the case of columns that have a stretch alignment, we go ahead and lay out at the 2050 // In the case of columns that have a stretch alignment, we go ahead and lay out at the
2062 // stretched size to avoid an extra layout when applying alignment. 2051 // stretched size to avoid an extra layout when applying alignment.
2063 if (parent()->isFlexibleBox()) { 2052 if (parent()->isFlexibleBox()) {
2064 // For multiline columns, we need to apply align-content first, so we ca n't stretch now. 2053 // For multiline columns, we need to apply align-content first, so we ca n't stretch now.
2065 if (!parent()->style()->isColumnFlexDirection() || parent()->style()->fl exWrap() != FlexNoWrap) 2054 if (!parent()->style()->isColumnFlexDirection() || parent()->style()->fl exWrap() != FlexNoWrap)
2066 return true; 2055 return true;
2067 if (!columnFlexItemHasStretchAlignment(this)) 2056 if (!columnFlexItemHasStretchAlignment(this))
2068 return true; 2057 return true;
2069 } 2058 }
(...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after
3790 } 3779 }
3791 } 3780 }
3792 3781
3793 if (closestRenderer) 3782 if (closestRenderer)
3794 return closestRenderer->positionForPoint(adjustedPoint - closestRenderer ->locationOffset()); 3783 return closestRenderer->positionForPoint(adjustedPoint - closestRenderer ->locationOffset());
3795 return createPositionWithAffinity(firstPositionInOrBeforeNode(nonPseudoNode( ))); 3784 return createPositionWithAffinity(firstPositionInOrBeforeNode(nonPseudoNode( )));
3796 } 3785 }
3797 3786
3798 bool RenderBox::shrinkToAvoidFloats() const 3787 bool RenderBox::shrinkToAvoidFloats() const
3799 { 3788 {
3800 // Floating objects don't shrink. Objects that don't avoid floats don't shr ink. Marquees don't shrink. 3789 // Floating objects don't shrink. Objects that don't avoid floats don't shr ink. Marquees don't shrink.
mstensho (USE GERRIT) 2014/10/06 20:00:34 Can you remove the comment about marquees, please?
Hajime Morrita 2014/10/06 20:22:10 Done.
3801 if ((isInline() && !isMarquee()) || !avoidsFloats() || isFloating()) 3790 if (isInline() || !avoidsFloats() || isFloating())
3802 return false; 3791 return false;
3803 3792
3804 // Only auto width objects can possibly shrink to avoid floats. 3793 // Only auto width objects can possibly shrink to avoid floats.
3805 return style()->width().isAuto(); 3794 return style()->width().isAuto();
3806 } 3795 }
3807 3796
3808 static bool isReplacedElement(Node* node) 3797 static bool isReplacedElement(Node* node)
3809 { 3798 {
3810 // Checkboxes and radioboxes are not isReplaced() nor do they have their own renderer in which to override avoidFloats(). 3799 // Checkboxes and radioboxes are not isReplaced() nor do they have their own renderer in which to override avoidFloats().
3811 return node && node->isElementNode() && toElement(node)->isFormControlElemen t(); 3800 return node && node->isElementNode() && toElement(node)->isFormControlElemen t();
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
4509 ASSERT(style()->hasBackground() || style()->hasBoxDecorations()); 4498 ASSERT(style()->hasBackground() || style()->hasBoxDecorations());
4510 4499
4511 if (m_rareData && m_rareData->m_previousBorderBoxSize.width() != -1) 4500 if (m_rareData && m_rareData->m_previousBorderBoxSize.width() != -1)
4512 return m_rareData->m_previousBorderBoxSize; 4501 return m_rareData->m_previousBorderBoxSize;
4513 4502
4514 // We didn't save the old border box size because it was the same as the siz e of oldBounds. 4503 // We didn't save the old border box size because it was the same as the siz e of oldBounds.
4515 return previousBoundsSize; 4504 return previousBoundsSize;
4516 } 4505 }
4517 4506
4518 } // namespace blink 4507 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698