- Revision
- 90773
- Author
- t...@chromium.org
- Date
- 2011-07-11 12:02:17 -0700 (Mon, 11 Jul 2011)
Log Message
rename RenderObject::isFlexibleBox to isDeprecatedFlexibleBox
https://bugs.webkit.org/show_bug.cgi?id=64217
Reviewed by Ojan Vafai.
This is to make way for the new flexbox needing a similar method.
RenderObject also has isFlexingChildren() and isStretchingChildren(),
but we may be able to use those for the new flexbox as well so I
didn't rename them.
No new tests, just refactoring.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::removeChild):
(WebCore::RenderBlock::expandsToEncloseOverhangingFloats):
(WebCore::shouldCheckLines):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::removeFloatingOrPositionedChildFromBlockLists):
(WebCore::RenderBox::computeLogicalWidth):
(WebCore::RenderBox::sizesToIntrinsicLogicalWidth):
(WebCore::RenderBox::computeLogicalHeight):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
* rendering/RenderDeprecatedFlexibleBox.h:
(WebCore::RenderDeprecatedFlexibleBox::isDeprecatedFlexibleBox):
* rendering/RenderObject.h:
(WebCore::RenderObject::isDeprecatedFlexibleBox):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (90772 => 90773)
--- trunk/Source/WebCore/ChangeLog 2011-07-11 18:58:39 UTC (rev 90772)
+++ trunk/Source/WebCore/ChangeLog 2011-07-11 19:02:17 UTC (rev 90773)
@@ -1,3 +1,33 @@
+2011-07-11 Tony Chang <t...@chromium.org>
+
+ rename RenderObject::isFlexibleBox to isDeprecatedFlexibleBox
+ https://bugs.webkit.org/show_bug.cgi?id=64217
+
+ Reviewed by Ojan Vafai.
+
+ This is to make way for the new flexbox needing a similar method.
+ RenderObject also has isFlexingChildren() and isStretchingChildren(),
+ but we may be able to use those for the new flexbox as well so I
+ didn't rename them.
+
+ No new tests, just refactoring.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::removeChild):
+ (WebCore::RenderBlock::expandsToEncloseOverhangingFloats):
+ (WebCore::shouldCheckLines):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::removeFloatingOrPositionedChildFromBlockLists):
+ (WebCore::RenderBox::computeLogicalWidth):
+ (WebCore::RenderBox::sizesToIntrinsicLogicalWidth):
+ (WebCore::RenderBox::computeLogicalHeight):
+ * rendering/RenderDeprecatedFlexibleBox.cpp:
+ (WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
+ * rendering/RenderDeprecatedFlexibleBox.h:
+ (WebCore::RenderDeprecatedFlexibleBox::isDeprecatedFlexibleBox):
+ * rendering/RenderObject.h:
+ (WebCore::RenderObject::isDeprecatedFlexibleBox):
+
2011-07-11 Nate Chapin <jap...@chromium.org>
[Chromium] Ensure we don't crash when an
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (90772 => 90773)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2011-07-11 18:58:39 UTC (rev 90772)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2011-07-11 19:02:17 UTC (rev 90773)
@@ -1045,7 +1045,7 @@
RenderBox::removeChild(oldChild);
RenderObject* child = prev ? prev : next;
- if (canMergeAnonymousBlocks && child && !child->previousSibling() && !child->nextSibling() && !isFlexibleBox()) {
+ if (canMergeAnonymousBlocks && child && !child->previousSibling() && !child->nextSibling() && !isDeprecatedFlexibleBox()) {
// The removal has knocked us down to containing only a single anonymous
// box. We can go ahead and pull the content right back up into our
// box.
@@ -1452,7 +1452,7 @@
bool RenderBlock::expandsToEncloseOverhangingFloats() const
{
- return isInlineBlockOrInlineTable() || isFloatingOrPositioned() || hasOverflowClip() || (parent() && parent()->isFlexibleBox())
+ return isInlineBlockOrInlineTable() || isFloatingOrPositioned() || hasOverflowClip() || (parent() && parent()->isDeprecatedFlexibleBox())
|| hasColumns() || isTableCell() || isFieldset() || isWritingModeRoot() || isRoot();
}
@@ -5508,7 +5508,7 @@
{
return !obj->isFloatingOrPositioned() && !obj->isRunIn() &&
obj->isBlockFlow() && obj->style()->height().isAuto() &&
- (!obj->isFlexibleBox() || obj->style()->boxOrient() == VERTICAL);
+ (!obj->isDeprecatedFlexibleBox() || obj->style()->boxOrient() == VERTICAL);
}
static RootInlineBox* getLineAtIndex(RenderBlock* block, int i, int& count)
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (90772 => 90773)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2011-07-11 18:58:39 UTC (rev 90772)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2011-07-11 19:02:17 UTC (rev 90773)
@@ -227,7 +227,7 @@
if (parentBlock) {
RenderObject* parent = parentBlock->parent();
- if (parent && parent->isFlexibleBox())
+ if (parent && parent->isDeprecatedFlexibleBox())
parentBlock = toRenderBlock(parent);
parentBlock->markAllDescendantsWithFloatsForLayout(this, false);
@@ -1549,14 +1549,14 @@
// FIXME: Account for block-flow in flexible boxes.
// https://bugs.webkit.org/show_bug.cgi?id=46418
if (hasOverrideSize() && parent()->style()->boxOrient() == HORIZONTAL
- && parent()->isFlexibleBox() && parent()->isFlexingChildren()) {
+ && parent()->isDeprecatedFlexibleBox() && parent()->isFlexingChildren()) {
setLogicalWidth(overrideWidth());
return;
}
// FIXME: Account for block-flow in flexible boxes.
// https://bugs.webkit.org/show_bug.cgi?id=46418
- bool inVerticalBox = parent()->isFlexibleBox() && (parent()->style()->boxOrient() == VERTICAL);
+ bool inVerticalBox = parent()->isDeprecatedFlexibleBox() && (parent()->style()->boxOrient() == VERTICAL);
bool stretching = (parent()->style()->boxAlign() == BSTRETCH);
bool treatAsReplaced = shouldComputeSizeAsReplaced() && (!inVerticalBox || !stretching);
@@ -1616,7 +1616,7 @@
computeInlineDirectionMargins(cb, containerLogicalWidth, logicalWidth());
if (!hasPerpendicularContainingBlock && containerLogicalWidth && containerLogicalWidth != (logicalWidth() + marginStart() + marginEnd())
- && !isFloating() && !isInline() && !cb->isFlexibleBox())
+ && !isFloating() && !isInline() && !cb->isDeprecatedFlexibleBox())
cb->setMarginEndForChild(this, containerLogicalWidth - logicalWidth() - cb->marginStartForChild(this));
}
@@ -1675,7 +1675,7 @@
// that don't stretch their kids lay out their children at their intrinsic widths.
// FIXME: Think about block-flow here.
// https://bugs.webkit.org/show_bug.cgi?id=46473
- if (parent()->isFlexibleBox()
+ if (parent()->isDeprecatedFlexibleBox()
&& (parent()->style()->boxOrient() == HORIZONTAL || parent()->style()->boxAlign() != BSTRETCH))
return true;
@@ -1684,7 +1684,7 @@
// stretching vertical flexbox.
// FIXME: Think about block-flow here.
// https://bugs.webkit.org/show_bug.cgi?id=46473
- if (logicalWidth.type() == Auto && !(parent()->isFlexibleBox() && parent()->style()->boxOrient() == VERTICAL && parent()->style()->boxAlign() == BSTRETCH) && node() && (node()->hasTagName(inputTag) || node()->hasTagName(selectTag) || node()->hasTagName(buttonTag) || node()->hasTagName(textareaTag) || node()->hasTagName(legendTag)))
+ if (logicalWidth.type() == Auto && !(parent()->isDeprecatedFlexibleBox() && parent()->style()->boxOrient() == VERTICAL && parent()->style()->boxAlign() == BSTRETCH) && node() && (node()->hasTagName(inputTag) || node()->hasTagName(selectTag) || node()->hasTagName(buttonTag) || node()->hasTagName(textareaTag) || node()->hasTagName(legendTag)))
return true;
return false;
@@ -1753,7 +1753,7 @@
// FIXME: Account for block-flow in flexible boxes.
// https://bugs.webkit.org/show_bug.cgi?id=46418
- bool inHorizontalBox = parent()->isFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL;
+ bool inHorizontalBox = parent()->isDeprecatedFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL;
bool stretching = parent()->style()->boxAlign() == BSTRETCH;
bool treatAsReplaced = shouldComputeSizeAsReplaced() && (!inHorizontalBox || !stretching);
bool checkMinMaxHeight = false;
@@ -1762,7 +1762,7 @@
// grab our cached flexible height.
// FIXME: Account for block-flow in flexible boxes.
// https://bugs.webkit.org/show_bug.cgi?id=46418
- if (hasOverrideSize() && parent()->isFlexibleBox() && parent()->style()->boxOrient() == VERTICAL
+ if (hasOverrideSize() && parent()->isDeprecatedFlexibleBox() && parent()->style()->boxOrient() == VERTICAL
&& parent()->isFlexingChildren())
h = Length(overrideHeight() - borderAndPaddingLogicalHeight(), Fixed);
else if (treatAsReplaced)
@@ -1775,7 +1775,7 @@
// Block children of horizontal flexible boxes fill the height of the box.
// FIXME: Account for block-flow in flexible boxes.
// https://bugs.webkit.org/show_bug.cgi?id=46418
- if (h.isAuto() && parent()->isFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL
+ if (h.isAuto() && parent()->isDeprecatedFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL
&& parent()->isStretchingChildren()) {
h = Length(parentBox()->contentLogicalHeight() - marginBefore() - marginAfter() - borderAndPaddingLogicalHeight(), Fixed);
checkMinMaxHeight = false;
Modified: trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp (90772 => 90773)
--- trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp 2011-07-11 18:58:39 UTC (rev 90772)
+++ trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp 2011-07-11 19:02:17 UTC (rev 90773)
@@ -216,7 +216,7 @@
m_overflow.clear();
if (previousSize != size()
- || (parent()->isFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL
+ || (parent()->isDeprecatedFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL
&& parent()->style()->boxAlign() == BSTRETCH))
relayoutChildren = true;
Modified: trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h (90772 => 90773)
--- trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h 2011-07-11 18:58:39 UTC (rev 90772)
+++ trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h 2011-07-11 19:02:17 UTC (rev 90773)
@@ -46,7 +46,7 @@
virtual bool avoidsFloats() const { return true; }
- virtual bool isFlexibleBox() const { return true; }
+ virtual bool isDeprecatedFlexibleBox() const { return true; }
virtual bool isFlexingChildren() const { return m_flexingChildren; }
virtual bool isStretchingChildren() const { return m_stretchingChildren; }
Modified: trunk/Source/WebCore/rendering/RenderObject.h (90772 => 90773)
--- trunk/Source/WebCore/rendering/RenderObject.h 2011-07-11 18:58:39 UTC (rev 90772)
+++ trunk/Source/WebCore/rendering/RenderObject.h 2011-07-11 19:02:17 UTC (rev 90773)
@@ -739,8 +739,8 @@
virtual void destroy();
- // Virtual function helpers for CSS3 Flexible Box Layout
- virtual bool isFlexibleBox() const { return false; }
+ // Virtual function helpers for the deprecated Flexible Box Layout (display: -webkit-box)
+ virtual bool isDeprecatedFlexibleBox() const { return false; }
virtual bool isFlexingChildren() const { return false; }
virtual bool isStretchingChildren() const { return false; }