Rename some line box functions to be just about lines
https://bugs.webkit.org/show_bug.cgi?id=123168
Reviewed by Dave Hyatt.
firstLineBoxBaseline -> firstLineBaseline
hasInlineBoxChildren -> hasLines
Also use hasLines in a bunch of places where firstLineBox() was used.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
Also use hasRenderedText() instead of firstTextBox()
* rendering/RenderFullScreen.cpp:
Fix namespace.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157810 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index d2e8af7..4695033 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2013-10-22 Antti Koivisto <antti@apple.com>
+
+ Rename some line box functions to be just about lines
+ https://bugs.webkit.org/show_bug.cgi?id=123168
+
+ Reviewed by Dave Hyatt.
+
+ firstLineBoxBaseline -> firstLineBaseline
+ hasInlineBoxChildren -> hasLines
+
+ Also use hasLines in a bunch of places where firstLineBox() was used.
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
+
+ Also use hasRenderedText() instead of firstTextBox()
+
+ * rendering/RenderFullScreen.cpp:
+
+ Fix namespace.
+
2013-10-22 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org>
Adding Mock class to test RTCPeerConnection
diff --git a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
index f69f004..fb5a480 100644
--- a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -1166,8 +1166,8 @@
AccessibilityObject* parent = parentObjectUnignored();
if (parent && (parent->isMenuItem() || parent->ariaRoleAttribute() == MenuButtonRole))
return true;
- RenderText* renderText = toRenderText(m_renderer);
- if (!renderText->firstTextBox())
+ auto& renderText = toRenderText(*m_renderer);
+ if (!renderText.hasRenderedText())
return true;
// static text beneath TextControls is reported along with the text control text so it's ignored.
@@ -1177,7 +1177,7 @@
}
// text elements that are just empty whitespace should not be returned
- return renderText->text()->containsOnlyWhitespace();
+ return renderText.text()->containsOnlyWhitespace();
}
if (isHeading())
@@ -1231,7 +1231,7 @@
return true;
if (m_renderer->isRenderBlockFlow() && m_renderer->childrenInline() && !canSetFocusAttribute())
- return !toRenderBlockFlow(m_renderer)->firstLineBox() && !mouseButtonListener();
+ return !toRenderBlockFlow(m_renderer)->hasLines() && !mouseButtonListener();
// ignore images seemingly used as spacers
if (isImage()) {
diff --git a/Source/WebCore/rendering/InlineTextBox.cpp b/Source/WebCore/rendering/InlineTextBox.cpp
index 29690fb..214547c 100644
--- a/Source/WebCore/rendering/InlineTextBox.cpp
+++ b/Source/WebCore/rendering/InlineTextBox.cpp
@@ -465,7 +465,7 @@
RenderRubyText* rubyText = toRenderRubyRun(containingBlock->parent())->rubyText();
// The emphasis marks over are suppressed only if there is a ruby text box and it not empty.
- return !rubyText || !rubyText->firstLineBox();
+ return !rubyText || !rubyText->hasLines();
}
enum RotationDirection { Counterclockwise, Clockwise };
diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp
index 9bc4da0..df8a23e 100644
--- a/Source/WebCore/rendering/RenderBlock.cpp
+++ b/Source/WebCore/rendering/RenderBlock.cpp
@@ -1195,7 +1195,7 @@
// If the block has inline children, see if we generated any line boxes. If we have any
// line boxes, then we can't be self-collapsing, since we have content.
if (childrenInline())
- return !hasInlineBoxChildren();
+ return !hasLines();
// Whether or not we collapse is dependent on whether all our normal flow children
// are also self-collapsing.
@@ -4617,14 +4617,14 @@
return std::max<LayoutUnit>(replacedHeight, lineHeight(isFirstLine, isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes));
}
-int RenderBlock::firstLineBoxBaseline() const
+int RenderBlock::firstLineBaseline() const
{
if (isWritingModeRoot() && !isRubyRun())
return -1;
for (RenderBox* curr = firstChildBox(); curr; curr = curr->nextSiblingBox()) {
if (!curr->isFloatingOrOutOfFlowPositioned()) {
- int result = curr->firstLineBoxBaseline();
+ int result = curr->firstLineBaseline();
if (result != -1)
return curr->logicalTop() + result; // Translate to our coordinate space.
}
@@ -4639,17 +4639,17 @@
return -1;
bool haveNormalFlowChild = false;
- for (RenderBox* curr = lastChildBox(); curr; curr = curr->previousSiblingBox()) {
- if (!curr->isFloatingOrOutOfFlowPositioned()) {
- haveNormalFlowChild = true;
- int result = curr->inlineBlockBaseline(lineDirection);
- if (result != -1)
- return curr->logicalTop() + result; // Translate to our coordinate space.
- }
+ for (auto box = lastChildBox(); box; box = box->previousSiblingBox()) {
+ if (box->isFloatingOrOutOfFlowPositioned())
+ continue;
+ haveNormalFlowChild = true;
+ int result = box->inlineBlockBaseline(lineDirection);
+ if (result != -1)
+ return box->logicalTop() + result; // Translate to our coordinate space.
}
if (!haveNormalFlowChild && hasLineIfEmpty()) {
- const FontMetrics& fontMetrics = firstLineStyle()->fontMetrics();
+ auto& fontMetrics = firstLineStyle()->fontMetrics();
return fontMetrics.ascent()
+ (lineHeight(true, lineDirection, PositionOfInteriorLineBoxes) - fontMetrics.height()) / 2
+ (lineDirection == HorizontalLine ? borderTop() + paddingTop() : borderRight() + paddingRight());
diff --git a/Source/WebCore/rendering/RenderBlock.h b/Source/WebCore/rendering/RenderBlock.h
index 3854c24..61e9e85 100644
--- a/Source/WebCore/rendering/RenderBlock.h
+++ b/Source/WebCore/rendering/RenderBlock.h
@@ -458,7 +458,7 @@
virtual void computePreferredLogicalWidths() OVERRIDE;
void adjustIntrinsicLogicalWidthsForColumns(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const;
- virtual int firstLineBoxBaseline() const OVERRIDE;
+ virtual int firstLineBaseline() const OVERRIDE;
virtual int inlineBlockBaseline(LineDirectionMode) const OVERRIDE;
// Delay update scrollbar until finishDelayRepaint() will be
@@ -541,7 +541,7 @@
virtual bool isSelfCollapsingBlock() const OVERRIDE FINAL;
// FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow
- virtual bool hasInlineBoxChildren() const { return false; }
+ virtual bool hasLines() const { return false; }
void insertIntoTrackedRendererMaps(RenderBox* descendant, TrackedDescendantsMap*&, TrackedContainerMap*&);
static void removeFromTrackedRendererMaps(RenderBox* descendant, TrackedDescendantsMap*&, TrackedContainerMap*&);
diff --git a/Source/WebCore/rendering/RenderBlockFlow.cpp b/Source/WebCore/rendering/RenderBlockFlow.cpp
index b393213..f9963aa 100644
--- a/Source/WebCore/rendering/RenderBlockFlow.cpp
+++ b/Source/WebCore/rendering/RenderBlockFlow.cpp
@@ -2488,13 +2488,13 @@
}
}
-int RenderBlockFlow::firstLineBoxBaseline() const
+int RenderBlockFlow::firstLineBaseline() const
{
if (isWritingModeRoot() && !isRubyRun())
return -1;
if (!childrenInline())
- return RenderBlock::firstLineBoxBaseline();
+ return RenderBlock::firstLineBaseline();
if (firstLineBox())
return firstLineBox()->logicalTop() + firstLineStyle()->fontMetrics().ascent(firstRootBox()->baselineType());
@@ -2510,19 +2510,18 @@
if (!childrenInline())
return RenderBlock::inlineBlockBaseline(lineDirection);
- if (!firstLineBox() && hasLineIfEmpty()) {
+ if (!hasLines()) {
+ if (!hasLineIfEmpty())
+ return -1;
const FontMetrics& fontMetrics = firstLineStyle()->fontMetrics();
return fontMetrics.ascent()
+ (lineHeight(true, lineDirection, PositionOfInteriorLineBoxes) - fontMetrics.height()) / 2
+ (lineDirection == HorizontalLine ? borderTop() + paddingTop() : borderRight() + paddingRight());
}
- if (lastLineBox()) {
- bool isFirstLine = lastLineBox() == firstLineBox();
- RenderStyle* style = isFirstLine ? firstLineStyle() : this->style();
- return lastLineBox()->logicalTop() + style->fontMetrics().ascent(lastRootBox()->baselineType());
- }
- return -1;
+ bool isFirstLine = lastLineBox() == firstLineBox();
+ RenderStyle* style = isFirstLine ? firstLineStyle() : this->style();
+ return lastLineBox()->logicalTop() + style->fontMetrics().ascent(lastRootBox()->baselineType());
}
GapRects RenderBlockFlow::inlineSelectionGaps(RenderBlock* rootBlock, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
@@ -2532,7 +2531,7 @@
bool containsStart = selectionState() == SelectionStart || selectionState() == SelectionBoth;
- if (!firstLineBox()) {
+ if (!hasLines()) {
if (containsStart) {
// Go ahead and update our lastLogicalTop to be the bottom of the block. <hr>s or empty blocks with height can trip this
// case.
diff --git a/Source/WebCore/rendering/RenderBlockFlow.h b/Source/WebCore/rendering/RenderBlockFlow.h
index ac56daa..9c60002 100644
--- a/Source/WebCore/rendering/RenderBlockFlow.h
+++ b/Source/WebCore/rendering/RenderBlockFlow.h
@@ -307,7 +307,7 @@
RootInlineBox* firstRootBox() const { return static_cast<RootInlineBox*>(firstLineBox()); }
RootInlineBox* lastRootBox() const { return static_cast<RootInlineBox*>(lastLineBox()); }
- virtual bool hasInlineBoxChildren() const OVERRIDE FINAL { return firstLineBox(); }
+ virtual bool hasLines() const OVERRIDE FINAL { return firstLineBox(); }
// Helper methods for computing line counts and heights for line counts.
RootInlineBox* lineAtIndex(int) const;
@@ -364,7 +364,7 @@
void createFloatingObjects();
- virtual int firstLineBoxBaseline() const OVERRIDE;
+ virtual int firstLineBaseline() const OVERRIDE;
virtual int inlineBlockBaseline(LineDirectionMode) const OVERRIDE;
private:
diff --git a/Source/WebCore/rendering/RenderBox.h b/Source/WebCore/rendering/RenderBox.h
index dfd14be..1ff04b0 100644
--- a/Source/WebCore/rendering/RenderBox.h
+++ b/Source/WebCore/rendering/RenderBox.h
@@ -508,7 +508,7 @@
RenderLayer* enclosingFloatPaintingLayer() const;
- virtual int firstLineBoxBaseline() const { return -1; }
+ virtual int firstLineBaseline() const { return -1; }
virtual int inlineBlockBaseline(LineDirectionMode) const { return -1; } // Returns -1 if we should skip this box when computing the baseline of an inline-block.
bool shrinkToAvoidFloats() const;
diff --git a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
index d6b2056..95bcbb5 100644
--- a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
+++ b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
@@ -441,7 +441,7 @@
// Update our height and overflow height.
if (style()->boxAlign() == BBASELINE) {
- LayoutUnit ascent = child->firstLineBoxBaseline();
+ LayoutUnit ascent = child->firstLineBaseline();
if (ascent == -1)
ascent = child->height() + child->marginBottom();
ascent += child->marginTop();
@@ -519,7 +519,7 @@
childY += child->marginTop() + max<LayoutUnit>(0, (contentHeight() - (child->height() + child->marginHeight())) / 2);
break;
case BBASELINE: {
- LayoutUnit ascent = child->firstLineBoxBaseline();
+ LayoutUnit ascent = child->firstLineBaseline();
if (ascent == -1)
ascent = child->height() + child->marginBottom();
ascent += child->marginTop();
diff --git a/Source/WebCore/rendering/RenderFlexibleBox.cpp b/Source/WebCore/rendering/RenderFlexibleBox.cpp
index e9a6b32..a03647d 100644
--- a/Source/WebCore/rendering/RenderFlexibleBox.cpp
+++ b/Source/WebCore/rendering/RenderFlexibleBox.cpp
@@ -241,7 +241,7 @@
int RenderFlexibleBox::baselinePosition(FontBaseline, bool, LineDirectionMode direction, LinePositionMode) const
{
- int baseline = firstLineBoxBaseline();
+ int baseline = firstLineBaseline();
if (baseline == -1)
baseline = synthesizedBaselineFromContentBox(this, direction);
@@ -249,7 +249,7 @@
return baseline + marginAscent;
}
-int RenderFlexibleBox::firstLineBoxBaseline() const
+int RenderFlexibleBox::firstLineBaseline() const
{
if (isWritingModeRoot() || m_numberOfInFlowChildrenOnFirstLine <= 0)
return -1;
@@ -278,7 +278,7 @@
if (isColumnFlow() && !hasOrthogonalFlow(baselineChild))
return mainAxisExtentForChild(baselineChild) + baselineChild->logicalTop();
- int baseline = baselineChild->firstLineBoxBaseline();
+ int baseline = baselineChild->firstLineBaseline();
if (baseline == -1) {
// FIXME: We should pass |direction| into firstLineBoxBaseline and stop bailing out if we're a writing mode root.
// This would also fix some cases where the flexbox is orthogonal to its container.
@@ -291,7 +291,7 @@
int RenderFlexibleBox::inlineBlockBaseline(LineDirectionMode direction) const
{
- int baseline = firstLineBoxBaseline();
+ int baseline = firstLineBaseline();
if (baseline != -1)
return baseline;
@@ -894,7 +894,7 @@
LayoutUnit RenderFlexibleBox::marginBoxAscentForChild(RenderBox* child)
{
- LayoutUnit ascent = child->firstLineBoxBaseline();
+ LayoutUnit ascent = child->firstLineBaseline();
if (ascent == -1)
ascent = crossAxisExtentForChild(child);
return ascent + flowAwareMarginBeforeForChild(child);
diff --git a/Source/WebCore/rendering/RenderFlexibleBox.h b/Source/WebCore/rendering/RenderFlexibleBox.h
index dd0e172..7273a39 100644
--- a/Source/WebCore/rendering/RenderFlexibleBox.h
+++ b/Source/WebCore/rendering/RenderFlexibleBox.h
@@ -49,7 +49,7 @@
virtual void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) OVERRIDE FINAL;
virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const OVERRIDE;
- virtual int firstLineBoxBaseline() const OVERRIDE;
+ virtual int firstLineBaseline() const OVERRIDE;
virtual int inlineBlockBaseline(LineDirectionMode) const OVERRIDE;
virtual void paintChildren(PaintInfo& forSelf, const LayoutPoint&, PaintInfo& forChild, bool usePrintRect) OVERRIDE;
diff --git a/Source/WebCore/rendering/RenderFullScreen.cpp b/Source/WebCore/rendering/RenderFullScreen.cpp
index fbb78d4..6c2595c7 100644
--- a/Source/WebCore/rendering/RenderFullScreen.cpp
+++ b/Source/WebCore/rendering/RenderFullScreen.cpp
@@ -35,7 +35,7 @@
#include "RenderLayerCompositor.h"
#endif
-using namespace WebCore;
+namespace WebCore {
class RenderFullScreenPlaceholder FINAL : public RenderBlockFlow {
public:
@@ -185,4 +185,6 @@
m_placeholder->setStyle(*style);
}
+}
+
#endif
diff --git a/Source/WebCore/rendering/RenderMenuList.h b/Source/WebCore/rendering/RenderMenuList.h
index ff9e2ad..d1a2e4c 100644
--- a/Source/WebCore/rendering/RenderMenuList.h
+++ b/Source/WebCore/rendering/RenderMenuList.h
@@ -122,7 +122,7 @@
{
return RenderBlock::baselinePosition(baseline, firstLine, direction, position);
}
- virtual int firstLineBoxBaseline() const OVERRIDE { return RenderBlock::firstLineBoxBaseline(); }
+ virtual int firstLineBaseline() const OVERRIDE { return RenderBlock::firstLineBaseline(); }
virtual int inlineBlockBaseline(LineDirectionMode direction) const OVERRIDE { return RenderBlock::inlineBlockBaseline(direction); }
void getItemBackgroundColor(unsigned listIndex, Color&, bool& itemHasCustomBackgroundColor) const;
diff --git a/Source/WebCore/rendering/RenderTable.cpp b/Source/WebCore/rendering/RenderTable.cpp
index 3ab416f..716c1eb 100644
--- a/Source/WebCore/rendering/RenderTable.cpp
+++ b/Source/WebCore/rendering/RenderTable.cpp
@@ -1335,7 +1335,7 @@
int RenderTable::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
{
- LayoutUnit baseline = firstLineBoxBaseline();
+ LayoutUnit baseline = firstLineBaseline();
if (baseline != -1)
return baseline;
@@ -1348,7 +1348,7 @@
return -1;
}
-int RenderTable::firstLineBoxBaseline() const
+int RenderTable::firstLineBaseline() const
{
// The baseline of a 'table' is the same as the 'inline-table' baseline per CSS 3 Flexbox (CSS 2.1
// doesn't define the baseline of a 'table' only an 'inline-table').
@@ -1363,7 +1363,7 @@
if (!topNonEmptySection)
return -1;
- int baseline = topNonEmptySection->firstLineBoxBaseline();
+ int baseline = topNonEmptySection->firstLineBaseline();
if (baseline > 0)
return topNonEmptySection->logicalTop() + baseline;
diff --git a/Source/WebCore/rendering/RenderTable.h b/Source/WebCore/rendering/RenderTable.h
index d245106..62a87b3 100644
--- a/Source/WebCore/rendering/RenderTable.h
+++ b/Source/WebCore/rendering/RenderTable.h
@@ -284,7 +284,7 @@
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) OVERRIDE;
virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const OVERRIDE FINAL;
- virtual int firstLineBoxBaseline() const OVERRIDE;
+ virtual int firstLineBaseline() const OVERRIDE;
virtual int inlineBlockBaseline(LineDirectionMode) const OVERRIDE FINAL;
RenderTableCol* slowColElement(unsigned col, bool* startEdge, bool* endEdge) const;
diff --git a/Source/WebCore/rendering/RenderTableCell.cpp b/Source/WebCore/rendering/RenderTableCell.cpp
index aefba441..ccaa931 100644
--- a/Source/WebCore/rendering/RenderTableCell.cpp
+++ b/Source/WebCore/rendering/RenderTableCell.cpp
@@ -397,9 +397,9 @@
// <http://www.w3.org/TR/2007/CR-CSS21-20070719/tables.html#height-layout>: The baseline of a cell is the baseline of
// the first in-flow line box in the cell, or the first in-flow table-row in the cell, whichever comes first. If there
// is no such line box or table-row, the baseline is the bottom of content edge of the cell box.
- LayoutUnit firstLineBaseline = firstLineBoxBaseline();
- if (firstLineBaseline != -1)
- return firstLineBaseline;
+ LayoutUnit baseline = firstLineBaseline();
+ if (baseline != -1)
+ return baseline;
return borderAndPaddingBefore() + contentLogicalHeight();
}
diff --git a/Source/WebCore/rendering/RenderTableSection.cpp b/Source/WebCore/rendering/RenderTableSection.cpp
index f7f47f4..9a67fca 100644
--- a/Source/WebCore/rendering/RenderTableSection.cpp
+++ b/Source/WebCore/rendering/RenderTableSection.cpp
@@ -915,7 +915,7 @@
m_outerBorderEnd = calcOuterBorderEnd();
}
-int RenderTableSection::firstLineBoxBaseline() const
+int RenderTableSection::firstLineBaseline() const
{
if (!m_grid.size())
return -1;
diff --git a/Source/WebCore/rendering/RenderTableSection.h b/Source/WebCore/rendering/RenderTableSection.h
index 04e51c4..887a4a8 100644
--- a/Source/WebCore/rendering/RenderTableSection.h
+++ b/Source/WebCore/rendering/RenderTableSection.h
@@ -73,7 +73,7 @@
virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0) OVERRIDE;
- virtual int firstLineBoxBaseline() const OVERRIDE;
+ virtual int firstLineBaseline() const OVERRIDE;
void addCell(RenderTableCell*, RenderTableRow* row);
diff --git a/Source/WebCore/rendering/RenderTextControl.h b/Source/WebCore/rendering/RenderTextControl.h
index 7e231ab..6c07e0d 100644
--- a/Source/WebCore/rendering/RenderTextControl.h
+++ b/Source/WebCore/rendering/RenderTextControl.h
@@ -114,7 +114,7 @@
{
return RenderBlock::baselinePosition(baseline, firstLine, direction, position);
}
- virtual int firstLineBoxBaseline() const OVERRIDE { return RenderBlock::firstLineBoxBaseline(); }
+ virtual int firstLineBaseline() const OVERRIDE { return RenderBlock::firstLineBaseline(); }
virtual int inlineBlockBaseline(LineDirectionMode direction) const OVERRIDE { return RenderBlock::inlineBlockBaseline(direction); }
};
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp b/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
index cbcc555..6c58388 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
@@ -74,7 +74,7 @@
if (linePositionMode == PositionOfInteriorLineBoxes)
return 0;
- LayoutUnit baseline = firstLineBoxBaseline(); // FIXME: This may be unnecessary after flex baselines are implemented (https://bugs.webkit.org/show_bug.cgi?id=96188).
+ LayoutUnit baseline = firstLineBaseline(); // FIXME: This may be unnecessary after flex baselines are implemented (https://bugs.webkit.org/show_bug.cgi?id=96188).
if (baseline != -1)
return baseline;
@@ -301,9 +301,9 @@
return false;
}
-int RenderMathMLTable::firstLineBoxBaseline() const
+int RenderMathMLTable::firstLineBaseline() const
{
- // In legal MathML, we'll have a MathML parent. That RenderFlexibleBox parent will use our firstLineBoxBaseline() for baseline alignment, per
+ // In legal MathML, we'll have a MathML parent. That RenderFlexibleBox parent will use our firstLineBaseline() for baseline alignment, per
// http://dev.w3.org/csswg/css3-flexbox/#flex-baselines. We want to vertically center an <mtable>, such as a matrix. Essentially the whole <mtable> element fits on a
// single line, whose baseline gives this centering. This is different than RenderTable::firstLineBoxBaseline, which returns the baseline of the first row of a <table>.
return (logicalHeight() + style()->fontMetrics().xHeight()) / 2;
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLBlock.h b/Source/WebCore/rendering/mathml/RenderMathMLBlock.h
index 3be6d69..172793f 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLBlock.h
+++ b/Source/WebCore/rendering/mathml/RenderMathMLBlock.h
@@ -107,7 +107,7 @@
{
}
- virtual int firstLineBoxBaseline() const OVERRIDE;
+ virtual int firstLineBaseline() const OVERRIDE;
private:
virtual const char* renderName() const OVERRIDE { return "RenderMathMLTable"; }
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp b/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
index 764df05..d9c16d1 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
@@ -159,11 +159,11 @@
info.context->drawLine(adjustedPaintOffset, IntPoint(adjustedPaintOffset.x() + denominatorWrapper->pixelSnappedOffsetWidth(), adjustedPaintOffset.y()));
}
-int RenderMathMLFraction::firstLineBoxBaseline() const
+int RenderMathMLFraction::firstLineBaseline() const
{
if (RenderBox* denominatorWrapper = lastChildBox())
return denominatorWrapper->logicalTop() + static_cast<int>(lroundf((m_lineThickness + style()->fontMetrics().xHeight()) / 2));
- return RenderMathMLBlock::firstLineBoxBaseline();
+ return RenderMathMLBlock::firstLineBaseline();
}
}
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLFraction.h b/Source/WebCore/rendering/mathml/RenderMathMLFraction.h
index 5b42181..6d9821d 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLFraction.h
+++ b/Source/WebCore/rendering/mathml/RenderMathMLFraction.h
@@ -47,7 +47,7 @@
virtual void addChild(RenderObject* child, RenderObject* beforeChild) OVERRIDE;
virtual void updateFromElement() OVERRIDE;
- virtual int firstLineBoxBaseline() const OVERRIDE;
+ virtual int firstLineBaseline() const OVERRIDE;
virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE;
virtual RenderMathMLOperator* unembellishedOperator() OVERRIDE;
virtual void layout() OVERRIDE;
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp b/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
index ef373e4..ebc994c 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
@@ -265,11 +265,11 @@
m_isStretched = false;
}
-int RenderMathMLOperator::firstLineBoxBaseline() const
+int RenderMathMLOperator::firstLineBaseline() const
{
if (m_isStretched)
return expandedStretchHeight() * 2 / 3 - (expandedStretchHeight() - m_stretchHeight) / 2;
- return RenderMathMLBlock::firstLineBoxBaseline();
+ return RenderMathMLBlock::firstLineBaseline();
}
void RenderMathMLOperator::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLOperator.h b/Source/WebCore/rendering/mathml/RenderMathMLOperator.h
index a83032e..74886d7 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLOperator.h
+++ b/Source/WebCore/rendering/mathml/RenderMathMLOperator.h
@@ -70,7 +70,7 @@
virtual bool isChildAllowed(const RenderObject&, const RenderStyle&) const OVERRIDE;
virtual void computePreferredLogicalWidths() OVERRIDE;
virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues&) const OVERRIDE;
- virtual int firstLineBoxBaseline() const OVERRIDE;
+ virtual int firstLineBaseline() const OVERRIDE;
virtual RenderMathMLOperator* unembellishedOperator() OVERRIDE { return this; }
bool shouldAllowStretching(UChar& characterForStretching);
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp b/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp
index e11ed53..a2d3309 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp
@@ -279,7 +279,7 @@
// below the base's top edge, or the subscript's bottom edge above the base's bottom edge.
LayoutUnit baseHeight = base->logicalHeight();
- LayoutUnit baseBaseline = base->firstLineBoxBaseline();
+ LayoutUnit baseBaseline = base->firstLineBaseline();
if (baseBaseline == -1)
baseBaseline = baseHeight;
LayoutUnit axis = style()->fontMetrics().xHeight() / 2;
@@ -313,7 +313,7 @@
if (RenderBox* superscript = m_kind == Sub ? 0 : subSupPair->lastChildBox()) {
LayoutUnit superscriptHeight = superscript->logicalHeight();
- LayoutUnit superscriptBaseline = superscript->firstLineBoxBaseline();
+ LayoutUnit superscriptBaseline = superscript->firstLineBaseline();
if (superscriptBaseline == -1)
superscriptBaseline = superscriptHeight;
LayoutUnit minBaseline = max<LayoutUnit>(fontSize / 3 + 1 + superscriptBaseline, superscriptHeight + axis + superscriptShiftValue);
@@ -323,7 +323,7 @@
if (RenderBox* subscript = m_kind == Super ? 0 : subSupPair->firstChildBox()) {
LayoutUnit subscriptHeight = subscript->logicalHeight();
- LayoutUnit subscriptBaseline = subscript->firstLineBoxBaseline();
+ LayoutUnit subscriptBaseline = subscript->firstLineBaseline();
if (subscriptBaseline == -1)
subscriptBaseline = subscriptHeight;
LayoutUnit baseExtendUnderBaseline = baseHeight - baseBaseline;
@@ -355,14 +355,14 @@
RenderMathMLBlock::layout();
}
-int RenderMathMLScripts::firstLineBoxBaseline() const
+int RenderMathMLScripts::firstLineBaseline() const
{
if (m_baseWrapper) {
- LayoutUnit baseline = m_baseWrapper->firstLineBoxBaseline();
+ LayoutUnit baseline = m_baseWrapper->firstLineBaseline();
if (baseline != -1)
return baseline;
}
- return RenderMathMLBlock::firstLineBoxBaseline();
+ return RenderMathMLBlock::firstLineBaseline();
}
RenderMathMLScriptsWrapper* RenderMathMLScriptsWrapper::createAnonymousWrapper(RenderMathMLScripts* renderObject, WrapperType type)
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLScripts.h b/Source/WebCore/rendering/mathml/RenderMathMLScripts.h
index 0101361..af3cc5d 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLScripts.h
+++ b/Source/WebCore/rendering/mathml/RenderMathMLScripts.h
@@ -102,7 +102,7 @@
virtual void removeChild(RenderObject&) OVERRIDE;
virtual RenderMathMLOperator* unembellishedOperator();
- virtual int firstLineBoxBaseline() const OVERRIDE;
+ virtual int firstLineBaseline() const OVERRIDE;
protected:
virtual void layout();
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp b/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp
index 1996889..65a2a3b 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp
@@ -91,7 +91,7 @@
updateFromElement();
}
-int RenderMathMLSpace::firstLineBoxBaseline() const
+int RenderMathMLSpace::firstLineBaseline() const
{
return m_height;
}
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLSpace.h b/Source/WebCore/rendering/mathml/RenderMathMLSpace.h
index e2c0a81..d40f961 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLSpace.h
+++ b/Source/WebCore/rendering/mathml/RenderMathMLSpace.h
@@ -45,7 +45,7 @@
virtual bool isChildAllowed(const RenderObject&, const RenderStyle&) const OVERRIDE { return false; }
virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const OVERRIDE;
virtual void updateFromElement() OVERRIDE;
- virtual int firstLineBoxBaseline() const OVERRIDE;
+ virtual int firstLineBaseline() const OVERRIDE;
virtual void updateLogicalWidth() OVERRIDE;
virtual void updateLogicalHeight() OVERRIDE;
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp b/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp
index 17a929b..48c8c2d 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp
@@ -57,12 +57,12 @@
return toRenderMathMLBlock(base)->unembellishedOperator();
}
-int RenderMathMLUnderOver::firstLineBoxBaseline() const
+int RenderMathMLUnderOver::firstLineBaseline() const
{
RenderBox* base = firstChildBox();
if (!base)
return -1;
- LayoutUnit baseline = base->firstLineBoxBaseline();
+ LayoutUnit baseline = base->firstLineBaseline();
if (baseline != -1)
baseline += base->logicalTop();
return baseline;
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.h b/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.h
index 3e2d5b0..66f61d4 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.h
+++ b/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.h
@@ -38,7 +38,7 @@
virtual RenderMathMLOperator* unembellishedOperator();
- virtual int firstLineBoxBaseline() const OVERRIDE;
+ virtual int firstLineBaseline() const OVERRIDE;
private:
virtual bool isRenderMathMLUnderOver() const { return true; }