Changeset 258836 in webkit


Ignore:
Timestamp:
Mar 23, 2020 7:22:04 AM (4 years ago)
Author:
Alan Bujtas
Message:

[LFC] Box::establishesBlockFormattingContext should check isInitialContainingBlock
https://bugs.webkit.org/show_bug.cgi?id=209390
<rdar://problem/60735021>

Reviewed by Antti Koivisto.

It's more correct to call isInitialContainingBlock() to check if the current box is the ICB.

  • layout/layouttree/LayoutBox.cpp:

(WebCore::Layout::Box::establishesBlockFormattingContext const):
(WebCore::Layout::Box::initialContainingBlock const):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r258834 r258836  
     12020-03-23  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC] Box::establishesBlockFormattingContext should check isInitialContainingBlock
     4        https://bugs.webkit.org/show_bug.cgi?id=209390
     5        <rdar://problem/60735021>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        It's more correct to call isInitialContainingBlock() to check if the current box is the ICB.
     10
     11        * layout/layouttree/LayoutBox.cpp:
     12        (WebCore::Layout::Box::establishesBlockFormattingContext const):
     13        (WebCore::Layout::Box::initialContainingBlock const):
     14
    1152020-03-23  Antoine Quint  <graouts@apple.com>
    216
  • trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp

    r258820 r258836  
    7070bool Box::establishesBlockFormattingContext() const
    7171{
    72     // Initial Containing Block always creates a new (inital) block formatting context.
    73     if (!parent())
     72    // ICB always creates a new (inital) block formatting context.
     73    if (isInitialContainingBlock())
    7474        return true;
    7575
     
    246246        return downcast<ContainerBox>(*this);
    247247
    248     auto* parent = this->parent();
    249     for (; parent->parent(); parent = parent->parent()) { }
    250 
    251     return *parent;
     248    auto* ancestor = parent();
     249    for (; ancestor->parent(); ancestor = ancestor->parent()) { }
     250
     251    return *ancestor;
    252252}
    253253
Note: See TracChangeset for help on using the changeset viewer.