summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/rendering/RenderBlock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering/RenderBlock.cpp')
-rw-r--r--Source/WebCore/rendering/RenderBlock.cpp28
1 files changed, 9 insertions, 19 deletions
diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp
index e0fe6a0..794bafc 100644
--- a/Source/WebCore/rendering/RenderBlock.cpp
+++ b/Source/WebCore/rendering/RenderBlock.cpp
@@ -35,6 +35,7 @@
#include "HTMLNames.h"
#include "HitTestResult.h"
#include "InlineTextBox.h"
+#include "PaintInfo.h"
#include "RenderFlexibleBox.h"
#include "RenderImage.h"
#include "RenderInline.h"
@@ -116,6 +117,7 @@ RenderBlock::RenderBlock(Node* node)
, m_positionedObjects(0)
, m_rareData(0)
, m_lineHeight(-1)
+ , m_beingDestroyed(false)
{
setChildrenInline(true);
}
@@ -150,6 +152,9 @@ RenderBlock::~RenderBlock()
void RenderBlock::destroy()
{
+ // Mark as being destroyed to avoid trouble with merges in removeChild().
+ m_beingDestroyed = true;
+
// Make sure to destroy anonymous children first while they are still connected to the rest of the tree, so that they will
// properly dirty line boxes that they are removed from. Effects that do :before/:after only on hover could crash otherwise.
children()->destroyLeftoverChildren();
@@ -192,7 +197,7 @@ void RenderBlock::destroy()
void RenderBlock::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
{
- setReplaced(newStyle->isDisplayReplacedType());
+ setReplaced(newStyle->isDisplayInlineType());
if (style() && parent() && diff == StyleDifferenceLayout && style()->position() != newStyle->position()) {
if (newStyle->position() == StaticPosition)
@@ -930,8 +935,8 @@ static bool canMergeContiguousAnonymousBlocks(RenderObject* oldChild, RenderObje
if (oldChild->documentBeingDestroyed() || oldChild->isInline() || oldChild->virtualContinuation())
return false;
- if ((prev && (!prev->isAnonymousBlock() || toRenderBlock(prev)->continuation()))
- || (next && (!next->isAnonymousBlock() || toRenderBlock(next)->continuation())))
+ if ((prev && (!prev->isAnonymousBlock() || toRenderBlock(prev)->continuation() || toRenderBlock(prev)->beingDestroyed()))
+ || (next && (!next->isAnonymousBlock() || toRenderBlock(next)->continuation() || toRenderBlock(next)->beingDestroyed())))
return false;
// FIXME: This check isn't required when inline run-ins can't be split into continuations.
@@ -991,27 +996,12 @@ void RenderBlock::removeChild(RenderObject* oldChild)
} else {
// Take all the children out of the |next| block and put them in
// the |prev| block.
- nextBlock->moveAllChildrenTo(prevBlock, nextBlock->hasLayer() || prevBlock->hasLayer());
-
- // FIXME: When we destroy nextBlock, it might happen that nextBlock's next sibling block and
- // oldChild can get merged. Since oldChild is getting removed, we do not want to move
- // nextBlock's next sibling block's children into it. By setting a fake continuation,
- // we prevent this from happening. This is not the best approach, we should replace this
- // something better later to automatically detect that oldChild is getting removed.
- RenderBlock* oldChildBlock = 0;
- if (oldChild->isAnonymous() && oldChild->isRenderBlock() && !toRenderBlock(oldChild)->continuation()) {
- oldChildBlock = toRenderBlock(oldChild);
- oldChildBlock->setContinuation(oldChildBlock);
- }
+ nextBlock->moveAllChildrenTo(prevBlock, nextBlock->hasLayer() || prevBlock->hasLayer());
// Delete the now-empty block's lines and nuke it.
nextBlock->deleteLineBoxTree();
nextBlock->destroy();
next = 0;
-
- // FIXME: Revert the continuation change done above.
- if (oldChildBlock)
- oldChildBlock->setContinuation(0);
}
}