summaryrefslogtreecommitdiffstats
path: root/WebCore/mathml
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-09-08 12:18:00 +0100
committerKristian Monsen <kristianm@google.com>2010-09-11 12:08:58 +0100
commit5ddde30071f639962dd557c453f2ad01f8f0fd00 (patch)
tree775803c4ab35af50aa5f5472cd1fb95fe9d5152d /WebCore/mathml
parent3e63d9b33b753ca86d0765d1b3d711114ba9e34f (diff)
downloadexternal_webkit-5ddde30071f639962dd557c453f2ad01f8f0fd00.zip
external_webkit-5ddde30071f639962dd557c453f2ad01f8f0fd00.tar.gz
external_webkit-5ddde30071f639962dd557c453f2ad01f8f0fd00.tar.bz2
Merge WebKit at r66666 : Initial merge by git.
Change-Id: I57dedeb49859adc9c539e760f0e749768c66626f
Diffstat (limited to 'WebCore/mathml')
-rw-r--r--WebCore/mathml/RenderMathMLRoot.cpp15
-rw-r--r--WebCore/mathml/RenderMathMLSubSup.cpp2
2 files changed, 13 insertions, 4 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);
diff --git a/WebCore/mathml/RenderMathMLSubSup.cpp b/WebCore/mathml/RenderMathMLSubSup.cpp
index 52ac0e3..4cda36f 100644
--- a/WebCore/mathml/RenderMathMLSubSup.cpp
+++ b/WebCore/mathml/RenderMathMLSubSup.cpp
@@ -162,7 +162,7 @@ void RenderMathMLSubSup::layout()
maxHeight = height;
current = current->nextSibling();
}
- int heightDiff = (m_scripts->offsetHeight() - maxHeight) / 2;
+ int heightDiff = m_scripts ? (m_scripts->offsetHeight() - maxHeight) / 2 : 0;
if (heightDiff < 0)
heightDiff = 0;
base->style()->setMarginTop(Length(heightDiff, Fixed));