Remove Element::isInlineElementContinuation
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Nov 2017 16:39:02 +0000 (16:39 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Nov 2017 16:39:02 +0000 (16:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=179425

Reviewed by Zalan Bujtas.

It is really just isInline+isContinuation test and most callers know it is an inline already.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::firstChildConsideringContinuation):
(WebCore::startOfContinuations):
(WebCore::firstChildIsInlineContinuation):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::determineSpacingForFlowBoxes):
(WebCore::InlineFlowBox::paint):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addContinuationWithOutline):
* rendering/RenderElement.h:
(WebCore::RenderElement::setIsContinuation):
(WebCore::RenderElement::isElementContinuation const): Deleted.
(WebCore::RenderElement::isInlineElementContinuation const): Deleted.
* rendering/RenderInline.cpp:
(WebCore::RenderInline::willBeDestroyed):
(WebCore::RenderInline::updateHitTestResult):
* rendering/line/LineInlineHeaders.h:
(WebCore::hasInlineDirectionBordersPaddingOrMargin):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224583 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/rendering/InlineFlowBox.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderElement.h
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/line/LineInlineHeaders.h

index b495d8a..10eba6d 100644 (file)
@@ -1,3 +1,31 @@
+2017-11-08  Antti Koivisto  <antti@apple.com>
+
+        Remove Element::isInlineElementContinuation
+        https://bugs.webkit.org/show_bug.cgi?id=179425
+
+        Reviewed by Zalan Bujtas.
+
+        It is really just isInline+isContinuation test and most callers know it is an inline already.
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::firstChildConsideringContinuation):
+        (WebCore::startOfContinuations):
+        (WebCore::firstChildIsInlineContinuation):
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::determineSpacingForFlowBoxes):
+        (WebCore::InlineFlowBox::paint):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::addContinuationWithOutline):
+        * rendering/RenderElement.h:
+        (WebCore::RenderElement::setIsContinuation):
+        (WebCore::RenderElement::isElementContinuation const): Deleted.
+        (WebCore::RenderElement::isInlineElementContinuation const): Deleted.
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::willBeDestroyed):
+        (WebCore::RenderInline::updateHitTestResult):
+        * rendering/line/LineInlineHeaders.h:
+        (WebCore::hasInlineDirectionBordersPaddingOrMargin):
+
 2017-11-08  David Hyatt  <hyatt@apple.com>
 
         [Experiment] Implement code to detect high frequency painting
index b9dc8d3..8e03dd5 100644 (file)
@@ -183,7 +183,7 @@ static inline RenderObject* firstChildConsideringContinuation(RenderObject& rend
     // We don't want to include the end of a continuation as the firstChild of the
     // anonymous parent, because everything has already been linked up via continuation.
     // CSS first-letter selector is an example of this case.
-    if (renderer.isAnonymous() && is<RenderElement>(firstChild) && downcast<RenderElement>(*firstChild).isInlineElementContinuation())
+    if (renderer.isAnonymous() && is<RenderInline>(firstChild) && downcast<RenderInline>(*firstChild).isContinuation())
         firstChild = nullptr;
     
     if (!firstChild && isInlineWithContinuation(renderer))
@@ -251,7 +251,7 @@ static inline RenderInline* startOfContinuations(RenderObject& renderer)
     if (!is<RenderElement>(renderer))
         return nullptr;
     auto& renderElement = downcast<RenderElement>(renderer);
-    if (renderElement.isInlineElementContinuation() && is<RenderInline>(renderElement.element()->renderer()))
+    if (is<RenderInline>(renderElement) && renderElement.isContinuation() && is<RenderInline>(renderElement.element()->renderer()))
         return downcast<RenderInline>(renderer.node()->renderer());
 
     // Blocks with a previous continuation always have a next continuation
@@ -310,7 +310,7 @@ static inline RenderObject* childBeforeConsideringContinuations(RenderInline* re
 static inline bool firstChildIsInlineContinuation(RenderElement& renderer)
 {
     RenderObject* child = renderer.firstChild();
-    return is<RenderElement>(child) && downcast<RenderElement>(*child).isInlineElementContinuation();
+    return is<RenderInline>(child) && downcast<RenderInline>(*child).isContinuation();
 }
 
 AccessibilityObject* AccessibilityRenderObject::previousSibling() const
index 38a0d40..58eb4dd 100644 (file)
@@ -308,7 +308,7 @@ void InlineFlowBox::determineSpacingForFlowBoxes(bool lastLine, bool isLogically
         // Check to see if all initial lines are unconstructed.  If so, then
         // we know the inline began on this line (unless we are a continuation).
         const auto& lineBoxList = inlineFlow.lineBoxes();
-        if (!lineBoxList.firstLineBox()->isConstructed() && !renderer().isInlineElementContinuation()) {
+        if (!lineBoxList.firstLineBox()->isConstructed() && !inlineFlow.isContinuation()) {
 #if ENABLE(CSS_BOX_DECORATION_BREAK)
             if (renderer().style().boxDecorationBreak() == DCLONE)
                 includeLeftEdge = includeRightEdge = true;
@@ -1155,7 +1155,7 @@ void InlineFlowBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset,
                 RenderInline& inlineFlow = downcast<RenderInline>(renderer());
 
                 RenderBlock* containingBlock = nullptr;
-                bool containingBlockPaintsContinuationOutline = inlineFlow.continuation() || inlineFlow.isInlineElementContinuation();
+                bool containingBlockPaintsContinuationOutline = inlineFlow.continuation() || inlineFlow.isContinuation();
                 if (containingBlockPaintsContinuationOutline) {           
                     // FIXME: See https://bugs.webkit.org/show_bug.cgi?id=54690. We currently don't reconnect inline continuations
                     // after a child removal. As a result, those merged inlines do not get seperated and hence not get enclosed by
@@ -1178,7 +1178,7 @@ void InlineFlowBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset,
                     // Add ourselves to the containing block of the entire continuation so that it can
                     // paint us atomically.
                     containingBlock->addContinuationWithOutline(downcast<RenderInline>(renderer().element()->renderer()));
-                } else if (!inlineFlow.isInlineElementContinuation())
+                } else if (!inlineFlow.isContinuation())
                     paintInfo.outlineObjects->add(&inlineFlow);
             }
         } else if (paintInfo.phase == PaintPhaseMask)
index 51b4333..ee4c03b 100644 (file)
@@ -1746,7 +1746,7 @@ void RenderBlock::addContinuationWithOutline(RenderInline* flow)
 {
     // We can't make this work if the inline is in a layer.  We'll just rely on the broken
     // way of painting.
-    ASSERT(!flow->layer() && !flow->isInlineElementContinuation());
+    ASSERT(!flow->layer() && !flow->isContinuation());
     
     ContinuationOutlineTableMap* table = continuationOutlineTable();
     ListHashSet<RenderInline*>* continuations = table->get(this);
index e40ed9a..3a49ebe 100644 (file)
@@ -227,8 +227,6 @@ public:
     bool hasContinuationChainNode() const { return m_hasContinuationChainNode; }
     bool isContinuation() const { return m_isContinuation; }
     void setIsContinuation() { m_isContinuation = true; }
-    bool isElementContinuation() const { return isContinuation() && !isAnonymous(); }
-    bool isInlineElementContinuation() const { return isElementContinuation() && isInline(); }
     bool isFirstLetter() const { return m_isFirstLetter; }
     void setIsFirstLetter() { m_isFirstLetter = true; }
 
index a7eef4e..613c31d 100644 (file)
@@ -74,7 +74,7 @@ void RenderInline::willBeDestroyed()
 #if !ASSERT_DISABLED
     // Make sure we do not retain "this" in the continuation outline table map of our containing blocks.
     if (parent() && style().visibility() == VISIBLE && hasOutline()) {
-        bool containingBlockPaintsContinuationOutline = continuation() || isInlineElementContinuation();
+        bool containingBlockPaintsContinuationOutline = continuation() || isContinuation();
         if (containingBlockPaintsContinuationOutline) {
             if (RenderBlock* cb = containingBlock()) {
                 if (RenderBlock* cbCb = cb->containingBlock())
@@ -1394,7 +1394,7 @@ void RenderInline::updateHitTestResult(HitTestResult& result, const LayoutPoint&
 
     LayoutPoint localPoint(point);
     if (Element* element = this->element()) {
-        if (isInlineElementContinuation()) {
+        if (isContinuation()) {
             // We're in the continuation of a split inline.  Adjust our local point to be in the coordinate space
             // of the principal renderer's containing block.  This will end up being the innerNonSharedNode.
             RenderBlock* firstBlock = element->renderer()->containingBlock();
index db7ad2e..9a1b040 100644 (file)
@@ -34,11 +34,11 @@ inline bool hasInlineDirectionBordersPaddingOrMargin(const RenderInline& flow)
 {
     // Where an empty inline is split across anonymous blocks we should only give lineboxes to the 'sides' of the
     // inline that have borders, padding or margin.
-    bool shouldApplyStartBorderPaddingOrMargin = !flow.parent()->isAnonymousBlock() || !flow.isInlineElementContinuation();
+    bool shouldApplyStartBorderPaddingOrMargin = !flow.parent()->isAnonymousBlock() || !flow.isContinuation();
     if (shouldApplyStartBorderPaddingOrMargin && (flow.borderStart() || flow.marginStart() || flow.paddingStart()))
         return true;
 
-    bool shouldApplyEndBorderPaddingOrMargin = !flow.parent()->isAnonymousBlock() || flow.isInlineElementContinuation() || !flow.inlineElementContinuation();
+    bool shouldApplyEndBorderPaddingOrMargin = !flow.parent()->isAnonymousBlock() || flow.isContinuation() || !flow.inlineElementContinuation();
     return shouldApplyEndBorderPaddingOrMargin && (flow.borderEnd() || flow.marginEnd() || flow.paddingEnd());
 }