Changeset 224561 in webkit


Ignore:
Timestamp:
Nov 7, 2017 5:02:32 PM (6 years ago)
Author:
Antti Koivisto
Message:

There is no such thing as block element continuation
https://bugs.webkit.org/show_bug.cgi?id=179400

Reviewed by Zalan Bujtas.

There are no non-anonymous block continuations. This is dead code.

  • rendering/RenderBlock.cpp:

(WebCore::borderOrPaddingLogicalWidthChanged):
(WebCore::RenderBlock::styleDidChange):
(WebCore::RenderBlock::blockElementContinuation const): Deleted.

This would always return null.

  • rendering/RenderBlock.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r224559 r224561  
     12017-11-07  Antti Koivisto  <antti@apple.com>
     2
     3        There is no such thing as block element continuation
     4        https://bugs.webkit.org/show_bug.cgi?id=179400
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        There are no non-anonymous block continuations. This is dead code.
     9
     10        * rendering/RenderBlock.cpp:
     11        (WebCore::borderOrPaddingLogicalWidthChanged):
     12        (WebCore::RenderBlock::styleDidChange):
     13        (WebCore::RenderBlock::blockElementContinuation const): Deleted.
     14
     15            This would always return null.
     16
     17        * rendering/RenderBlock.h:
     18
    1192017-11-07  Zalan Bujtas  <zalan@apple.com>
    220
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r224546 r224561  
    416416}
    417417
    418 static bool borderOrPaddingLogicalWidthChanged(const RenderStyle* oldStyle, const RenderStyle* newStyle)
    419 {
    420     if (newStyle->isHorizontalWritingMode())
    421         return oldStyle->borderLeftWidth() != newStyle->borderLeftWidth()
    422             || oldStyle->borderRightWidth() != newStyle->borderRightWidth()
    423             || oldStyle->paddingLeft() != newStyle->paddingLeft()
    424             || oldStyle->paddingRight() != newStyle->paddingRight();
    425 
    426     return oldStyle->borderTopWidth() != newStyle->borderTopWidth()
    427         || oldStyle->borderBottomWidth() != newStyle->borderBottomWidth()
    428         || oldStyle->paddingTop() != newStyle->paddingTop()
    429         || oldStyle->paddingBottom() != newStyle->paddingBottom();
     418static bool borderOrPaddingLogicalWidthChanged(const RenderStyle& oldStyle, const RenderStyle& newStyle)
     419{
     420    if (newStyle.isHorizontalWritingMode()) {
     421        return oldStyle.borderLeftWidth() != newStyle.borderLeftWidth()
     422            || oldStyle.borderRightWidth() != newStyle.borderRightWidth()
     423            || oldStyle.paddingLeft() != newStyle.paddingLeft()
     424            || oldStyle.paddingRight() != newStyle.paddingRight();
     425    }
     426
     427    return oldStyle.borderTopWidth() != newStyle.borderTopWidth()
     428        || oldStyle.borderBottomWidth() != newStyle.borderBottomWidth()
     429        || oldStyle.paddingTop() != newStyle.paddingTop()
     430        || oldStyle.paddingBottom() != newStyle.paddingBottom();
    430431}
    431432
     
    438439        adjustFragmentedFlowStateOnContainingBlockChangeIfNeeded();
    439440
    440     auto& newStyle = style();
    441     if (!isAnonymousBlock() && !isContinuation()) {
    442         // Ensure that all of our continuation blocks pick up the new style.
    443         for (RenderBlock* currCont = blockElementContinuation(); currCont; currCont = currCont->blockElementContinuation())
    444             currCont->setStyle(RenderStyle::clone(newStyle));
    445     }
    446 
    447441    propagateStyleToAnonymousChildren(PropagateToBlockChildrenOnly);
    448442
    449443    // It's possible for our border/padding to change, but for the overall logical width of the block to
    450444    // end up being the same. We keep track of this change so in layoutBlock, we can know to set relayoutChildren=true.
    451     setShouldForceRelayoutChildren(oldStyle && diff == StyleDifferenceLayout && needsLayout() && borderOrPaddingLogicalWidthChanged(oldStyle, &newStyle));
     445    setShouldForceRelayoutChildren(oldStyle && diff == StyleDifferenceLayout && needsLayout() && borderOrPaddingLogicalWidthChanged(*oldStyle, style()));
    452446}
    453447
     
    17431737}
    17441738
    1745 RenderBlock* RenderBlock::blockElementContinuation() const
    1746 {
    1747     RenderBoxModelObject* currentContinuation = continuation();
    1748     if (!currentContinuation || currentContinuation->isInline())
    1749         return nullptr;
    1750     RenderBlock& nextContinuation = downcast<RenderBlock>(*currentContinuation);
    1751     if (nextContinuation.isAnonymousBlock())
    1752         return nextContinuation.blockElementContinuation();
    1753     return &nextContinuation;
    1754 }
    1755    
    17561739static ContinuationOutlineTableMap* continuationOutlineTable()
    17571740{
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r224537 r224561  
    192192    bool isAnonymousBlockContinuation() const { return isAnonymousBlock() && continuation(); }
    193193    WEBCORE_EXPORT RenderInline* inlineElementContinuation() const;
    194     RenderBlock* blockElementContinuation() const;
    195194
    196195    static RenderPtr<RenderBlock> createAnonymousWithParentRendererAndDisplay(const RenderBox& parent, EDisplay = BLOCK);
Note: See TracChangeset for help on using the changeset viewer.