Commit d9b9bdfc authored by zalan@apple.com's avatar zalan@apple.com
Browse files

MathML: ASSERTION FAILED: !isPreferredLogicalHeightDirty() in...

MathML: ASSERTION FAILED: !isPreferredLogicalHeightDirty() in RenderMathMLBlock::preferredLogicalHeight() const
https://bugs.webkit.org/show_bug.cgi?id=120157

Reviewed by Antti Koivisto.

RenderListMarker needs to be inserted to the render tree before
we start computing the preferred logical widths for the associated
RenderListItem.

Source/WebCore:

Test: mathml/mn-as-list-item-assert.html

* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
(WebCore::RenderListItem::layout):
(WebCore::RenderListItem::computePreferredLogicalWidths):
* rendering/RenderListItem.h:

LayoutTests:

* mathml/mn-as-list-item-assert-expected.txt: Added.
* mathml/mn-as-list-item-assert.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154475 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9a7ad7a4
2013-08-23 Zalan Bujtas <zalan@apple.com>
MathML: ASSERTION FAILED: !isPreferredLogicalHeightDirty() in RenderMathMLBlock::preferredLogicalHeight() const
https://bugs.webkit.org/show_bug.cgi?id=120157
Reviewed by Antti Koivisto.
RenderListMarker needs to be inserted to the render tree before
we start computing the preferred logical widths for the associated
RenderListItem.
* mathml/mn-as-list-item-assert-expected.txt: Added.
* mathml/mn-as-list-item-assert.html: Added.
2013-08-22 Simon Fraser <simon.fraser@apple.com>
 
compositing/geometry/bounds-ignores-hidden-dynamic.html has incorrect initial rendering
This test PASSES if it does not CRASH or ASSERT.
<!doctype html>
<html>
<head>
<script>
if (window.testRunner)
testRunner.dumpAsText();
</script>
</head>
<body>
<math>
<munderover>
<mn style="display: list-item;">This test PASSES if it does not CRASH or ASSERT.</mn>
</munderover>
</math>
2013-08-23 Zalan Bujtas <zalan@apple.com>
MathML: ASSERTION FAILED: !isPreferredLogicalHeightDirty() in RenderMathMLBlock::preferredLogicalHeight() const
https://bugs.webkit.org/show_bug.cgi?id=120157
Reviewed by Antti Koivisto.
RenderListMarker needs to be inserted to the render tree before
we start computing the preferred logical widths for the associated
RenderListItem.
Test: mathml/mn-as-list-item-assert.html
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
(WebCore::RenderListItem::layout):
(WebCore::RenderListItem::computePreferredLogicalWidths):
* rendering/RenderListItem.h:
2013-08-22 Gyuyoung Kim <gyuyoung.kim@samsung.com>
 
Introduce toSVGLinearGradientElement(), and use it
......@@ -268,38 +268,36 @@ static RenderObject* firstNonMarkerChild(RenderObject* parent)
return result;
}
void RenderListItem::updateMarkerLocation()
void RenderListItem::insertOrMoveMarkerRendererIfNeeded()
{
// Sanity check the location of our marker.
if (m_marker) {
RenderObject* markerPar = m_marker->parent();
RenderObject* lineBoxParent = getParentOfFirstLineBox(this, m_marker);
if (!lineBoxParent) {
// If the marker is currently contained inside an anonymous box,
// then we are the only item in that anonymous box (since no line box
// parent was found). It's ok to just leave the marker where it is
// in this case.
if (markerPar && markerPar->isAnonymousBlock())
lineBoxParent = markerPar;
else
lineBoxParent = this;
}
if (!m_marker)
return;
if (markerPar != lineBoxParent || m_marker->preferredLogicalWidthsDirty()) {
// Removing and adding the marker can trigger repainting in
// containers other than ourselves, so we need to disable LayoutState.
LayoutStateDisabler layoutStateDisabler(view());
updateFirstLetter();
m_marker->remove();
if (!lineBoxParent)
lineBoxParent = this;
lineBoxParent->addChild(m_marker, firstNonMarkerChild(lineBoxParent));
m_marker->updateMarginsAndContent();
// If markerPar is an anonymous block that has lost all its children, destroy it.
if (markerPar && markerPar->isAnonymousBlock() && !markerPar->firstChild() && !toRenderBlock(markerPar)->continuation())
markerPar->destroy();
}
RenderObject* currentParent = m_marker->parent();
RenderObject* newParent = getParentOfFirstLineBox(this, m_marker);
if (!newParent) {
// If the marker is currently contained inside an anonymous box,
// then we are the only item in that anonymous box (since no line box
// parent was found). It's ok to just leave the marker where it is
// in this case.
if (currentParent && currentParent->isAnonymousBlock())
return;
newParent = this;
}
if (newParent != currentParent) {
// Removing and adding the marker can trigger repainting in
// containers other than ourselves, so we need to disable LayoutState.
LayoutStateDisabler layoutStateDisabler(view());
m_marker->remove();
newParent->addChild(m_marker, firstNonMarkerChild(newParent));
m_marker->updateMarginsAndContent();
// If current parent is an anonymous block that has lost all its children, destroy it.
if (currentParent && currentParent->isAnonymousBlock() && !currentParent->firstChild() && !toRenderBlock(currentParent)->continuation())
currentParent->destroy();
}
}
void RenderListItem::layout()
......@@ -307,7 +305,7 @@ void RenderListItem::layout()
StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());
updateMarkerLocation();
insertOrMoveMarkerRendererIfNeeded();
RenderBlock::layout();
}
......@@ -317,6 +315,19 @@ void RenderListItem::addOverflowFromChildren()
positionListMarker();
}
void RenderListItem::computePreferredLogicalWidths()
{
#ifndef NDEBUG
// FIXME: We shouldn't be modifying the tree in computePreferredLogicalWidths.
// Instead, we should insert the marker soon after the tree construction.
// This is similar case to RenderCounter::computePreferredLogicalWidths()
// See https://bugs.webkit.org/show_bug.cgi?id=104829
SetLayoutNeededForbiddenScope layoutForbiddenScope(this, false);
#endif
insertOrMoveMarkerRendererIfNeeded();
RenderBlock::computePreferredLogicalWidths();
}
void RenderListItem::positionListMarker()
{
if (m_marker && m_marker->parent()->isBox() && !m_marker->isInside() && m_marker->inlineBoxWrapper()) {
......
......@@ -75,8 +75,9 @@ private:
virtual bool requiresForcedStyleRecalcPropagation() const { return true; }
virtual void addOverflowFromChildren();
virtual void computePreferredLogicalWidths() OVERRIDE;
void updateMarkerLocation();
void insertOrMoveMarkerRendererIfNeeded();
inline int calcValue() const;
void updateValueNow() const;
void explicitValueChanged();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment