Title: [186611] branches/safari-600.8-branch

Diff

Modified: branches/safari-600.8-branch/LayoutTests/ChangeLog (186610 => 186611)


--- branches/safari-600.8-branch/LayoutTests/ChangeLog	2015-07-09 21:01:46 UTC (rev 186610)
+++ branches/safari-600.8-branch/LayoutTests/ChangeLog	2015-07-09 21:01:50 UTC (rev 186611)
@@ -1,5 +1,37 @@
 2015-07-09  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r186503. rdar://problem/21707907
+
+    2015-07-07  Matthew Hanson  <matthew_han...@apple.com>
+
+            Merge r184885. rdar://problem/21708260
+
+        2015-05-26  Zalan Bujtas  <za...@apple.com>
+
+                Overhanging float sets are not cleaned up properly when floating renderer is destroyed.
+                https://bugs.webkit.org/show_bug.cgi?id=145323
+                rdar://problem/20980628
+
+                Reviewed by Dave Hyatt.
+
+                This patch ensures when an overhanging float renderer is destroyed,
+                all the sibling containers' floating object set(m_floatingObjects) gets properly cleaned up.
+
+                When an overhanging float is present, we cache the renderer on the parent and on the affected
+                sibling containers too. (RenderBlockFlow::m_floatingObjects) These caches(sets) get cleared and repopulated
+                during ::layout(). In order to have a float renderer removed from a set, a layout needs to be initiated on the container.
+                This is normally done through RenderBlockFlow::markSiblingsWithFloatsForLayout() and RenderBlockFlow::markAllDescendantsWithFloatsForLayout().
+                However, when the float container's parent's writing direction changes (and we promote the children containers to new formatting contexts),
+                the layout propagation through siblings does not work anymore.
+
+                The avoidsFloats() check in RenderBlockFlow::markSiblingsWithFloatsForLayout() has very little performance gain, but it prevents us
+                from propagating layout to siblings when certain properties of the parent container changes.
+
+                * fast/block/float/crash-when-floating-object-is-removed-expected.txt: Added.
+                * fast/block/float/crash-when-floating-object-is-removed.xhtml: Added.
+
+2015-07-09  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r186502. rdar://problem/21707910
 
     2015-07-07  Matthew Hanson  <matthew_han...@apple.com>

Added: branches/safari-600.8-branch/LayoutTests/fast/block/float/crash-when-floating-object-is-removed-expected.txt (0 => 186611)


--- branches/safari-600.8-branch/LayoutTests/fast/block/float/crash-when-floating-object-is-removed-expected.txt	                        (rev 0)
+++ branches/safari-600.8-branch/LayoutTests/fast/block/float/crash-when-floating-object-is-removed-expected.txt	2015-07-09 21:01:50 UTC (rev 186611)
@@ -0,0 +1 @@
+ PASS if no crash or ASSERT in debug.

Added: branches/safari-600.8-branch/LayoutTests/fast/block/float/crash-when-floating-object-is-removed.xhtml (0 => 186611)


--- branches/safari-600.8-branch/LayoutTests/fast/block/float/crash-when-floating-object-is-removed.xhtml	                        (rev 0)
+++ branches/safari-600.8-branch/LayoutTests/fast/block/float/crash-when-floating-object-is-removed.xhtml	2015-07-09 21:01:50 UTC (rev 186611)
@@ -0,0 +1,45 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>This tests that sets for overhanging floating objects are cleaned up properly when the floating object is destroyed.</title>
+<script>
+  if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+<style>
+  html {
+    position: absolute;
+  }
+  
+  .float { 
+    float: left; 
+  }
+</style>
+</head>
+<head id="head1" style="-webkit-writing-mode: horizontal-bt;"></head>
+
+<i>
+  <button id="button1">PASS if no crash or ASSERT in debug.</button>
+</i>
+<td id="td1">
+  <body></body>
+</td>
+<i></i>
+
+<script>
+var docElement = document.documentElement;
+function crash() {
+    button1 = document.getElementById("button1");
+    button1.classList.toggle("float");
+
+    head1 = document.getElementById("head1");
+    td1 = document.getElementById("td1");
+    head1.appendChild(td1);
+
+    docElement.offsetTop;
+    head1.style.display = "list-item";
+    docElement.offsetTop;
+    button1.classList.toggle("float");
+}
+document.addEventListener("DOMContentLoaded", crash, false);
+</script>
+</html>

Modified: branches/safari-600.8-branch/Source/WebCore/ChangeLog (186610 => 186611)


--- branches/safari-600.8-branch/Source/WebCore/ChangeLog	2015-07-09 21:01:46 UTC (rev 186610)
+++ branches/safari-600.8-branch/Source/WebCore/ChangeLog	2015-07-09 21:01:50 UTC (rev 186611)
@@ -1,5 +1,44 @@
 2015-07-09  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r186503. rdar://problem/21707907
+
+    2015-07-07  Matthew Hanson  <matthew_han...@apple.com>
+
+            Merge r184885. rdar://problem/21708260
+
+        2015-05-26  Zalan Bujtas  <za...@apple.com>
+
+                Overhanging float sets are not cleaned up properly when floating renderer is destroyed.
+                https://bugs.webkit.org/show_bug.cgi?id=145323
+                rdar://problem/20980628
+
+                Reviewed by Dave Hyatt.
+
+                This patch ensures when an overhanging float renderer is destroyed,
+                all the sibling containers' floating object set(m_floatingObjects) gets properly cleaned up.
+
+                When an overhanging float is present, we cache the renderer on the parent and on the affected
+                sibling containers too. (RenderBlockFlow::m_floatingObjects) These caches(sets) get cleared and repopulated
+                during ::layout(). In order to have a float renderer removed from a set, a layout needs to be initiated on the container.
+                This is normally done through RenderBlockFlow::markSiblingsWithFloatsForLayout() and RenderBlockFlow::markAllDescendantsWithFloatsForLayout().
+                However, when the float container's parent's writing direction changes (and we promote the children containers to new formatting contexts),
+                the layout propagation through siblings does not work anymore.
+
+                The avoidsFloats() check in RenderBlockFlow::markSiblingsWithFloatsForLayout() has very little performance gain, but it prevents us
+                from propagating layout to siblings when certain properties of the parent container changes.
+
+                Test: fast/block/float/crash-when-floating-object-is-removed.xhtml
+
+                * rendering/RenderBlockFlow.cpp:
+                (WebCore::RenderBlockFlow::markSiblingsWithFloatsForLayout):
+                * rendering/RenderBox.cpp:
+                (WebCore::outermostBlockContainingFloatingObject):
+                (WebCore::RenderBox::removeFloatingOrPositionedChildFromBlockLists):
+                (WebCore::RenderBox::outermostBlockContainingFloatingObject): Deleted.
+                * rendering/RenderBox.h:
+
+2015-07-09  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r186502. rdar://problem/21707910
 
     2015-07-07  Matthew Hanson  <matthew_han...@apple.com>

Modified: branches/safari-600.8-branch/Source/WebCore/rendering/RenderBlockFlow.cpp (186610 => 186611)


--- branches/safari-600.8-branch/Source/WebCore/rendering/RenderBlockFlow.cpp	2015-07-09 21:01:46 UTC (rev 186610)
+++ branches/safari-600.8-branch/Source/WebCore/rendering/RenderBlockFlow.cpp	2015-07-09 21:01:50 UTC (rev 186611)
@@ -85,7 +85,7 @@
     // with it. We also don't collapse if we have any bottom border/padding.
     m_canCollapseMarginAfterWithChildren = m_canCollapseWithChildren && !afterBorderPadding
         && (blockStyle.logicalHeight().isAuto() && !blockStyle.logicalHeight().value()) && blockStyle.marginAfterCollapse() != MSEPARATE;
-    
+
     m_quirkContainer = block.isTableCell() || block.isBody();
 
     m_discardMargin = m_canCollapseMarginBeforeWithChildren && block.mustDiscardMarginBefore();
@@ -224,7 +224,7 @@
             m_floatingObjects->clear();
     }
 
-    // We should not process floats if the parent node is not a RenderBlock. Otherwise, we will add 
+    // We should not process floats if the parent node is not a RenderBlock. Otherwise, we will add
     // floats in an invalid context. This will cause a crash arising from a bad cast on the parent.
     // See <rdar://problem/8049753>, where float property is applied on a text node in a SVG.
     if (!parent() || !parent()->isRenderBlockFlow())
@@ -247,7 +247,7 @@
     LayoutUnit logicalTopOffset = logicalTop();
     if (parentHasFloats || (parentBlock->lowestFloatLogicalBottom() > logicalTopOffset && prev && toRenderBlockFlow(prev)->isSelfCollapsingBlock()))
         addIntrudingFloats(parentBlock, parentBlock->logicalLeftOffsetForContent(), logicalTopOffset);
-    
+
     LayoutUnit logicalLeftOffset = 0;
     if (prev)
         logicalTopOffset -= toRenderBox(prev)->logicalTop();
@@ -256,7 +256,7 @@
         logicalLeftOffset += parentBlock->logicalLeftOffsetForContent();
     }
 
-    // Add overhanging floats from the previous RenderBlock, but only if it has a float that intrudes into our space.    
+    // Add overhanging floats from the previous RenderBlock, but only if it has a float that intrudes into our space.
     RenderBlockFlow* block = toRenderBlockFlow(prev);
     if (block->m_floatingObjects && block->lowestFloatLogicalBottom() > logicalTopOffset)
         addIntrudingFloats(block, logicalLeftOffset, logicalTopOffset);
@@ -386,7 +386,7 @@
 
     LayoutUnit oldColumnWidth = computedColumnWidth();
     computeColumnCountAndWidth();
-    
+
     return changed || oldColumnWidth != computedColumnWidth();
 }
 
@@ -398,18 +398,18 @@
 }
 
 void RenderBlockFlow::computeColumnCountAndWidth()
-{   
+{
     // Calculate our column width and column count.
     // FIXME: Can overflow on fast/block/float/float-not-removed-from-next-sibling4.html, see https://bugs.webkit.org/show_bug.cgi?id=68744
     unsigned desiredColumnCount = 1;
     LayoutUnit desiredColumnWidth = contentLogicalWidth();
-    
+
     // For now, we don't support multi-column layouts when printing, since we have to do a lot of work for proper pagination.
     if (document().paginated() || (style().hasAutoColumnCount() && style().hasAutoColumnWidth()) || !style().hasInlineColumnAxis()) {
         setComputedColumnCountAndWidth(desiredColumnCount, desiredColumnWidth);
         return;
     }
-        
+
     LayoutUnit availWidth = desiredColumnWidth;
     LayoutUnit colGap = columnGap();
     LayoutUnit colWidth = std::max<LayoutUnit>(LayoutUnit::fromPixel(1), LayoutUnit(style().columnWidth()));
@@ -470,7 +470,7 @@
     bool isCell = isTableCell();
     if (!isCell) {
         initMaxMarginValues();
-        
+
         setHasMarginBeforeQuirk(styleToUse.hasMarginBeforeQuirk());
         setHasMarginAfterQuirk(styleToUse.hasMarginAfterQuirk());
         setPaginationStrut(0);
@@ -490,7 +490,7 @@
     LayoutUnit toAdd = borderAndPaddingAfter() + scrollbarLogicalHeight();
     if (lowestFloatLogicalBottom() > (logicalHeight() - toAdd) && expandsToEncloseOverhangingFloats())
         setLogicalHeight(lowestFloatLogicalBottom() + toAdd);
-    
+
     if (relayoutForPagination(statePusher) || relayoutToAvoidWidows(statePusher)) {
         ASSERT(!shouldBreakAtLineToAvoidWidow());
         return;
@@ -527,7 +527,7 @@
 
     // Add overflow from children (unless we're multi-column, since in that case all our child overflow is clipped anyway).
     computeOverflow(oldClientAfterEdge);
-    
+
     statePusher.pop();
 
     fitBorderToLinesIfNeeded();
@@ -556,7 +556,7 @@
             repaintLogicalLeft = std::min(repaintLogicalLeft, logicalLeftLayoutOverflow());
             repaintLogicalRight = std::max(repaintLogicalRight, logicalRightLayoutOverflow());
         }
-        
+
         LayoutRect repaintRect;
         if (isHorizontalWritingMode())
             repaintRect = LayoutRect(repaintLogicalLeft, repaintLogicalTop, repaintLogicalRight - repaintLogicalLeft, repaintLogicalBottom - repaintLogicalTop);
@@ -564,7 +564,7 @@
             repaintRect = LayoutRect(repaintLogicalTop, repaintLogicalLeft, repaintLogicalBottom - repaintLogicalTop, repaintLogicalRight - repaintLogicalLeft);
 
         repaintRect.inflate(maximalOutlineSize(PaintPhaseOutline));
-        
+
         if (hasOverflowClip()) {
             // Adjust repaint rect for scroll offset
             repaintRect.move(-scrolledContentOffset());
@@ -592,7 +592,7 @@
     LayoutUnit afterEdge = borderAndPaddingAfter() + scrollbarLogicalHeight();
 
     setLogicalHeight(beforeEdge);
-    
+
     // Lay out our hypothetical grid line as though it occurs at the top of the block.
     if (view().layoutState()->lineGrid() == this)
         layoutLineGridBox();
@@ -633,7 +633,7 @@
         // Lay out the child.
         layoutBlockChild(child, marginInfo, previousFloatLogicalBottom, maxFloatLogicalBottom);
     }
-    
+
     // Now do the handling of the bottom of the block, adding in our bottom border/padding and
     // determining the correct collapsed bottom margin information.
     handleAfterSideOfBlock(beforeEdge, afterEdge, marginInfo);
@@ -722,7 +722,7 @@
 
     // Now check for clear.
     LayoutUnit logicalTopAfterClear = clearFloatsIfNeeded(child, marginInfo, oldPosMarginBefore, oldNegMarginBefore, logicalTopBeforeClear);
-    
+
     bool paginated = view().layoutState()->isPaginated();
     if (paginated)
         logicalTopAfterClear = adjustBlockChildForPagination(logicalTopAfterClear, estimateWithoutPagination, child, atBeforeSideOfBlock && logicalTopBeforeClear == logicalTopAfterClear);
@@ -740,7 +740,7 @@
             // So go ahead and mark the item as dirty.
             child.setChildNeedsLayout(MarkOnlyThis);
         }
-        
+
         if (childBlockFlow) {
             if (!child.avoidsFloats() && childBlockFlow->containsFloats())
                 childBlockFlow->markAllDescendantsWithFloatsForLayout();
@@ -754,7 +754,7 @@
     // In case our guess was wrong, relayout the child.
     child.layoutIfNeeded();
 
-    // We are no longer at the top of the block if we encounter a non-empty child.  
+    // We are no longer at the top of the block if we encounter a non-empty child.
     // This has to be done after checking for clear, so that margins can be reset if a clear occurred.
     if (marginInfo.atBeforeSideOfBlock() && !child.isSelfCollapsingBlock())
         marginInfo.setAtBeforeSideOfBlock(false);
@@ -805,7 +805,7 @@
 {
     bool isHorizontal = isHorizontalWritingMode();
     bool hasStaticBlockPosition = child.style().hasStaticBlockPosition(isHorizontal);
-    
+
     LayoutUnit logicalTop = logicalHeight();
     updateStaticInlinePositionForChild(child, logicalTop);
 
@@ -816,7 +816,7 @@
         LayoutUnit collapsedBeforeNeg = marginInfo.negativeMargin();
         logicalTop += collapsedBeforePos - collapsedBeforeNeg;
     }
-    
+
     RenderLayer* childLayer = child.layer();
     if (childLayer->staticBlockPosition() != logicalTop) {
         childLayer->setStaticBlockPosition(logicalTop);
@@ -844,7 +844,7 @@
     // Add in our start margin.
     LayoutUnit childMarginStart = marginStartForChild(child);
     LayoutUnit newPosition = startPosition + childMarginStart;
-        
+
     // Some objects (e.g., tables, horizontal rules, overflow:auto blocks) avoid floats. They need
     // to shift over as necessary to dodge any floats that might get in the way.
     if (child.avoidsFloats() && containsFloats() && !flowThreadContainingBlock())
@@ -902,7 +902,7 @@
     LayoutUnit afterMargin = 0;
 
     RenderBlockFlow* childRenderBlock = child.isRenderBlockFlow() ? toRenderBlockFlow(&child) : nullptr;
-    
+
     // If the child has the same directionality as we do, then we can just return its
     // margins in the same direction.
     if (!child.isWritingModeRoot()) {
@@ -973,7 +973,7 @@
         posTop = std::max(posTop, childMargins.positiveMarginAfter());
         negTop = std::max(negTop, childMargins.negativeMarginAfter());
     }
-    
+
     // See if the top margin is quirky. We only care if this child has
     // margins that will collapse with us.
     bool topQuirk = hasMarginBeforeQuirk(child);
@@ -1007,7 +1007,7 @@
             setMustDiscardMarginBefore();
     }
 
-    // Once we find a child with discardMarginBefore all the margins collapsing with us must also discard. 
+    // Once we find a child with discardMarginBefore all the margins collapsing with us must also discard.
     if (childDiscardMarginBefore) {
         marginInfo.setDiscardMargin(true);
         marginInfo.clearMargin();
@@ -1022,7 +1022,7 @@
     LayoutUnit clearanceForSelfCollapsingBlock;
     RenderObject* prev = child.previousSibling();
     // If the child's previous sibling is a self-collapsing block that cleared a float then its top border edge has been set at the bottom border edge
-    // of the float. Since we want to collapse the child's top margin with the self-collapsing block's top and bottom margins we need to adjust our parent's height to match the 
+    // of the float. Since we want to collapse the child's top margin with the self-collapsing block's top and bottom margins we need to adjust our parent's height to match the
     // margin top of the self-collapsing block. If the resulting collapsed margin leaves the child still intruding into the float then we will want to clear it.
     if (!marginInfo.canCollapseWithMarginBefore() && prev && prev->isRenderBlockFlow() && toRenderBlockFlow(prev)->isSelfCollapsingBlock()) {
         clearanceForSelfCollapsingBlock = toRenderBlockFlow(prev)->marginOffsetForSelfCollapsingBlock();
@@ -1039,9 +1039,9 @@
             LayoutUnit collapsedBeforePos = std::max(marginInfo.positiveMargin(), childMargins.positiveMarginBefore());
             LayoutUnit collapsedBeforeNeg = std::max(marginInfo.negativeMargin(), childMargins.negativeMarginBefore());
             marginInfo.setMargin(collapsedBeforePos, collapsedBeforeNeg);
-            
+
             // Now collapse the child's margins together, which means examining our
-            // bottom margin values as well. 
+            // bottom margin values as well.
             marginInfo.setPositiveMarginIfLarger(childMargins.positiveMarginAfter());
             marginInfo.setNegativeMarginIfLarger(childMargins.negativeMarginAfter());
 
@@ -1071,7 +1071,7 @@
         }
 
         marginInfo.setDiscardMargin(childDiscardMarginAfter);
-        
+
         if (!marginInfo.discardMargin()) {
             marginInfo.setPositiveMargin(childMargins.positiveMarginAfter());
             marginInfo.setNegativeMargin(childMargins.negativeMarginAfter());
@@ -1081,7 +1081,7 @@
         if (marginInfo.margin())
             marginInfo.setHasMarginAfterQuirk(hasMarginAfterQuirk(child));
     }
-    
+
     // If margins would pull us past the top of the next page, then we need to pull back and pretend like the margins
     // collapsed into the page edge.
     LayoutState* layoutState = view().layoutState();
@@ -1135,7 +1135,7 @@
         marginInfo.setDiscardMargin(childDiscardMargin);
 
         // CSS2.1 states:
-        // "If the top and bottom margins of an element with clearance are adjoining, its margins collapse with 
+        // "If the top and bottom margins of an element with clearance are adjoining, its margins collapse with
         // the adjoining margins of following siblings but that resulting margin does not collapse with the bottom margin of the parent block."
         // So the parent's bottom margin cannot collapse through this block or any subsequent self-collapsing blocks. Check subsequent siblings
         // for a block with height - if none is found then don't allow the margins to collapse with the parent.
@@ -1149,7 +1149,7 @@
 
         // For now set the border-top of |child| flush with the bottom border-edge of the float so it can layout any floating or positioned children of
         // its own at the correct vertical position. If subsequent siblings attempt to collapse with |child|'s margins in |collapseMargins| we will
-        // adjust the height of the parent to |child|'s margin top (which if it is positive sits up 'inside' the float it's clearing) so that all three 
+        // adjust the height of the parent to |child|'s margin top (which if it is positive sits up 'inside' the float it's clearing) so that all three
         // margins can collapse at the correct vertical position.
         // Per CSS2.1 we need to ensure that any negative margin-top clears |child| beyond the bottom border-edge of the float so that the top border edge of the child
         // (i.e. its clearance)  is at a position that satisfies the equation: "the amount of clearance is set so that clearance + margin-top = [height of float],
@@ -1158,7 +1158,7 @@
     } else
         // Increase our height by the amount we had to clear.
         setLogicalHeight(logicalHeight() + heightIncrease);
-    
+
     if (marginInfo.canCollapseWithMarginBefore()) {
         // We can no longer collapse with the top of the block since a clear
         // occurred. The empty blocks collapse into the cleared block.
@@ -1198,7 +1198,7 @@
 
     if (!child.isRenderBlockFlow())
         return;
-    
+
     RenderBlockFlow& childBlock = toRenderBlockFlow(child);
     if (childBlock.childrenInline() || childBlock.isWritingModeRoot())
         return;
@@ -1212,7 +1212,7 @@
         if (!grandchildBox->isFloatingOrOutOfFlowPositioned())
             break;
     }
-    
+
     // Give up if there is clearance on the box, since it probably won't collapse into us.
     if (!grandchildBox || grandchildBox->style().clear() != CNONE)
         return;
@@ -1265,16 +1265,16 @@
         logicalTopEstimate = std::min(logicalTopEstimate, nextPageLogicalTop(logicalHeight()));
 
     logicalTopEstimate += getClearDelta(child, logicalTopEstimate);
-    
+
     estimateWithoutPagination = logicalTopEstimate;
 
     if (layoutState->isPaginated()) {
         // If the object has a page or column break value of "before", then we should shift to the top of the next page.
         logicalTopEstimate = applyBeforeBreak(child, logicalTopEstimate);
-    
+
         // For replaced elements and scrolled elements, we want to shift them to the next page if they don't fit on the current one.
         logicalTopEstimate = adjustForUnsplittableChild(child, logicalTopEstimate);
-        
+
         if (!child.selfNeedsLayout() && child.isRenderBlock())
             logicalTopEstimate += toRenderBlock(child).paginationStrut();
     }
@@ -1322,7 +1322,7 @@
     if (!marginInfo.discardMargin() && (!marginInfo.canCollapseWithMarginAfter() && !marginInfo.canCollapseWithMarginBefore()
         && (!document().inQuirksMode() || !marginInfo.quirkContainer() || !marginInfo.hasMarginAfterQuirk())))
         setLogicalHeight(logicalHeight() + marginInfo.margin());
-        
+
     // Now add in our bottom border/padding.
     setLogicalHeight(logicalHeight() + afterSide);
 
@@ -1538,7 +1538,7 @@
             // So go ahead and mark the item as dirty.
             child.setChildNeedsLayout(MarkOnlyThis);
         }
-        
+
         if (childRenderBlock) {
             if (!child.avoidsFloats() && childRenderBlock->containsFloats())
                 toRenderBlockFlow(childRenderBlock)->markAllDescendantsWithFloatsForLayout();
@@ -1572,7 +1572,7 @@
     // For replaced elements and scrolled elements, we want to shift them to the next page if they don't fit on the current one.
     LayoutUnit logicalTopBeforeUnsplittableAdjustment = result;
     LayoutUnit logicalTopAfterUnsplittableAdjustment = adjustForUnsplittableChild(child, result);
-    
+
     LayoutUnit paginationStrut = 0;
     LayoutUnit unsplittableAdjustmentDelta = logicalTopAfterUnsplittableAdjustment - logicalTopBeforeUnsplittableAdjustment;
     if (unsplittableAdjustmentDelta)
@@ -1596,7 +1596,7 @@
 
     // Similar to how we apply clearance. Go ahead and boost height() to be the place where we're going to position the child.
     setLogicalHeight(logicalHeight() + (result - oldTop));
-    
+
     // Return the final adjusted logical top.
     return result;
 }
@@ -1690,7 +1690,7 @@
             return; // Give up. We're genuinely too big even after excluding blank space and overflow.
         pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset);
     }
-    
+
     LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset, ExcludePageBoundary);
     overflowsRegion = (lineHeight > remainingLogicalHeight);
 
@@ -1856,7 +1856,7 @@
     LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset);
     if (!pageLogicalHeight)
         return logicalOffset;
-    
+
     // The logicalOffset is in our coordinate space.  We can add in our pushed offset.
     LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset);
     if (pageBoundaryRule == ExcludePageBoundary)
@@ -1889,7 +1889,7 @@
     LayoutUnit pageLogicalHeight = view().layoutState()->m_pageLogicalHeight;
     if (!pageLogicalHeight)
         return 0;
-    
+
     // Now check for a flow thread.
     RenderFlowThread* flowThread = flowThreadContainingBlock();
     if (!flowThread)
@@ -1900,7 +1900,7 @@
 LayoutUnit RenderBlockFlow::pageRemainingLogicalHeightForOffset(LayoutUnit offset, PageBoundaryRule pageBoundaryRule) const
 {
     offset += offsetFromLogicalTopOfFirstPage();
-    
+
     RenderFlowThread* flowThread = flowThreadContainingBlock();
     if (!flowThread) {
         LayoutUnit pageLogicalHeight = view().layoutState()->m_pageLogicalHeight;
@@ -1912,14 +1912,14 @@
         }
         return remainingHeight;
     }
-    
+
     return flowThread->pageRemainingLogicalHeightForOffset(offset, pageBoundaryRule);
 }
 
 LayoutUnit RenderBlockFlow::logicalHeightForChildForFragmentation(const RenderBox& child) const
 {
     // This method is required because regions do not fragment monolithic elements but instead
-    // they let them overflow the region they flow in. This behaviour is different from the 
+    // they let them overflow the region they flow in. This behaviour is different from the
     // multicol/printing implementations, which have not yet been updated to correctly handle
     // monolithic elements.
     // As a result, for the moment, this method will only be used for regions, the multicol and
@@ -1941,7 +1941,7 @@
     LayoutUnit childLogicalTop = logicalTopForChild(child);
     if (!hasNextPage(childLogicalTop))
         return logicalHeightForChild(child);
-    
+
     LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(childLogicalTop, ExcludePageBoundary);
     return std::min(child.logicalHeight(), remainingLogicalHeight);
 }
@@ -1952,7 +1952,7 @@
         setLineGridBox(0);
         return;
     }
-    
+
     setLineGridBox(0);
 
     auto lineGridBox = std::make_unique<RootInlineBox>(*this);
@@ -1961,7 +1961,7 @@
     GlyphOverflowAndFallbackFontsMap textBoxDataMap;
     VerticalPositionCache verticalPositionCache;
     lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, verticalPositionCache);
-    
+
     setLineGridBox(WTF::move(lineGridBox));
 
     // FIXME: If any of the characteristics of the box change compared to the old one, then we need to do a deep dirtying
@@ -1977,7 +1977,7 @@
 void RenderBlockFlow::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     RenderBlock::styleDidChange(diff, oldStyle);
-    
+
     // After our style changed, if we lose our ability to propagate floats into next sibling
     // blocks, then we need to find the top most parent containing that overhanging float and
     // then mark its descendants with floats for layout and clear all floats from its next
@@ -2032,7 +2032,7 @@
     if (oldStyle) {
         EPosition oldPosition = oldStyle->position();
         EPosition newPosition = newStyle.position();
-        
+
         if (parent() && diff == StyleDifferenceLayout && oldPosition != newPosition) {
             if (containsFloats() && !isFloating() && !isOutOfFlowPositioned() && newStyle.hasOutOfFlowPosition())
                 markAllDescendantsWithFloatsForLayout();
@@ -2160,7 +2160,7 @@
 void RenderBlockFlow::paintColumnRules(PaintInfo& paintInfo, const LayoutPoint& point)
 {
     RenderBlock::paintColumnRules(paintInfo, point);
-    
+
     if (!multiColumnFlowThread() || paintInfo.context->paintingDisabled())
         return;
 
@@ -2251,13 +2251,13 @@
     // Create the special floatingObject entry & append it to the list
 
     std::unique_ptr<FloatingObject> floatingObject = FloatingObject::create(floatBox);
-    
+
     // Our location is irrelevant if we're unsplittable or no pagination is in effect.
     // Just go ahead and lay out the float.
     bool isChildRenderBlock = floatBox.isRenderBlock();
     if (isChildRenderBlock && !floatBox.needsLayout() && view().layoutState()->pageLogicalHeightChanged())
         floatBox.setChildNeedsLayout(MarkOnlyThis);
-            
+
     bool needsBlockDirectionLocationSetBeforeLayout = isChildRenderBlock && view().layoutState()->needsBlockDirectionLocationSetBeforeLayout();
     if (!needsBlockDirectionLocationSetBeforeLayout || isWritingModeRoot()) // We are unsplittable if we're a block flow root.
         floatBox.layoutIfNeeded();
@@ -2312,7 +2312,7 @@
 {
     if (!containsFloats())
         return;
-    
+
     const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
     FloatingObject* curr = floatingObjectSet.last().get();
     while (curr != lastFloat && (!curr->isPlaced() || logicalTopForFloat(curr) >= logicalOffset)) {
@@ -2385,7 +2385,7 @@
         // fast/block/float/clamped-right-float.html.
         floatLogicalLeft -= logicalWidthForFloat(floatingObject);
     }
-    
+
     return LayoutPoint(floatLogicalLeft, logicalTopOffset);
 }
 
@@ -2419,7 +2419,7 @@
     }
 
     LayoutUnit logicalTop = logicalHeight();
-    
+
     // The float cannot start above the top position of the last positioned float.
     if (lastPlacedFloatingObject)
         logicalTop = std::max(logicalTopForFloat(lastPlacedFloatingObject), logicalTop);
@@ -2455,14 +2455,14 @@
 
         childBox.markForPaginationRelayoutIfNeeded();
         childBox.layoutIfNeeded();
-        
+
         LayoutState* layoutState = view().layoutState();
         bool isPaginated = layoutState->isPaginated();
         if (isPaginated) {
             // If we are unsplittable and don't fit, then we need to move down.
             // We include our margins as part of the unsplittable area.
             LayoutUnit newLogicalTop = adjustForUnsplittableChild(childBox, floatLogicalLocation.y(), true);
-            
+
             // See if we have a pagination strut that is making us move down further.
             // Note that an unsplittable child can't also have a pagination strut, so this is
             // exclusive with the case above.
@@ -2471,7 +2471,7 @@
                 newLogicalTop += childBlock->paginationStrut();
                 childBlock->setPaginationStrut(0);
             }
-            
+
             if (newLogicalTop != floatLogicalLocation.y()) {
                 floatingObject->setPaginationStrut(newLogicalTop - floatLogicalLocation.y());
 
@@ -2480,7 +2480,7 @@
 
                 setLogicalLeftForChild(childBox, floatLogicalLocation.x() + childLogicalLeftMargin);
                 setLogicalTopForChild(childBox, floatLogicalLocation.y() + marginBeforeForChild(childBox));
-        
+
                 if (childBlock)
                     childBlock->setChildNeedsLayout(MarkOnlyThis);
                 childBox.layoutIfNeeded();
@@ -2627,7 +2627,7 @@
                 // it should paint.
                 floatingObject->setShouldPaint(true);
             }
-            
+
             // Since the float doesn't overhang, it didn't get put into our list. We need to go ahead and add its overflow in to the
             // child now.
             if (floatingObject->isDescendant())
@@ -2720,7 +2720,7 @@
     auto end = floatingObjectSet.end();
 
     for (RenderObject* next = nextSibling(); next; next = next->nextSibling()) {
-        if (!next->isRenderBlockFlow() || next->isFloatingOrOutOfFlowPositioned() || toRenderBlock(next)->avoidsFloats())
+        if (!next->isRenderBlockFlow() || next->isFloatingOrOutOfFlowPositioned())
             continue;
 
         RenderBlockFlow* nextBlock = toRenderBlockFlow(next);
@@ -2738,7 +2738,7 @@
 {
     if (!style().isFlippedBlocksWritingMode())
         return point;
-    
+
     // This is similar to RenderBox::flipForWritingModeForChild. We have to subtract out our left/top offsets twice, since
     // it's going to get added back in. We hide this complication here so that the calling code looks normal for the unflipped
     // case.
@@ -2752,7 +2752,7 @@
     // There is no need to compute clearance if we have no floats.
     if (!containsFloats())
         return 0;
-    
+
     // At least one float is present. We need to perform the clearance computation.
     bool clearSet = child.style().clear() != CNONE;
     LayoutUnit logicalBottom = 0;
@@ -2799,7 +2799,7 @@
             child.setLogicalWidth(childOldLogicalWidth);
             child.setMarginLeft(childOldMarginLeft);
             child.setMarginRight(childOldMarginRight);
-            
+
             if (childLogicalWidthAtNewLogicalTopOffset <= availableLogicalWidthAtNewLogicalTopOffset) {
                 // Even though we may not be moving, if the logical width did shrink because of the presence of new floats, then
                 // we need to force a relayout as though we shifted. This happens because of the dynamic addition of overhanging floats
@@ -2913,17 +2913,17 @@
     LayoutUnit right = LayoutUnit::min();
     LayoutUnit oldWidth = contentWidth();
     adjustForBorderFit(0, left, right);
-    
+
     // Clamp to our existing edges. We can never grow. We only shrink.
     LayoutUnit leftEdge = borderLeft() + paddingLeft();
     LayoutUnit rightEdge = leftEdge + oldWidth;
     left = std::min(rightEdge, std::max(leftEdge, left));
     right = std::max(leftEdge, std::min(rightEdge, right));
-    
+
     LayoutUnit newContentWidth = right - left;
     if (newContentWidth == oldWidth)
         return;
-    
+
     setOverrideLogicalContentWidth(newContentWidth);
     layoutBlock(false);
     clearOverrideLogicalContentWidth();
@@ -3028,7 +3028,7 @@
         if (!containsStart && !lastSelectedLine &&
             selectionState() != SelectionStart && selectionState() != SelectionBoth && !isRubyBase())
             result.uniteCenter(blockSelectionGap(rootBlock, rootBlockPhysicalPosition, offsetFromRootBlock, lastLogicalTop, lastLogicalLeft, lastLogicalRight, selTop, cache, paintInfo));
-        
+
         LayoutRect logicalRect(curr->logicalLeft(), selTop, curr->logicalWidth(), selTop + selHeight);
         logicalRect.move(isHorizontalWritingMode() ? offsetFromRootBlock : offsetFromRootBlock.transposedSize());
         LayoutRect physicalRect = rootBlock.logicalRectToPhysicalRect(rootBlockPhysicalPosition, logicalRect);
@@ -3211,7 +3211,7 @@
         if (normalFlowChildWithoutLines && !lineCount)
             return normalFlowChildWithoutLines->y() + normalFlowChildWithoutLines->height();
     }
-    
+
     return -1;
 }
 
@@ -3398,7 +3398,7 @@
 {
     if (!multiColumnFlowThread() || !multiColumnFlowThread()->shouldRelayoutForPagination())
         return false;
-    
+
     multiColumnFlowThread()->setNeedsHeightsRecalculation(false);
     multiColumnFlowThread()->setInBalancingPass(true); // Prevent re-entering this method (and recursion into layout).
 
@@ -3434,9 +3434,9 @@
         }
         firstPass = false;
     } while (needsRelayout);
-    
+
     multiColumnFlowThread()->setInBalancingPass(false);
-    
+
     return neededRelayout;
 }
 
@@ -3603,7 +3603,7 @@
     // Don't do any work if the block is smaller than the visible area.
     if (visibleWidth >= width())
         return;
-    
+
     unsigned lineCount;
     if (m_lineCountForTextAutosizing == NOT_SET) {
         int count = lineCountForTextAutosizing();
@@ -3615,15 +3615,15 @@
             lineCount = MULTI_LINE;
     } else
         lineCount = m_lineCountForTextAutosizing;
-    
+
     ASSERT(lineCount != NOT_SET);
     if (lineCount == NO_LINE)
         return;
-    
+
     float actualWidth = m_widthForTextAutosizing != -1 ? static_cast<float>(m_widthForTextAutosizing) : static_cast<float>(width());
     float scale = visibleWidth / actualWidth;
     float minFontSize = roundf(size / scale);
-    
+
     for (RenderObject* descendent = traverseNext(this, isNonBlocksOrNonFixedHeightListItems); descendent; descendent = descendent->traverseNext(this, isNonBlocksOrNonFixedHeightListItems)) {
         if (isVisibleRenderText(descendent) && resizeTextPermitted(descendent)) {
             RenderText* text = toRenderText(descendent);
@@ -3638,7 +3638,7 @@
                     m_lineCountForTextAutosizing = lineCount;
                 if (m_widthForTextAutosizing == -1)
                     m_widthForTextAutosizing = actualWidth;
-                
+
                 float candidateNewSize = 0;
                 float lineTextMultiplier = lineCount == ONE_LINE ? oneLineTextMultiplier(specifiedSize) : textMultiplier(specifiedSize);
                 candidateNewSize = roundf(std::min(minFontSize, specifiedSize * lineTextMultiplier));
@@ -3710,7 +3710,7 @@
     // If we don't use columns or flow threads, then bail.
     if (!isRenderFlowThread() && !multiColumnFlowThread())
         return;
-    
+
     // We don't actually update any of the variables. We just subclassed to adjust our column height.
     if (RenderMultiColumnFlowThread* flowThread = multiColumnFlowThread()) {
         LogicalExtentComputedValues computedValues;
@@ -3766,7 +3766,7 @@
 {
     if (!multiColumnFlowThread())
         return;
-    
+
     bool needsLayout = false;
     bool oldProgressionIsInline = multiColumnFlowThread()->progressionIsInline();
     bool newProgressionIsInline = style->hasInlineColumnAxis();
@@ -3797,7 +3797,7 @@
 {
     if (multiColumnFlowThread())
         return multiColumnFlowThread()->computedColumnCount();
-    
+
     return 1;
 }
 
@@ -3806,7 +3806,7 @@
     bool hasTopOverflow = RenderBlock::isTopLayoutOverflowAllowed();
     if (!multiColumnFlowThread() || style().columnProgression() == NormalColumnProgression)
         return hasTopOverflow;
-    
+
     if (!(isHorizontalWritingMode() ^ !style().hasInlineColumnAxis()))
         hasTopOverflow = !hasTopOverflow;
 
@@ -3818,7 +3818,7 @@
     bool hasLeftOverflow = RenderBlock::isLeftLayoutOverflowAllowed();
     if (!multiColumnFlowThread() || style().columnProgression() == NormalColumnProgression)
         return hasLeftOverflow;
-    
+
     if (isHorizontalWritingMode() ^ !style().hasInlineColumnAxis())
         hasLeftOverflow = !hasLeftOverflow;
 

Modified: branches/safari-600.8-branch/Source/WebCore/rendering/RenderBox.cpp (186610 => 186611)


--- branches/safari-600.8-branch/Source/WebCore/rendering/RenderBox.cpp	2015-07-09 21:01:46 UTC (rev 186610)
+++ branches/safari-600.8-branch/Source/WebCore/rendering/RenderBox.cpp	2015-07-09 21:01:50 UTC (rev 186611)
@@ -194,7 +194,7 @@
         // FIXME: In a perfect world this condition should never happen.
         return borderBoxRect();
     }
-    
+
     ASSERT(flowThread->regionInRange(region, startRegion, endRegion));
 
     // Compute the logical width and placement in this region.
@@ -205,7 +205,7 @@
     // We have cached insets.
     LayoutUnit logicalWidth = boxInfo->logicalWidth();
     LayoutUnit logicalLeft = boxInfo->logicalLeft();
-        
+
     // Now apply the parent inset since it is cumulative whenever anything in the containing block chain shifts.
     // FIXME: Doesn't work right with perpendicular writing modes.
     const RenderBlock* currentBox = containingBlock();
@@ -219,7 +219,7 @@
         region = currentBox->clampToStartAndEndRegions(region);
         currentBoxInfo = currentBox->renderBoxRegionInfo(region);
     }
-    
+
     if (cacheFlag == DoNotCacheRenderBoxRegionInfo)
         delete boxInfo;
 
@@ -247,14 +247,14 @@
     RenderBoxModelObject::willBeDestroyed();
 }
 
-RenderBlockFlow* RenderBox::outermostBlockContainingFloatingObject()
+static RenderBlockFlow* outermostBlockContainingFloatingObject(RenderBox& box)
 {
-    ASSERT(isFloating());
+    ASSERT(box.isFloating());
     RenderBlockFlow* parentBlock = nullptr;
-    for (auto& ancestor : ancestorsOfType<RenderBlockFlow>(*this)) {
+    for (auto& ancestor : ancestorsOfType<RenderBlockFlow>(box)) {
         if (ancestor.isRenderView())
             break;
-        if (!parentBlock || ancestor.containsFloat(*this))
+        if (!parentBlock || ancestor.containsFloat(box))
             parentBlock = &ancestor;
     }
     return parentBlock;
@@ -268,7 +268,7 @@
         return;
 
     if (isFloating()) {
-        if (RenderBlockFlow* parentBlock = outermostBlockContainingFloatingObject()) {
+        if (RenderBlockFlow* parentBlock = outermostBlockContainingFloatingObject(*this)) {
             parentBlock->markSiblingsWithFloatsForLayout(this);
             parentBlock->markAllDescendantsWithFloatsForLayout(this, false);
         }
@@ -291,7 +291,7 @@
             if (oldStyle->hasEntirelyFixedBackground() != newStyle.hasEntirelyFixedBackground())
                 view().compositor().rootFixedBackgroundsChanged();
         }
-        
+
         // When a layout hint happens and an object's position style changes, we have to do a layout
         // to dirty the render tree using the old position value now.
         if (diff == StyleDifferenceLayout && parent() && oldStyle->position() != newStyle.position()) {
@@ -395,17 +395,17 @@
         }
 
         view().frameView().recalculateScrollbarOverlayStyle();
-        
+
         const Pagination& pagination = view().frameView().pagination();
         if (viewChangedWritingMode && pagination.mode != Pagination::Unpaginated) {
             viewStyle.setColumnStylesFromPaginationMode(pagination.mode);
             if (view().multiColumnFlowThread())
                 view().updateColumnProgressionFromStyle(&viewStyle);
         }
-        
+
         if (viewStyleChanged && view().multiColumnFlowThread())
             view().updateStylesForColumnChildren();
-        
+
         if (rootStyleChanged && rootRenderer && rootRenderer->isRenderBlockFlow() && toRenderBlockFlow(rootRenderer)->multiColumnFlowThread())
             toRenderBlockFlow(rootRenderer)->updateStylesForColumnChildren();
     }
@@ -470,7 +470,7 @@
                 boxHasOverflowClip = false;
             }
         }
-        
+
         // Check for overflow clip.
         // It's sufficient to just check one direction, since it's illegal to have visible on only one overflow value.
         if (boxHasOverflowClip) {
@@ -676,7 +676,7 @@
 
         box = LayoutRect(containerRelativeQuad.boundingBox());
     }
-    
+
     // FIXME: layoutDelta needs to be applied in parts before/after transforms and
     // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308
     box.move(view().layoutDelta());
@@ -828,7 +828,7 @@
 bool RenderBox::logicalScroll(ScrollLogicalDirection direction, ScrollGranularity granularity, float multiplier, Element** stopElement)
 {
     bool scrolled = false;
-    
+
     RenderLayer* l = layer();
     if (l) {
 #if PLATFORM(COCOA)
@@ -838,7 +838,7 @@
 #endif
         if (l->scroll(logicalToPhysical(direction, isHorizontalWritingMode(), style().isFlippedBlocksWritingMode()), granularity, multiplier))
             scrolled = true;
-        
+
         if (scrolled) {
             if (stopElement)
                 *stopElement = element();
@@ -859,7 +859,7 @@
 {
     return canBeProgramaticallyScrolled() && (scrollHeight() != clientHeight() || scrollWidth() != clientWidth());
 }
-    
+
 bool RenderBox::canBeProgramaticallyScrolled() const
 {
     if (isRenderView())
@@ -994,7 +994,7 @@
 #endif
         const_cast<RenderBox*>(this)->computePreferredLogicalWidths();
     }
-        
+
     return m_minPreferredLogicalWidth;
 }
 
@@ -1006,7 +1006,7 @@
 #endif
         const_cast<RenderBox*>(this)->computePreferredLogicalWidths();
     }
-        
+
     return m_maxPreferredLogicalWidth;
 }
 
@@ -1186,7 +1186,7 @@
         return;
 
     auto& rootBackgroundRenderer = rendererForRootBackground();
-    
+
     const FillLayer* bgLayer = rootBackgroundRenderer.style().backgroundLayers();
     Color bgColor = rootBackgroundRenderer.style().visitedDependentColor(CSSPropertyBackgroundColor);
 
@@ -1206,7 +1206,7 @@
     AffineTransform ctm = context->getCTM();
     FloatSize contextScaling(static_cast<float>(ctm.xScale()), static_cast<float>(ctm.yScale()));
 
-    // Because RoundedRect uses IntRect internally the inset applied by the 
+    // Because RoundedRect uses IntRect internally the inset applied by the
     // BackgroundBleedShrinkBackground strategy cannot be less than one integer
     // layout coordinate, even with subpixel layout enabled. To take that into
     // account, we clamp the contextScaling to 1.0 for the following test so
@@ -1215,9 +1215,9 @@
     // coordinates.
     // This precaution will become obsolete if RoundedRect is ever promoted to
     // a sub-pixel representation.
-    if (contextScaling.width() > 1) 
+    if (contextScaling.width() > 1)
         contextScaling.setWidth(1);
-    if (contextScaling.height() > 1) 
+    if (contextScaling.height() > 1)
         contextScaling.setHeight(1);
 
     if (borderObscuresBackgroundEdge(contextScaling))
@@ -1355,7 +1355,7 @@
     // FIXME: Use rounded rect if border radius is present.
     if (style().hasBorderRadius())
         return false;
-    
+
     // FIXME: The background color clip is defined by the last layer.
     if (style().backgroundLayers()->next())
         return false;
@@ -1488,7 +1488,7 @@
     CompositeOperator compositeOp = CompositeSourceOver;
 
     bool allMaskImagesLoaded = true;
-    
+
     if (!compositedMask || flattenCompositingLayers) {
         pushTransparencyLayer = true;
         StyleImage* maskBoxImage = style().maskBoxImage().image();
@@ -1510,7 +1510,7 @@
         paintFillLayers(paintInfo, Color(), style().maskLayers(), paintRect, BackgroundBleedNone, compositeOp);
         paintNinePieceImage(paintInfo.context, paintRect, style(), style().maskBoxImage(), compositeOp);
     }
-    
+
     if (pushTransparencyLayer)
         paintInfo.context->endTransparencyLayer();
 }
@@ -1520,12 +1520,12 @@
     const NinePieceImage& maskBoxImage = style().maskBoxImage();
     if (maskBoxImage.image()) {
         LayoutRect borderImageRect = borderBoxRect();
-        
+
         // Apply outsets to the border box.
         borderImageRect.expand(style().maskBoxImageOutsets());
         return borderImageRect;
     }
-    
+
     LayoutRect result;
     LayoutRect borderBox = borderBoxRect();
     for (const FillLayer* maskLayer = style().maskLayers(); maskLayer; maskLayer = maskLayer->next()) {
@@ -1548,7 +1548,7 @@
     while (curLayer) {
         layers.append(curLayer);
         // Stop traversal when an opaque layer is encountered.
-        // FIXME : It would be possible for the following occlusion culling test to be more aggressive 
+        // FIXME : It would be possible for the following occlusion culling test to be more aggressive
         // on layers with no repeat by testing whether the image covers the layout rect.
         // Testing that here would imply duplicating a lot of calculations that are currently done in
         // RenderBoxModelObject::paintFillLayerExtended. A more efficient solution might be to move
@@ -1666,7 +1666,7 @@
                 layerRenderer->repaint();
                 return true;
             }
-            
+
             LayoutRect rectToRepaint = geometry.destRect();
             bool shouldClipToLayer = true;
 
@@ -1698,13 +1698,13 @@
 {
     if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == PaintPhaseSelfOutline || paintInfo.phase == PaintPhaseMask)
         return false;
-        
+
     bool isControlClip = hasControlClip();
     bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer();
-    
+
     if (!isControlClip && !isOverflowClip)
         return false;
-    
+
     if (paintInfo.phase == PaintPhaseOutline)
         paintInfo.phase = PaintPhaseChildOutlines;
     else if (paintInfo.phase == PaintPhaseChildBlockBackground) {
@@ -1782,7 +1782,7 @@
 }
 
 LayoutUnit RenderBox::shrinkLogicalWidthToAvoidFloats(LayoutUnit childMarginStart, LayoutUnit childMarginEnd, const RenderBlock* cb, RenderRegion* region) const
-{    
+{
     RenderRegion* containingBlockRegion = 0;
     LayoutUnit logicalTopPosition = logicalTop();
     if (region) {
@@ -1807,7 +1807,7 @@
         else
             result += startOffset - startContentSide;
     }
-    
+
     if (childMarginEnd > 0) {
         LayoutUnit endContentSide = cb->endOffsetForContent(containingBlockRegion);
         LayoutUnit endContentSideWithMargin = endContentSide + childMarginEnd;
@@ -1931,9 +1931,9 @@
 
     if (wasFixed)
         *wasFixed = mode & IsFixed;
-    
+
     LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(transformState.mappedPoint()));
-    
+
     bool preserve3D = mode & UseTransforms && (o->style().preserves3D() || style().preserves3D());
     if (mode & UseTransforms && shouldUseTransformFromContainer(o)) {
         TransformationMatrix t;
@@ -1987,13 +1987,13 @@
         TransformationMatrix t;
         getTransformFromContainer(container, containerOffset, t);
         t.translateRight(adjustmentForSkippedAncestor.width(), adjustmentForSkippedAncestor.height());
-        
+
         geometryMap.push(this, t, preserve3D, offsetDependsOnPoint, isFixedPos, hasTransform);
     } else {
         containerOffset += adjustmentForSkippedAncestor;
         geometryMap.push(this, containerOffset, preserve3D, offsetDependsOnPoint, isFixedPos, hasTransform);
     }
-    
+
     return ancestorSkipped ? ancestorToStopAt : container;
 }
 
@@ -2013,10 +2013,10 @@
 
 LayoutSize RenderBox::offsetFromContainer(RenderObject* o, const LayoutPoint&, bool* offsetDependsOnPoint) const
 {
-    // A region "has" boxes inside it without being their container. 
+    // A region "has" boxes inside it without being their container.
     ASSERT(o == container() || o->isRenderRegion());
 
-    LayoutSize offset;    
+    LayoutSize offset;
     if (isInFlowPositioned())
         offset += offsetForInFlowPosition();
 
@@ -2106,12 +2106,12 @@
     // FIXME: layoutDelta needs to be applied in parts before/after transforms and
     // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308
     r.move(view().layoutDelta());
-    
+
     // We have to use maximalOutlineSize() because a child might have an outline
     // that projects outside of our overflowRect.
     ASSERT(style().outlineSize() <= view().maximalOutlineSize());
     r.inflate(view().maximalOutlineSize());
-    
+
     computeRectForRepaint(repaintContainer, r);
     return r;
 }
@@ -2172,7 +2172,7 @@
     auto o = container(repaintContainer, &containerSkipped);
     if (!o)
         return;
-    
+
     EPosition position = styleToUse.position();
 
     // This code isn't necessary for in-flow RenderFlowThreads.
@@ -2306,7 +2306,7 @@
     RenderBlock* cb = containingBlock();
     LayoutUnit containerLogicalWidth = std::max<LayoutUnit>(0, containingBlockLogicalWidthForContentInRegion(region));
     bool hasPerpendicularContainingBlock = cb->isHorizontalWritingMode() != isHorizontalWritingMode();
-    
+
     if (isInline() && !isInlineBlockOrInlineTable()) {
         // just calculate margins
         computedValues.m_margins.m_start = minimumValueForLength(styleToUse.marginStart(), containerLogicalWidth);
@@ -2340,7 +2340,7 @@
             hasInvertedDirection ? computedValues.m_margins.m_end : computedValues.m_margins.m_start,
             hasInvertedDirection ? computedValues.m_margins.m_start : computedValues.m_margins.m_end);
     }
-    
+
     if (!hasPerpendicularContainingBlock && containerLogicalWidth && containerLogicalWidth != (computedValues.m_extent + computedValues.m_margins.m_start + computedValues.m_margins.m_end)
         && !isFloating() && !isInline() && !cb->isFlexibleBoxIncludingDeprecated()
 #if ENABLE(CSS_GRID_LAYOUT)
@@ -2514,15 +2514,15 @@
         marginStart = centeredMarginBoxStart + marginStartWidth;
         marginEnd = containerWidth - childWidth - marginStart + marginEndWidth;
         return;
-    } 
-    
+    }
+
     // Case Two: The object is being pushed to the start of the containing block's available logical width.
     if (marginEndLength.isAuto() && childWidth < containerWidth) {
         marginStart = valueForLength(marginStartLength, containerWidth);
         marginEnd = containerWidth - childWidth - marginStart;
         return;
-    } 
-    
+    }
+
     // Case Three: The object is being pushed to the end of the containing block's available logical width.
     bool pushToEndFromTextAlign = !marginEndLength.isAuto() && ((!containingBlockStyle.isLeftToRightDirection() && containingBlockStyle.textAlign() == WEBKIT_LEFT)
         || (containingBlockStyle.isLeftToRightDirection() && containingBlockStyle.textAlign() == WEBKIT_RIGHT));
@@ -2530,8 +2530,8 @@
         marginEnd = valueForLength(marginEndLength, containerWidth);
         marginStart = containerWidth - childWidth - marginEnd;
         return;
-    } 
-    
+    }
+
     // Case Four: Either no auto margins, or our width is >= the container width (css2.1, 10.3.3).  In that case
     // auto margins will just turn into 0.
     marginStart = minimumValueForLength(marginStartLength, containerWidth);
@@ -2566,7 +2566,7 @@
     RenderBoxRegionInfo* containingBlockInfo = cb->renderBoxRegionInfo(clampedContainingBlockRegion);
     LayoutUnit containingBlockLogicalWidth = cb->logicalWidth();
     LayoutUnit containingBlockLogicalWidthInRegion = containingBlockInfo ? containingBlockInfo->logicalWidth() : containingBlockLogicalWidth;
-    
+
     LayoutUnit marginStartInRegion = computedValues.m_margins.m_start;
     LayoutUnit startMarginDelta = marginStartInRegion - marginStart();
     LayoutUnit logicalWidthInRegion = computedValues.m_extent;
@@ -2578,7 +2578,7 @@
     LayoutUnit logicalRightDelta = isOutOfFlowPositioned() ? logicalRightInRegion - oldLogicalRight : startMarginDelta;
 
     LayoutUnit logicalLeftOffset = 0;
-    
+
     if (!isOutOfFlowPositioned() && avoidsFloats() && cb->containsFloats()) {
         LayoutUnit startPositionDelta = cb->computeStartPositionDeltaForChildAvoidingFloats(*this, marginStartInRegion, region);
         if (cb->style().isLeftToRightDirection())
@@ -2591,7 +2591,7 @@
         logicalLeftOffset += logicalLeftDelta;
     else
         logicalLeftOffset -= (widthDelta + logicalRightDelta);
-    
+
     LayoutUnit logicalRightOffset = logicalWidth() - (logicalLeftOffset + logicalWidthInRegion);
     bool isShifted = (containingBlockInfo && containingBlockInfo->isShifted())
             || (style().isLeftToRightDirection() && logicalLeftOffset)
@@ -2655,7 +2655,7 @@
     else {
         RenderBlock* cb = containingBlock();
         bool hasPerpendicularContainingBlock = cb->isHorizontalWritingMode() != isHorizontalWritingMode();
-    
+
         if (!hasPerpendicularContainingBlock) {
             bool shouldFlipBeforeAfter = cb->style().writingMode() != style().writingMode();
             computeBlockDirectionMargins(cb,
@@ -2717,7 +2717,7 @@
         }
 
         computedValues.m_extent = heightResult;
-        
+
         if (hasPerpendicularContainingBlock) {
             bool shouldFlipBeforeAfter = shouldFlipBeforeAfterMargins(cb->style(), &style());
             computeInlineDirectionMargins(cb, containingBlockLogicalWidthForContent(), heightResult,
@@ -2728,8 +2728,8 @@
 
     // WinIE quirk: The <html> block always fills the entire canvas in quirks mode.  The <body> always fills the
     // <html> block in quirks mode.  Only apply this quirk if the block is normal flow and no height
-    // is specified. When we're printing, we also need this quirk if the body or root has a percentage 
-    // height since we don't set a height in RenderView when we're printing. So without this quirk, the 
+    // is specified. When we're printing, we also need this quirk if the body or root has a percentage
+    // height since we don't set a height in RenderView when we're printing. So without this quirk, the
     // height has nothing to be a percentage of, and it ends up being 0. That is bad.
     bool paginatedContentNeedsBaseHeight = document().printing() && h.isPercent()
         && (isRoot() || (isBody() && document().documentElement()->renderer()->style().logicalHeight().isPercent())) && !isInline();
@@ -2787,7 +2787,7 @@
 LayoutUnit RenderBox::computePercentageLogicalHeight(const Length& height) const
 {
     LayoutUnit availableHeight = -1;
-    
+
     bool skippedAutoHeightContainingBlock = false;
     RenderBlock* cb = containingBlock();
     const RenderBox* containingBlockChild = this;
@@ -2903,7 +2903,7 @@
         }
         case FitContent:
         case FillAvailable:
-        case Percent: 
+        case Percent:
         case Calculated: {
             // FIXME: containingBlockLogicalWidthForContent() is wrong if the replaced element's block-flow is perpendicular to the
             // containing block's block-flow.
@@ -2967,7 +2967,7 @@
                 LayoutUnit newHeight = block->adjustContentBoxLogicalHeightForBoxSizing(newContentHeight);
                 return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeight, newHeight));
             }
-            
+
             // FIXME: availableLogicalHeight() is wrong if the replaced element's block-flow is perpendicular to the
             // containing block's block-flow.
             // https://bugs.webkit.org/show_bug.cgi?id=46496
@@ -3155,7 +3155,7 @@
         }
         return result;
     }
-        
+
     ASSERT(containingBlock->isRenderInline() && containingBlock->isInFlowPositioned());
 
     const RenderInline* flow = toRenderInline(containingBlock);
@@ -3253,7 +3253,7 @@
     // We don't use containingBlock(), since we may be positioned by an enclosing
     // relative positioned inline.
     const RenderBoxModelObject* containerBlock = toRenderBoxModelObject(container());
-    
+
     const LayoutUnit containerLogicalWidth = containingBlockLogicalWidthForPositioned(containerBlock, region);
 
     // Use the container block's direction except when calculating the static distance
@@ -3296,7 +3296,7 @@
     // see FIXME 1
     // Calculate the static distance if needed.
     computeInlineStaticDistance(logicalLeftLength, logicalRightLength, this, containerBlock, containerLogicalWidth, region);
-    
+
     // Calculate constraint equation values for 'width' case.
     computePositionedLogicalWidthUsing(style().logicalWidth(), containerBlock, containerDirection,
                                        containerLogicalWidth, bordersPlusPadding,
@@ -3338,7 +3338,7 @@
     }
 
     computedValues.m_extent += bordersPlusPadding;
-    
+
     // Adjust logicalLeft if we need to for the flipped version of our writing mode in regions.
     // FIXME: Add support for other types of objects as containerBlock, not only RenderBlock.
     RenderFlowThread* flowThread = flowThreadContainingBlock();
@@ -3555,7 +3555,7 @@
 {
     if (!logicalTop.isAuto() || !logicalBottom.isAuto())
         return;
-    
+
     // FIXME: The static distance computation has not been patched for mixed writing modes.
     LayoutUnit staticLogicalTop = child->layer()->staticBlockPosition() - containerBlock->borderBefore();
     for (RenderElement* curr = child->parent(); curr && curr != containerBlock; curr = curr->container()) {
@@ -3655,7 +3655,7 @@
 
     // Set final height value.
     computedValues.m_extent += bordersPlusPadding;
-    
+
     // Adjust logicalTop if we need to for perpendicular writing modes in regions.
     // FIXME: Add support for other types of objects as containerBlock, not only RenderBlock.
     RenderFlowThread* flowThread = flowThreadContainingBlock();
@@ -4182,7 +4182,7 @@
     if (isTable() && nonPseudoElement()) {
         LayoutUnit right = contentWidth() + horizontalBorderAndPaddingExtent();
         LayoutUnit bottom = contentHeight() + verticalBorderAndPaddingExtent();
-        
+
         if (point.x() < 0 || point.x() > right || point.y() < 0 || point.y() > bottom) {
             if (point.x() <= right / 2)
                 return createVisiblePosition(firstPositionInOrBeforeNode(nonPseudoElement()));
@@ -4217,7 +4217,7 @@
         LayoutUnit bottom = top + renderer->contentHeight();
         LayoutUnit left = renderer->borderLeft() + renderer->paddingLeft() + (isTableRow() ? LayoutUnit() : renderer->x());
         LayoutUnit right = left + renderer->contentWidth();
-        
+
         if (point.x() <= right && point.x() >= left && point.y() <= top && point.y() >= bottom) {
             if (renderer->isTableRow())
                 return renderer->positionForPoint(point + adjustedPoint - renderer->locationOffset(), region);
@@ -4256,10 +4256,10 @@
             minDist = dist;
         }
     }
-    
+
     if (closestRenderer)
         return closestRenderer->positionForPoint(adjustedPoint - closestRenderer->locationOffset(), region);
-    
+
     return createVisiblePosition(firstPositionInOrBeforeNode(nonPseudoElement()));
 }
 
@@ -4268,7 +4268,7 @@
     // Floating objects don't shrink.  Objects that don't avoid floats don't shrink.  Marquees don't shrink.
     if ((isInline() && !isHTMLMarquee()) || !avoidsFloats() || isFloating())
         return false;
-    
+
     // Only auto width objects can possibly shrink to avoid floats.
     return style().width().isAuto();
 }
@@ -4295,12 +4295,12 @@
 {
     bool isFlipped = style().isFlippedBlocksWritingMode();
     bool isHorizontal = isHorizontalWritingMode();
-    
+
     LayoutUnit overflowMinX = borderBox.x();
     LayoutUnit overflowMaxX = borderBox.maxX();
     LayoutUnit overflowMinY = borderBox.y();
     LayoutUnit overflowMaxY = borderBox.maxY();
-    
+
     // Compute box-shadow overflow first.
     if (style().boxShadow()) {
         LayoutUnit shadowLeft;
@@ -4319,7 +4319,7 @@
     // Now compute border-image-outset overflow.
     if (style().hasBorderImageOutsets()) {
         LayoutBoxExtent borderOutsets = style().borderImageOutsets();
-        
+
         // In flipped blocks writing modes, the physical sides are inverted. For example in vertical-rl, the right
         // border is at the lower x coordinate value.
         overflowMinX = std::min(overflowMinX, borderBox.x() - ((!isFlipped || isHorizontal) ? borderOutsets.left() : borderOutsets.right()));
@@ -4348,7 +4348,7 @@
     LayoutRect childLayoutOverflowRect = child->layoutOverflowRectForPropagation(&style());
     childLayoutOverflowRect.move(delta);
     addLayoutOverflow(childLayoutOverflowRect);
-            
+
     // Add in visual overflow from the child.  Even if the child clips its overflow, it may still
     // have visual overflow of its own set from box shadows or reflections.  It is unnecessary to propagate this
     // overflow if we are clipping our own overflow.
@@ -4364,11 +4364,11 @@
     LayoutRect clientBox = flippedClientBoxRect();
     if (clientBox.contains(rect) || rect.isEmpty())
         return;
-    
+
     // For overflow clip objects, we don't want to propagate overflow into unreachable areas.
     LayoutRect overflowRect(rect);
     if (hasOverflowClip() || isRenderView()) {
-        // Overflow is in the block's coordinate space and thus is flipped for horizontal-bt and vertical-rl 
+        // Overflow is in the block's coordinate space and thus is flipped for horizontal-bt and vertical-rl
         // writing modes.  At this stage that is actually a simplification, since we can treat horizontal-tb/bt as the same
         // and vertical-lr/rl as the same.
         bool hasTopOverflow = isTopLayoutOverflowAllowed();
@@ -4382,7 +4382,7 @@
             overflowRect.shiftXEdgeTo(std::max(overflowRect.x(), clientBox.x()));
         else
             overflowRect.shiftMaxXEdgeTo(std::min(overflowRect.maxX(), clientBox.maxX()));
-        
+
         // Now re-test with the adjusted rectangle and see if it has become unreachable or fully
         // contained.
         if (clientBox.contains(overflowRect) || overflowRect.isEmpty())
@@ -4391,7 +4391,7 @@
 
     if (!m_overflow)
         m_overflow = adoptRef(new RenderOverflow(clientBox, borderBoxRect()));
-    
+
     m_overflow->addLayoutOverflow(overflowRect);
 }
 
@@ -4400,10 +4400,10 @@
     LayoutRect borderBox = borderBoxRect();
     if (borderBox.contains(rect) || rect.isEmpty())
         return;
-        
+
     if (!m_overflow)
         m_overflow = adoptRef(new RenderOverflow(flippedClientBoxRect(), borderBox));
-    
+
     m_overflow->addVisualOverflow(rect);
 }
 
@@ -4470,7 +4470,7 @@
     bool isHorizontal = isHorizontalWritingMode();
     if ((isHorizontal && !scrollsOverflowY()) || (!isHorizontal && !scrollsOverflowX()))
         return false;
-    
+
     // We do have overflow. We'll still be willing to paginate as long as the block
     // has auto logical height, auto or undefined max-logical-height and a zero or auto min-logical-height.
     // Note this is just a heuristic, and it's still possible to have overflow under these
@@ -4528,12 +4528,12 @@
 
 LayoutRect RenderBox::visualOverflowRectForPropagation(RenderStyle* parentStyle) const
 {
-    // If the writing modes of the child and parent match, then we don't have to 
+    // If the writing modes of the child and parent match, then we don't have to
     // do anything fancy. Just return the result.
     LayoutRect rect = visualOverflowRect();
     if (parentStyle->writingMode() == style().writingMode())
         return rect;
-    
+
     // We are putting ourselves into our parent's coordinate space.  If there is a flipped block mismatch
     // in a particular axis, then we have to flip the rect along that axis.
     if (style().writingMode() == RightToLeftWritingMode || parentStyle->writingMode() == RightToLeftWritingMode)
@@ -4569,22 +4569,22 @@
         // this rectangle into physical coordinates, apply relative positioning and transforms
         // to it, and then convert it back.
         flipForWritingMode(rect);
-        
+
         if (hasTransform)
             rect = layer()->currentTransform().mapRect(rect);
 
         if (isInFlowPositioned())
             rect.move(offsetForInFlowPosition());
-        
+
         // Now we need to flip back.
         flipForWritingMode(rect);
     }
-    
-    // If the writing modes of the child and parent match, then we don't have to 
+
+    // If the writing modes of the child and parent match, then we don't have to
     // do anything fancy. Just return the result.
     if (parentStyle->writingMode() == style().writingMode())
         return rect;
-    
+
     // We are putting ourselves into our parent's coordinate space.  If there is a flipped block mismatch
     // in a particular axis, then we have to flip the rect along that axis.
     if (style().writingMode() == RightToLeftWritingMode || parentStyle->writingMode() == RightToLeftWritingMode)
@@ -4618,7 +4618,7 @@
 LayoutRect RenderBox::overflowRectForPaintRejection(RenderNamedFlowFragment* namedFlowFragment) const
 {
     LayoutRect overflowRect = visualOverflowRect();
-    
+
     // When using regions, some boxes might have their frame rect relative to the flow thread, which could
     // cause the paint rejection algorithm to prevent them from painting when using different width regions.
     // e.g. an absolutely positioned box with bottom:0px and right:0px would have it's frameRect.x relative
@@ -4630,7 +4630,7 @@
         if (flowThread->getRegionRangeForBox(this, startRegion, endRegion))
             overflowRect.unite(namedFlowFragment->visualOverflowRectForBox(this));
     }
-    
+
     if (!m_overflow || !usesCompositedScrolling())
         return overflowRect;
 
@@ -4653,7 +4653,7 @@
 {
     if (!style().isFlippedBlocksWritingMode())
         return point;
-    
+
     // The child is going to add in its x() and y(), so we have to make sure it ends up in
     // the right place.
     if (isHorizontalWritingMode())
@@ -4724,7 +4724,7 @@
     RenderBlock* containerBlock = containingBlock();
     if (!containerBlock || containerBlock == this)
         return locationOffset();
-    
+
     LayoutRect rect(frameRect());
     containerBlock->flipForWritingMode(rect); // FIXME: This is wrong if we are an absolutely positioned object enclosed by a relative-positioned inline.
     return LayoutSize(rect.x(), rect.y());

Modified: branches/safari-600.8-branch/Source/WebCore/rendering/RenderBox.h (186610 => 186611)


--- branches/safari-600.8-branch/Source/WebCore/rendering/RenderBox.h	2015-07-09 21:01:46 UTC (rev 186610)
+++ branches/safari-600.8-branch/Source/WebCore/rendering/RenderBox.h	2015-07-09 21:01:50 UTC (rev 186611)
@@ -516,8 +516,6 @@
 
     virtual VisiblePosition positionForPoint(const LayoutPoint&, const RenderRegion*) override;
 
-    RenderBlockFlow* outermostBlockContainingFloatingObject();
-
     void removeFloatingOrPositionedChildFromBlockLists();
     
     RenderLayer* enclosingFloatPaintingLayer() const;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to