From e8b154fd68f9b33be40a3590e58347f353835f5c Mon Sep 17 00:00:00 2001 From: Steve Block Date: Fri, 27 Aug 2010 11:02:25 +0100 Subject: Merge WebKit at r66079 : Initial merge by git Change-Id: Ie2e1440fb9d487d24e52c247342c076fecaecac7 --- WebCore/mathml/RenderMathMLFraction.cpp | 2 +- WebCore/mathml/RenderMathMLUnderOver.cpp | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'WebCore/mathml') diff --git a/WebCore/mathml/RenderMathMLFraction.cpp b/WebCore/mathml/RenderMathMLFraction.cpp index 72f7298..914f6fe 100644 --- a/WebCore/mathml/RenderMathMLFraction.cpp +++ b/WebCore/mathml/RenderMathMLFraction.cpp @@ -176,7 +176,7 @@ void RenderMathMLFraction::paint(PaintInfo& info, int tx, int ty) int RenderMathMLFraction::baselinePosition(bool firstLine, bool isRootLineBox) const { - if (firstChild()->isRenderMathMLBlock()) { + if (firstChild() && firstChild()->isRenderMathMLBlock()) { RenderMathMLBlock* numerator = toRenderMathMLBlock(firstChild()); // FIXME: the baseline should adjust so the fraction line aligns // relative certain operators (e.g. aligns with the horizontal diff --git a/WebCore/mathml/RenderMathMLUnderOver.cpp b/WebCore/mathml/RenderMathMLUnderOver.cpp index ad32d59..f015054 100644 --- a/WebCore/mathml/RenderMathMLUnderOver.cpp +++ b/WebCore/mathml/RenderMathMLUnderOver.cpp @@ -236,35 +236,35 @@ void RenderMathMLUnderOver::layout() int RenderMathMLUnderOver::baselinePosition(bool firstLine, bool isRootLineBox) const { + RenderObject* current = firstChild(); + if (!current) + return RenderBlock::baselinePosition(firstLine, isRootLineBox); + int baseline = 0; - RenderObject* current = 0; switch (m_kind) { case UnderOver: case Over: - current = firstChild(); baseline += getOffsetHeight(current); current = current->nextSibling(); if (current) { // actual base RenderObject* base = current->firstChild(); + if (!base) + break; baseline += base->baselinePosition(firstLine, isRootLineBox); // added the negative top margin baseline += current->style()->marginTop().value(); - // FIXME: Where is the extra 2-3px adjusted for zoom coming from? - float zoomFactor = style()->effectiveZoom(); - baseline += static_cast((zoomFactor > 1.25 ? 2 : 3) * zoomFactor); } break; case Under: - current = firstChild(); - if (current) { - RenderObject* base = current->firstChild(); + RenderObject* base = current->firstChild(); + if (base) baseline += base->baselinePosition(true); - // FIXME: Where is the extra 2-3px adjusted for zoom coming from? - float zoomFactor = style()->effectiveZoom(); - baseline += static_cast((zoomFactor > 1.25 ? 2 : 3) * zoomFactor); - } } + + // FIXME: Where is the extra 2-3px adjusted for zoom coming from? + float zoomFactor = style()->effectiveZoom(); + baseline += static_cast((zoomFactor > 1.25 ? 2 : 3) * zoomFactor); return baseline; } -- cgit v1.1