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

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

Issue 669553002: Remove <marquee> leftovers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase 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 1977 matching lines...) Expand 10 before | Expand all | Expand 10 after
1988 return true; 1988 return true;
1989 1989
1990 // We don't stretch multiline flexboxes because they need to apply line spac ing (align-content) first. 1990 // We don't stretch multiline flexboxes because they need to apply line spac ing (align-content) first.
1991 if (parent->isFlexibleBox() && parent->style()->flexWrap() == FlexNoWrap && parent->style()->isColumnFlexDirection() && columnFlexItemHasStretchAlignment(fl exitem)) 1991 if (parent->isFlexibleBox() && parent->style()->flexWrap() == FlexNoWrap && parent->style()->isColumnFlexDirection() && columnFlexItemHasStretchAlignment(fl exitem))
1992 return true; 1992 return true;
1993 return false; 1993 return false;
1994 } 1994 }
1995 1995
1996 bool RenderBox::sizesLogicalWidthToFitContent(const Length& logicalWidth) const 1996 bool RenderBox::sizesLogicalWidthToFitContent(const Length& logicalWidth) const
1997 { 1997 {
1998 // Marquees in WinIE are like a mixture of blocks and inline-blocks. They s ize as though they're blocks, 1998 if (isFloating() || isInlineBlockOrInlineTable())
1999 // but they allow text to sit on the same line as the marquee.
2000 if (isFloating() || (isInlineBlockOrInlineTable() && !isMarquee()))
2001 return true; 1999 return true;
2002 2000
2003 if (logicalWidth.type() == Intrinsic) 2001 if (logicalWidth.type() == Intrinsic)
2004 return true; 2002 return true;
2005 2003
2006 // Children of a horizontal marquee do not fill the container by default.
2007 // FIXME: Need to deal with MAUTO value properly. It could be vertical.
2008 // FIXME: Think about block-flow here. Need to find out how marquee directi on relates to
2009 // block-flow (as well as how marquee overflow should relate to block flow).
2010 // https://bugs.webkit.org/show_bug.cgi?id=46472
2011 if (parent()->isMarquee()) {
2012 EMarqueeDirection dir = parent()->style()->marqueeDirection();
2013 if (dir == MAUTO || dir == MFORWARD || dir == MBACKWARD || dir == MLEFT || dir == MRIGHT)
2014 return true;
2015 }
2016
2017 // Flexible box items should shrink wrap, so we lay them out at their intrin sic widths. 2004 // Flexible box items should shrink wrap, so we lay them out at their intrin sic widths.
2018 // In the case of columns that have a stretch alignment, we go ahead and lay out at the 2005 // In the case of columns that have a stretch alignment, we go ahead and lay out at the
2019 // stretched size to avoid an extra layout when applying alignment. 2006 // stretched size to avoid an extra layout when applying alignment.
2020 if (parent()->isFlexibleBox()) { 2007 if (parent()->isFlexibleBox()) {
2021 // For multiline columns, we need to apply align-content first, so we ca n't stretch now. 2008 // For multiline columns, we need to apply align-content first, so we ca n't stretch now.
2022 if (!parent()->style()->isColumnFlexDirection() || parent()->style()->fl exWrap() != FlexNoWrap) 2009 if (!parent()->style()->isColumnFlexDirection() || parent()->style()->fl exWrap() != FlexNoWrap)
2023 return true; 2010 return true;
2024 if (!columnFlexItemHasStretchAlignment(this)) 2011 if (!columnFlexItemHasStretchAlignment(this))
2025 return true; 2012 return true;
2026 } 2013 }
(...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after
3747 } 3734 }
3748 } 3735 }
3749 3736
3750 if (closestRenderer) 3737 if (closestRenderer)
3751 return closestRenderer->positionForPoint(adjustedPoint - closestRenderer ->locationOffset()); 3738 return closestRenderer->positionForPoint(adjustedPoint - closestRenderer ->locationOffset());
3752 return createPositionWithAffinity(firstPositionInOrBeforeNode(nonPseudoNode( ))); 3739 return createPositionWithAffinity(firstPositionInOrBeforeNode(nonPseudoNode( )));
3753 } 3740 }
3754 3741
3755 bool RenderBox::shrinkToAvoidFloats() const 3742 bool RenderBox::shrinkToAvoidFloats() const
3756 { 3743 {
3757 // Floating objects don't shrink. Objects that don't avoid floats don't shr ink. Marquees don't shrink. 3744 // Floating objects don't shrink. Objects that don't avoid floats don't shr ink.
3758 if ((isInline() && !isMarquee()) || !avoidsFloats() || isFloating()) 3745 if (isInline() || !avoidsFloats() || isFloating())
3759 return false; 3746 return false;
3760 3747
3761 // Only auto width objects can possibly shrink to avoid floats. 3748 // Only auto width objects can possibly shrink to avoid floats.
3762 return style()->width().isAuto(); 3749 return style()->width().isAuto();
3763 } 3750 }
3764 3751
3765 static bool isReplacedElement(Node* node) 3752 static bool isReplacedElement(Node* node)
3766 { 3753 {
3767 // Checkboxes and radioboxes are not isReplaced() nor do they have their own renderer in which to override avoidFloats(). 3754 // Checkboxes and radioboxes are not isReplaced() nor do they have their own renderer in which to override avoidFloats().
3768 return node && node->isElementNode() && toElement(node)->isFormControlElemen t(); 3755 return node && node->isElementNode() && toElement(node)->isFormControlElemen t();
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
4466 ASSERT(style()->hasBackground() || style()->hasBoxDecorations()); 4453 ASSERT(style()->hasBackground() || style()->hasBoxDecorations());
4467 4454
4468 if (m_rareData && m_rareData->m_previousBorderBoxSize.width() != -1) 4455 if (m_rareData && m_rareData->m_previousBorderBoxSize.width() != -1)
4469 return m_rareData->m_previousBorderBoxSize; 4456 return m_rareData->m_previousBorderBoxSize;
4470 4457
4471 // We didn't save the old border box size because it was the same as the siz e of oldBounds. 4458 // We didn't save the old border box size because it was the same as the siz e of oldBounds.
4472 return previousBoundsSize; 4459 return previousBoundsSize;
4473 } 4460 }
4474 4461
4475 } // namespace blink 4462 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBlock.cpp ('k') | Source/core/rendering/RenderLayerScrollableArea.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698