Changeset 259455 in webkit


Ignore:
Timestamp:
Apr 3, 2020 6:56:32 AM (4 years ago)
Author:
Alan Bujtas
Message:

[MultiColumn] Infinite loop in RenderBlockFlow::pushToNextPageWithMinimumLogicalHeight
https://bugs.webkit.org/show_bug.cgi?id=209948
<rdar://problem/59331899>

Reviewed by Antti Koivisto.

Source/WebCore:

pushToNextPageWithMinimumLogicalHeight is supposed to find the next page/column with enough space for the content.
However we keep finding the same column because it is not balanced properly yet (while in layout, they have the initial height of LayoutUnit::max).

Test: fast/multicol/infinite-loop-with-unbalanced-column.html

  • rendering/RenderBlockFlow.cpp:

(WebCore::RenderBlockFlow::pushToNextPageWithMinimumLogicalHeight const):

LayoutTests:

  • fast/multicol/infinite-loop-with-unbalanced-column-expected.txt: Added.
  • fast/multicol/infinite-loop-with-unbalanced-column.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r259452 r259455  
     12020-04-03  Zalan Bujtas  <zalan@apple.com>
     2
     3        [MultiColumn] Infinite loop in RenderBlockFlow::pushToNextPageWithMinimumLogicalHeight
     4        https://bugs.webkit.org/show_bug.cgi?id=209948
     5        <rdar://problem/59331899>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        * fast/multicol/infinite-loop-with-unbalanced-column-expected.txt: Added.
     10        * fast/multicol/infinite-loop-with-unbalanced-column.html: Added.
     11
    1122020-04-03  youenn fablet  <youenn@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r259452 r259455  
     12020-04-03  Zalan Bujtas  <zalan@apple.com>
     2
     3        [MultiColumn] Infinite loop in RenderBlockFlow::pushToNextPageWithMinimumLogicalHeight
     4        https://bugs.webkit.org/show_bug.cgi?id=209948
     5        <rdar://problem/59331899>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        pushToNextPageWithMinimumLogicalHeight is supposed to find the next page/column with enough space for the content.
     10        However we keep finding the same column because it is not balanced properly yet (while in layout, they have the initial height of LayoutUnit::max).   
     11
     12        Test: fast/multicol/infinite-loop-with-unbalanced-column.html
     13
     14        * rendering/RenderBlockFlow.cpp:
     15        (WebCore::RenderBlockFlow::pushToNextPageWithMinimumLogicalHeight const):
     16
    1172020-04-03  youenn fablet  <youenn@apple.com>
    218
  • trunk/Source/WebCore/rendering/RenderBlockFlow.cpp

    r259232 r259455  
    19401940{
    19411941    bool checkFragment = false;
    1942     for (LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset + adjustment); pageLogicalHeight;
    1943         pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset + adjustment)) {
     1942    auto* fragmentedFlow = enclosingFragmentedFlow();
     1943    RenderFragmentContainer* currentFragmentContainer = nullptr;
     1944    for (auto pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset + adjustment); pageLogicalHeight; pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset + adjustment)) {
    19441945        if (minimumLogicalHeight <= pageLogicalHeight)
    19451946            return true;
    1946         if (!hasNextPage(logicalOffset + adjustment))
     1947        auto adjustedOffset = logicalOffset + adjustment;
     1948        if (!hasNextPage(adjustedOffset))
    19471949            return false;
     1950        if (fragmentedFlow) {
     1951            // While in layout and the columnsets are not balanced yet, we keep finding the same (infinite tall) column over and over again.
     1952            auto* nextFragmentContainer = fragmentedFlow->fragmentAtBlockOffset(this, adjustedOffset, true);
     1953            ASSERT(nextFragmentContainer);
     1954            if (nextFragmentContainer == currentFragmentContainer)
     1955                return false;
     1956            currentFragmentContainer = nextFragmentContainer;
     1957        }
    19481958        adjustment += pageLogicalHeight;
    19491959        checkFragment = true;
Note: See TracChangeset for help on using the changeset viewer.