<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[186611] branches/safari-600.8-branch</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/186611">186611</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2015-07-09 14:01:50 -0700 (Thu, 09 Jul 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/186503">r186503</a>. rdar://problem/21707907</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6008branchLayoutTestsChangeLog">branches/safari-600.8-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari6008branchSourceWebCoreChangeLog">branches/safari-600.8-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari6008branchSourceWebCorerenderingRenderBlockFlowcpp">branches/safari-600.8-branch/Source/WebCore/rendering/RenderBlockFlow.cpp</a></li>
<li><a href="#branchessafari6008branchSourceWebCorerenderingRenderBoxcpp">branches/safari-600.8-branch/Source/WebCore/rendering/RenderBox.cpp</a></li>
<li><a href="#branchessafari6008branchSourceWebCorerenderingRenderBoxh">branches/safari-600.8-branch/Source/WebCore/rendering/RenderBox.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari6008branchLayoutTestsfastblockfloatcrashwhenfloatingobjectisremovedexpectedtxt">branches/safari-600.8-branch/LayoutTests/fast/block/float/crash-when-floating-object-is-removed-expected.txt</a></li>
<li><a href="#branchessafari6008branchLayoutTestsfastblockfloatcrashwhenfloatingobjectisremovedxhtml">branches/safari-600.8-branch/LayoutTests/fast/block/float/crash-when-floating-object-is-removed.xhtml</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6008branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.8-branch/LayoutTests/ChangeLog (186610 => 186611)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,5 +1,37 @@
</span><span class="cx"> 2015-07-09 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><ins>+ Merge r186503. rdar://problem/21707907
+
+ 2015-07-07 Matthew Hanson <matthew_hanson@apple.com>
+
+ Merge r184885. rdar://problem/21708260
+
+ 2015-05-26 Zalan Bujtas <zalan@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_hanson@apple.com>
+
</ins><span class="cx"> Merge r186502. rdar://problem/21707910
</span><span class="cx">
</span><span class="cx"> 2015-07-07 Matthew Hanson <matthew_hanson@apple.com>
</span></span></pre></div>
<a id="branchessafari6008branchLayoutTestsfastblockfloatcrashwhenfloatingobjectisremovedexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-600.8-branch/LayoutTests/fast/block/float/crash-when-floating-object-is-removed-expected.txt (0 => 186611)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+ PASS if no crash or ASSERT in debug.
</ins></span></pre></div>
<a id="branchessafari6008branchLayoutTestsfastblockfloatcrashwhenfloatingobjectisremovedxhtml"></a>
<div class="addfile"><h4>Added: branches/safari-600.8-branch/LayoutTests/fast/block/float/crash-when-floating-object-is-removed.xhtml (0 => 186611)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+<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>
</ins></span></pre></div>
<a id="branchessafari6008branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.8-branch/Source/WebCore/ChangeLog (186610 => 186611)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,5 +1,44 @@
</span><span class="cx"> 2015-07-09 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><ins>+ Merge r186503. rdar://problem/21707907
+
+ 2015-07-07 Matthew Hanson <matthew_hanson@apple.com>
+
+ Merge r184885. rdar://problem/21708260
+
+ 2015-05-26 Zalan Bujtas <zalan@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_hanson@apple.com>
+
</ins><span class="cx"> Merge r186502. rdar://problem/21707910
</span><span class="cx">
</span><span class="cx"> 2015-07-07 Matthew Hanson <matthew_hanson@apple.com>
</span></span></pre></div>
<a id="branchessafari6008branchSourceWebCorerenderingRenderBlockFlowcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.8-branch/Source/WebCore/rendering/RenderBlockFlow.cpp (186610 => 186611)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx"> // with it. We also don't collapse if we have any bottom border/padding.
</span><span class="cx"> m_canCollapseMarginAfterWithChildren = m_canCollapseWithChildren && !afterBorderPadding
</span><span class="cx"> && (blockStyle.logicalHeight().isAuto() && !blockStyle.logicalHeight().value()) && blockStyle.marginAfterCollapse() != MSEPARATE;
</span><del>-
</del><ins>+
</ins><span class="cx"> m_quirkContainer = block.isTableCell() || block.isBody();
</span><span class="cx">
</span><span class="cx"> m_discardMargin = m_canCollapseMarginBeforeWithChildren && block.mustDiscardMarginBefore();
</span><span class="lines">@@ -224,7 +224,7 @@
</span><span class="cx"> m_floatingObjects->clear();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- // We should not process floats if the parent node is not a RenderBlock. Otherwise, we will add
</del><ins>+ // We should not process floats if the parent node is not a RenderBlock. Otherwise, we will add
</ins><span class="cx"> // floats in an invalid context. This will cause a crash arising from a bad cast on the parent.
</span><span class="cx"> // See <rdar://problem/8049753>, where float property is applied on a text node in a SVG.
</span><span class="cx"> if (!parent() || !parent()->isRenderBlockFlow())
</span><span class="lines">@@ -247,7 +247,7 @@
</span><span class="cx"> LayoutUnit logicalTopOffset = logicalTop();
</span><span class="cx"> if (parentHasFloats || (parentBlock->lowestFloatLogicalBottom() > logicalTopOffset && prev && toRenderBlockFlow(prev)->isSelfCollapsingBlock()))
</span><span class="cx"> addIntrudingFloats(parentBlock, parentBlock->logicalLeftOffsetForContent(), logicalTopOffset);
</span><del>-
</del><ins>+
</ins><span class="cx"> LayoutUnit logicalLeftOffset = 0;
</span><span class="cx"> if (prev)
</span><span class="cx"> logicalTopOffset -= toRenderBox(prev)->logicalTop();
</span><span class="lines">@@ -256,7 +256,7 @@
</span><span class="cx"> logicalLeftOffset += parentBlock->logicalLeftOffsetForContent();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- // Add overhanging floats from the previous RenderBlock, but only if it has a float that intrudes into our space.
</del><ins>+ // Add overhanging floats from the previous RenderBlock, but only if it has a float that intrudes into our space.
</ins><span class="cx"> RenderBlockFlow* block = toRenderBlockFlow(prev);
</span><span class="cx"> if (block->m_floatingObjects && block->lowestFloatLogicalBottom() > logicalTopOffset)
</span><span class="cx"> addIntrudingFloats(block, logicalLeftOffset, logicalTopOffset);
</span><span class="lines">@@ -386,7 +386,7 @@
</span><span class="cx">
</span><span class="cx"> LayoutUnit oldColumnWidth = computedColumnWidth();
</span><span class="cx"> computeColumnCountAndWidth();
</span><del>-
</del><ins>+
</ins><span class="cx"> return changed || oldColumnWidth != computedColumnWidth();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -398,18 +398,18 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void RenderBlockFlow::computeColumnCountAndWidth()
</span><del>-{
</del><ins>+{
</ins><span class="cx"> // Calculate our column width and column count.
</span><span class="cx"> // FIXME: Can overflow on fast/block/float/float-not-removed-from-next-sibling4.html, see https://bugs.webkit.org/show_bug.cgi?id=68744
</span><span class="cx"> unsigned desiredColumnCount = 1;
</span><span class="cx"> LayoutUnit desiredColumnWidth = contentLogicalWidth();
</span><del>-
</del><ins>+
</ins><span class="cx"> // For now, we don't support multi-column layouts when printing, since we have to do a lot of work for proper pagination.
</span><span class="cx"> if (document().paginated() || (style().hasAutoColumnCount() && style().hasAutoColumnWidth()) || !style().hasInlineColumnAxis()) {
</span><span class="cx"> setComputedColumnCountAndWidth(desiredColumnCount, desiredColumnWidth);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> LayoutUnit availWidth = desiredColumnWidth;
</span><span class="cx"> LayoutUnit colGap = columnGap();
</span><span class="cx"> LayoutUnit colWidth = std::max<LayoutUnit>(LayoutUnit::fromPixel(1), LayoutUnit(style().columnWidth()));
</span><span class="lines">@@ -470,7 +470,7 @@
</span><span class="cx"> bool isCell = isTableCell();
</span><span class="cx"> if (!isCell) {
</span><span class="cx"> initMaxMarginValues();
</span><del>-
</del><ins>+
</ins><span class="cx"> setHasMarginBeforeQuirk(styleToUse.hasMarginBeforeQuirk());
</span><span class="cx"> setHasMarginAfterQuirk(styleToUse.hasMarginAfterQuirk());
</span><span class="cx"> setPaginationStrut(0);
</span><span class="lines">@@ -490,7 +490,7 @@
</span><span class="cx"> LayoutUnit toAdd = borderAndPaddingAfter() + scrollbarLogicalHeight();
</span><span class="cx"> if (lowestFloatLogicalBottom() > (logicalHeight() - toAdd) && expandsToEncloseOverhangingFloats())
</span><span class="cx"> setLogicalHeight(lowestFloatLogicalBottom() + toAdd);
</span><del>-
</del><ins>+
</ins><span class="cx"> if (relayoutForPagination(statePusher) || relayoutToAvoidWidows(statePusher)) {
</span><span class="cx"> ASSERT(!shouldBreakAtLineToAvoidWidow());
</span><span class="cx"> return;
</span><span class="lines">@@ -527,7 +527,7 @@
</span><span class="cx">
</span><span class="cx"> // Add overflow from children (unless we're multi-column, since in that case all our child overflow is clipped anyway).
</span><span class="cx"> computeOverflow(oldClientAfterEdge);
</span><del>-
</del><ins>+
</ins><span class="cx"> statePusher.pop();
</span><span class="cx">
</span><span class="cx"> fitBorderToLinesIfNeeded();
</span><span class="lines">@@ -556,7 +556,7 @@
</span><span class="cx"> repaintLogicalLeft = std::min(repaintLogicalLeft, logicalLeftLayoutOverflow());
</span><span class="cx"> repaintLogicalRight = std::max(repaintLogicalRight, logicalRightLayoutOverflow());
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> LayoutRect repaintRect;
</span><span class="cx"> if (isHorizontalWritingMode())
</span><span class="cx"> repaintRect = LayoutRect(repaintLogicalLeft, repaintLogicalTop, repaintLogicalRight - repaintLogicalLeft, repaintLogicalBottom - repaintLogicalTop);
</span><span class="lines">@@ -564,7 +564,7 @@
</span><span class="cx"> repaintRect = LayoutRect(repaintLogicalTop, repaintLogicalLeft, repaintLogicalBottom - repaintLogicalTop, repaintLogicalRight - repaintLogicalLeft);
</span><span class="cx">
</span><span class="cx"> repaintRect.inflate(maximalOutlineSize(PaintPhaseOutline));
</span><del>-
</del><ins>+
</ins><span class="cx"> if (hasOverflowClip()) {
</span><span class="cx"> // Adjust repaint rect for scroll offset
</span><span class="cx"> repaintRect.move(-scrolledContentOffset());
</span><span class="lines">@@ -592,7 +592,7 @@
</span><span class="cx"> LayoutUnit afterEdge = borderAndPaddingAfter() + scrollbarLogicalHeight();
</span><span class="cx">
</span><span class="cx"> setLogicalHeight(beforeEdge);
</span><del>-
</del><ins>+
</ins><span class="cx"> // Lay out our hypothetical grid line as though it occurs at the top of the block.
</span><span class="cx"> if (view().layoutState()->lineGrid() == this)
</span><span class="cx"> layoutLineGridBox();
</span><span class="lines">@@ -633,7 +633,7 @@
</span><span class="cx"> // Lay out the child.
</span><span class="cx"> layoutBlockChild(child, marginInfo, previousFloatLogicalBottom, maxFloatLogicalBottom);
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> // Now do the handling of the bottom of the block, adding in our bottom border/padding and
</span><span class="cx"> // determining the correct collapsed bottom margin information.
</span><span class="cx"> handleAfterSideOfBlock(beforeEdge, afterEdge, marginInfo);
</span><span class="lines">@@ -722,7 +722,7 @@
</span><span class="cx">
</span><span class="cx"> // Now check for clear.
</span><span class="cx"> LayoutUnit logicalTopAfterClear = clearFloatsIfNeeded(child, marginInfo, oldPosMarginBefore, oldNegMarginBefore, logicalTopBeforeClear);
</span><del>-
</del><ins>+
</ins><span class="cx"> bool paginated = view().layoutState()->isPaginated();
</span><span class="cx"> if (paginated)
</span><span class="cx"> logicalTopAfterClear = adjustBlockChildForPagination(logicalTopAfterClear, estimateWithoutPagination, child, atBeforeSideOfBlock && logicalTopBeforeClear == logicalTopAfterClear);
</span><span class="lines">@@ -740,7 +740,7 @@
</span><span class="cx"> // So go ahead and mark the item as dirty.
</span><span class="cx"> child.setChildNeedsLayout(MarkOnlyThis);
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> if (childBlockFlow) {
</span><span class="cx"> if (!child.avoidsFloats() && childBlockFlow->containsFloats())
</span><span class="cx"> childBlockFlow->markAllDescendantsWithFloatsForLayout();
</span><span class="lines">@@ -754,7 +754,7 @@
</span><span class="cx"> // In case our guess was wrong, relayout the child.
</span><span class="cx"> child.layoutIfNeeded();
</span><span class="cx">
</span><del>- // We are no longer at the top of the block if we encounter a non-empty child.
</del><ins>+ // We are no longer at the top of the block if we encounter a non-empty child.
</ins><span class="cx"> // This has to be done after checking for clear, so that margins can be reset if a clear occurred.
</span><span class="cx"> if (marginInfo.atBeforeSideOfBlock() && !child.isSelfCollapsingBlock())
</span><span class="cx"> marginInfo.setAtBeforeSideOfBlock(false);
</span><span class="lines">@@ -805,7 +805,7 @@
</span><span class="cx"> {
</span><span class="cx"> bool isHorizontal = isHorizontalWritingMode();
</span><span class="cx"> bool hasStaticBlockPosition = child.style().hasStaticBlockPosition(isHorizontal);
</span><del>-
</del><ins>+
</ins><span class="cx"> LayoutUnit logicalTop = logicalHeight();
</span><span class="cx"> updateStaticInlinePositionForChild(child, logicalTop);
</span><span class="cx">
</span><span class="lines">@@ -816,7 +816,7 @@
</span><span class="cx"> LayoutUnit collapsedBeforeNeg = marginInfo.negativeMargin();
</span><span class="cx"> logicalTop += collapsedBeforePos - collapsedBeforeNeg;
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> RenderLayer* childLayer = child.layer();
</span><span class="cx"> if (childLayer->staticBlockPosition() != logicalTop) {
</span><span class="cx"> childLayer->setStaticBlockPosition(logicalTop);
</span><span class="lines">@@ -844,7 +844,7 @@
</span><span class="cx"> // Add in our start margin.
</span><span class="cx"> LayoutUnit childMarginStart = marginStartForChild(child);
</span><span class="cx"> LayoutUnit newPosition = startPosition + childMarginStart;
</span><del>-
</del><ins>+
</ins><span class="cx"> // Some objects (e.g., tables, horizontal rules, overflow:auto blocks) avoid floats. They need
</span><span class="cx"> // to shift over as necessary to dodge any floats that might get in the way.
</span><span class="cx"> if (child.avoidsFloats() && containsFloats() && !flowThreadContainingBlock())
</span><span class="lines">@@ -902,7 +902,7 @@
</span><span class="cx"> LayoutUnit afterMargin = 0;
</span><span class="cx">
</span><span class="cx"> RenderBlockFlow* childRenderBlock = child.isRenderBlockFlow() ? toRenderBlockFlow(&child) : nullptr;
</span><del>-
</del><ins>+
</ins><span class="cx"> // If the child has the same directionality as we do, then we can just return its
</span><span class="cx"> // margins in the same direction.
</span><span class="cx"> if (!child.isWritingModeRoot()) {
</span><span class="lines">@@ -973,7 +973,7 @@
</span><span class="cx"> posTop = std::max(posTop, childMargins.positiveMarginAfter());
</span><span class="cx"> negTop = std::max(negTop, childMargins.negativeMarginAfter());
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> // See if the top margin is quirky. We only care if this child has
</span><span class="cx"> // margins that will collapse with us.
</span><span class="cx"> bool topQuirk = hasMarginBeforeQuirk(child);
</span><span class="lines">@@ -1007,7 +1007,7 @@
</span><span class="cx"> setMustDiscardMarginBefore();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- // Once we find a child with discardMarginBefore all the margins collapsing with us must also discard.
</del><ins>+ // Once we find a child with discardMarginBefore all the margins collapsing with us must also discard.
</ins><span class="cx"> if (childDiscardMarginBefore) {
</span><span class="cx"> marginInfo.setDiscardMargin(true);
</span><span class="cx"> marginInfo.clearMargin();
</span><span class="lines">@@ -1022,7 +1022,7 @@
</span><span class="cx"> LayoutUnit clearanceForSelfCollapsingBlock;
</span><span class="cx"> RenderObject* prev = child.previousSibling();
</span><span class="cx"> // 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
</span><del>- // 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
</del><ins>+ // 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
</ins><span class="cx"> // 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.
</span><span class="cx"> if (!marginInfo.canCollapseWithMarginBefore() && prev && prev->isRenderBlockFlow() && toRenderBlockFlow(prev)->isSelfCollapsingBlock()) {
</span><span class="cx"> clearanceForSelfCollapsingBlock = toRenderBlockFlow(prev)->marginOffsetForSelfCollapsingBlock();
</span><span class="lines">@@ -1039,9 +1039,9 @@
</span><span class="cx"> LayoutUnit collapsedBeforePos = std::max(marginInfo.positiveMargin(), childMargins.positiveMarginBefore());
</span><span class="cx"> LayoutUnit collapsedBeforeNeg = std::max(marginInfo.negativeMargin(), childMargins.negativeMarginBefore());
</span><span class="cx"> marginInfo.setMargin(collapsedBeforePos, collapsedBeforeNeg);
</span><del>-
</del><ins>+
</ins><span class="cx"> // Now collapse the child's margins together, which means examining our
</span><del>- // bottom margin values as well.
</del><ins>+ // bottom margin values as well.
</ins><span class="cx"> marginInfo.setPositiveMarginIfLarger(childMargins.positiveMarginAfter());
</span><span class="cx"> marginInfo.setNegativeMarginIfLarger(childMargins.negativeMarginAfter());
</span><span class="cx">
</span><span class="lines">@@ -1071,7 +1071,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> marginInfo.setDiscardMargin(childDiscardMarginAfter);
</span><del>-
</del><ins>+
</ins><span class="cx"> if (!marginInfo.discardMargin()) {
</span><span class="cx"> marginInfo.setPositiveMargin(childMargins.positiveMarginAfter());
</span><span class="cx"> marginInfo.setNegativeMargin(childMargins.negativeMarginAfter());
</span><span class="lines">@@ -1081,7 +1081,7 @@
</span><span class="cx"> if (marginInfo.margin())
</span><span class="cx"> marginInfo.setHasMarginAfterQuirk(hasMarginAfterQuirk(child));
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> // If margins would pull us past the top of the next page, then we need to pull back and pretend like the margins
</span><span class="cx"> // collapsed into the page edge.
</span><span class="cx"> LayoutState* layoutState = view().layoutState();
</span><span class="lines">@@ -1135,7 +1135,7 @@
</span><span class="cx"> marginInfo.setDiscardMargin(childDiscardMargin);
</span><span class="cx">
</span><span class="cx"> // CSS2.1 states:
</span><del>- // "If the top and bottom margins of an element with clearance are adjoining, its margins collapse with
</del><ins>+ // "If the top and bottom margins of an element with clearance are adjoining, its margins collapse with
</ins><span class="cx"> // the adjoining margins of following siblings but that resulting margin does not collapse with the bottom margin of the parent block."
</span><span class="cx"> // So the parent's bottom margin cannot collapse through this block or any subsequent self-collapsing blocks. Check subsequent siblings
</span><span class="cx"> // for a block with height - if none is found then don't allow the margins to collapse with the parent.
</span><span class="lines">@@ -1149,7 +1149,7 @@
</span><span class="cx">
</span><span class="cx"> // 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
</span><span class="cx"> // its own at the correct vertical position. If subsequent siblings attempt to collapse with |child|'s margins in |collapseMargins| we will
</span><del>- // 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
</del><ins>+ // 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
</ins><span class="cx"> // margins can collapse at the correct vertical position.
</span><span class="cx"> // 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
</span><span class="cx"> // (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],
</span><span class="lines">@@ -1158,7 +1158,7 @@
</span><span class="cx"> } else
</span><span class="cx"> // Increase our height by the amount we had to clear.
</span><span class="cx"> setLogicalHeight(logicalHeight() + heightIncrease);
</span><del>-
</del><ins>+
</ins><span class="cx"> if (marginInfo.canCollapseWithMarginBefore()) {
</span><span class="cx"> // We can no longer collapse with the top of the block since a clear
</span><span class="cx"> // occurred. The empty blocks collapse into the cleared block.
</span><span class="lines">@@ -1198,7 +1198,7 @@
</span><span class="cx">
</span><span class="cx"> if (!child.isRenderBlockFlow())
</span><span class="cx"> return;
</span><del>-
</del><ins>+
</ins><span class="cx"> RenderBlockFlow& childBlock = toRenderBlockFlow(child);
</span><span class="cx"> if (childBlock.childrenInline() || childBlock.isWritingModeRoot())
</span><span class="cx"> return;
</span><span class="lines">@@ -1212,7 +1212,7 @@
</span><span class="cx"> if (!grandchildBox->isFloatingOrOutOfFlowPositioned())
</span><span class="cx"> break;
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> // Give up if there is clearance on the box, since it probably won't collapse into us.
</span><span class="cx"> if (!grandchildBox || grandchildBox->style().clear() != CNONE)
</span><span class="cx"> return;
</span><span class="lines">@@ -1265,16 +1265,16 @@
</span><span class="cx"> logicalTopEstimate = std::min(logicalTopEstimate, nextPageLogicalTop(logicalHeight()));
</span><span class="cx">
</span><span class="cx"> logicalTopEstimate += getClearDelta(child, logicalTopEstimate);
</span><del>-
</del><ins>+
</ins><span class="cx"> estimateWithoutPagination = logicalTopEstimate;
</span><span class="cx">
</span><span class="cx"> if (layoutState->isPaginated()) {
</span><span class="cx"> // If the object has a page or column break value of "before", then we should shift to the top of the next page.
</span><span class="cx"> logicalTopEstimate = applyBeforeBreak(child, logicalTopEstimate);
</span><del>-
</del><ins>+
</ins><span class="cx"> // For replaced elements and scrolled elements, we want to shift them to the next page if they don't fit on the current one.
</span><span class="cx"> logicalTopEstimate = adjustForUnsplittableChild(child, logicalTopEstimate);
</span><del>-
</del><ins>+
</ins><span class="cx"> if (!child.selfNeedsLayout() && child.isRenderBlock())
</span><span class="cx"> logicalTopEstimate += toRenderBlock(child).paginationStrut();
</span><span class="cx"> }
</span><span class="lines">@@ -1322,7 +1322,7 @@
</span><span class="cx"> if (!marginInfo.discardMargin() && (!marginInfo.canCollapseWithMarginAfter() && !marginInfo.canCollapseWithMarginBefore()
</span><span class="cx"> && (!document().inQuirksMode() || !marginInfo.quirkContainer() || !marginInfo.hasMarginAfterQuirk())))
</span><span class="cx"> setLogicalHeight(logicalHeight() + marginInfo.margin());
</span><del>-
</del><ins>+
</ins><span class="cx"> // Now add in our bottom border/padding.
</span><span class="cx"> setLogicalHeight(logicalHeight() + afterSide);
</span><span class="cx">
</span><span class="lines">@@ -1538,7 +1538,7 @@
</span><span class="cx"> // So go ahead and mark the item as dirty.
</span><span class="cx"> child.setChildNeedsLayout(MarkOnlyThis);
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> if (childRenderBlock) {
</span><span class="cx"> if (!child.avoidsFloats() && childRenderBlock->containsFloats())
</span><span class="cx"> toRenderBlockFlow(childRenderBlock)->markAllDescendantsWithFloatsForLayout();
</span><span class="lines">@@ -1572,7 +1572,7 @@
</span><span class="cx"> // For replaced elements and scrolled elements, we want to shift them to the next page if they don't fit on the current one.
</span><span class="cx"> LayoutUnit logicalTopBeforeUnsplittableAdjustment = result;
</span><span class="cx"> LayoutUnit logicalTopAfterUnsplittableAdjustment = adjustForUnsplittableChild(child, result);
</span><del>-
</del><ins>+
</ins><span class="cx"> LayoutUnit paginationStrut = 0;
</span><span class="cx"> LayoutUnit unsplittableAdjustmentDelta = logicalTopAfterUnsplittableAdjustment - logicalTopBeforeUnsplittableAdjustment;
</span><span class="cx"> if (unsplittableAdjustmentDelta)
</span><span class="lines">@@ -1596,7 +1596,7 @@
</span><span class="cx">
</span><span class="cx"> // Similar to how we apply clearance. Go ahead and boost height() to be the place where we're going to position the child.
</span><span class="cx"> setLogicalHeight(logicalHeight() + (result - oldTop));
</span><del>-
</del><ins>+
</ins><span class="cx"> // Return the final adjusted logical top.
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="lines">@@ -1690,7 +1690,7 @@
</span><span class="cx"> return; // Give up. We're genuinely too big even after excluding blank space and overflow.
</span><span class="cx"> pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset);
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset, ExcludePageBoundary);
</span><span class="cx"> overflowsRegion = (lineHeight > remainingLogicalHeight);
</span><span class="cx">
</span><span class="lines">@@ -1856,7 +1856,7 @@
</span><span class="cx"> LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset);
</span><span class="cx"> if (!pageLogicalHeight)
</span><span class="cx"> return logicalOffset;
</span><del>-
</del><ins>+
</ins><span class="cx"> // The logicalOffset is in our coordinate space. We can add in our pushed offset.
</span><span class="cx"> LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset);
</span><span class="cx"> if (pageBoundaryRule == ExcludePageBoundary)
</span><span class="lines">@@ -1889,7 +1889,7 @@
</span><span class="cx"> LayoutUnit pageLogicalHeight = view().layoutState()->m_pageLogicalHeight;
</span><span class="cx"> if (!pageLogicalHeight)
</span><span class="cx"> return 0;
</span><del>-
</del><ins>+
</ins><span class="cx"> // Now check for a flow thread.
</span><span class="cx"> RenderFlowThread* flowThread = flowThreadContainingBlock();
</span><span class="cx"> if (!flowThread)
</span><span class="lines">@@ -1900,7 +1900,7 @@
</span><span class="cx"> LayoutUnit RenderBlockFlow::pageRemainingLogicalHeightForOffset(LayoutUnit offset, PageBoundaryRule pageBoundaryRule) const
</span><span class="cx"> {
</span><span class="cx"> offset += offsetFromLogicalTopOfFirstPage();
</span><del>-
</del><ins>+
</ins><span class="cx"> RenderFlowThread* flowThread = flowThreadContainingBlock();
</span><span class="cx"> if (!flowThread) {
</span><span class="cx"> LayoutUnit pageLogicalHeight = view().layoutState()->m_pageLogicalHeight;
</span><span class="lines">@@ -1912,14 +1912,14 @@
</span><span class="cx"> }
</span><span class="cx"> return remainingHeight;
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> return flowThread->pageRemainingLogicalHeightForOffset(offset, pageBoundaryRule);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> LayoutUnit RenderBlockFlow::logicalHeightForChildForFragmentation(const RenderBox& child) const
</span><span class="cx"> {
</span><span class="cx"> // This method is required because regions do not fragment monolithic elements but instead
</span><del>- // they let them overflow the region they flow in. This behaviour is different from the
</del><ins>+ // they let them overflow the region they flow in. This behaviour is different from the
</ins><span class="cx"> // multicol/printing implementations, which have not yet been updated to correctly handle
</span><span class="cx"> // monolithic elements.
</span><span class="cx"> // As a result, for the moment, this method will only be used for regions, the multicol and
</span><span class="lines">@@ -1941,7 +1941,7 @@
</span><span class="cx"> LayoutUnit childLogicalTop = logicalTopForChild(child);
</span><span class="cx"> if (!hasNextPage(childLogicalTop))
</span><span class="cx"> return logicalHeightForChild(child);
</span><del>-
</del><ins>+
</ins><span class="cx"> LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(childLogicalTop, ExcludePageBoundary);
</span><span class="cx"> return std::min(child.logicalHeight(), remainingLogicalHeight);
</span><span class="cx"> }
</span><span class="lines">@@ -1952,7 +1952,7 @@
</span><span class="cx"> setLineGridBox(0);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> setLineGridBox(0);
</span><span class="cx">
</span><span class="cx"> auto lineGridBox = std::make_unique<RootInlineBox>(*this);
</span><span class="lines">@@ -1961,7 +1961,7 @@
</span><span class="cx"> GlyphOverflowAndFallbackFontsMap textBoxDataMap;
</span><span class="cx"> VerticalPositionCache verticalPositionCache;
</span><span class="cx"> lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, verticalPositionCache);
</span><del>-
</del><ins>+
</ins><span class="cx"> setLineGridBox(WTF::move(lineGridBox));
</span><span class="cx">
</span><span class="cx"> // FIXME: If any of the characteristics of the box change compared to the old one, then we need to do a deep dirtying
</span><span class="lines">@@ -1977,7 +1977,7 @@
</span><span class="cx"> void RenderBlockFlow::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
</span><span class="cx"> {
</span><span class="cx"> RenderBlock::styleDidChange(diff, oldStyle);
</span><del>-
</del><ins>+
</ins><span class="cx"> // After our style changed, if we lose our ability to propagate floats into next sibling
</span><span class="cx"> // blocks, then we need to find the top most parent containing that overhanging float and
</span><span class="cx"> // then mark its descendants with floats for layout and clear all floats from its next
</span><span class="lines">@@ -2032,7 +2032,7 @@
</span><span class="cx"> if (oldStyle) {
</span><span class="cx"> EPosition oldPosition = oldStyle->position();
</span><span class="cx"> EPosition newPosition = newStyle.position();
</span><del>-
</del><ins>+
</ins><span class="cx"> if (parent() && diff == StyleDifferenceLayout && oldPosition != newPosition) {
</span><span class="cx"> if (containsFloats() && !isFloating() && !isOutOfFlowPositioned() && newStyle.hasOutOfFlowPosition())
</span><span class="cx"> markAllDescendantsWithFloatsForLayout();
</span><span class="lines">@@ -2160,7 +2160,7 @@
</span><span class="cx"> void RenderBlockFlow::paintColumnRules(PaintInfo& paintInfo, const LayoutPoint& point)
</span><span class="cx"> {
</span><span class="cx"> RenderBlock::paintColumnRules(paintInfo, point);
</span><del>-
</del><ins>+
</ins><span class="cx"> if (!multiColumnFlowThread() || paintInfo.context->paintingDisabled())
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -2251,13 +2251,13 @@
</span><span class="cx"> // Create the special floatingObject entry & append it to the list
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<FloatingObject> floatingObject = FloatingObject::create(floatBox);
</span><del>-
</del><ins>+
</ins><span class="cx"> // Our location is irrelevant if we're unsplittable or no pagination is in effect.
</span><span class="cx"> // Just go ahead and lay out the float.
</span><span class="cx"> bool isChildRenderBlock = floatBox.isRenderBlock();
</span><span class="cx"> if (isChildRenderBlock && !floatBox.needsLayout() && view().layoutState()->pageLogicalHeightChanged())
</span><span class="cx"> floatBox.setChildNeedsLayout(MarkOnlyThis);
</span><del>-
</del><ins>+
</ins><span class="cx"> bool needsBlockDirectionLocationSetBeforeLayout = isChildRenderBlock && view().layoutState()->needsBlockDirectionLocationSetBeforeLayout();
</span><span class="cx"> if (!needsBlockDirectionLocationSetBeforeLayout || isWritingModeRoot()) // We are unsplittable if we're a block flow root.
</span><span class="cx"> floatBox.layoutIfNeeded();
</span><span class="lines">@@ -2312,7 +2312,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (!containsFloats())
</span><span class="cx"> return;
</span><del>-
</del><ins>+
</ins><span class="cx"> const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
</span><span class="cx"> FloatingObject* curr = floatingObjectSet.last().get();
</span><span class="cx"> while (curr != lastFloat && (!curr->isPlaced() || logicalTopForFloat(curr) >= logicalOffset)) {
</span><span class="lines">@@ -2385,7 +2385,7 @@
</span><span class="cx"> // fast/block/float/clamped-right-float.html.
</span><span class="cx"> floatLogicalLeft -= logicalWidthForFloat(floatingObject);
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> return LayoutPoint(floatLogicalLeft, logicalTopOffset);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2419,7 +2419,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> LayoutUnit logicalTop = logicalHeight();
</span><del>-
</del><ins>+
</ins><span class="cx"> // The float cannot start above the top position of the last positioned float.
</span><span class="cx"> if (lastPlacedFloatingObject)
</span><span class="cx"> logicalTop = std::max(logicalTopForFloat(lastPlacedFloatingObject), logicalTop);
</span><span class="lines">@@ -2455,14 +2455,14 @@
</span><span class="cx">
</span><span class="cx"> childBox.markForPaginationRelayoutIfNeeded();
</span><span class="cx"> childBox.layoutIfNeeded();
</span><del>-
</del><ins>+
</ins><span class="cx"> LayoutState* layoutState = view().layoutState();
</span><span class="cx"> bool isPaginated = layoutState->isPaginated();
</span><span class="cx"> if (isPaginated) {
</span><span class="cx"> // If we are unsplittable and don't fit, then we need to move down.
</span><span class="cx"> // We include our margins as part of the unsplittable area.
</span><span class="cx"> LayoutUnit newLogicalTop = adjustForUnsplittableChild(childBox, floatLogicalLocation.y(), true);
</span><del>-
</del><ins>+
</ins><span class="cx"> // See if we have a pagination strut that is making us move down further.
</span><span class="cx"> // Note that an unsplittable child can't also have a pagination strut, so this is
</span><span class="cx"> // exclusive with the case above.
</span><span class="lines">@@ -2471,7 +2471,7 @@
</span><span class="cx"> newLogicalTop += childBlock->paginationStrut();
</span><span class="cx"> childBlock->setPaginationStrut(0);
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> if (newLogicalTop != floatLogicalLocation.y()) {
</span><span class="cx"> floatingObject->setPaginationStrut(newLogicalTop - floatLogicalLocation.y());
</span><span class="cx">
</span><span class="lines">@@ -2480,7 +2480,7 @@
</span><span class="cx">
</span><span class="cx"> setLogicalLeftForChild(childBox, floatLogicalLocation.x() + childLogicalLeftMargin);
</span><span class="cx"> setLogicalTopForChild(childBox, floatLogicalLocation.y() + marginBeforeForChild(childBox));
</span><del>-
</del><ins>+
</ins><span class="cx"> if (childBlock)
</span><span class="cx"> childBlock->setChildNeedsLayout(MarkOnlyThis);
</span><span class="cx"> childBox.layoutIfNeeded();
</span><span class="lines">@@ -2627,7 +2627,7 @@
</span><span class="cx"> // it should paint.
</span><span class="cx"> floatingObject->setShouldPaint(true);
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> // 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
</span><span class="cx"> // child now.
</span><span class="cx"> if (floatingObject->isDescendant())
</span><span class="lines">@@ -2720,7 +2720,7 @@
</span><span class="cx"> auto end = floatingObjectSet.end();
</span><span class="cx">
</span><span class="cx"> for (RenderObject* next = nextSibling(); next; next = next->nextSibling()) {
</span><del>- if (!next->isRenderBlockFlow() || next->isFloatingOrOutOfFlowPositioned() || toRenderBlock(next)->avoidsFloats())
</del><ins>+ if (!next->isRenderBlockFlow() || next->isFloatingOrOutOfFlowPositioned())
</ins><span class="cx"> continue;
</span><span class="cx">
</span><span class="cx"> RenderBlockFlow* nextBlock = toRenderBlockFlow(next);
</span><span class="lines">@@ -2738,7 +2738,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (!style().isFlippedBlocksWritingMode())
</span><span class="cx"> return point;
</span><del>-
</del><ins>+
</ins><span class="cx"> // This is similar to RenderBox::flipForWritingModeForChild. We have to subtract out our left/top offsets twice, since
</span><span class="cx"> // it's going to get added back in. We hide this complication here so that the calling code looks normal for the unflipped
</span><span class="cx"> // case.
</span><span class="lines">@@ -2752,7 +2752,7 @@
</span><span class="cx"> // There is no need to compute clearance if we have no floats.
</span><span class="cx"> if (!containsFloats())
</span><span class="cx"> return 0;
</span><del>-
</del><ins>+
</ins><span class="cx"> // At least one float is present. We need to perform the clearance computation.
</span><span class="cx"> bool clearSet = child.style().clear() != CNONE;
</span><span class="cx"> LayoutUnit logicalBottom = 0;
</span><span class="lines">@@ -2799,7 +2799,7 @@
</span><span class="cx"> child.setLogicalWidth(childOldLogicalWidth);
</span><span class="cx"> child.setMarginLeft(childOldMarginLeft);
</span><span class="cx"> child.setMarginRight(childOldMarginRight);
</span><del>-
</del><ins>+
</ins><span class="cx"> if (childLogicalWidthAtNewLogicalTopOffset <= availableLogicalWidthAtNewLogicalTopOffset) {
</span><span class="cx"> // Even though we may not be moving, if the logical width did shrink because of the presence of new floats, then
</span><span class="cx"> // we need to force a relayout as though we shifted. This happens because of the dynamic addition of overhanging floats
</span><span class="lines">@@ -2913,17 +2913,17 @@
</span><span class="cx"> LayoutUnit right = LayoutUnit::min();
</span><span class="cx"> LayoutUnit oldWidth = contentWidth();
</span><span class="cx"> adjustForBorderFit(0, left, right);
</span><del>-
</del><ins>+
</ins><span class="cx"> // Clamp to our existing edges. We can never grow. We only shrink.
</span><span class="cx"> LayoutUnit leftEdge = borderLeft() + paddingLeft();
</span><span class="cx"> LayoutUnit rightEdge = leftEdge + oldWidth;
</span><span class="cx"> left = std::min(rightEdge, std::max(leftEdge, left));
</span><span class="cx"> right = std::max(leftEdge, std::min(rightEdge, right));
</span><del>-
</del><ins>+
</ins><span class="cx"> LayoutUnit newContentWidth = right - left;
</span><span class="cx"> if (newContentWidth == oldWidth)
</span><span class="cx"> return;
</span><del>-
</del><ins>+
</ins><span class="cx"> setOverrideLogicalContentWidth(newContentWidth);
</span><span class="cx"> layoutBlock(false);
</span><span class="cx"> clearOverrideLogicalContentWidth();
</span><span class="lines">@@ -3028,7 +3028,7 @@
</span><span class="cx"> if (!containsStart && !lastSelectedLine &&
</span><span class="cx"> selectionState() != SelectionStart && selectionState() != SelectionBoth && !isRubyBase())
</span><span class="cx"> result.uniteCenter(blockSelectionGap(rootBlock, rootBlockPhysicalPosition, offsetFromRootBlock, lastLogicalTop, lastLogicalLeft, lastLogicalRight, selTop, cache, paintInfo));
</span><del>-
</del><ins>+
</ins><span class="cx"> LayoutRect logicalRect(curr->logicalLeft(), selTop, curr->logicalWidth(), selTop + selHeight);
</span><span class="cx"> logicalRect.move(isHorizontalWritingMode() ? offsetFromRootBlock : offsetFromRootBlock.transposedSize());
</span><span class="cx"> LayoutRect physicalRect = rootBlock.logicalRectToPhysicalRect(rootBlockPhysicalPosition, logicalRect);
</span><span class="lines">@@ -3211,7 +3211,7 @@
</span><span class="cx"> if (normalFlowChildWithoutLines && !lineCount)
</span><span class="cx"> return normalFlowChildWithoutLines->y() + normalFlowChildWithoutLines->height();
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> return -1;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3398,7 +3398,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (!multiColumnFlowThread() || !multiColumnFlowThread()->shouldRelayoutForPagination())
</span><span class="cx"> return false;
</span><del>-
</del><ins>+
</ins><span class="cx"> multiColumnFlowThread()->setNeedsHeightsRecalculation(false);
</span><span class="cx"> multiColumnFlowThread()->setInBalancingPass(true); // Prevent re-entering this method (and recursion into layout).
</span><span class="cx">
</span><span class="lines">@@ -3434,9 +3434,9 @@
</span><span class="cx"> }
</span><span class="cx"> firstPass = false;
</span><span class="cx"> } while (needsRelayout);
</span><del>-
</del><ins>+
</ins><span class="cx"> multiColumnFlowThread()->setInBalancingPass(false);
</span><del>-
</del><ins>+
</ins><span class="cx"> return neededRelayout;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3603,7 +3603,7 @@
</span><span class="cx"> // Don't do any work if the block is smaller than the visible area.
</span><span class="cx"> if (visibleWidth >= width())
</span><span class="cx"> return;
</span><del>-
</del><ins>+
</ins><span class="cx"> unsigned lineCount;
</span><span class="cx"> if (m_lineCountForTextAutosizing == NOT_SET) {
</span><span class="cx"> int count = lineCountForTextAutosizing();
</span><span class="lines">@@ -3615,15 +3615,15 @@
</span><span class="cx"> lineCount = MULTI_LINE;
</span><span class="cx"> } else
</span><span class="cx"> lineCount = m_lineCountForTextAutosizing;
</span><del>-
</del><ins>+
</ins><span class="cx"> ASSERT(lineCount != NOT_SET);
</span><span class="cx"> if (lineCount == NO_LINE)
</span><span class="cx"> return;
</span><del>-
</del><ins>+
</ins><span class="cx"> float actualWidth = m_widthForTextAutosizing != -1 ? static_cast<float>(m_widthForTextAutosizing) : static_cast<float>(width());
</span><span class="cx"> float scale = visibleWidth / actualWidth;
</span><span class="cx"> float minFontSize = roundf(size / scale);
</span><del>-
</del><ins>+
</ins><span class="cx"> for (RenderObject* descendent = traverseNext(this, isNonBlocksOrNonFixedHeightListItems); descendent; descendent = descendent->traverseNext(this, isNonBlocksOrNonFixedHeightListItems)) {
</span><span class="cx"> if (isVisibleRenderText(descendent) && resizeTextPermitted(descendent)) {
</span><span class="cx"> RenderText* text = toRenderText(descendent);
</span><span class="lines">@@ -3638,7 +3638,7 @@
</span><span class="cx"> m_lineCountForTextAutosizing = lineCount;
</span><span class="cx"> if (m_widthForTextAutosizing == -1)
</span><span class="cx"> m_widthForTextAutosizing = actualWidth;
</span><del>-
</del><ins>+
</ins><span class="cx"> float candidateNewSize = 0;
</span><span class="cx"> float lineTextMultiplier = lineCount == ONE_LINE ? oneLineTextMultiplier(specifiedSize) : textMultiplier(specifiedSize);
</span><span class="cx"> candidateNewSize = roundf(std::min(minFontSize, specifiedSize * lineTextMultiplier));
</span><span class="lines">@@ -3710,7 +3710,7 @@
</span><span class="cx"> // If we don't use columns or flow threads, then bail.
</span><span class="cx"> if (!isRenderFlowThread() && !multiColumnFlowThread())
</span><span class="cx"> return;
</span><del>-
</del><ins>+
</ins><span class="cx"> // We don't actually update any of the variables. We just subclassed to adjust our column height.
</span><span class="cx"> if (RenderMultiColumnFlowThread* flowThread = multiColumnFlowThread()) {
</span><span class="cx"> LogicalExtentComputedValues computedValues;
</span><span class="lines">@@ -3766,7 +3766,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (!multiColumnFlowThread())
</span><span class="cx"> return;
</span><del>-
</del><ins>+
</ins><span class="cx"> bool needsLayout = false;
</span><span class="cx"> bool oldProgressionIsInline = multiColumnFlowThread()->progressionIsInline();
</span><span class="cx"> bool newProgressionIsInline = style->hasInlineColumnAxis();
</span><span class="lines">@@ -3797,7 +3797,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (multiColumnFlowThread())
</span><span class="cx"> return multiColumnFlowThread()->computedColumnCount();
</span><del>-
</del><ins>+
</ins><span class="cx"> return 1;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3806,7 +3806,7 @@
</span><span class="cx"> bool hasTopOverflow = RenderBlock::isTopLayoutOverflowAllowed();
</span><span class="cx"> if (!multiColumnFlowThread() || style().columnProgression() == NormalColumnProgression)
</span><span class="cx"> return hasTopOverflow;
</span><del>-
</del><ins>+
</ins><span class="cx"> if (!(isHorizontalWritingMode() ^ !style().hasInlineColumnAxis()))
</span><span class="cx"> hasTopOverflow = !hasTopOverflow;
</span><span class="cx">
</span><span class="lines">@@ -3818,7 +3818,7 @@
</span><span class="cx"> bool hasLeftOverflow = RenderBlock::isLeftLayoutOverflowAllowed();
</span><span class="cx"> if (!multiColumnFlowThread() || style().columnProgression() == NormalColumnProgression)
</span><span class="cx"> return hasLeftOverflow;
</span><del>-
</del><ins>+
</ins><span class="cx"> if (isHorizontalWritingMode() ^ !style().hasInlineColumnAxis())
</span><span class="cx"> hasLeftOverflow = !hasLeftOverflow;
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari6008branchSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.8-branch/Source/WebCore/rendering/RenderBox.cpp (186610 => 186611)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -194,7 +194,7 @@
</span><span class="cx"> // FIXME: In a perfect world this condition should never happen.
</span><span class="cx"> return borderBoxRect();
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> ASSERT(flowThread->regionInRange(region, startRegion, endRegion));
</span><span class="cx">
</span><span class="cx"> // Compute the logical width and placement in this region.
</span><span class="lines">@@ -205,7 +205,7 @@
</span><span class="cx"> // We have cached insets.
</span><span class="cx"> LayoutUnit logicalWidth = boxInfo->logicalWidth();
</span><span class="cx"> LayoutUnit logicalLeft = boxInfo->logicalLeft();
</span><del>-
</del><ins>+
</ins><span class="cx"> // Now apply the parent inset since it is cumulative whenever anything in the containing block chain shifts.
</span><span class="cx"> // FIXME: Doesn't work right with perpendicular writing modes.
</span><span class="cx"> const RenderBlock* currentBox = containingBlock();
</span><span class="lines">@@ -219,7 +219,7 @@
</span><span class="cx"> region = currentBox->clampToStartAndEndRegions(region);
</span><span class="cx"> currentBoxInfo = currentBox->renderBoxRegionInfo(region);
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> if (cacheFlag == DoNotCacheRenderBoxRegionInfo)
</span><span class="cx"> delete boxInfo;
</span><span class="cx">
</span><span class="lines">@@ -247,14 +247,14 @@
</span><span class="cx"> RenderBoxModelObject::willBeDestroyed();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RenderBlockFlow* RenderBox::outermostBlockContainingFloatingObject()
</del><ins>+static RenderBlockFlow* outermostBlockContainingFloatingObject(RenderBox& box)
</ins><span class="cx"> {
</span><del>- ASSERT(isFloating());
</del><ins>+ ASSERT(box.isFloating());
</ins><span class="cx"> RenderBlockFlow* parentBlock = nullptr;
</span><del>- for (auto& ancestor : ancestorsOfType<RenderBlockFlow>(*this)) {
</del><ins>+ for (auto& ancestor : ancestorsOfType<RenderBlockFlow>(box)) {
</ins><span class="cx"> if (ancestor.isRenderView())
</span><span class="cx"> break;
</span><del>- if (!parentBlock || ancestor.containsFloat(*this))
</del><ins>+ if (!parentBlock || ancestor.containsFloat(box))
</ins><span class="cx"> parentBlock = &ancestor;
</span><span class="cx"> }
</span><span class="cx"> return parentBlock;
</span><span class="lines">@@ -268,7 +268,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (isFloating()) {
</span><del>- if (RenderBlockFlow* parentBlock = outermostBlockContainingFloatingObject()) {
</del><ins>+ if (RenderBlockFlow* parentBlock = outermostBlockContainingFloatingObject(*this)) {
</ins><span class="cx"> parentBlock->markSiblingsWithFloatsForLayout(this);
</span><span class="cx"> parentBlock->markAllDescendantsWithFloatsForLayout(this, false);
</span><span class="cx"> }
</span><span class="lines">@@ -291,7 +291,7 @@
</span><span class="cx"> if (oldStyle->hasEntirelyFixedBackground() != newStyle.hasEntirelyFixedBackground())
</span><span class="cx"> view().compositor().rootFixedBackgroundsChanged();
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> // When a layout hint happens and an object's position style changes, we have to do a layout
</span><span class="cx"> // to dirty the render tree using the old position value now.
</span><span class="cx"> if (diff == StyleDifferenceLayout && parent() && oldStyle->position() != newStyle.position()) {
</span><span class="lines">@@ -395,17 +395,17 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> view().frameView().recalculateScrollbarOverlayStyle();
</span><del>-
</del><ins>+
</ins><span class="cx"> const Pagination& pagination = view().frameView().pagination();
</span><span class="cx"> if (viewChangedWritingMode && pagination.mode != Pagination::Unpaginated) {
</span><span class="cx"> viewStyle.setColumnStylesFromPaginationMode(pagination.mode);
</span><span class="cx"> if (view().multiColumnFlowThread())
</span><span class="cx"> view().updateColumnProgressionFromStyle(&viewStyle);
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> if (viewStyleChanged && view().multiColumnFlowThread())
</span><span class="cx"> view().updateStylesForColumnChildren();
</span><del>-
</del><ins>+
</ins><span class="cx"> if (rootStyleChanged && rootRenderer && rootRenderer->isRenderBlockFlow() && toRenderBlockFlow(rootRenderer)->multiColumnFlowThread())
</span><span class="cx"> toRenderBlockFlow(rootRenderer)->updateStylesForColumnChildren();
</span><span class="cx"> }
</span><span class="lines">@@ -470,7 +470,7 @@
</span><span class="cx"> boxHasOverflowClip = false;
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> // Check for overflow clip.
</span><span class="cx"> // It's sufficient to just check one direction, since it's illegal to have visible on only one overflow value.
</span><span class="cx"> if (boxHasOverflowClip) {
</span><span class="lines">@@ -676,7 +676,7 @@
</span><span class="cx">
</span><span class="cx"> box = LayoutRect(containerRelativeQuad.boundingBox());
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> // FIXME: layoutDelta needs to be applied in parts before/after transforms and
</span><span class="cx"> // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308
</span><span class="cx"> box.move(view().layoutDelta());
</span><span class="lines">@@ -828,7 +828,7 @@
</span><span class="cx"> bool RenderBox::logicalScroll(ScrollLogicalDirection direction, ScrollGranularity granularity, float multiplier, Element** stopElement)
</span><span class="cx"> {
</span><span class="cx"> bool scrolled = false;
</span><del>-
</del><ins>+
</ins><span class="cx"> RenderLayer* l = layer();
</span><span class="cx"> if (l) {
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="lines">@@ -838,7 +838,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> if (l->scroll(logicalToPhysical(direction, isHorizontalWritingMode(), style().isFlippedBlocksWritingMode()), granularity, multiplier))
</span><span class="cx"> scrolled = true;
</span><del>-
</del><ins>+
</ins><span class="cx"> if (scrolled) {
</span><span class="cx"> if (stopElement)
</span><span class="cx"> *stopElement = element();
</span><span class="lines">@@ -859,7 +859,7 @@
</span><span class="cx"> {
</span><span class="cx"> return canBeProgramaticallyScrolled() && (scrollHeight() != clientHeight() || scrollWidth() != clientWidth());
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> bool RenderBox::canBeProgramaticallyScrolled() const
</span><span class="cx"> {
</span><span class="cx"> if (isRenderView())
</span><span class="lines">@@ -994,7 +994,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> const_cast<RenderBox*>(this)->computePreferredLogicalWidths();
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> return m_minPreferredLogicalWidth;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1006,7 +1006,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> const_cast<RenderBox*>(this)->computePreferredLogicalWidths();
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> return m_maxPreferredLogicalWidth;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1186,7 +1186,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> auto& rootBackgroundRenderer = rendererForRootBackground();
</span><del>-
</del><ins>+
</ins><span class="cx"> const FillLayer* bgLayer = rootBackgroundRenderer.style().backgroundLayers();
</span><span class="cx"> Color bgColor = rootBackgroundRenderer.style().visitedDependentColor(CSSPropertyBackgroundColor);
</span><span class="cx">
</span><span class="lines">@@ -1206,7 +1206,7 @@
</span><span class="cx"> AffineTransform ctm = context->getCTM();
</span><span class="cx"> FloatSize contextScaling(static_cast<float>(ctm.xScale()), static_cast<float>(ctm.yScale()));
</span><span class="cx">
</span><del>- // Because RoundedRect uses IntRect internally the inset applied by the
</del><ins>+ // Because RoundedRect uses IntRect internally the inset applied by the
</ins><span class="cx"> // BackgroundBleedShrinkBackground strategy cannot be less than one integer
</span><span class="cx"> // layout coordinate, even with subpixel layout enabled. To take that into
</span><span class="cx"> // account, we clamp the contextScaling to 1.0 for the following test so
</span><span class="lines">@@ -1215,9 +1215,9 @@
</span><span class="cx"> // coordinates.
</span><span class="cx"> // This precaution will become obsolete if RoundedRect is ever promoted to
</span><span class="cx"> // a sub-pixel representation.
</span><del>- if (contextScaling.width() > 1)
</del><ins>+ if (contextScaling.width() > 1)
</ins><span class="cx"> contextScaling.setWidth(1);
</span><del>- if (contextScaling.height() > 1)
</del><ins>+ if (contextScaling.height() > 1)
</ins><span class="cx"> contextScaling.setHeight(1);
</span><span class="cx">
</span><span class="cx"> if (borderObscuresBackgroundEdge(contextScaling))
</span><span class="lines">@@ -1355,7 +1355,7 @@
</span><span class="cx"> // FIXME: Use rounded rect if border radius is present.
</span><span class="cx"> if (style().hasBorderRadius())
</span><span class="cx"> return false;
</span><del>-
</del><ins>+
</ins><span class="cx"> // FIXME: The background color clip is defined by the last layer.
</span><span class="cx"> if (style().backgroundLayers()->next())
</span><span class="cx"> return false;
</span><span class="lines">@@ -1488,7 +1488,7 @@
</span><span class="cx"> CompositeOperator compositeOp = CompositeSourceOver;
</span><span class="cx">
</span><span class="cx"> bool allMaskImagesLoaded = true;
</span><del>-
</del><ins>+
</ins><span class="cx"> if (!compositedMask || flattenCompositingLayers) {
</span><span class="cx"> pushTransparencyLayer = true;
</span><span class="cx"> StyleImage* maskBoxImage = style().maskBoxImage().image();
</span><span class="lines">@@ -1510,7 +1510,7 @@
</span><span class="cx"> paintFillLayers(paintInfo, Color(), style().maskLayers(), paintRect, BackgroundBleedNone, compositeOp);
</span><span class="cx"> paintNinePieceImage(paintInfo.context, paintRect, style(), style().maskBoxImage(), compositeOp);
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> if (pushTransparencyLayer)
</span><span class="cx"> paintInfo.context->endTransparencyLayer();
</span><span class="cx"> }
</span><span class="lines">@@ -1520,12 +1520,12 @@
</span><span class="cx"> const NinePieceImage& maskBoxImage = style().maskBoxImage();
</span><span class="cx"> if (maskBoxImage.image()) {
</span><span class="cx"> LayoutRect borderImageRect = borderBoxRect();
</span><del>-
</del><ins>+
</ins><span class="cx"> // Apply outsets to the border box.
</span><span class="cx"> borderImageRect.expand(style().maskBoxImageOutsets());
</span><span class="cx"> return borderImageRect;
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> LayoutRect result;
</span><span class="cx"> LayoutRect borderBox = borderBoxRect();
</span><span class="cx"> for (const FillLayer* maskLayer = style().maskLayers(); maskLayer; maskLayer = maskLayer->next()) {
</span><span class="lines">@@ -1548,7 +1548,7 @@
</span><span class="cx"> while (curLayer) {
</span><span class="cx"> layers.append(curLayer);
</span><span class="cx"> // Stop traversal when an opaque layer is encountered.
</span><del>- // FIXME : It would be possible for the following occlusion culling test to be more aggressive
</del><ins>+ // FIXME : It would be possible for the following occlusion culling test to be more aggressive
</ins><span class="cx"> // on layers with no repeat by testing whether the image covers the layout rect.
</span><span class="cx"> // Testing that here would imply duplicating a lot of calculations that are currently done in
</span><span class="cx"> // RenderBoxModelObject::paintFillLayerExtended. A more efficient solution might be to move
</span><span class="lines">@@ -1666,7 +1666,7 @@
</span><span class="cx"> layerRenderer->repaint();
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> LayoutRect rectToRepaint = geometry.destRect();
</span><span class="cx"> bool shouldClipToLayer = true;
</span><span class="cx">
</span><span class="lines">@@ -1698,13 +1698,13 @@
</span><span class="cx"> {
</span><span class="cx"> if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == PaintPhaseSelfOutline || paintInfo.phase == PaintPhaseMask)
</span><span class="cx"> return false;
</span><del>-
</del><ins>+
</ins><span class="cx"> bool isControlClip = hasControlClip();
</span><span class="cx"> bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer();
</span><del>-
</del><ins>+
</ins><span class="cx"> if (!isControlClip && !isOverflowClip)
</span><span class="cx"> return false;
</span><del>-
</del><ins>+
</ins><span class="cx"> if (paintInfo.phase == PaintPhaseOutline)
</span><span class="cx"> paintInfo.phase = PaintPhaseChildOutlines;
</span><span class="cx"> else if (paintInfo.phase == PaintPhaseChildBlockBackground) {
</span><span class="lines">@@ -1782,7 +1782,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> LayoutUnit RenderBox::shrinkLogicalWidthToAvoidFloats(LayoutUnit childMarginStart, LayoutUnit childMarginEnd, const RenderBlock* cb, RenderRegion* region) const
</span><del>-{
</del><ins>+{
</ins><span class="cx"> RenderRegion* containingBlockRegion = 0;
</span><span class="cx"> LayoutUnit logicalTopPosition = logicalTop();
</span><span class="cx"> if (region) {
</span><span class="lines">@@ -1807,7 +1807,7 @@
</span><span class="cx"> else
</span><span class="cx"> result += startOffset - startContentSide;
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> if (childMarginEnd > 0) {
</span><span class="cx"> LayoutUnit endContentSide = cb->endOffsetForContent(containingBlockRegion);
</span><span class="cx"> LayoutUnit endContentSideWithMargin = endContentSide + childMarginEnd;
</span><span class="lines">@@ -1931,9 +1931,9 @@
</span><span class="cx">
</span><span class="cx"> if (wasFixed)
</span><span class="cx"> *wasFixed = mode & IsFixed;
</span><del>-
</del><ins>+
</ins><span class="cx"> LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(transformState.mappedPoint()));
</span><del>-
</del><ins>+
</ins><span class="cx"> bool preserve3D = mode & UseTransforms && (o->style().preserves3D() || style().preserves3D());
</span><span class="cx"> if (mode & UseTransforms && shouldUseTransformFromContainer(o)) {
</span><span class="cx"> TransformationMatrix t;
</span><span class="lines">@@ -1987,13 +1987,13 @@
</span><span class="cx"> TransformationMatrix t;
</span><span class="cx"> getTransformFromContainer(container, containerOffset, t);
</span><span class="cx"> t.translateRight(adjustmentForSkippedAncestor.width(), adjustmentForSkippedAncestor.height());
</span><del>-
</del><ins>+
</ins><span class="cx"> geometryMap.push(this, t, preserve3D, offsetDependsOnPoint, isFixedPos, hasTransform);
</span><span class="cx"> } else {
</span><span class="cx"> containerOffset += adjustmentForSkippedAncestor;
</span><span class="cx"> geometryMap.push(this, containerOffset, preserve3D, offsetDependsOnPoint, isFixedPos, hasTransform);
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> return ancestorSkipped ? ancestorToStopAt : container;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2013,10 +2013,10 @@
</span><span class="cx">
</span><span class="cx"> LayoutSize RenderBox::offsetFromContainer(RenderObject* o, const LayoutPoint&, bool* offsetDependsOnPoint) const
</span><span class="cx"> {
</span><del>- // A region "has" boxes inside it without being their container.
</del><ins>+ // A region "has" boxes inside it without being their container.
</ins><span class="cx"> ASSERT(o == container() || o->isRenderRegion());
</span><span class="cx">
</span><del>- LayoutSize offset;
</del><ins>+ LayoutSize offset;
</ins><span class="cx"> if (isInFlowPositioned())
</span><span class="cx"> offset += offsetForInFlowPosition();
</span><span class="cx">
</span><span class="lines">@@ -2106,12 +2106,12 @@
</span><span class="cx"> // FIXME: layoutDelta needs to be applied in parts before/after transforms and
</span><span class="cx"> // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308
</span><span class="cx"> r.move(view().layoutDelta());
</span><del>-
</del><ins>+
</ins><span class="cx"> // We have to use maximalOutlineSize() because a child might have an outline
</span><span class="cx"> // that projects outside of our overflowRect.
</span><span class="cx"> ASSERT(style().outlineSize() <= view().maximalOutlineSize());
</span><span class="cx"> r.inflate(view().maximalOutlineSize());
</span><del>-
</del><ins>+
</ins><span class="cx"> computeRectForRepaint(repaintContainer, r);
</span><span class="cx"> return r;
</span><span class="cx"> }
</span><span class="lines">@@ -2172,7 +2172,7 @@
</span><span class="cx"> auto o = container(repaintContainer, &containerSkipped);
</span><span class="cx"> if (!o)
</span><span class="cx"> return;
</span><del>-
</del><ins>+
</ins><span class="cx"> EPosition position = styleToUse.position();
</span><span class="cx">
</span><span class="cx"> // This code isn't necessary for in-flow RenderFlowThreads.
</span><span class="lines">@@ -2306,7 +2306,7 @@
</span><span class="cx"> RenderBlock* cb = containingBlock();
</span><span class="cx"> LayoutUnit containerLogicalWidth = std::max<LayoutUnit>(0, containingBlockLogicalWidthForContentInRegion(region));
</span><span class="cx"> bool hasPerpendicularContainingBlock = cb->isHorizontalWritingMode() != isHorizontalWritingMode();
</span><del>-
</del><ins>+
</ins><span class="cx"> if (isInline() && !isInlineBlockOrInlineTable()) {
</span><span class="cx"> // just calculate margins
</span><span class="cx"> computedValues.m_margins.m_start = minimumValueForLength(styleToUse.marginStart(), containerLogicalWidth);
</span><span class="lines">@@ -2340,7 +2340,7 @@
</span><span class="cx"> hasInvertedDirection ? computedValues.m_margins.m_end : computedValues.m_margins.m_start,
</span><span class="cx"> hasInvertedDirection ? computedValues.m_margins.m_start : computedValues.m_margins.m_end);
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> if (!hasPerpendicularContainingBlock && containerLogicalWidth && containerLogicalWidth != (computedValues.m_extent + computedValues.m_margins.m_start + computedValues.m_margins.m_end)
</span><span class="cx"> && !isFloating() && !isInline() && !cb->isFlexibleBoxIncludingDeprecated()
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="lines">@@ -2514,15 +2514,15 @@
</span><span class="cx"> marginStart = centeredMarginBoxStart + marginStartWidth;
</span><span class="cx"> marginEnd = containerWidth - childWidth - marginStart + marginEndWidth;
</span><span class="cx"> return;
</span><del>- }
-
</del><ins>+ }
+
</ins><span class="cx"> // Case Two: The object is being pushed to the start of the containing block's available logical width.
</span><span class="cx"> if (marginEndLength.isAuto() && childWidth < containerWidth) {
</span><span class="cx"> marginStart = valueForLength(marginStartLength, containerWidth);
</span><span class="cx"> marginEnd = containerWidth - childWidth - marginStart;
</span><span class="cx"> return;
</span><del>- }
-
</del><ins>+ }
+
</ins><span class="cx"> // Case Three: The object is being pushed to the end of the containing block's available logical width.
</span><span class="cx"> bool pushToEndFromTextAlign = !marginEndLength.isAuto() && ((!containingBlockStyle.isLeftToRightDirection() && containingBlockStyle.textAlign() == WEBKIT_LEFT)
</span><span class="cx"> || (containingBlockStyle.isLeftToRightDirection() && containingBlockStyle.textAlign() == WEBKIT_RIGHT));
</span><span class="lines">@@ -2530,8 +2530,8 @@
</span><span class="cx"> marginEnd = valueForLength(marginEndLength, containerWidth);
</span><span class="cx"> marginStart = containerWidth - childWidth - marginEnd;
</span><span class="cx"> return;
</span><del>- }
-
</del><ins>+ }
+
</ins><span class="cx"> // Case Four: Either no auto margins, or our width is >= the container width (css2.1, 10.3.3). In that case
</span><span class="cx"> // auto margins will just turn into 0.
</span><span class="cx"> marginStart = minimumValueForLength(marginStartLength, containerWidth);
</span><span class="lines">@@ -2566,7 +2566,7 @@
</span><span class="cx"> RenderBoxRegionInfo* containingBlockInfo = cb->renderBoxRegionInfo(clampedContainingBlockRegion);
</span><span class="cx"> LayoutUnit containingBlockLogicalWidth = cb->logicalWidth();
</span><span class="cx"> LayoutUnit containingBlockLogicalWidthInRegion = containingBlockInfo ? containingBlockInfo->logicalWidth() : containingBlockLogicalWidth;
</span><del>-
</del><ins>+
</ins><span class="cx"> LayoutUnit marginStartInRegion = computedValues.m_margins.m_start;
</span><span class="cx"> LayoutUnit startMarginDelta = marginStartInRegion - marginStart();
</span><span class="cx"> LayoutUnit logicalWidthInRegion = computedValues.m_extent;
</span><span class="lines">@@ -2578,7 +2578,7 @@
</span><span class="cx"> LayoutUnit logicalRightDelta = isOutOfFlowPositioned() ? logicalRightInRegion - oldLogicalRight : startMarginDelta;
</span><span class="cx">
</span><span class="cx"> LayoutUnit logicalLeftOffset = 0;
</span><del>-
</del><ins>+
</ins><span class="cx"> if (!isOutOfFlowPositioned() && avoidsFloats() && cb->containsFloats()) {
</span><span class="cx"> LayoutUnit startPositionDelta = cb->computeStartPositionDeltaForChildAvoidingFloats(*this, marginStartInRegion, region);
</span><span class="cx"> if (cb->style().isLeftToRightDirection())
</span><span class="lines">@@ -2591,7 +2591,7 @@
</span><span class="cx"> logicalLeftOffset += logicalLeftDelta;
</span><span class="cx"> else
</span><span class="cx"> logicalLeftOffset -= (widthDelta + logicalRightDelta);
</span><del>-
</del><ins>+
</ins><span class="cx"> LayoutUnit logicalRightOffset = logicalWidth() - (logicalLeftOffset + logicalWidthInRegion);
</span><span class="cx"> bool isShifted = (containingBlockInfo && containingBlockInfo->isShifted())
</span><span class="cx"> || (style().isLeftToRightDirection() && logicalLeftOffset)
</span><span class="lines">@@ -2655,7 +2655,7 @@
</span><span class="cx"> else {
</span><span class="cx"> RenderBlock* cb = containingBlock();
</span><span class="cx"> bool hasPerpendicularContainingBlock = cb->isHorizontalWritingMode() != isHorizontalWritingMode();
</span><del>-
</del><ins>+
</ins><span class="cx"> if (!hasPerpendicularContainingBlock) {
</span><span class="cx"> bool shouldFlipBeforeAfter = cb->style().writingMode() != style().writingMode();
</span><span class="cx"> computeBlockDirectionMargins(cb,
</span><span class="lines">@@ -2717,7 +2717,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> computedValues.m_extent = heightResult;
</span><del>-
</del><ins>+
</ins><span class="cx"> if (hasPerpendicularContainingBlock) {
</span><span class="cx"> bool shouldFlipBeforeAfter = shouldFlipBeforeAfterMargins(cb->style(), &style());
</span><span class="cx"> computeInlineDirectionMargins(cb, containingBlockLogicalWidthForContent(), heightResult,
</span><span class="lines">@@ -2728,8 +2728,8 @@
</span><span class="cx">
</span><span class="cx"> // WinIE quirk: The <html> block always fills the entire canvas in quirks mode. The <body> always fills the
</span><span class="cx"> // <html> block in quirks mode. Only apply this quirk if the block is normal flow and no height
</span><del>- // 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
</del><ins>+ // 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
</ins><span class="cx"> // height has nothing to be a percentage of, and it ends up being 0. That is bad.
</span><span class="cx"> bool paginatedContentNeedsBaseHeight = document().printing() && h.isPercent()
</span><span class="cx"> && (isRoot() || (isBody() && document().documentElement()->renderer()->style().logicalHeight().isPercent())) && !isInline();
</span><span class="lines">@@ -2787,7 +2787,7 @@
</span><span class="cx"> LayoutUnit RenderBox::computePercentageLogicalHeight(const Length& height) const
</span><span class="cx"> {
</span><span class="cx"> LayoutUnit availableHeight = -1;
</span><del>-
</del><ins>+
</ins><span class="cx"> bool skippedAutoHeightContainingBlock = false;
</span><span class="cx"> RenderBlock* cb = containingBlock();
</span><span class="cx"> const RenderBox* containingBlockChild = this;
</span><span class="lines">@@ -2903,7 +2903,7 @@
</span><span class="cx"> }
</span><span class="cx"> case FitContent:
</span><span class="cx"> case FillAvailable:
</span><del>- case Percent:
</del><ins>+ case Percent:
</ins><span class="cx"> case Calculated: {
</span><span class="cx"> // FIXME: containingBlockLogicalWidthForContent() is wrong if the replaced element's block-flow is perpendicular to the
</span><span class="cx"> // containing block's block-flow.
</span><span class="lines">@@ -2967,7 +2967,7 @@
</span><span class="cx"> LayoutUnit newHeight = block->adjustContentBoxLogicalHeightForBoxSizing(newContentHeight);
</span><span class="cx"> return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeight, newHeight));
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> // FIXME: availableLogicalHeight() is wrong if the replaced element's block-flow is perpendicular to the
</span><span class="cx"> // containing block's block-flow.
</span><span class="cx"> // https://bugs.webkit.org/show_bug.cgi?id=46496
</span><span class="lines">@@ -3155,7 +3155,7 @@
</span><span class="cx"> }
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> ASSERT(containingBlock->isRenderInline() && containingBlock->isInFlowPositioned());
</span><span class="cx">
</span><span class="cx"> const RenderInline* flow = toRenderInline(containingBlock);
</span><span class="lines">@@ -3253,7 +3253,7 @@
</span><span class="cx"> // We don't use containingBlock(), since we may be positioned by an enclosing
</span><span class="cx"> // relative positioned inline.
</span><span class="cx"> const RenderBoxModelObject* containerBlock = toRenderBoxModelObject(container());
</span><del>-
</del><ins>+
</ins><span class="cx"> const LayoutUnit containerLogicalWidth = containingBlockLogicalWidthForPositioned(containerBlock, region);
</span><span class="cx">
</span><span class="cx"> // Use the container block's direction except when calculating the static distance
</span><span class="lines">@@ -3296,7 +3296,7 @@
</span><span class="cx"> // see FIXME 1
</span><span class="cx"> // Calculate the static distance if needed.
</span><span class="cx"> computeInlineStaticDistance(logicalLeftLength, logicalRightLength, this, containerBlock, containerLogicalWidth, region);
</span><del>-
</del><ins>+
</ins><span class="cx"> // Calculate constraint equation values for 'width' case.
</span><span class="cx"> computePositionedLogicalWidthUsing(style().logicalWidth(), containerBlock, containerDirection,
</span><span class="cx"> containerLogicalWidth, bordersPlusPadding,
</span><span class="lines">@@ -3338,7 +3338,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> computedValues.m_extent += bordersPlusPadding;
</span><del>-
</del><ins>+
</ins><span class="cx"> // Adjust logicalLeft if we need to for the flipped version of our writing mode in regions.
</span><span class="cx"> // FIXME: Add support for other types of objects as containerBlock, not only RenderBlock.
</span><span class="cx"> RenderFlowThread* flowThread = flowThreadContainingBlock();
</span><span class="lines">@@ -3555,7 +3555,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (!logicalTop.isAuto() || !logicalBottom.isAuto())
</span><span class="cx"> return;
</span><del>-
</del><ins>+
</ins><span class="cx"> // FIXME: The static distance computation has not been patched for mixed writing modes.
</span><span class="cx"> LayoutUnit staticLogicalTop = child->layer()->staticBlockPosition() - containerBlock->borderBefore();
</span><span class="cx"> for (RenderElement* curr = child->parent(); curr && curr != containerBlock; curr = curr->container()) {
</span><span class="lines">@@ -3655,7 +3655,7 @@
</span><span class="cx">
</span><span class="cx"> // Set final height value.
</span><span class="cx"> computedValues.m_extent += bordersPlusPadding;
</span><del>-
</del><ins>+
</ins><span class="cx"> // Adjust logicalTop if we need to for perpendicular writing modes in regions.
</span><span class="cx"> // FIXME: Add support for other types of objects as containerBlock, not only RenderBlock.
</span><span class="cx"> RenderFlowThread* flowThread = flowThreadContainingBlock();
</span><span class="lines">@@ -4182,7 +4182,7 @@
</span><span class="cx"> if (isTable() && nonPseudoElement()) {
</span><span class="cx"> LayoutUnit right = contentWidth() + horizontalBorderAndPaddingExtent();
</span><span class="cx"> LayoutUnit bottom = contentHeight() + verticalBorderAndPaddingExtent();
</span><del>-
</del><ins>+
</ins><span class="cx"> if (point.x() < 0 || point.x() > right || point.y() < 0 || point.y() > bottom) {
</span><span class="cx"> if (point.x() <= right / 2)
</span><span class="cx"> return createVisiblePosition(firstPositionInOrBeforeNode(nonPseudoElement()));
</span><span class="lines">@@ -4217,7 +4217,7 @@
</span><span class="cx"> LayoutUnit bottom = top + renderer->contentHeight();
</span><span class="cx"> LayoutUnit left = renderer->borderLeft() + renderer->paddingLeft() + (isTableRow() ? LayoutUnit() : renderer->x());
</span><span class="cx"> LayoutUnit right = left + renderer->contentWidth();
</span><del>-
</del><ins>+
</ins><span class="cx"> if (point.x() <= right && point.x() >= left && point.y() <= top && point.y() >= bottom) {
</span><span class="cx"> if (renderer->isTableRow())
</span><span class="cx"> return renderer->positionForPoint(point + adjustedPoint - renderer->locationOffset(), region);
</span><span class="lines">@@ -4256,10 +4256,10 @@
</span><span class="cx"> minDist = dist;
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> if (closestRenderer)
</span><span class="cx"> return closestRenderer->positionForPoint(adjustedPoint - closestRenderer->locationOffset(), region);
</span><del>-
</del><ins>+
</ins><span class="cx"> return createVisiblePosition(firstPositionInOrBeforeNode(nonPseudoElement()));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -4268,7 +4268,7 @@
</span><span class="cx"> // Floating objects don't shrink. Objects that don't avoid floats don't shrink. Marquees don't shrink.
</span><span class="cx"> if ((isInline() && !isHTMLMarquee()) || !avoidsFloats() || isFloating())
</span><span class="cx"> return false;
</span><del>-
</del><ins>+
</ins><span class="cx"> // Only auto width objects can possibly shrink to avoid floats.
</span><span class="cx"> return style().width().isAuto();
</span><span class="cx"> }
</span><span class="lines">@@ -4295,12 +4295,12 @@
</span><span class="cx"> {
</span><span class="cx"> bool isFlipped = style().isFlippedBlocksWritingMode();
</span><span class="cx"> bool isHorizontal = isHorizontalWritingMode();
</span><del>-
</del><ins>+
</ins><span class="cx"> LayoutUnit overflowMinX = borderBox.x();
</span><span class="cx"> LayoutUnit overflowMaxX = borderBox.maxX();
</span><span class="cx"> LayoutUnit overflowMinY = borderBox.y();
</span><span class="cx"> LayoutUnit overflowMaxY = borderBox.maxY();
</span><del>-
</del><ins>+
</ins><span class="cx"> // Compute box-shadow overflow first.
</span><span class="cx"> if (style().boxShadow()) {
</span><span class="cx"> LayoutUnit shadowLeft;
</span><span class="lines">@@ -4319,7 +4319,7 @@
</span><span class="cx"> // Now compute border-image-outset overflow.
</span><span class="cx"> if (style().hasBorderImageOutsets()) {
</span><span class="cx"> LayoutBoxExtent borderOutsets = style().borderImageOutsets();
</span><del>-
</del><ins>+
</ins><span class="cx"> // In flipped blocks writing modes, the physical sides are inverted. For example in vertical-rl, the right
</span><span class="cx"> // border is at the lower x coordinate value.
</span><span class="cx"> overflowMinX = std::min(overflowMinX, borderBox.x() - ((!isFlipped || isHorizontal) ? borderOutsets.left() : borderOutsets.right()));
</span><span class="lines">@@ -4348,7 +4348,7 @@
</span><span class="cx"> LayoutRect childLayoutOverflowRect = child->layoutOverflowRectForPropagation(&style());
</span><span class="cx"> childLayoutOverflowRect.move(delta);
</span><span class="cx"> addLayoutOverflow(childLayoutOverflowRect);
</span><del>-
</del><ins>+
</ins><span class="cx"> // Add in visual overflow from the child. Even if the child clips its overflow, it may still
</span><span class="cx"> // have visual overflow of its own set from box shadows or reflections. It is unnecessary to propagate this
</span><span class="cx"> // overflow if we are clipping our own overflow.
</span><span class="lines">@@ -4364,11 +4364,11 @@
</span><span class="cx"> LayoutRect clientBox = flippedClientBoxRect();
</span><span class="cx"> if (clientBox.contains(rect) || rect.isEmpty())
</span><span class="cx"> return;
</span><del>-
</del><ins>+
</ins><span class="cx"> // For overflow clip objects, we don't want to propagate overflow into unreachable areas.
</span><span class="cx"> LayoutRect overflowRect(rect);
</span><span class="cx"> if (hasOverflowClip() || isRenderView()) {
</span><del>- // Overflow is in the block's coordinate space and thus is flipped for horizontal-bt and vertical-rl
</del><ins>+ // Overflow is in the block's coordinate space and thus is flipped for horizontal-bt and vertical-rl
</ins><span class="cx"> // writing modes. At this stage that is actually a simplification, since we can treat horizontal-tb/bt as the same
</span><span class="cx"> // and vertical-lr/rl as the same.
</span><span class="cx"> bool hasTopOverflow = isTopLayoutOverflowAllowed();
</span><span class="lines">@@ -4382,7 +4382,7 @@
</span><span class="cx"> overflowRect.shiftXEdgeTo(std::max(overflowRect.x(), clientBox.x()));
</span><span class="cx"> else
</span><span class="cx"> overflowRect.shiftMaxXEdgeTo(std::min(overflowRect.maxX(), clientBox.maxX()));
</span><del>-
</del><ins>+
</ins><span class="cx"> // Now re-test with the adjusted rectangle and see if it has become unreachable or fully
</span><span class="cx"> // contained.
</span><span class="cx"> if (clientBox.contains(overflowRect) || overflowRect.isEmpty())
</span><span class="lines">@@ -4391,7 +4391,7 @@
</span><span class="cx">
</span><span class="cx"> if (!m_overflow)
</span><span class="cx"> m_overflow = adoptRef(new RenderOverflow(clientBox, borderBoxRect()));
</span><del>-
</del><ins>+
</ins><span class="cx"> m_overflow->addLayoutOverflow(overflowRect);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -4400,10 +4400,10 @@
</span><span class="cx"> LayoutRect borderBox = borderBoxRect();
</span><span class="cx"> if (borderBox.contains(rect) || rect.isEmpty())
</span><span class="cx"> return;
</span><del>-
</del><ins>+
</ins><span class="cx"> if (!m_overflow)
</span><span class="cx"> m_overflow = adoptRef(new RenderOverflow(flippedClientBoxRect(), borderBox));
</span><del>-
</del><ins>+
</ins><span class="cx"> m_overflow->addVisualOverflow(rect);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -4470,7 +4470,7 @@
</span><span class="cx"> bool isHorizontal = isHorizontalWritingMode();
</span><span class="cx"> if ((isHorizontal && !scrollsOverflowY()) || (!isHorizontal && !scrollsOverflowX()))
</span><span class="cx"> return false;
</span><del>-
</del><ins>+
</ins><span class="cx"> // We do have overflow. We'll still be willing to paginate as long as the block
</span><span class="cx"> // has auto logical height, auto or undefined max-logical-height and a zero or auto min-logical-height.
</span><span class="cx"> // Note this is just a heuristic, and it's still possible to have overflow under these
</span><span class="lines">@@ -4528,12 +4528,12 @@
</span><span class="cx">
</span><span class="cx"> LayoutRect RenderBox::visualOverflowRectForPropagation(RenderStyle* parentStyle) const
</span><span class="cx"> {
</span><del>- // If the writing modes of the child and parent match, then we don't have to
</del><ins>+ // If the writing modes of the child and parent match, then we don't have to
</ins><span class="cx"> // do anything fancy. Just return the result.
</span><span class="cx"> LayoutRect rect = visualOverflowRect();
</span><span class="cx"> if (parentStyle->writingMode() == style().writingMode())
</span><span class="cx"> return rect;
</span><del>-
</del><ins>+
</ins><span class="cx"> // We are putting ourselves into our parent's coordinate space. If there is a flipped block mismatch
</span><span class="cx"> // in a particular axis, then we have to flip the rect along that axis.
</span><span class="cx"> if (style().writingMode() == RightToLeftWritingMode || parentStyle->writingMode() == RightToLeftWritingMode)
</span><span class="lines">@@ -4569,22 +4569,22 @@
</span><span class="cx"> // this rectangle into physical coordinates, apply relative positioning and transforms
</span><span class="cx"> // to it, and then convert it back.
</span><span class="cx"> flipForWritingMode(rect);
</span><del>-
</del><ins>+
</ins><span class="cx"> if (hasTransform)
</span><span class="cx"> rect = layer()->currentTransform().mapRect(rect);
</span><span class="cx">
</span><span class="cx"> if (isInFlowPositioned())
</span><span class="cx"> rect.move(offsetForInFlowPosition());
</span><del>-
</del><ins>+
</ins><span class="cx"> // Now we need to flip back.
</span><span class="cx"> flipForWritingMode(rect);
</span><span class="cx"> }
</span><del>-
- // If the writing modes of the child and parent match, then we don't have to
</del><ins>+
+ // If the writing modes of the child and parent match, then we don't have to
</ins><span class="cx"> // do anything fancy. Just return the result.
</span><span class="cx"> if (parentStyle->writingMode() == style().writingMode())
</span><span class="cx"> return rect;
</span><del>-
</del><ins>+
</ins><span class="cx"> // We are putting ourselves into our parent's coordinate space. If there is a flipped block mismatch
</span><span class="cx"> // in a particular axis, then we have to flip the rect along that axis.
</span><span class="cx"> if (style().writingMode() == RightToLeftWritingMode || parentStyle->writingMode() == RightToLeftWritingMode)
</span><span class="lines">@@ -4618,7 +4618,7 @@
</span><span class="cx"> LayoutRect RenderBox::overflowRectForPaintRejection(RenderNamedFlowFragment* namedFlowFragment) const
</span><span class="cx"> {
</span><span class="cx"> LayoutRect overflowRect = visualOverflowRect();
</span><del>-
</del><ins>+
</ins><span class="cx"> // When using regions, some boxes might have their frame rect relative to the flow thread, which could
</span><span class="cx"> // cause the paint rejection algorithm to prevent them from painting when using different width regions.
</span><span class="cx"> // e.g. an absolutely positioned box with bottom:0px and right:0px would have it's frameRect.x relative
</span><span class="lines">@@ -4630,7 +4630,7 @@
</span><span class="cx"> if (flowThread->getRegionRangeForBox(this, startRegion, endRegion))
</span><span class="cx"> overflowRect.unite(namedFlowFragment->visualOverflowRectForBox(this));
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> if (!m_overflow || !usesCompositedScrolling())
</span><span class="cx"> return overflowRect;
</span><span class="cx">
</span><span class="lines">@@ -4653,7 +4653,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (!style().isFlippedBlocksWritingMode())
</span><span class="cx"> return point;
</span><del>-
</del><ins>+
</ins><span class="cx"> // The child is going to add in its x() and y(), so we have to make sure it ends up in
</span><span class="cx"> // the right place.
</span><span class="cx"> if (isHorizontalWritingMode())
</span><span class="lines">@@ -4724,7 +4724,7 @@
</span><span class="cx"> RenderBlock* containerBlock = containingBlock();
</span><span class="cx"> if (!containerBlock || containerBlock == this)
</span><span class="cx"> return locationOffset();
</span><del>-
</del><ins>+
</ins><span class="cx"> LayoutRect rect(frameRect());
</span><span class="cx"> containerBlock->flipForWritingMode(rect); // FIXME: This is wrong if we are an absolutely positioned object enclosed by a relative-positioned inline.
</span><span class="cx"> return LayoutSize(rect.x(), rect.y());
</span></span></pre></div>
<a id="branchessafari6008branchSourceWebCorerenderingRenderBoxh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.8-branch/Source/WebCore/rendering/RenderBox.h (186610 => 186611)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -516,8 +516,6 @@
</span><span class="cx">
</span><span class="cx"> virtual VisiblePosition positionForPoint(const LayoutPoint&, const RenderRegion*) override;
</span><span class="cx">
</span><del>- RenderBlockFlow* outermostBlockContainingFloatingObject();
-
</del><span class="cx"> void removeFloatingOrPositionedChildFromBlockLists();
</span><span class="cx">
</span><span class="cx"> RenderLayer* enclosingFloatPaintingLayer() const;
</span></span></pre>
</div>
</div>
</body>
</html>