- Revision
- 90144
- Author
- [email protected]
- Date
- 2011-06-30 12:16:53 -0700 (Thu, 30 Jun 2011)
Log Message
2011-06-30 Levi Weintraub <[email protected]>
Reviewed by Eric Seidel.
Switch availableWidth/Height, logicalLeft/RightOffsetForLine to new layout types
https://bugs.webkit.org/show_bug.cgi?id=63671
Switch availableWidth/Height, logicalLeft/RightOffsetForLine functions over to the
new layout unit abstraction.
No new tests, no functionality changes.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::logicalLeftOffsetForLine):
(WebCore::RenderBlock::logicalRightOffsetForLine):
(WebCore::RenderBlock::availableLogicalWidthForLine):
(WebCore::RenderBlock::availableLogicalWidth):
* rendering/RenderBlock.h:
(WebCore::RenderBlock::logicalRightOffsetForLine):
(WebCore::RenderBlock::logicalLeftOffsetForLine):
(WebCore::RenderBlock::startOffsetForLine):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::availableLogicalHeight):
(WebCore::RenderBox::availableLogicalHeightUsing):
* rendering/RenderBox.h:
(WebCore::RenderBox::availableLogicalWidth):
(WebCore::RenderBox::availableWidth):
(WebCore::RenderBox::availableHeight):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (90143 => 90144)
--- trunk/Source/WebCore/ChangeLog 2011-06-30 19:16:53 UTC (rev 90143)
+++ trunk/Source/WebCore/ChangeLog 2011-06-30 19:16:53 UTC (rev 90144)
@@ -1,3 +1,32 @@
+2011-06-30 Levi Weintraub <[email protected]>
+
+ Reviewed by Eric Seidel.
+
+ Switch availableWidth/Height, logicalLeft/RightOffsetForLine to new layout types
+ https://bugs.webkit.org/show_bug.cgi?id=63671
+
+ Switch availableWidth/Height, logicalLeft/RightOffsetForLine functions over to the
+ new layout unit abstraction.
+
+ No new tests, no functionality changes.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::logicalLeftOffsetForLine):
+ (WebCore::RenderBlock::logicalRightOffsetForLine):
+ (WebCore::RenderBlock::availableLogicalWidthForLine):
+ (WebCore::RenderBlock::availableLogicalWidth):
+ * rendering/RenderBlock.h:
+ (WebCore::RenderBlock::logicalRightOffsetForLine):
+ (WebCore::RenderBlock::logicalLeftOffsetForLine):
+ (WebCore::RenderBlock::startOffsetForLine):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::availableLogicalHeight):
+ (WebCore::RenderBox::availableLogicalHeightUsing):
+ * rendering/RenderBox.h:
+ (WebCore::RenderBox::availableLogicalWidth):
+ (WebCore::RenderBox::availableWidth):
+ (WebCore::RenderBox::availableHeight):
+
2011-06-30 Adam Barth <[email protected]>
Remove useless ASSERT that breaks the build.
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (90143 => 90144)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2011-06-30 19:16:53 UTC (rev 90143)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2011-06-30 19:16:53 UTC (rev 90144)
@@ -3451,9 +3451,9 @@
// each float individually, we'd just walk backwards through the "lines" and stop when we hit a line that is fully above
// the vertical offset that we'd like to check. Computing the "lines" would be rather complicated, but could replace the left
// objects and right objects count hack that is currently used here.
-int RenderBlock::logicalLeftOffsetForLine(int logicalTop, int fixedOffset, bool applyTextIndent, int* heightRemaining) const
+LayoutUnit RenderBlock::logicalLeftOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining) const
{
- int left = fixedOffset;
+ LayoutUnit left = fixedOffset;
if (m_floatingObjects && m_floatingObjects->hasLeftObjects()) {
if (heightRemaining)
*heightRemaining = 1;
@@ -3478,7 +3478,7 @@
}
if (applyTextIndent && style()->isLeftToRightDirection()) {
- int cw = 0;
+ LayoutUnit cw = 0;
if (style()->textIndent().isPercent())
cw = containingBlock()->availableLogicalWidth();
left += style()->textIndent().calcMinValue(cw);
@@ -3487,9 +3487,9 @@
return left;
}
-int RenderBlock::logicalRightOffsetForLine(int logicalTop, int fixedOffset, bool applyTextIndent, int* heightRemaining) const
+LayoutUnit RenderBlock::logicalRightOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining) const
{
- int right = fixedOffset;
+ LayoutUnit right = fixedOffset;
if (m_floatingObjects && m_floatingObjects->hasRightObjects()) {
if (heightRemaining)
@@ -3515,7 +3515,7 @@
}
if (applyTextIndent && !style()->isLeftToRightDirection()) {
- int cw = 0;
+ LayoutUnit cw = 0;
if (style()->textIndent().isPercent())
cw = containingBlock()->availableLogicalWidth();
right -= style()->textIndent().calcMinValue(cw);
@@ -3524,9 +3524,9 @@
return right;
}
-int RenderBlock::availableLogicalWidthForLine(int position, bool firstLine) const
+LayoutUnit RenderBlock::availableLogicalWidthForLine(LayoutUnit position, bool firstLine) const
{
- int result = logicalRightOffsetForLine(position, firstLine) - logicalLeftOffsetForLine(position, firstLine);
+ LayoutUnit result = logicalRightOffsetForLine(position, firstLine) - logicalLeftOffsetForLine(position, firstLine);
return (result < 0) ? 0 : result;
}
@@ -4253,7 +4253,7 @@
adjustPointToColumnContents(offset);
}
-int RenderBlock::availableLogicalWidth() const
+LayoutUnit RenderBlock::availableLogicalWidth() const
{
// If we have multiple columns, then the available logical width is reduced to our column width.
if (hasColumns())
Modified: trunk/Source/WebCore/rendering/RenderBlock.h (90143 => 90144)
--- trunk/Source/WebCore/rendering/RenderBlock.h 2011-06-30 19:16:53 UTC (rev 90143)
+++ trunk/Source/WebCore/rendering/RenderBlock.h 2011-06-30 19:16:53 UTC (rev 90144)
@@ -115,15 +115,15 @@
bool containsFloats() { return m_floatingObjects && !m_floatingObjects->set().isEmpty(); }
bool containsFloat(RenderBox*);
- int availableLogicalWidthForLine(int position, bool firstLine) const;
- int logicalRightOffsetForLine(int position, bool firstLine) const { return logicalRightOffsetForLine(position, logicalRightOffsetForContent(), firstLine); }
- int logicalLeftOffsetForLine(int position, bool firstLine) const { return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(), firstLine); }
- int startOffsetForLine(int position, bool firstLine) const { return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, firstLine) : logicalRightOffsetForLine(position, firstLine); }
+ LayoutUnit availableLogicalWidthForLine(LayoutUnit position, bool firstLine) const;
+ LayoutUnit logicalRightOffsetForLine(LayoutUnit position, bool firstLine) const { return logicalRightOffsetForLine(position, logicalRightOffsetForContent(), firstLine); }
+ LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, bool firstLine) const { return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(), firstLine); }
+ LayoutUnit startOffsetForLine(LayoutUnit position, bool firstLine) const { return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, firstLine) : logicalRightOffsetForLine(position, firstLine); }
virtual VisiblePosition positionForPoint(const IntPoint&);
// Block flows subclass availableWidth to handle multi column layout (shrinking the width available to children when laying out.)
- virtual int availableLogicalWidth() const;
+ virtual LayoutUnit availableLogicalWidth() const;
IntPoint flipForWritingModeIncludingColumns(const IntPoint&) const;
void flipForWritingModeIncludingColumns(IntRect&) const;
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (90143 => 90144)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2011-06-30 19:16:53 UTC (rev 90143)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2011-06-30 19:16:53 UTC (rev 90144)
@@ -2031,12 +2031,12 @@
}
}
-int RenderBox::availableLogicalHeight() const
+LayoutUnit RenderBox::availableLogicalHeight() const
{
return availableLogicalHeightUsing(style()->logicalHeight());
}
-int RenderBox::availableLogicalHeightUsing(const Length& h) const
+LayoutUnit RenderBox::availableLogicalHeightUsing(const Length& h) const
{
if (h.isFixed())
return computeContentBoxLogicalHeight(h.value());
@@ -2057,9 +2057,9 @@
// https://bugs.webkit.org/show_bug.cgi?id=46500
if (isRenderBlock() && isPositioned() && style()->height().isAuto() && !(style()->top().isAuto() || style()->bottom().isAuto())) {
RenderBlock* block = const_cast<RenderBlock*>(toRenderBlock(this));
- int oldHeight = block->logicalHeight();
+ LayoutUnit oldHeight = block->logicalHeight();
block->computeLogicalHeight();
- int newHeight = block->computeContentBoxLogicalHeight(block->contentLogicalHeight());
+ LayoutUnit newHeight = block->computeContentBoxLogicalHeight(block->contentLogicalHeight());
block->setLogicalHeight(oldHeight);
return computeContentBoxLogicalHeight(newHeight);
}
Modified: trunk/Source/WebCore/rendering/RenderBox.h (90143 => 90144)
--- trunk/Source/WebCore/rendering/RenderBox.h 2011-06-30 19:16:53 UTC (rev 90143)
+++ trunk/Source/WebCore/rendering/RenderBox.h 2011-06-30 19:16:53 UTC (rev 90144)
@@ -318,14 +318,14 @@
LayoutUnit computePercentageLogicalHeight(const Length& height);
// Block flows subclass availableWidth to handle multi column layout (shrinking the width available to children when laying out.)
- virtual int availableLogicalWidth() const { return contentLogicalWidth(); }
- int availableLogicalHeight() const;
- int availableLogicalHeightUsing(const Length&) const;
+ virtual LayoutUnit availableLogicalWidth() const { return contentLogicalWidth(); }
+ LayoutUnit availableLogicalHeight() const;
+ LayoutUnit availableLogicalHeightUsing(const Length&) const;
// There are a few cases where we need to refer specifically to the available physical width and available physical height.
// Relative positioning is one of those cases, since left/top offsets are physical.
- int availableWidth() const { return style()->isHorizontalWritingMode() ? availableLogicalWidth() : availableLogicalHeight(); }
- int availableHeight() const { return style()->isHorizontalWritingMode() ? availableLogicalHeight() : availableLogicalWidth(); }
+ LayoutUnit availableWidth() const { return style()->isHorizontalWritingMode() ? availableLogicalWidth() : availableLogicalHeight(); }
+ LayoutUnit availableHeight() const { return style()->isHorizontalWritingMode() ? availableLogicalHeight() : availableLogicalWidth(); }
virtual int verticalScrollbarWidth() const;
int horizontalScrollbarHeight() const;