summaryrefslogtreecommitdiffstats
path: root/WebCore/mathml/RenderMathMLRoot.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/mathml/RenderMathMLRoot.cpp')
-rw-r--r--WebCore/mathml/RenderMathMLRoot.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/WebCore/mathml/RenderMathMLRoot.cpp b/WebCore/mathml/RenderMathMLRoot.cpp
index 4ed8c19..da303c9 100644
--- a/WebCore/mathml/RenderMathMLRoot.cpp
+++ b/WebCore/mathml/RenderMathMLRoot.cpp
@@ -99,7 +99,10 @@ void RenderMathMLRoot::paint(PaintInfo& info, int tx, int ty)
if (info.context->paintingDisabled())
return;
-
+
+ if (!firstChild() || !lastChild())
+ return;
+
tx += x();
ty += y();
@@ -203,11 +206,15 @@ void RenderMathMLRoot::paint(PaintInfo& info, int tx, int ty)
void RenderMathMLRoot::layout()
{
RenderBlock::layout();
-
+
+ if (!firstChild() || !lastChild())
+ return;
+
int maxHeight = toRenderBoxModelObject(lastChild())->offsetHeight();
RenderObject* current = lastChild()->firstChild();
- current->style()->setVerticalAlign(BASELINE);
+ if (current)
+ current->style()->setVerticalAlign(BASELINE);
if (!maxHeight)
maxHeight = style()->fontSize();
@@ -228,6 +235,8 @@ void RenderMathMLRoot::layout()
// Positioning of the index
RenderBoxModelObject* indexBox = toRenderBoxModelObject(firstChild()->firstChild());
+ if (!indexBox)
+ return;
int indexShift = indexBox->offsetWidth() + topStartShift;
int radicalHeight = static_cast<int>((1 - gRadicalTopLeftPointYPos) * maxHeight);