summaryrefslogtreecommitdiffstats
path: root/WebCore/mathml
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/mathml')
-rw-r--r--WebCore/mathml/RenderMathMLFraction.cpp2
-rw-r--r--WebCore/mathml/RenderMathMLUnderOver.cpp24
2 files changed, 13 insertions, 13 deletions
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<int>((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<int>((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<int>((zoomFactor > 1.25 ? 2 : 3) * zoomFactor);
return baseline;
}