From 6b70adc33054f8aee8c54d0f460458a9df11b8a5 Mon Sep 17 00:00:00 2001 From: Russell Brenner Date: Thu, 18 Nov 2010 17:33:13 -0800 Subject: Merge WebKit at r72274: Initial merge by git. Change-Id: Ie51f0b4a16da82942bd516dce59cfb79ebbe25fb --- WebCore/mathml/RenderMathMLFraction.cpp | 4 ++-- WebCore/mathml/RenderMathMLFraction.h | 2 +- WebCore/mathml/RenderMathMLOperator.cpp | 4 ++-- WebCore/mathml/RenderMathMLOperator.h | 2 +- WebCore/mathml/RenderMathMLRow.cpp | 6 +++--- WebCore/mathml/RenderMathMLRow.h | 2 +- WebCore/mathml/RenderMathMLSubSup.cpp | 6 +++--- WebCore/mathml/RenderMathMLSubSup.h | 2 +- WebCore/mathml/RenderMathMLUnderOver.cpp | 16 ++++++++-------- WebCore/mathml/RenderMathMLUnderOver.h | 2 +- 10 files changed, 23 insertions(+), 23 deletions(-) (limited to 'WebCore/mathml') diff --git a/WebCore/mathml/RenderMathMLFraction.cpp b/WebCore/mathml/RenderMathMLFraction.cpp index 1000604..1435be7 100644 --- a/WebCore/mathml/RenderMathMLFraction.cpp +++ b/WebCore/mathml/RenderMathMLFraction.cpp @@ -167,7 +167,7 @@ void RenderMathMLFraction::paint(PaintInfo& info, int tx, int ty) info.context->restore(); } -int RenderMathMLFraction::baselinePosition(bool firstLine, LineDirectionMode lineDirection, LinePositionMode linePositionMode) const +int RenderMathMLFraction::baselinePosition(FontBaseline, bool firstLine, LineDirectionMode lineDirection, LinePositionMode linePositionMode) const { if (firstChild() && firstChild()->isRenderMathMLBlock()) { RenderMathMLBlock* numerator = toRenderMathMLBlock(firstChild()); @@ -177,7 +177,7 @@ int RenderMathMLFraction::baselinePosition(bool firstLine, LineDirectionMode lin // a good guess. return numerator->offsetHeight() + style()->fontSize() / 3; } - return RenderBlock::baselinePosition(firstLine, lineDirection, linePositionMode); + return RenderBlock::baselinePosition(AlphabeticBaseline, firstLine, lineDirection, linePositionMode); } } diff --git a/WebCore/mathml/RenderMathMLFraction.h b/WebCore/mathml/RenderMathMLFraction.h index d0f3fe0..8a3a9ed 100644 --- a/WebCore/mathml/RenderMathMLFraction.h +++ b/WebCore/mathml/RenderMathMLFraction.h @@ -38,7 +38,7 @@ public: RenderMathMLFraction(Element* fraction); virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0); virtual void updateFromElement(); - virtual int baselinePosition(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const; + virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const; virtual void paint(PaintInfo&, int tx, int ty); protected: virtual void layout(); diff --git a/WebCore/mathml/RenderMathMLOperator.cpp b/WebCore/mathml/RenderMathMLOperator.cpp index 9f35480..72c997b 100644 --- a/WebCore/mathml/RenderMathMLOperator.cpp +++ b/WebCore/mathml/RenderMathMLOperator.cpp @@ -332,11 +332,11 @@ RenderBlock* RenderMathMLOperator::createGlyph(UChar glyph, int size, int charRe return container; } -int RenderMathMLOperator::baselinePosition(bool firstLine, LineDirectionMode lineDirection, LinePositionMode linePositionMode) const +int RenderMathMLOperator::baselinePosition(FontBaseline, bool firstLine, LineDirectionMode lineDirection, LinePositionMode linePositionMode) const { if (m_isStacked) return m_stretchHeight * 2 / 3 - (m_stretchHeight - static_cast(m_stretchHeight / gOperatorExpansion)) / 2; - return RenderBlock::baselinePosition(firstLine, lineDirection, linePositionMode); + return RenderBlock::baselinePosition(AlphabeticBaseline, firstLine, lineDirection, linePositionMode); } } diff --git a/WebCore/mathml/RenderMathMLOperator.h b/WebCore/mathml/RenderMathMLOperator.h index 7091b34..6501494 100644 --- a/WebCore/mathml/RenderMathMLOperator.h +++ b/WebCore/mathml/RenderMathMLOperator.h @@ -41,7 +41,7 @@ public: virtual void stretchToHeight(int pixelHeight); virtual void updateFromElement(); virtual bool isChildAllowed(RenderObject*, RenderStyle*) const; - virtual int baselinePosition(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const; + virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const; protected: virtual void layout(); diff --git a/WebCore/mathml/RenderMathMLRow.cpp b/WebCore/mathml/RenderMathMLRow.cpp index ae911fc..ad54846 100644 --- a/WebCore/mathml/RenderMathMLRow.cpp +++ b/WebCore/mathml/RenderMathMLRow.cpp @@ -119,15 +119,15 @@ void RenderMathMLRow::layout() } -int RenderMathMLRow::baselinePosition(bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const +int RenderMathMLRow::baselinePosition(FontBaseline, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const { if (firstChild() && firstChild()->isRenderMathMLBlock()) { RenderMathMLBlock* block = toRenderMathMLBlock(firstChild()); if (block->isRenderMathMLOperator()) - return block->y() + block->baselinePosition(firstLine, direction, linePositionMode); + return block->y() + block->baselinePosition(AlphabeticBaseline, firstLine, direction, linePositionMode); } - return RenderBlock::baselinePosition(firstLine, direction, linePositionMode); + return RenderBlock::baselinePosition(AlphabeticBaseline, firstLine, direction, linePositionMode); } } diff --git a/WebCore/mathml/RenderMathMLRow.h b/WebCore/mathml/RenderMathMLRow.h index c877561..62a0d09 100644 --- a/WebCore/mathml/RenderMathMLRow.h +++ b/WebCore/mathml/RenderMathMLRow.h @@ -37,7 +37,7 @@ public: RenderMathMLRow(Node* container); virtual bool isRenderMathMLRow() const { return true; } virtual int nonOperatorHeight() const; - virtual int baselinePosition(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const; + virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const; virtual void stretchToHeight(int) {} protected: virtual void layout(); diff --git a/WebCore/mathml/RenderMathMLSubSup.cpp b/WebCore/mathml/RenderMathMLSubSup.cpp index 6c9c6b9..f4ed506 100644 --- a/WebCore/mathml/RenderMathMLSubSup.cpp +++ b/WebCore/mathml/RenderMathMLSubSup.cpp @@ -173,7 +173,7 @@ void RenderMathMLSubSup::layout() } } -int RenderMathMLSubSup::baselinePosition(bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const +int RenderMathMLSubSup::baselinePosition(FontBaseline, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const { RenderObject* base = firstChild(); if (!base) @@ -194,13 +194,13 @@ int RenderMathMLSubSup::baselinePosition(bool firstLine, LineDirectionMode direc // FIXME: The last bit of this calculation should be more exact. Why is the 2-3px scaled for zoom necessary? // The baseline is top spacing of the base + the baseline of the base + adjusted space for zoom float zoomFactor = style()->effectiveZoom(); - return topAdjust + box->baselinePosition(firstLine, direction, linePositionMode) + static_cast((zoomFactor > 1.25 ? 2 : 3) * zoomFactor); + return topAdjust + box->baselinePosition(AlphabeticBaseline, firstLine, direction, linePositionMode) + static_cast((zoomFactor > 1.25 ? 2 : 3) * zoomFactor); } break; case Sup: case Sub: RenderBoxModelObject* box = toRenderBoxModelObject(base); - baseline = box->baselinePosition(firstLine, direction, linePositionMode); + baseline = box->baselinePosition(AlphabeticBaseline, firstLine, direction, linePositionMode); break; } diff --git a/WebCore/mathml/RenderMathMLSubSup.h b/WebCore/mathml/RenderMathMLSubSup.h index 3e62eb0..7a9d310 100644 --- a/WebCore/mathml/RenderMathMLSubSup.h +++ b/WebCore/mathml/RenderMathMLSubSup.h @@ -41,7 +41,7 @@ public: virtual bool hasBase() const { return true; } virtual int nonOperatorHeight() const; virtual void stretchToHeight(int pixelHeight); - virtual int baselinePosition(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const; + virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const; protected: virtual void layout(); diff --git a/WebCore/mathml/RenderMathMLUnderOver.cpp b/WebCore/mathml/RenderMathMLUnderOver.cpp index a76f6b1..a3de697 100644 --- a/WebCore/mathml/RenderMathMLUnderOver.cpp +++ b/WebCore/mathml/RenderMathMLUnderOver.cpp @@ -158,7 +158,7 @@ void RenderMathMLUnderOver::layout() if (!over->firstChild()->isBoxModelObject()) break; - int overSpacing = static_cast(gOverSpacingAdjustment * (getOffsetHeight(over) - toRenderBoxModelObject(over->firstChild())->baselinePosition(true, HorizontalLine))); + int overSpacing = static_cast(gOverSpacingAdjustment * (getOffsetHeight(over) - toRenderBoxModelObject(over->firstChild())->baselinePosition(AlphabeticBaseline, true, HorizontalLine))); // base row wrapper base = over->nextSibling(); @@ -188,7 +188,7 @@ void RenderMathMLUnderOver::layout() // FIXME: We need to look at the space between a single maximum height of // the line boxes and the baseline and squeeze them together - int underSpacing = baseHeight - toRenderBoxModelObject(base)->baselinePosition(true, HorizontalLine); + int underSpacing = baseHeight - toRenderBoxModelObject(base)->baselinePosition(AlphabeticBaseline, true, HorizontalLine); // adjust the base's intrusion into the under RenderObject* under = lastChild(); @@ -209,7 +209,7 @@ void RenderMathMLUnderOver::layout() // FIXME: bases that ascend higher than the line box intrude into the over if (!over->firstChild()->isBoxModelObject()) break; - int overSpacing = static_cast(gOverSpacingAdjustment * (getOffsetHeight(over) - toRenderBoxModelObject(over->firstChild())->baselinePosition(true, HorizontalLine))); + int overSpacing = static_cast(gOverSpacingAdjustment * (getOffsetHeight(over) - toRenderBoxModelObject(over->firstChild())->baselinePosition(AlphabeticBaseline, true, HorizontalLine))); // base row wrapper base = over->nextSibling(); @@ -229,7 +229,7 @@ void RenderMathMLUnderOver::layout() // FIXME: We need to look at the space between a single maximum height of // the line boxes and the baseline and squeeze them together - int underSpacing = baseHeight - toRenderBoxModelObject(base)->baselinePosition(true, HorizontalLine); + int underSpacing = baseHeight - toRenderBoxModelObject(base)->baselinePosition(AlphabeticBaseline, true, HorizontalLine); RenderObject* under = lastChild(); if (under && under->firstChild()->isRenderInline() && underSpacing > 0) @@ -243,11 +243,11 @@ void RenderMathMLUnderOver::layout() RenderBlock::layout(); } -int RenderMathMLUnderOver::baselinePosition(bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const +int RenderMathMLUnderOver::baselinePosition(FontBaseline, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const { RenderObject* current = firstChild(); if (!current) - return RenderBlock::baselinePosition(firstLine, direction, linePositionMode); + return RenderBlock::baselinePosition(AlphabeticBaseline, firstLine, direction, linePositionMode); int baseline = 0; switch (m_kind) { @@ -260,7 +260,7 @@ int RenderMathMLUnderOver::baselinePosition(bool firstLine, LineDirectionMode di RenderObject* base = current->firstChild(); if (!base || !base->isBoxModelObject()) break; - baseline += toRenderBoxModelObject(base)->baselinePosition(firstLine, HorizontalLine, linePositionMode); + baseline += toRenderBoxModelObject(base)->baselinePosition(AlphabeticBaseline, firstLine, HorizontalLine, linePositionMode); // added the negative top margin baseline += current->style()->marginTop().value(); } @@ -268,7 +268,7 @@ int RenderMathMLUnderOver::baselinePosition(bool firstLine, LineDirectionMode di case Under: RenderObject* base = current->firstChild(); if (base && base->isBoxModelObject()) - baseline += toRenderBoxModelObject(base)->baselinePosition(true, HorizontalLine); + baseline += toRenderBoxModelObject(base)->baselinePosition(AlphabeticBaseline, true, HorizontalLine); } // FIXME: Where is the extra 2-3px adjusted for zoom coming from? diff --git a/WebCore/mathml/RenderMathMLUnderOver.h b/WebCore/mathml/RenderMathMLUnderOver.h index 88edea8..fbab72a 100644 --- a/WebCore/mathml/RenderMathMLUnderOver.h +++ b/WebCore/mathml/RenderMathMLUnderOver.h @@ -40,7 +40,7 @@ public: virtual void layout(); virtual bool hasBase() const { return true; } virtual int nonOperatorHeight() const; - virtual int baselinePosition(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const; + virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const; virtual void stretchToHeight(int pixelHeight); private: enum UnderOverType { Under, Over, UnderOver }; -- cgit v1.1