Title: [221456] trunk
Revision
221456
Author
an...@apple.com
Date
2017-08-31 16:27:02 -0700 (Thu, 31 Aug 2017)

Log Message

Remove newBlockInsideInlineModel and anonymous inline block
https://bugs.webkit.org/show_bug.cgi?id=176181

Reviewed by Zalan Bujtas.

Source/WebCore:

Anonymous inline block exists to support newBlockInsideInlineModel which was planned as the replacement for continuations.
It has never been enabled and it is time to remove it.

* page/Settings.in:
* rendering/InlineElementBox.cpp:
(WebCore::InlineElementBox::paint):
(WebCore::InlineElementBox::nodeAtPoint):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::addToLine):
(WebCore::InlineFlowBox::placeBoxesInBlockDirection):
(WebCore::InlineFlowBox::nodeAtPoint):
(WebCore::InlineFlowBox::paint):
(WebCore::InlineFlowBox::anonymousInlineBlock const): Deleted.
* rendering/InlineFlowBox.h:
(WebCore::InlineFlowBox::InlineFlowBox):
(WebCore::InlineFlowBox::hasAnonymousInlineBlock const): Deleted.
(WebCore::InlineFlowBox::setHasAnonymousInlineBlock): Deleted.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::lineHeight const):
(WebCore::RenderBlock::baselinePosition const):
(WebCore::RenderBlock::renderName const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
(WebCore::RenderBlockFlow::childrenPreventSelfCollapsing const):
(WebCore::RenderBlockFlow::adjustLinePositionForPagination):
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
* rendering/RenderBlockFlow.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::updateLogicalInlinePositions):
(WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine):
(WebCore::RenderBlockFlow::layoutRunsAndFloats):
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
(WebCore::RenderBlockFlow::layoutLineBoxes):
(WebCore::RenderBlockFlow::determineStartPosition):
(WebCore::RenderBlockFlow::matchedEndLine):
(WebCore::RenderBlockFlow::marginCollapseLinesFromStart): Deleted.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::sizesLogicalWidthToFitContent const):
(WebCore::RenderBox::createsNewFormattingContext const):
(WebCore::RenderBox::avoidsFloats const):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::addChildIgnoringContinuation):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::isAnonymousInlineBlock const): Deleted.
* rendering/RenderObject.h:
(WebCore::RenderObject::isAnonymousBlock const):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::alignBoxesInBlockDirection):
(WebCore::RootInlineBox::ascentAndDescentForBox const):
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::BreakingContext):
(WebCore::BreakingContext::handleReplaced):
* rendering/line/LineBreaker.cpp:
(WebCore::LineBreaker::nextLineBreak):
* rendering/line/LineBreaker.h:
* rendering/line/LineLayoutState.h:
(WebCore::LineLayoutState::marginInfo):
(WebCore::LineLayoutState::prevFloatBottomFromAnonymousInlineBlock): Deleted.
(WebCore::LineLayoutState::maxFloatBottomFromAnonymousInlineBlock): Deleted.

LayoutTests:

* TestExpectations:
* fast/block/inside-inlines/crash-on-first-line-change.html:

    Don't set newBlockInsideInlineModel.

* fast/block/inside-inlines/new-model: Removed.
* fast/block/inside-inlines/new-model/basic-float-intrusion-expected.html: Removed.
* fast/block/inside-inlines/new-model/basic-float-intrusion.html: Removed.
* fast/block/inside-inlines/new-model/block-width-check-expected.html: Removed.
* fast/block/inside-inlines/new-model/block-width-check.html: Removed.
* fast/block/inside-inlines/new-model/breaking-behavior-expected.html: Removed.
* fast/block/inside-inlines/new-model/breaking-behavior.html: Removed.
* fast/block/inside-inlines/new-model/empty-block-expected.html: Removed.
* fast/block/inside-inlines/new-model/empty-block.html: Removed.
* fast/block/inside-inlines/new-model/margin-collapse: Removed.
* fast/block/inside-inlines/new-model/margin-collapse/001-expected.html: Removed.
* fast/block/inside-inlines/new-model/margin-collapse/001.html: Removed.
* fast/block/inside-inlines/new-model/margin-collapse/002-expected.html: Removed.
* fast/block/inside-inlines/new-model/margin-collapse/002.html: Removed.
* fast/block/inside-inlines/new-model/margin-collapse/003-expected.html: Removed.
* fast/block/inside-inlines/new-model/margin-collapse/003.html: Removed.
* fast/block/inside-inlines/new-model/margin-collapse/004-expected.html: Removed.
* fast/block/inside-inlines/new-model/margin-collapse/004.html: Removed.
* fast/block/inside-inlines/new-model/margins-pushing-below-float-expected.html: Removed.
* fast/block/inside-inlines/new-model/margins-pushing-below-float.html: Removed.
* fast/block/inside-inlines/new-model/paint-order-expected.html: Removed.
* fast/block/inside-inlines/new-model/paint-order.html: Removed.
* fast/block/inside-inlines/new-model/self-collapsing-test-expected.html: Removed.
* fast/block/inside-inlines/new-model/self-collapsing-test.html: Removed.

    These are reftests comparing newBlockInsideInlineModel and the current model and don't have value anymore.

* fast/block/inside-inlines/opacity-on-inline.html:

    Don't set newBlockInsideInlineModel.
    Marked this as failing since it only worked with newBlockInsideInlineModel enabled.
    The test passes in Firefox and fails in Chrome.

Modified Paths

Removed Paths

  • trunk/LayoutTests/fast/block/inside-inlines/new-model/

Diff

Modified: trunk/LayoutTests/ChangeLog (221455 => 221456)


--- trunk/LayoutTests/ChangeLog	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/LayoutTests/ChangeLog	2017-08-31 23:27:02 UTC (rev 221456)
@@ -1,3 +1,48 @@
+2017-08-31  Antti Koivisto  <an...@apple.com>
+
+        Remove newBlockInsideInlineModel and anonymous inline block
+        https://bugs.webkit.org/show_bug.cgi?id=176181
+
+        Reviewed by Zalan Bujtas.
+
+        * TestExpectations:
+        * fast/block/inside-inlines/crash-on-first-line-change.html:
+
+            Don't set newBlockInsideInlineModel.
+
+        * fast/block/inside-inlines/new-model: Removed.
+        * fast/block/inside-inlines/new-model/basic-float-intrusion-expected.html: Removed.
+        * fast/block/inside-inlines/new-model/basic-float-intrusion.html: Removed.
+        * fast/block/inside-inlines/new-model/block-width-check-expected.html: Removed.
+        * fast/block/inside-inlines/new-model/block-width-check.html: Removed.
+        * fast/block/inside-inlines/new-model/breaking-behavior-expected.html: Removed.
+        * fast/block/inside-inlines/new-model/breaking-behavior.html: Removed.
+        * fast/block/inside-inlines/new-model/empty-block-expected.html: Removed.
+        * fast/block/inside-inlines/new-model/empty-block.html: Removed.
+        * fast/block/inside-inlines/new-model/margin-collapse: Removed.
+        * fast/block/inside-inlines/new-model/margin-collapse/001-expected.html: Removed.
+        * fast/block/inside-inlines/new-model/margin-collapse/001.html: Removed.
+        * fast/block/inside-inlines/new-model/margin-collapse/002-expected.html: Removed.
+        * fast/block/inside-inlines/new-model/margin-collapse/002.html: Removed.
+        * fast/block/inside-inlines/new-model/margin-collapse/003-expected.html: Removed.
+        * fast/block/inside-inlines/new-model/margin-collapse/003.html: Removed.
+        * fast/block/inside-inlines/new-model/margin-collapse/004-expected.html: Removed.
+        * fast/block/inside-inlines/new-model/margin-collapse/004.html: Removed.
+        * fast/block/inside-inlines/new-model/margins-pushing-below-float-expected.html: Removed.
+        * fast/block/inside-inlines/new-model/margins-pushing-below-float.html: Removed.
+        * fast/block/inside-inlines/new-model/paint-order-expected.html: Removed.
+        * fast/block/inside-inlines/new-model/paint-order.html: Removed.
+        * fast/block/inside-inlines/new-model/self-collapsing-test-expected.html: Removed.
+        * fast/block/inside-inlines/new-model/self-collapsing-test.html: Removed.
+
+            These are reftests comparing newBlockInsideInlineModel and the current model and don't have value anymore.
+
+        * fast/block/inside-inlines/opacity-on-inline.html:
+
+            Don't set newBlockInsideInlineModel.
+            Marked this as failing since it only worked with newBlockInsideInlineModel enabled.
+            The test passes in Firefox and fails in Chrome.
+
 2017-08-31  Youenn Fablet  <you...@apple.com>
 
         Add support for Request body stream cloning

Modified: trunk/LayoutTests/TestExpectations (221455 => 221456)


--- trunk/LayoutTests/TestExpectations	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/LayoutTests/TestExpectations	2017-08-31 23:27:02 UTC (rev 221456)
@@ -1457,3 +1457,5 @@
 fast/shapes/shape-outside-floats/shape-outside-floats-layout-after-initial-layout-pass.html [ Skip ]
 
 webkit.org/b/171945 perf/class-list-remove.html [ Pass Failure Timeout ]
+
+webkit.org/b/176183 fast/block/inside-inlines/opacity-on-inline.html [ ImageOnlyFailure ]

Modified: trunk/LayoutTests/fast/block/inside-inlines/crash-on-first-line-change.html (221455 => 221456)


--- trunk/LayoutTests/fast/block/inside-inlines/crash-on-first-line-change.html	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/LayoutTests/fast/block/inside-inlines/crash-on-first-line-change.html	2017-08-31 23:27:02 UTC (rev 221456)
@@ -17,9 +17,6 @@
 PASS if no crash.
 <div class=container><span><div id=foo></div></div></div>
 <script>
-if (window.internals)
-    internals.settings.setNewBlockInsideInlineModelEnabled(true)
-
 if (window.testRunner) {
     testRunner.dumpAsText();
     testRunner.waitUntilDone();  

Modified: trunk/LayoutTests/fast/block/inside-inlines/opacity-on-inline.html (221455 => 221456)


--- trunk/LayoutTests/fast/block/inside-inlines/opacity-on-inline.html	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/LayoutTests/fast/block/inside-inlines/opacity-on-inline.html	2017-08-31 23:27:02 UTC (rev 221456)
@@ -5,10 +5,6 @@
 .box div { height:40px; border:2px solid black; background-color:orange }
 a { opacity:0.5 }
 </style>
-<script>
-if (window.internals)
-    window.internals.settings.setNewBlockInsideInlineModelEnabled(true)
-</script>
 <body>
 
 <div class="box"><a><div>This block should be partially transparent.</div></a></div>

Modified: trunk/LayoutTests/platform/ios-wk1/TestExpectations (221455 => 221456)


--- trunk/LayoutTests/platform/ios-wk1/TestExpectations	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/LayoutTests/platform/ios-wk1/TestExpectations	2017-08-31 23:27:02 UTC (rev 221456)
@@ -1418,7 +1418,6 @@
 compositing/tiling/offscreen-tiled-layer.html [ Pass Failure ]
 compositing/visible-rect/backing-change-height-from-zero.html [ Pass Failure ]
 css3/calc/transforms-translate.html [ ImageOnlyFailure Pass ]
-fast/block/inside-inlines/new-model/margin-collapse/003.html [ ImageOnlyFailure Pass ]
 fast/css-generated-content/after-with-inline-continuation.html [ ImageOnlyFailure Pass ]
 fast/css/cascade/background-clip-and-webkit-background-clip-cascade-order.html [ ImageOnlyFailure Pass ]
 fast/css3-text/font-synthesis.html [ ImageOnlyFailure Pass ]

Modified: trunk/Source/WebCore/ChangeLog (221455 => 221456)


--- trunk/Source/WebCore/ChangeLog	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/Source/WebCore/ChangeLog	2017-08-31 23:27:02 UTC (rev 221456)
@@ -1,3 +1,70 @@
+2017-08-31  Antti Koivisto  <an...@apple.com>
+
+        Remove newBlockInsideInlineModel and anonymous inline block
+        https://bugs.webkit.org/show_bug.cgi?id=176181
+
+        Reviewed by Zalan Bujtas.
+
+        Anonymous inline block exists to support newBlockInsideInlineModel which was planned as the replacement for continuations.
+        It has never been enabled and it is time to remove it.
+
+        * page/Settings.in:
+        * rendering/InlineElementBox.cpp:
+        (WebCore::InlineElementBox::paint):
+        (WebCore::InlineElementBox::nodeAtPoint):
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::addToLine):
+        (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
+        (WebCore::InlineFlowBox::nodeAtPoint):
+        (WebCore::InlineFlowBox::paint):
+        (WebCore::InlineFlowBox::anonymousInlineBlock const): Deleted.
+        * rendering/InlineFlowBox.h:
+        (WebCore::InlineFlowBox::InlineFlowBox):
+        (WebCore::InlineFlowBox::hasAnonymousInlineBlock const): Deleted.
+        (WebCore::InlineFlowBox::setHasAnonymousInlineBlock): Deleted.
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::lineHeight const):
+        (WebCore::RenderBlock::baselinePosition const):
+        (WebCore::RenderBlock::renderName const):
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
+        (WebCore::RenderBlockFlow::childrenPreventSelfCollapsing const):
+        (WebCore::RenderBlockFlow::adjustLinePositionForPagination):
+        (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
+        * rendering/RenderBlockFlow.h:
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::updateLogicalInlinePositions):
+        (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine):
+        (WebCore::RenderBlockFlow::layoutRunsAndFloats):
+        (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
+        (WebCore::RenderBlockFlow::layoutLineBoxes):
+        (WebCore::RenderBlockFlow::determineStartPosition):
+        (WebCore::RenderBlockFlow::matchedEndLine):
+        (WebCore::RenderBlockFlow::marginCollapseLinesFromStart): Deleted.
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::sizesLogicalWidthToFitContent const):
+        (WebCore::RenderBox::createsNewFormattingContext const):
+        (WebCore::RenderBox::avoidsFloats const):
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::addChildIgnoringContinuation):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::isAnonymousInlineBlock const): Deleted.
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::isAnonymousBlock const):
+        * rendering/RootInlineBox.cpp:
+        (WebCore::RootInlineBox::alignBoxesInBlockDirection):
+        (WebCore::RootInlineBox::ascentAndDescentForBox const):
+        * rendering/line/BreakingContext.h:
+        (WebCore::BreakingContext::BreakingContext):
+        (WebCore::BreakingContext::handleReplaced):
+        * rendering/line/LineBreaker.cpp:
+        (WebCore::LineBreaker::nextLineBreak):
+        * rendering/line/LineBreaker.h:
+        * rendering/line/LineLayoutState.h:
+        (WebCore::LineLayoutState::marginInfo):
+        (WebCore::LineLayoutState::prevFloatBottomFromAnonymousInlineBlock): Deleted.
+        (WebCore::LineLayoutState::maxFloatBottomFromAnonymousInlineBlock): Deleted.
+
 2017-08-31  Ryan Haddad  <ryanhad...@apple.com>
 
         Unreviewed, rolling out r221445.

Modified: trunk/Source/WebCore/page/Settings.in (221455 => 221456)


--- trunk/Source/WebCore/page/Settings.in	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/Source/WebCore/page/Settings.in	2017-08-31 23:27:02 UTC (rev 221456)
@@ -244,8 +244,6 @@
 
 attachmentElementEnabled initial=true, conditional=ATTACHMENT_ELEMENT
 
-newBlockInsideInlineModelEnabled initial=false, setNeedsStyleRecalcInAllFrames=1
-
 deferredCSSParserEnabled initial=false
 
 repaintOutsideLayoutEnabled initial=false

Modified: trunk/Source/WebCore/rendering/InlineElementBox.cpp (221455 => 221456)


--- trunk/Source/WebCore/rendering/InlineElementBox.cpp	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/Source/WebCore/rendering/InlineElementBox.cpp	2017-08-31 23:27:02 UTC (rev 221456)
@@ -68,19 +68,6 @@
     if (!paintInfo.shouldPaintWithinRoot(renderer()))
         return;
 
-    if (renderer().isAnonymousInlineBlock()) {
-        // Treat painting of a special inline-block line like the painting of a normal block and go through all phases.
-        PaintPhase newPhase = (paintInfo.phase == PaintPhaseChildOutlines) ? PaintPhaseOutline : paintInfo.phase;
-        newPhase = (newPhase == PaintPhaseChildBlockBackgrounds) ? PaintPhaseChildBlockBackground : newPhase;
-        
-        PaintInfo info(paintInfo);
-        info.phase = newPhase;
-        info.updateSubtreePaintRootForChildren(&renderer());
-        ASSERT(!renderer().hasSelfPaintingLayer());
-        renderer().paint(info, paintOffset);
-        return;
-    }
-
     if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection)
         return;
 
@@ -92,17 +79,9 @@
 }
 
 bool InlineElementBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit /* lineTop */, LayoutUnit /*lineBottom*/,
-    HitTestAction hitTestAction)
+    HitTestAction)
 {
-    // If we are an anonymous inline block, honor hit test phases.
-    if (renderer().isAnonymousInlineBlock()) {
-        HitTestAction childHitTest = hitTestAction;
-        if (hitTestAction == HitTestChildBlockBackgrounds)
-            childHitTest = HitTestChildBlockBackground;
-        return renderer().nodeAtPoint(request, result, locationInContainer, accumulatedOffset, childHitTest);
-    }
-
-    // Otherwise hit test all phases of replaced elements atomically, as though the replaced element established its
+    // Hit test all phases of replaced elements atomically, as though the replaced element established its
     // own stacking context.  (See Appendix E.2, section 6.4 on inline block/table elements in the CSS2.1
     // specification.)
     LayoutPoint childPoint = accumulatedOffset;

Modified: trunk/Source/WebCore/rendering/InlineFlowBox.cpp (221455 => 221456)


--- trunk/Source/WebCore/rendering/InlineFlowBox.cpp	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.cpp	2017-08-31 23:27:02 UTC (rev 221456)
@@ -69,17 +69,6 @@
 
 #endif
 
-RenderBlockFlow* InlineFlowBox::anonymousInlineBlock() const
-{
-    if (!m_hasAnonymousInlineBlock || !firstChild())
-        return nullptr;
-    if (is<InlineFlowBox>(*firstChild()))
-        return downcast<InlineFlowBox>(*firstChild()).anonymousInlineBlock();
-    if (firstChild()->renderer().isAnonymousInlineBlock())
-        return &downcast<RenderBlockFlow>(firstChild()->renderer());
-    return nullptr;
-}
-
 LayoutUnit InlineFlowBox::getFlowSpacingLogicalWidth()
 {
     LayoutUnit totalWidth = marginBorderPaddingLogicalLeft() + marginBorderPaddingLogicalRight();
@@ -123,12 +112,7 @@
     } else if (is<InlineFlowBox>(*child)) {
         if (downcast<InlineFlowBox>(*child).hasTextDescendants())
             setHasTextDescendantsOnAncestors(this);
-        if (downcast<InlineFlowBox>(*child).hasAnonymousInlineBlock())
-            setHasAnonymousInlineBlock(true);
     }
-    if (child->renderer().isAnonymousInlineBlock())
-        setHasAnonymousInlineBlock(true);
-
     if (descendantsHaveSameLineHeightAndBaseline() && !child->renderer().isOutOfFlowPositioned()) {
         const RenderStyle& parentStyle = lineStyle();
         const RenderStyle& childStyle = child->lineStyle();
@@ -663,11 +647,6 @@
             LayoutUnit posAdjust = maxAscent - child->baselinePosition(baselineType);
             child->setLogicalTop(child->logicalTop() + top + posAdjust);
         }
-        
-        if (child->renderer().isAnonymousInlineBlock()) {
-            const auto& box = downcast<RenderBox>(child->renderer());
-            child->setLogicalTop(box.logicalTop());
-        }
 
         LayoutUnit newLogicalTop = child->logicalTop();
         LayoutUnit newLogicalTopIncludingMargins = newLogicalTop;
@@ -685,7 +664,7 @@
                     : boxObject.borderRight() + boxObject.paddingRight();
             }
             newLogicalTopIncludingMargins = newLogicalTop;
-        } else if (!child->renderer().isBR() && !child->renderer().isAnonymousInlineBlock()) {
+        } else if (!child->renderer().isBR()) {
             const auto& box = downcast<RenderBox>(child->renderer());
             newLogicalTopIncludingMargins = newLogicalTop;
             LayoutUnit overSideMargin = child->isHorizontal() ? box.marginTop() : box.marginRight();
@@ -744,7 +723,7 @@
     }
 
     if (isRootBox) {
-        if (!hasAnonymousInlineBlock() && (strictMode || hasTextChildren() || (descendantsHaveSameLineHeightAndBaseline() && hasTextDescendants()))) {
+        if (strictMode || hasTextChildren() || (descendantsHaveSameLineHeightAndBaseline() && hasTextDescendants())) {
             if (!setLineTop) {
                 setLineTop = true;
                 lineTop = logicalTop();
@@ -1064,8 +1043,7 @@
 
 bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom, HitTestAction hitTestAction)
 {
-    // As long as we don't have an anonymous inline block on our line, we restrict our hit testing only to the foreground phase.
-    if (!hasAnonymousInlineBlock() && hitTestAction != HitTestForeground)
+    if (hitTestAction != HitTestForeground)
         return false;
 
     LayoutRect overflowRect(visualOverflowRect(lineTop, lineBottom));
@@ -1159,8 +1137,7 @@
 
 void InlineFlowBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom)
 {
-    // As long as we don't have an anonymous inline block on our line, we restrict our painting only to a few phases.
-    if (!hasAnonymousInlineBlock() && (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection && paintInfo.phase != PaintPhaseOutline && paintInfo.phase != PaintPhaseSelfOutline && paintInfo.phase != PaintPhaseChildOutlines && paintInfo.phase != PaintPhaseTextClip && paintInfo.phase != PaintPhaseMask))
+    if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection && paintInfo.phase != PaintPhaseOutline && paintInfo.phase != PaintPhaseSelfOutline && paintInfo.phase != PaintPhaseChildOutlines && paintInfo.phase != PaintPhaseTextClip && paintInfo.phase != PaintPhaseMask)
         return;
 
     LayoutRect overflowRect(visualOverflowRect(lineTop, lineBottom));
@@ -1204,14 +1181,11 @@
                 } else if (!inlineFlow.isInlineElementContinuation())
                     paintInfo.outlineObjects->add(&inlineFlow);
             }
-        } else if (paintInfo.phase == PaintPhaseMask) {
-            if (!hasAnonymousInlineBlock())
-                paintMask(paintInfo, paintOffset);
-            return;
-        } else {
+        } else if (paintInfo.phase == PaintPhaseMask)
+            paintMask(paintInfo, paintOffset);
+        else {
             // Paint our background, border and box-shadow.
-            if (!hasAnonymousInlineBlock())
-                paintBoxDecorations(paintInfo, paintOffset);
+            paintBoxDecorations(paintInfo, paintOffset);
         }
     }
 

Modified: trunk/Source/WebCore/rendering/InlineFlowBox.h (221455 => 221456)


--- trunk/Source/WebCore/rendering/InlineFlowBox.h	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.h	2017-08-31 23:27:02 UTC (rev 221456)
@@ -52,7 +52,6 @@
         , m_hasAnnotationsBefore(false)
         , m_hasAnnotationsAfter(false)
         , m_isFirstAfterPageBreak(false)
-        , m_hasAnonymousInlineBlock(false)
 #if !ASSERT_WITH_SECURITY_IMPLICATION_DISABLED
         , m_hasBadChildList(false)
 #endif
@@ -211,10 +210,6 @@
     void setHasTextChildren() { m_hasTextChildren = true; setHasTextDescendants(); }
     void setHasTextDescendants() { m_hasTextDescendants = true; }
     
-    bool hasAnonymousInlineBlock() const { return m_hasAnonymousInlineBlock; }
-    void setHasAnonymousInlineBlock(bool b) { m_hasAnonymousInlineBlock = b; }
-    RenderBlockFlow* anonymousInlineBlock() const;
-    
     void checkConsistency() const;
     void setHasBadChildList();
 
@@ -343,7 +338,6 @@
     unsigned m_lineBreakBidiStatusLast : 5; // UCharDirection
 
     unsigned m_isFirstAfterPageBreak : 1;
-    unsigned m_hasAnonymousInlineBlock : 1;
 
     // End of RootInlineBox-specific members.
 

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (221455 => 221456)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2017-08-31 23:27:02 UTC (rev 221456)
@@ -2934,10 +2934,6 @@
 
 LayoutUnit RenderBlock::lineHeight(bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
 {
-    // Anonymous inline blocks don't include margins or any real line height.
-    if (isAnonymousInlineBlock() && linePositionMode == PositionOnContainingLine)
-        return direction == HorizontalLine ? height() : width();
-    
     // Inline blocks are replaced elements. Otherwise, just pass off to
     // the base class.  If we're being queried as though we're the root line
     // box, then the fact that we're an inline-block is irrelevant, and we behave
@@ -2961,9 +2957,6 @@
     // box, then the fact that we're an inline-block is irrelevant, and we behave
     // just like a block.
     if (isReplaced() && linePositionMode == PositionOnContainingLine) {
-        if (isAnonymousInlineBlock())
-            return direction == HorizontalLine ? height() : width();
-        
         // For "leaf" theme objects, let the theme decide what the baseline position is.
         // FIXME: Might be better to have a custom CSS property instead, so that if the theme
         // is turned off, checkboxes/radios will still have decent baselines.
@@ -3608,8 +3601,6 @@
         return "RenderBlock (positioned)";
     if (isAnonymousBlock())
         return "RenderBlock (anonymous)";
-    if (isAnonymousInlineBlock())
-        return "RenderBlock (anonymous inline-block)";
     // FIXME: Temporary hack while the new generated content system is being implemented.
     if (isPseudoElement())
         return "RenderBlock (generated)";

Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (221455 => 221456)


--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2017-08-31 23:27:02 UTC (rev 221456)
@@ -241,17 +241,14 @@
     // We should not process floats if the parent node is not a RenderBlock. Otherwise, we will add 
     // floats in an invalid context. This will cause a crash arising from a bad cast on the parent.
     // See <rdar://problem/8049753>, where float property is applied on a text node in a SVG.
-    bool isBlockInsideInline = isAnonymousInlineBlock();
-    if (!is<RenderBlockFlow>(parent()) && !isBlockInsideInline)
+    if (!is<RenderBlockFlow>(parent()))
         return;
 
     // First add in floats from the parent. Self-collapsing blocks let their parent track any floats that intrude into
     // them (as opposed to floats they contain themselves) so check for those here too.
-    RenderBlockFlow& parentBlock = downcast<RenderBlockFlow>(isBlockInsideInline ? *containingBlock() : *parent());
-    bool parentHasFloats = isBlockInsideInline ? parentBlock.containsFloats() : false;
-    RenderBlockFlow* previousBlock = nullptr;
-    if (!isBlockInsideInline)
-        previousBlock = previousSiblingWithOverhangingFloats(parentHasFloats);
+    auto& parentBlock = downcast<RenderBlockFlow>(*parent());
+    bool parentHasFloats = false;
+    RenderBlockFlow* previousBlock = previousSiblingWithOverhangingFloats(parentHasFloats);
     LayoutUnit logicalTopOffset = logicalTop();
     if (parentHasFloats || (parentBlock.lowestFloatLogicalBottom() > logicalTopOffset && previousBlock && previousBlock->isSelfCollapsingBlock()))
         addIntrudingFloats(&parentBlock, &parentBlock, parentBlock.logicalLeftOffsetForContent(), logicalTopOffset);
@@ -995,20 +992,7 @@
     if (!childrenInline())
         return RenderBlock::childrenPreventSelfCollapsing();
 
-    // If the block has inline children, see if we generated any line boxes. If we have any
-    // line boxes, then we can only be self-collapsing if we have nothing but anonymous inline blocks
-    // that are also self-collapsing inside us.
-    if (!hasLines())
-        return false;
-    
-    if (simpleLineLayout())
-        return true; // We have simple line layout lines, so we can't be self-collapsing.
-    
-    for (auto* child = firstRootBox(); child; child = child->nextRootBox()) {
-        if (!child->hasAnonymousInlineBlock() || !child->anonymousInlineBlock()->isSelfCollapsingBlock())
-            return true;
-    }
-    return false; // We have no line boxes, so we must be self-collapsing.
+    return hasLines();
 }
 
 LayoutUnit RenderBlockFlow::collapseMargins(RenderBox& child, MarginInfo& marginInfo)
@@ -1704,8 +1688,6 @@
 
 void RenderBlockFlow::adjustLinePositionForPagination(RootInlineBox* lineBox, LayoutUnit& delta, bool& overflowsRegion, RenderFlowThread* flowThread)
 {
-    // FIXME: Ignore anonymous inline blocks. Handle the delta already having been set because of
-    // collapsing margins from a previous anonymous inline block.
     // FIXME: For now we paginate using line overflow. This ensures that lines don't overlap at all when we
     // put a strut between them for pagination purposes. However, this really isn't the desired rendering, since
     // the line on the top of the next page will appear too far down relative to the same kind of line at the top
@@ -4223,8 +4205,6 @@
     while (RenderObject* child = childIterator.next()) {
         bool autoWrap = child->isReplaced() ? child->parent()->style().autoWrap() :
             child->style().autoWrap();
-        bool isAnonymousInlineBlock = child->isAnonymousInlineBlock();
-        
         if (!child->isBR()) {
             // Step One: determine whether or not we need to terminate our current line.
             // Each discrete chunk can become the new min-width, if it is the widest chunk
@@ -4315,21 +4295,19 @@
                     clearPreviousFloat = false;
 
                 bool canBreakReplacedElement = !child->isImage() || allowImagesToBreak;
-                if (((canBreakReplacedElement && (autoWrap || oldAutoWrap) && (!isPrevChildInlineFlow || shouldBreakLineAfterText)) || clearPreviousFloat) || isAnonymousInlineBlock) {
-                    if (child->isAnonymousInlineBlock() && styleToUse.collapseWhiteSpace())
-                        stripTrailingSpace(inlineMax, inlineMin, trailingSpaceChild);
+                if (((canBreakReplacedElement && (autoWrap || oldAutoWrap) && (!isPrevChildInlineFlow || shouldBreakLineAfterText)) || clearPreviousFloat)) {
                     minLogicalWidth = preferredWidth(minLogicalWidth, inlineMin);
                     inlineMin = 0;
                 }
 
                 // If we're supposed to clear the previous float, then terminate maxwidth as well.
-                if (clearPreviousFloat || isAnonymousInlineBlock) {
+                if (clearPreviousFloat) {
                     maxLogicalWidth = preferredWidth(maxLogicalWidth, inlineMax);
                     inlineMax = 0;
                 }
 
                 // Add in text-indent. This is added in only once.
-                if (!addedTextIndent && !child->isFloating() && !isAnonymousInlineBlock) {
+                if (!addedTextIndent && !child->isFloating()) {
                     LayoutUnit ceiledIndent = textIndent.ceilToFloat();
                     childMin += ceiledIndent;
                     childMax += ceiledIndent;
@@ -4340,13 +4318,13 @@
                         addedTextIndent = true;
                 }
                 
-                if (canHangPunctuationAtStart && !addedStartPunctuationHang && !child->isFloating() && !isAnonymousInlineBlock)
+                if (canHangPunctuationAtStart && !addedStartPunctuationHang && !child->isFloating())
                     addedStartPunctuationHang = true;
 
                 // Add our width to the max.
                 inlineMax += std::max<float>(0, childMax);
 
-                if ((!autoWrap || !canBreakReplacedElement || (isPrevChildInlineFlow && !shouldBreakLineAfterText)) && !isAnonymousInlineBlock) {
+                if ((!autoWrap || !canBreakReplacedElement || (isPrevChildInlineFlow && !shouldBreakLineAfterText))) {
                     if (child->isFloating())
                         minLogicalWidth = preferredWidth(minLogicalWidth, childMin);
                     else
@@ -4356,13 +4334,7 @@
                     minLogicalWidth = preferredWidth(minLogicalWidth, childMin);
 
                     // Now start a new line.
-                    inlineMin = 0;
-                    
-                    if (child->isAnonymousInlineBlock()) {
-                        // Terminate max width as well.
-                        maxLogicalWidth = preferredWidth(maxLogicalWidth, childMax);
-                        inlineMax = 0;
-                    }
+                    inlineMin = 0;                    
                 }
 
                 if (autoWrap && canBreakReplacedElement && isPrevChildInlineFlow) {
@@ -4488,8 +4460,8 @@
                     inlineMax += std::max<float>(0, childMax);
             }
 
-            // Ignore spaces after a list marker and also after an anonymous inline block.
-            if (child->isListMarker() || isAnonymousInlineBlock)
+            // Ignore spaces after a list marker.
+            if (child->isListMarker())
                 stripFrontSpaces = true;
         } else {
             minLogicalWidth = preferredWidth(minLogicalWidth, inlineMin);

Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.h (221455 => 221456)


--- trunk/Source/WebCore/rendering/RenderBlockFlow.h	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.h	2017-08-31 23:27:02 UTC (rev 221456)
@@ -592,7 +592,6 @@
     // line, i.e., that it can't be re-used.
     bool lineWidthForPaginatedLineChanged(RootInlineBox*, LayoutUnit lineDelta, RenderFlowThread*) const;
     void updateLogicalWidthForAlignment(const ETextAlign&, const RootInlineBox*, BidiRun* trailingSpaceRun, float& logicalLeft, float& totalLogicalWidth, float& availableLogicalWidth, int expansionOpportunityCount);
-    void marginCollapseLinesFromStart(LineLayoutState&, RootInlineBox* stopLine);
 // END METHODS DEFINED IN RenderBlockLineLayout
 
     bool namedFlowFragmentNeedsUpdate() const;

Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (221455 => 221456)


--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2017-08-31 23:27:02 UTC (rev 221456)
@@ -669,16 +669,11 @@
 }
 
 static void updateLogicalInlinePositions(RenderBlockFlow& block, float& lineLogicalLeft, float& lineLogicalRight, float& availableLogicalWidth, bool firstLine,
-    IndentTextOrNot shouldIndentText, LayoutUnit boxLogicalHeight, RootInlineBox* rootBox)
+    IndentTextOrNot shouldIndentText, LayoutUnit boxLogicalHeight)
 {
     LayoutUnit lineLogicalHeight = block.minLineHeightForReplacedRenderer(firstLine, boxLogicalHeight);
-    if (rootBox->hasAnonymousInlineBlock()) {
-        lineLogicalLeft = block.logicalLeftOffsetForContent(block.logicalHeight());
-        lineLogicalRight = block.logicalRightOffsetForContent(block.logicalHeight());
-    } else {
-        lineLogicalLeft = block.logicalLeftOffsetForLine(block.logicalHeight(), shouldIndentText, lineLogicalHeight);
-        lineLogicalRight = block.logicalRightOffsetForLine(block.logicalHeight(), shouldIndentText, lineLogicalHeight);
-    }
+    lineLogicalLeft = block.logicalLeftOffsetForLine(block.logicalHeight(), shouldIndentText, lineLogicalHeight);
+    lineLogicalRight = block.logicalRightOffsetForLine(block.logicalHeight(), shouldIndentText, lineLogicalHeight);
     availableLogicalWidth = lineLogicalRight - lineLogicalLeft;
 }
 
@@ -696,12 +691,12 @@
     float lineLogicalLeft;
     float lineLogicalRight;
     float availableLogicalWidth;
-    updateLogicalInlinePositions(*this, lineLogicalLeft, lineLogicalRight, availableLogicalWidth, isFirstLine, shouldIndentText, 0, lineBox);
+    updateLogicalInlinePositions(*this, lineLogicalLeft, lineLogicalRight, availableLogicalWidth, isFirstLine, shouldIndentText, 0);
     bool needsWordSpacing;
 
     if (firstRun && firstRun->renderer().isReplaced()) {
         RenderBox& renderBox = downcast<RenderBox>(firstRun->renderer());
-        updateLogicalInlinePositions(*this, lineLogicalLeft, lineLogicalRight, availableLogicalWidth, isFirstLine, shouldIndentText, renderBox.logicalHeight(), lineBox);
+        updateLogicalInlinePositions(*this, lineLogicalLeft, lineLogicalRight, availableLogicalWidth, isFirstLine, shouldIndentText, renderBox.logicalHeight());
     }
 
     computeInlineDirectionPositionsForSegment(lineBox, lineInfo, textAlign, lineLogicalLeft, availableLogicalWidth, firstRun, trailingSpaceRun, textBoxDataMap, verticalPositionCache, wordMeasurements);
@@ -1267,9 +1262,6 @@
     InlineBidiResolver resolver;
     RootInlineBox* startLine = determineStartPosition(layoutState, resolver);
     
-    if (startLine)
-        marginCollapseLinesFromStart(layoutState, startLine);
-
     unsigned consecutiveHyphenatedLines = 0;
     if (startLine) {
         for (RootInlineBox* line = startLine->prevRootBox(); line && line->isHyphenated(); line = line->prevRootBox())
@@ -1369,7 +1361,7 @@
         FloatingObject* lastFloatFromPreviousLine = (containsFloats()) ? m_floatingObjects->set().last().get() : nullptr;
 
         WordMeasurements wordMeasurements;
-        end = lineBreaker.nextLineBreak(resolver, layoutState.lineInfo(), layoutState, renderTextInfo, lastFloatFromPreviousLine, consecutiveHyphenatedLines, wordMeasurements);
+        end = lineBreaker.nextLineBreak(resolver, layoutState.lineInfo(), renderTextInfo, lastFloatFromPreviousLine, consecutiveHyphenatedLines, wordMeasurements);
         cachePriorCharactersIfNeeded(renderTextInfo.lineBreakIterator);
         renderTextInfo.lineBreakIterator.resetPriorContext();
         if (resolver.position().atEnd()) {
@@ -1427,21 +1419,7 @@
                 LayoutUnit adjustment = 0;
                 bool overflowsRegion = false;
                 
-                // If our previous line was an anonymous block and we are not an anonymous block,
-                // simulate a margin collapse now so that we get the proper
-                // increased height. We also have to simulate a margin collapse to propagate margins
-                // through to the top of our block.
-                if (!lineBox->hasAnonymousInlineBlock()) {
-                    RootInlineBox* prevRoot = lineBox->prevRootBox();
-                    if (prevRoot && prevRoot->hasAnonymousInlineBlock()) {
-                        LayoutUnit currentLogicalHeight = logicalHeight();
-                        setLogicalHeight(oldLogicalHeight);
-                        collapseMarginsWithChildInfo(nullptr, nullptr, layoutState.marginInfo());
-                        adjustment = logicalHeight() - oldLogicalHeight;
-                        setLogicalHeight(currentLogicalHeight);
-                    }
-                    layoutState.marginInfo().setAtBeforeSideOfBlock(false);
-                }
+                layoutState.marginInfo().setAtBeforeSideOfBlock(false);
 
                 if (paginated)
                     adjustLinePositionForPagination(lineBox, adjustment, overflowsRegion, layoutState.flowThread());
@@ -1735,12 +1713,10 @@
                         setMarginEndForChild(box, 0);
                     }
                     box.dirtyLineBoxes(isFullLayout);
-                    if (!o.isAnonymousInlineBlock()) {
-                        if (isFullLayout)
-                            replacedChildren.append(&box);
-                        else
-                            box.layoutIfNeeded();
-                    }
+                    if (isFullLayout)
+                        replacedChildren.append(&box);
+                    else
+                        box.layoutIfNeeded();
                 }
             } else if (o.isTextOrLineBreak() || (is<RenderInline>(o) && !walker.atEndOfInline())) {
                 if (is<RenderInline>(o))
@@ -1771,12 +1747,8 @@
     // determining the correct collapsed bottom margin information. This collapse is only necessary
     // if our last child was an anonymous inline block that might need to propagate margin information out to
     // us.
-    LayoutUnit beforeEdge = borderAndPaddingBefore();
     LayoutUnit afterEdge = borderAndPaddingAfter() + scrollbarLogicalHeight() + lastLineAnnotationsAdjustment;
-    if (lastRootBox() && lastRootBox()->hasAnonymousInlineBlock())
-        handleAfterSideOfBlock(beforeEdge, afterEdge, layoutState.marginInfo());
-    else
-        setLogicalHeight(logicalHeight() + afterEdge);
+    setLogicalHeight(logicalHeight() + afterEdge);
 
     if (!firstRootBox() && hasLineIfEmpty())
         setLogicalHeight(logicalHeight() + lineHeight(true, isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes));
@@ -1884,7 +1856,7 @@
             // We have a dirty line.
             if (RootInlineBox* prevRootBox = currentLine->prevRootBox()) {
                 // We have a previous line.
-                if (!dirtiedByFloat && !currentLine->hasAnonymousInlineBlock() && (!prevRootBox->endsWithBreak()
+                if (!dirtiedByFloat && (!prevRootBox->endsWithBreak()
                     || !prevRootBox->lineBreakObj()
                     || (is<RenderText>(*prevRootBox->lineBreakObj())
                     && prevRootBox->lineBreakPos() >= downcast<RenderText>(*prevRootBox->lineBreakObj()).textLength()))) {
@@ -2062,7 +2034,7 @@
     RootInlineBox* originalEndLine = layoutState.endLine();
     RootInlineBox* line = originalEndLine;
     for (int i = 0; i < numLines && line; i++, line = line->nextRootBox()) {
-        if (line->lineBreakObj() == resolver.position().renderer() && line->lineBreakPos() == resolver.position().offset() && !line->hasAnonymousInlineBlock()) {
+        if (line->lineBreakObj() == resolver.position().renderer() && line->lineBreakPos() == resolver.position().offset()) {
             // We have a match.
             if (line->lineBreakBidiStatus() != resolver.status())
                 return false; // ...but the bidi state doesn't match.
@@ -2309,46 +2281,4 @@
         lineBox->setIsFirstAfterPageBreak(true);
 }
 
-void RenderBlockFlow::marginCollapseLinesFromStart(LineLayoutState& layoutState, RootInlineBox* stopLine)
-{
-    // We have to handle an anonymous inline block streak at the start of the block in order to make sure our own margins are
-    // correct. We only have to do this if the children can propagate margins out to us.
-    bool resetLogicalHeight = false;
-    if (layoutState.marginInfo().canCollapseWithMarginBefore()) {
-        RootInlineBox* startLine = firstRootBox();
-        RootInlineBox* curr;
-        for (curr = startLine; curr && curr->hasAnonymousInlineBlock() && layoutState.marginInfo().canCollapseWithMarginBefore(); curr = curr->nextRootBox()) {
-            if (curr == stopLine)
-                return;
-            if (!resetLogicalHeight) {
-                setLogicalHeight(borderAndPaddingBefore());
-                resetLogicalHeight = true;
-            }
-            layoutBlockChild(*curr->anonymousInlineBlock(), layoutState.marginInfo(),
-                layoutState.prevFloatBottomFromAnonymousInlineBlock(), layoutState.maxFloatBottomFromAnonymousInlineBlock());
-        }
-    }
-    
-    // Now that we've handled the top of the block, if the stopLine isn't an anonymous block, then we're done.
-    if (!stopLine->hasAnonymousInlineBlock())
-        return;
-
-    // We already handled top of block with startLine.
-    if (stopLine == firstRootBox())
-        return;
-
-    // Re-run margin collapsing on the block sequence that stopLine is a part of.
-    // First go backwards to get the entire sequence.
-    RootInlineBox* prev = stopLine;
-    for ( ; prev->hasAnonymousInlineBlock(); prev = prev->prevRootBox()) {
-    };
-
-    // Update the block height to the correct state.
-    setLogicalHeight(prev->lineBottomWithLeading());
-    
-    // Now run margin collapsing on those lines.
-    for (prev = prev->nextRootBox(); prev != stopLine; prev = prev->nextRootBox())
-        layoutBlockChild(*prev->anonymousInlineBlock(), layoutState.marginInfo(), layoutState.prevFloatBottomFromAnonymousInlineBlock(), layoutState.maxFloatBottomFromAnonymousInlineBlock());
 }
-
-}

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (221455 => 221456)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2017-08-31 23:27:02 UTC (rev 221456)
@@ -2561,10 +2561,6 @@
 
 bool RenderBox::sizesLogicalWidthToFitContent(SizeType widthType) const
 {
-    // Anonymous inline blocks always fill the width of their containing block.
-    if (isAnonymousInlineBlock())
-        return false;
-
     // Marquees in WinIE are like a mixture of blocks and inline-blocks.  They size as though they're blocks,
     // but they allow text to sit on the same line as the marquee.
     if (isFloating() || (isInlineBlockOrInlineTable() && !isHTMLMarquee()))
@@ -4582,7 +4578,7 @@
 
 bool RenderBox::createsNewFormattingContext() const
 {
-    return (isInlineBlockOrInlineTable() && !isAnonymousInlineBlock()) || isFloatingOrOutOfFlowPositioned() || hasOverflowClip() || isFlexItemIncludingDeprecated()
+    return isInlineBlockOrInlineTable() || isFloatingOrOutOfFlowPositioned() || hasOverflowClip() || isFlexItemIncludingDeprecated()
         || isTableCell() || isTableCaption() || isFieldset() || isWritingModeRoot() || isDocumentElementRenderer() || isRenderFlowThread() || isRenderRegion()
         || isGridItem() || style().specifiesColumns() || style().columnSpan();
 }
@@ -4589,7 +4585,7 @@
 
 bool RenderBox::avoidsFloats() const
 {
-    return (isReplaced() && !isAnonymousInlineBlock()) || isHR() || isLegend() || isFieldset() || createsNewFormattingContext();
+    return isReplaced() || isHR() || isLegend() || isFieldset() || createsNewFormattingContext();
 }
 
 void RenderBox::addVisualEffectOverflow()

Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (221455 => 221456)


--- trunk/Source/WebCore/rendering/RenderInline.cpp	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp	2017-08-31 23:27:02 UTC (rev 221456)
@@ -326,10 +326,9 @@
     if (!beforeChild && isAfterContent(lastChild()))
         beforeChild = lastChild();
     
-    bool useNewBlockInsideInlineModel = settings().newBlockInsideInlineModelEnabled();
     bool childInline = newChildIsInline(*newChild, *this);
     // This code is for the old block-inside-inline model that uses continuations.
-    if (!useNewBlockInsideInlineModel && !childInline && !newChild->isFloatingOrOutOfFlowPositioned()) {
+    if (!childInline && !newChild->isFloatingOrOutOfFlowPositioned()) {
         // We are placing a block inside an inline. We have to perform a split of this
         // inline into continuations.  This involves creating an anonymous block box to hold
         // |newChild|.  We then make that block box a continuation of this inline.  We take all of
@@ -350,67 +349,7 @@
         return;
     }
     
-    if (!useNewBlockInsideInlineModel) {
-        RenderBoxModelObject::addChild(newChild, beforeChild);
-        newChild->setNeedsLayoutAndPrefWidthsRecalc();
-        return;
-    }
-
-    // This code is for the new block-inside-inline model that uses anonymous inline blocks.
-    // If the requested beforeChild is not one of our children, then this is most likely because
-    // there is an anonymous inline-block box within this object that contains the beforeChild.
-    // Insert the child into the anonymous inline-block box instead of here.
-    // A second possibility is that the beforeChild is an anonymous block inside the anonymous inline block.
-    // This can happen if inlines are inserted in between two of the anonymous inline block's block-level
-    // children after it has been created.
-    if (beforeChild && beforeChild->parent() != this) {
-        ASSERT(beforeChild->parent());
-        ASSERT(beforeChild->parent()->isAnonymousInlineBlock() || beforeChild->parent()->isAnonymousBlock());
-        if (beforeChild->parent()->isAnonymousInlineBlock()) {
-            if (!childInline || (childInline && beforeChild->parent()->firstChild() != beforeChild))
-                beforeChild->parent()->addChild(newChild, beforeChild);
-            else
-                addChild(newChild, beforeChild->parent());
-        } else if (beforeChild->parent()->isAnonymousBlock()) {
-            ASSERT(!beforeChild->parent()->parent() || beforeChild->parent()->parent()->isAnonymousInlineBlock());
-            ASSERT(childInline);
-            if (childInline || (!childInline && beforeChild->parent()->firstChild() != beforeChild))
-                beforeChild->parent()->addChild(newChild, beforeChild);
-            else
-                addChild(newChild, beforeChild->parent());
-        }
-        return;
-    }
-
-    if (!childInline) {
-        // We are placing a block inside an inline. We have to place the block inside an anonymous inline-block.
-        // This inline-block can house a sequence of contiguous block-level children, and they will all sit on the
-        // same "line" together. We try to reuse an existing inline-block if possible.
-        if (beforeChild) {
-            if (beforeChild->previousSibling() && beforeChild->previousSibling()->isAnonymousInlineBlock()) {
-                downcast<RenderBlockFlow>(beforeChild->previousSibling())->addChild(newChild);
-                return;
-            }
-        } else {
-            if (lastChild() && lastChild()->isAnonymousInlineBlock()) {
-                downcast<RenderBlockFlow>(lastChild())->addChild(newChild);
-                return;
-            }
-        }
- 
-        if (!newChild->isFloatingOrOutOfFlowPositioned()) {
-            // There was no suitable existing anonymous inline-block. Create a new one.
-            RenderBlockFlow* anonymousInlineBlock = new RenderBlockFlow(document(), RenderStyle::createAnonymousStyleWithDisplay(style(), INLINE_BLOCK));
-            anonymousInlineBlock->initializeStyle();
-    
-            RenderBoxModelObject::addChild(anonymousInlineBlock, beforeChild);
-            anonymousInlineBlock->addChild(newChild);
-            return;
-        }
-    }
-
     RenderBoxModelObject::addChild(newChild, beforeChild);
-
     newChild->setNeedsLayoutAndPrefWidthsRecalc();
 }
 

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (221455 => 221456)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2017-08-31 23:27:02 UTC (rev 221456)
@@ -1595,11 +1595,6 @@
     return hasLayer() && downcast<RenderLayerModelObject>(*this).layer()->isComposited();
 }
 
-bool RenderObject::isAnonymousInlineBlock() const
-{
-    return isAnonymous() && style().display() == INLINE_BLOCK && style().styleType() == NOPSEUDO && isRenderBlockFlow() && !isRubyRun() && !isRubyBase() && !isRuby(parent());
-}
-
 bool RenderObject::hitTest(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestFilter hitTestFilter)
 {
     bool inside = false;

Modified: trunk/Source/WebCore/rendering/RenderObject.h (221455 => 221456)


--- trunk/Source/WebCore/rendering/RenderObject.h	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/Source/WebCore/rendering/RenderObject.h	2017-08-31 23:27:02 UTC (rev 221456)
@@ -417,7 +417,6 @@
 #endif
             ;
     }
-    bool isAnonymousInlineBlock() const;
     bool isElementContinuation() const { return node() && node()->renderer() != this; }
     bool isInlineElementContinuation() const { return isElementContinuation() && isInline(); }
     bool isBlockElementContinuation() const { return isElementContinuation() && !isInline(); }

Modified: trunk/Source/WebCore/rendering/RootInlineBox.cpp (221455 => 221456)


--- trunk/Source/WebCore/rendering/RootInlineBox.cpp	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/Source/WebCore/rendering/RootInlineBox.cpp	2017-08-31 23:27:02 UTC (rev 221456)
@@ -284,8 +284,8 @@
     
     maxHeight = std::max<LayoutUnit>(0, maxHeight); // FIXME: Is this really necessary?
 
-    LayoutUnit lineTopWithLeading = !hasAnonymousInlineBlock() ? heightOfBlock : lineTop;
-    LayoutUnit lineBottomWithLeading = !hasAnonymousInlineBlock() ? heightOfBlock + maxHeight : lineBottom;
+    LayoutUnit lineTopWithLeading = heightOfBlock;
+    LayoutUnit lineBottomWithLeading = heightOfBlock + maxHeight;
     setLineTopBottomPositions(lineTop, lineBottom, lineTopWithLeading, lineBottomWithLeading);
     setPaginatedLineWidth(blockFlow().availableLogicalWidthForContent(heightOfBlock));
 
@@ -890,14 +890,6 @@
     // Replaced boxes will return 0 for the line-height if line-box-contain says they are
     // not to be included.
     if (box.renderer().isReplaced()) {
-        if (hasAnonymousInlineBlock()) {
-            ascent = 0; // Margins exist "outside" the line, since they have to collapse.
-            descent = 0;
-            affectsAscent = true;
-            affectsDescent = true;
-            return;
-        }
-            
         if (lineStyle().lineBoxContain() & LineBoxContainReplaced) {
             ascent = box.baselinePosition(baselineType());
             descent = box.lineHeight() - ascent;
@@ -908,9 +900,6 @@
         }
         return;
     }
-    
-    if (hasAnonymousInlineBlock())
-        return;
 
     Vector<const Font*>* usedFonts = nullptr;
     GlyphOverflow* glyphOverflow = nullptr;

Modified: trunk/Source/WebCore/rendering/line/BreakingContext.h (221455 => 221456)


--- trunk/Source/WebCore/rendering/line/BreakingContext.h	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/Source/WebCore/rendering/line/BreakingContext.h	2017-08-31 23:27:02 UTC (rev 221456)
@@ -93,7 +93,7 @@
 
 class BreakingContext {
 public:
-    BreakingContext(LineBreaker& lineBreaker, InlineBidiResolver& resolver, LineInfo& inLineInfo, LineLayoutState& layoutState, LineWidth& lineWidth, RenderTextInfo& inRenderTextInfo, FloatingObject* inLastFloatFromPreviousLine, bool appliedStartWidth, RenderBlockFlow& block)
+    BreakingContext(LineBreaker& lineBreaker, InlineBidiResolver& resolver, LineInfo& inLineInfo, LineWidth& lineWidth, RenderTextInfo& inRenderTextInfo, FloatingObject* inLastFloatFromPreviousLine, bool appliedStartWidth, RenderBlockFlow& block)
         : m_lineBreaker(lineBreaker)
         , m_resolver(resolver)
         , m_current(resolver.position())
@@ -111,7 +111,6 @@
         , m_renderTextInfo(inRenderTextInfo)
         , m_lastFloatFromPreviousLine(inLastFloatFromPreviousLine)
         , m_width(lineWidth)
-        , m_lineLayoutState(layoutState)
         , m_currWS(NORMAL)
         , m_lastWS(NORMAL)
         , m_preservesNewline(false)
@@ -268,8 +267,6 @@
     FloatingObject* m_lastFloatFromPreviousLine;
 
     LineWidth m_width;
-    
-    LineLayoutState& m_lineLayoutState;
 
     EWhiteSpace m_currWS;
     EWhiteSpace m_lastWS;
@@ -542,24 +539,14 @@
         m_width.updateAvailableWidth(replacedBox.logicalHeight());
 
     // Break on replaced elements if either has normal white-space.
-    if (((m_autoWrap || RenderStyle::autoWrap(m_lastWS)) && (!replacedBox.isImage() || m_allowImagesToBreak)
-        && (!is<RenderRubyRun>(replacedBox) || downcast<RenderRubyRun>(replacedBox).canBreakBefore(m_renderTextInfo.lineBreakIterator))) || replacedBox.isAnonymousInlineBlock()) {
+    if ((m_autoWrap || RenderStyle::autoWrap(m_lastWS)) && (!replacedBox.isImage() || m_allowImagesToBreak)
+        && (!is<RenderRubyRun>(replacedBox) || downcast<RenderRubyRun>(replacedBox).canBreakBefore(m_renderTextInfo.lineBreakIterator))) {
         if (auto* renderer = m_current.renderer())
             commitLineBreakAtCurrentWidth(*renderer);
         else
             commitLineBreakClear();
-        if (m_width.committedWidth() && replacedBox.isAnonymousInlineBlock()) {
-            // Always force a break before an anonymous inline block if there is content on the line
-            // already.
-            m_atEnd = true;
-            return;
-        }
     } else
         m_hangsAtEnd = false;
-    
-    if (replacedBox.isAnonymousInlineBlock())
-        m_block.layoutBlockChild(replacedBox, m_lineLayoutState.marginInfo(),
-            m_lineLayoutState.prevFloatBottomFromAnonymousInlineBlock(), m_lineLayoutState.maxFloatBottomFromAnonymousInlineBlock());
 
     if (m_ignoringSpaces)
         m_lineWhitespaceCollapsingState.stopIgnoringSpaces(InlineIterator(0, &replacedBox, 0));
@@ -591,12 +578,7 @@
     } else {
         // Update prior line break context characters, using U+FFFD (OBJECT REPLACEMENT CHARACTER) for replaced element.
         m_renderTextInfo.lineBreakIterator.updatePriorContext(replacementCharacter);
-    }
-    
-    if (replacedBox.isAnonymousInlineBlock()) {
-        m_atEnd = true;
-        m_lineInfo.setPreviousLineBrokeCleanly(true);
-    }
+    }    
 }
 
 inline float firstPositiveWidth(const WordMeasurements& wordMeasurements)

Modified: trunk/Source/WebCore/rendering/line/LineBreaker.cpp (221455 => 221456)


--- trunk/Source/WebCore/rendering/line/LineBreaker.cpp	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/Source/WebCore/rendering/line/LineBreaker.cpp	2017-08-31 23:27:02 UTC (rev 221456)
@@ -77,7 +77,7 @@
     resolver.commitExplicitEmbedding();
 }
 
-InlineIterator LineBreaker::nextLineBreak(InlineBidiResolver& resolver, LineInfo& lineInfo, LineLayoutState& layoutState, RenderTextInfo& renderTextInfo, FloatingObject* lastFloatFromPreviousLine, unsigned consecutiveHyphenatedLines, WordMeasurements& wordMeasurements)
+InlineIterator LineBreaker::nextLineBreak(InlineBidiResolver& resolver, LineInfo& lineInfo, RenderTextInfo& renderTextInfo, FloatingObject* lastFloatFromPreviousLine, unsigned consecutiveHyphenatedLines, WordMeasurements& wordMeasurements)
 {
     reset();
 
@@ -92,7 +92,7 @@
     if (resolver.position().atEnd())
         return resolver.position();
 
-    BreakingContext context(*this, resolver, lineInfo, layoutState, width, renderTextInfo, lastFloatFromPreviousLine, appliedStartWidth, m_block);
+    BreakingContext context(*this, resolver, lineInfo, width, renderTextInfo, lastFloatFromPreviousLine, appliedStartWidth, m_block);
 
     while (context.currentObject()) {
         context.initializeForCurrentObject();

Modified: trunk/Source/WebCore/rendering/line/LineBreaker.h (221455 => 221456)


--- trunk/Source/WebCore/rendering/line/LineBreaker.h	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/Source/WebCore/rendering/line/LineBreaker.h	2017-08-31 23:27:02 UTC (rev 221456)
@@ -51,7 +51,7 @@
         reset();
     }
 
-    InlineIterator nextLineBreak(InlineBidiResolver&, LineInfo&, LineLayoutState&, RenderTextInfo&, FloatingObject* lastFloatFromPreviousLine, unsigned consecutiveHyphenatedLines, WordMeasurements&);
+    InlineIterator nextLineBreak(InlineBidiResolver&, LineInfo&, RenderTextInfo&, FloatingObject* lastFloatFromPreviousLine, unsigned consecutiveHyphenatedLines, WordMeasurements&);
 
     bool lineWasHyphenated() { return m_hyphenated; }
     const Vector<RenderBox*>& positionedObjects() { return m_positionedObjects; }

Modified: trunk/Source/WebCore/rendering/line/LineLayoutState.h (221455 => 221456)


--- trunk/Source/WebCore/rendering/line/LineLayoutState.h	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/Source/WebCore/rendering/line/LineLayoutState.h	2017-08-31 23:27:02 UTC (rev 221456)
@@ -152,8 +152,6 @@
     }
 
     RenderBlockFlow::MarginInfo& marginInfo() { return m_marginInfo; }
-    LayoutUnit& prevFloatBottomFromAnonymousInlineBlock() { return m_prevFloatBottomFromAnonymousInlineBlock; }
-    LayoutUnit& maxFloatBottomFromAnonymousInlineBlock() { return m_maxFloatBottomFromAnonymousInlineBlock; }
 
     FloatList& floatList() { return m_floatList; }
 
@@ -172,8 +170,6 @@
     LayoutUnit& m_repaintLogicalBottom;
 
     RenderBlockFlow::MarginInfo m_marginInfo;
-    LayoutUnit m_prevFloatBottomFromAnonymousInlineBlock;
-    LayoutUnit m_maxFloatBottomFromAnonymousInlineBlock;
 
     bool m_endLineMatched : 1;
     bool m_checkForFloatsFromLastLine : 1;

Modified: trunk/Source/WebKit/Shared/WebPreferencesDefinitions.h (221455 => 221456)


--- trunk/Source/WebKit/Shared/WebPreferencesDefinitions.h	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/Source/WebKit/Shared/WebPreferencesDefinitions.h	2017-08-31 23:27:02 UTC (rev 221456)
@@ -258,7 +258,6 @@
     macro(ImageControlsEnabled, imageControlsEnabled, Bool, bool, false, "", "") \
     macro(EnableInheritURIQueryComponent, enableInheritURIQueryComponent, Bool, bool, false, "", "") \
     macro(ServiceControlsEnabled, serviceControlsEnabled, Bool, bool, false, "", "") \
-    macro(NewBlockInsideInlineModelEnabled, newBlockInsideInlineModelEnabled, Bool, bool, false, "", "") \
     macro(DeferredCSSParserEnabled, deferredCSSParserEnabled, Bool, bool, false, "", "") \
     macro(HTTPEquivEnabled, httpEquivEnabled, Bool, bool, true, "", "") \
     macro(MockCaptureDevicesEnabled, mockCaptureDevicesEnabled, Bool, bool, false, "", "") \

Modified: trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp (221455 => 221456)


--- trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp	2017-08-31 23:27:02 UTC (rev 221456)
@@ -1329,14 +1329,15 @@
     return toImpl(preferencesRef)->simpleLineLayoutDebugBordersEnabled();
 }
 
-void WKPreferencesSetNewBlockInsideInlineModelEnabled(WKPreferencesRef preferencesRef, bool flag)
+void WKPreferencesSetNewBlockInsideInlineModelEnabled(WKPreferencesRef, bool)
 {
-    toImpl(preferencesRef)->setNewBlockInsideInlineModelEnabled(flag);
+    // FIXME: Remove Safari call to this.
 }
 
-bool WKPreferencesGetNewBlockInsideInlineModelEnabled(WKPreferencesRef preferencesRef)
+bool WKPreferencesGetNewBlockInsideInlineModelEnabled(WKPreferencesRef)
 {
-    return toImpl(preferencesRef)->newBlockInsideInlineModelEnabled();
+    // FIXME: Remove Safari call for this.
+    return false;
 }
 
 void WKPreferencesSetDeferredCSSParserEnabled(WKPreferencesRef preferencesRef, bool flag)

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (221455 => 221456)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2017-08-31 23:25:45 UTC (rev 221455)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2017-08-31 23:27:02 UTC (rev 221456)
@@ -3254,7 +3254,6 @@
     settings.setSimpleLineLayoutEnabled(store.getBoolValueForKey(WebPreferencesKey::simpleLineLayoutEnabledKey()));
     settings.setSimpleLineLayoutDebugBordersEnabled(store.getBoolValueForKey(WebPreferencesKey::simpleLineLayoutDebugBordersEnabledKey()));
     
-    settings.setNewBlockInsideInlineModelEnabled(store.getBoolValueForKey(WebPreferencesKey::newBlockInsideInlineModelEnabledKey()));
     settings.setDeferredCSSParserEnabled(store.getBoolValueForKey(WebPreferencesKey::deferredCSSParserEnabledKey()));
 
     settings.setSubpixelCSSOMElementMetricsEnabled(store.getBoolValueForKey(WebPreferencesKey::subpixelCSSOMElementMetricsEnabledKey()));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to