Upstream version 11.39.250.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / rendering / RenderBlock.cpp
index 711b4af..f52b31e 100644 (file)
@@ -376,20 +376,13 @@ void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldSty
         ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->addRenderObject(this);
 }
 
-void RenderBlock::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvalidationState)
+void RenderBlock::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationState& childPaintInvalidationState)
 {
-    // Note, we don't want to early out here using shouldCheckForInvalidationAfterLayout as
-    // we have to make sure we go through any positioned objects as they won't be seen in
-    // the normal tree walk.
-
-    RenderBox::invalidateTreeIfNeeded(paintInvalidationState);
+    RenderBox::invalidatePaintOfSubtreesIfNeeded(childPaintInvalidationState);
 
     // Take care of positioned objects. This is required as PaintInvalidationState keeps a single clip rect.
     if (TrackedRendererListHashSet* positionedObjects = this->positionedObjects()) {
         TrackedRendererListHashSet::iterator end = positionedObjects->end();
-        bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer();
-        const RenderLayerModelObject& newPaintInvalidationContainer = *adjustCompositedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this : &paintInvalidationState.paintInvalidationContainer());
-        PaintInvalidationState childPaintInvalidationState(paintInvalidationState, *this, newPaintInvalidationContainer);
         for (TrackedRendererListHashSet::iterator it = positionedObjects->begin(); it != end; ++it) {
             RenderBox* box = *it;
 
@@ -400,7 +393,7 @@ void RenderBlock::invalidateTreeIfNeeded(const PaintInvalidationState& paintInva
             // If it's a new paint invalidation container, we won't have properly accumulated the offset into the
             // PaintInvalidationState.
             // FIXME: Teach PaintInvalidationState to handle this case. crbug.com/371485
-            if (&paintInvalidationContainerForChild != newPaintInvalidationContainer) {
+            if (paintInvalidationContainerForChild != childPaintInvalidationState.paintInvalidationContainer()) {
                 ForceHorriblySlowRectMapping slowRectMapping(&childPaintInvalidationState);
                 PaintInvalidationState disabledPaintInvalidationState(childPaintInvalidationState, *this, paintInvalidationContainerForChild);
                 box->invalidateTreeIfNeeded(disabledPaintInvalidationState);
@@ -1123,7 +1116,16 @@ void RenderBlock::collapseAnonymousBlockChild(RenderBlock* parent, RenderBlock*
     CurrentRenderFlowThreadMaintainer flowThreadMaintainer(childFlowThread);
 
     parent->children()->removeChildNode(parent, child, child->hasLayer());
+    // FIXME: Get rid of the temporary disabling of continuations. This is needed by the old
+    // multicol implementation, because of buggy block continuation handling (which is hard and
+    // rather pointless to fix at this point). Support for block continuations can be removed
+    // together with the old multicol implementation. crbug.com/408123
+    RenderBoxModelObject* temporarilyInactiveContinuation = parent->continuation();
+    if (temporarilyInactiveContinuation)
+        parent->setContinuation(0);
     child->moveAllChildrenTo(parent, nextSibling, child->hasLayer());
+    if (temporarilyInactiveContinuation)
+        parent->setContinuation(temporarilyInactiveContinuation);
     // Explicitly delete the child's line box tree, or the special anonymous
     // block handling in willBeDestroyed will cause problems.
     child->deleteLineBoxTree();