⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 292532 in webkit


Ignore:
Timestamp:
Apr 7, 2022, 6:28:51 AM (4 years ago)
Author:
Alan Bujtas
Message:

A float avoider should never take a vertical position where a float is present even when its used width is zero
https://bugs.webkit.org/show_bug.cgi?id=238895

Reviewed by Antti Koivisto.

Source/WebCore:

A zero width available space is never a valid vertical position for a float avoider even when its width is zero too.

Test: fast/block/float/float-avoider-with-zero-width.html

  • rendering/RenderBlockFlow.cpp:

(WebCore::RenderBlockFlow::getClearDelta): skip and check the next candidate poisition when no space is available.

LayoutTests:

  • TestExpectations: inline-size-bfc-floats.html: never produced correct rendering, the red box just happened to be hidden (which made this test pass).
  • fast/block/float/float-avoider-with-zero-width-expected.html: Added.
  • fast/block/float/float-avoider-with-zero-width.html: Added.
Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r292531 r292532  
     12022-04-07  Alan Bujtas  <zalan@apple.com>
     2
     3        A float avoider should never take a vertical position where a float is present even when its used width is zero
     4        https://bugs.webkit.org/show_bug.cgi?id=238895
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * TestExpectations: inline-size-bfc-floats.html: never produced correct rendering, the red box just happened to be hidden (which made this test pass).
     9        * fast/block/float/float-avoider-with-zero-width-expected.html: Added.
     10        * fast/block/float/float-avoider-with-zero-width.html: Added.
     11
    1122022-04-07  Tim Nguyen  <ntim@apple.com>
    213
  • trunk/LayoutTests/TestExpectations

    r292465 r292532  
    46404640
    46414641# CSS containment tests that fail
    4642 imported/w3c/web-platform-tests/css/css-contain/contain-inline-size-bfc-floats-001.html [ ImageOnlyFailure ]
    46434642# webkit-ruby-text
    46444643imported/w3c/web-platform-tests/css/css-contain/contain-layout-017.html [ ImageOnlyFailure ]
     
    46974696webkit.org/b/229659 imported/w3c/web-platform-tests/css/css-contain/container-queries/pseudo-elements-002.html [ ImageOnlyFailure ]
    46984697webkit.org/b/229659 imported/w3c/web-platform-tests/css/css-contain/container-queries/svg-foreignobject-no-size-container.html [ Skip ]
     4698webkit.org/b/229659 imported/w3c/web-platform-tests/css/css-contain/container-queries/inline-size-bfc-floats.html [ ImageOnlyFailure ]
    46994699
    47004700# Flaky css-contain test
  • trunk/Source/WebCore/ChangeLog

    r292531 r292532  
     12022-04-07  Alan Bujtas  <zalan@apple.com>
     2
     3        A float avoider should never take a vertical position where a float is present even when its used width is zero
     4        https://bugs.webkit.org/show_bug.cgi?id=238895
     5
     6        Reviewed by Antti Koivisto.
     7
     8        A zero width available space is never a valid vertical position for a float avoider even when its width is zero too.
     9
     10        Test: fast/block/float/float-avoider-with-zero-width.html
     11
     12        * rendering/RenderBlockFlow.cpp:
     13        (WebCore::RenderBlockFlow::getClearDelta): skip and check the next candidate poisition when no space is available.
     14
    1152022-04-07  Tim Nguyen  <ntim@apple.com>
    216
  • trunk/Source/WebCore/rendering/RenderBlockFlow.cpp

    r292394 r292532  
    28442844            child.setMarginRight(childOldMarginRight);
    28452845           
    2846             if (childLogicalWidthAtNewLogicalTopOffset <= availableLogicalWidthAtNewLogicalTopOffset) {
     2846            auto shouldAvoidCurrentVerticalPosition = !availableLogicalWidthAtNewLogicalTopOffset || childLogicalWidthAtNewLogicalTopOffset > availableLogicalWidthAtNewLogicalTopOffset;
     2847            if (!shouldAvoidCurrentVerticalPosition) {
    28472848                // Even though we may not be moving, if the logical width did shrink because of the presence of new floats, then
    28482849                // we need to force a relayout as though we shifted. This happens because of the dynamic addition of overhanging floats
Note: See TracChangeset for help on using the changeset viewer.