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

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

Issue 197283038: Add RenderObject::needsResizeLayout (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename internal setNeedsResizeLayout Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/rendering/RenderBox.h » ('j') | Source/core/rendering/RenderBox.h » ('J')
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) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after
1625 } else { 1625 } else {
1626 for (RenderBox* box = firstChildBox(); box; box = box->nextSiblingBox()) { 1626 for (RenderBox* box = firstChildBox(); box; box = box->nextSiblingBox()) {
1627 if (!box->isOutOfFlowPositioned()) 1627 if (!box->isOutOfFlowPositioned())
1628 box->layoutIfNeeded(); 1628 box->layoutIfNeeded();
1629 } 1629 }
1630 } 1630 }
1631 } 1631 }
1632 1632
1633 bool RenderBlock::simplifiedLayout() 1633 bool RenderBlock::simplifiedLayout()
1634 { 1634 {
1635 if ((!posChildNeedsLayout() && !needsSimplifiedNormalFlowLayout()) || normal ChildNeedsLayout() || selfNeedsLayout()) 1635 if ((!posChildNeedsLayout() && !needsSimplifiedNormalFlowLayout() && !needsR esizeLayout())
1636 || normalChildNeedsLayout() || selfNeedsLayout())
1636 return false; 1637 return false;
1637 1638
1638 1639
1639 { 1640 {
1640 // LayoutStateMaintainer needs this deliberate scope to pop before repai nt 1641 // LayoutStateMaintainer needs this deliberate scope to pop before repai nt
1641 LayoutStateMaintainer statePusher(*this, locationOffset()); 1642 LayoutStateMaintainer statePusher(*this, locationOffset());
1642 1643
1643 if (needsPositionedMovementLayout() && !tryLayoutDoingPositionedMovement Only()) 1644 if (needsPositionedMovementLayout() && !tryLayoutDoingPositionedMovement Only())
1644 return false; 1645 return false;
1645 1646
1647 if (needsResizeLayout() && !tryLayoutDoingResizeOnly())
1648 return false;
1649
1646 FastTextAutosizer::LayoutScope fastTextAutosizerLayoutScope(this); 1650 FastTextAutosizer::LayoutScope fastTextAutosizerLayoutScope(this);
1647 1651
1648 // Lay out positioned descendants or objects that just need to recompute overflow. 1652 // Lay out positioned descendants or objects that just need to recompute overflow.
1649 if (needsSimplifiedNormalFlowLayout()) 1653 if (needsSimplifiedNormalFlowLayout())
1650 simplifiedNormalFlowLayout(); 1654 simplifiedNormalFlowLayout();
1651 1655
1652 // Make sure a forced break is applied after the content if we are a flo w thread in a simplified layout. 1656 // Make sure a forced break is applied after the content if we are a flo w thread in a simplified layout.
1653 // This ensures the size information is correctly computed for the last auto-height region receiving content. 1657 // This ensures the size information is correctly computed for the last auto-height region receiving content.
1654 if (isRenderFlowThread()) 1658 if (isRenderFlowThread())
1655 toRenderFlowThread(this)->applyBreakAfterContent(clientLogicalBottom ()); 1659 toRenderFlowThread(this)->applyBreakAfterContent(clientLogicalBottom ());
(...skipping 2152 matching lines...) Expand 10 before | Expand all | Expand 10 after
3808 } 3812 }
3809 3813
3810 bool RenderBlock::hasLineIfEmpty() const 3814 bool RenderBlock::hasLineIfEmpty() const
3811 { 3815 {
3812 if (!node()) 3816 if (!node())
3813 return false; 3817 return false;
3814 3818
3815 if (node()->isRootEditableElement()) 3819 if (node()->isRootEditableElement())
3816 return true; 3820 return true;
3817 3821
3818 if (node()->isShadowRoot() && isHTMLInputElement(*toShadowRoot(node())->host ())) 3822 if (node()->isShadowRoot() && toShadowRoot(node())->host()->hasTagName(input Tag))
esprehn 2014/03/24 22:40:04 Why did you change this?
Xianzhu 2014/03/24 23:53:24 Sorry for the carelessness. May be resulted from a
3819 return true; 3823 return true;
3820 3824
3821 return false; 3825 return false;
3822 } 3826 }
3823 3827
3824 LayoutUnit RenderBlock::lineHeight(bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const 3828 LayoutUnit RenderBlock::lineHeight(bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
3825 { 3829 {
3826 // Inline blocks are replaced elements. Otherwise, just pass off to 3830 // Inline blocks are replaced elements. Otherwise, just pass off to
3827 // the base class. If we're being queried as though we're the root line 3831 // the base class. If we're being queried as though we're the root line
3828 // box, then the fact that we're an inline-block is irrelevant, and we behav e 3832 // box, then the fact that we're an inline-block is irrelevant, and we behav e
(...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after
5025 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 5029 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
5026 { 5030 {
5027 showRenderObject(); 5031 showRenderObject();
5028 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 5032 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
5029 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 5033 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
5030 } 5034 }
5031 5035
5032 #endif 5036 #endif
5033 5037
5034 } // namespace WebCore 5038 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/RenderBox.h » ('j') | Source/core/rendering/RenderBox.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698