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

Changeset 249292 in webkit


Ignore:
Timestamp:
Aug 29, 2019, 2:26:23 PM (7 years ago)
Author:
Alan Bujtas
Message:

[LFC][BFC] BlockFormattingContext::usedAvailableWidthForFloatAvoider should only be called on float avoiders.
https://bugs.webkit.org/show_bug.cgi?id=201238
<rdar://problem/54807663>

Reviewed by Antti Koivisto.

Make the horizontal available space logic for float avoiders more explicit/readable.

  • layout/blockformatting/BlockFormattingContext.cpp:

(WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r249290 r249292  
     12019-08-29  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][BFC] BlockFormattingContext::usedAvailableWidthForFloatAvoider should only be called on float avoiders.
     4        https://bugs.webkit.org/show_bug.cgi?id=201238
     5        <rdar://problem/54807663>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Make the horizontal available space logic for float avoiders more explicit/readable.
     10
     11        * layout/blockformatting/BlockFormattingContext.cpp:
     12        (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
     13        (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
     14
    1152019-08-29  Zalan Bujtas  <zalan@apple.com>
    216
  • trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp

    r249288 r249292  
    123123    // Normally the available width for an in-flow block level box is the width of the containing block's content box.
    124124    // However (and can't find it anywhere in the spec) non-floating positioned float avoider block level boxes are constrained by existing floats.
    125     if (!layoutBox.isFloatAvoider() || layoutBox.isFloatingPositioned())
    126         return { };
     125    ASSERT(layoutBox.isFloatAvoider());
    127126    auto& floatingState = floatingContext.floatingState();
    128127    if (floatingState.isEmpty())
     
    164163    computeStaticVerticalPosition(floatingContext, layoutBox);
    165164
    166     computeWidthAndMargin(layoutBox, usedAvailableWidthForFloatAvoider(floatingContext, layoutBox));
     165    Optional<LayoutUnit> usedAvailableWidthForFloatAvoider;
     166    auto horizontalAvailableSpaceIsConstrainedByExistingFloats = layoutBox.isFloatAvoider() && !layoutBox.isFloatingPositioned();
     167    if (horizontalAvailableSpaceIsConstrainedByExistingFloats)
     168        usedAvailableWidthForFloatAvoider = this->usedAvailableWidthForFloatAvoider(floatingContext, layoutBox);
     169    computeWidthAndMargin(layoutBox, usedAvailableWidthForFloatAvoider);
    167170    computeStaticHorizontalPosition(layoutBox);
    168171    // Swich over to the new formatting context (the one that the root creates).
Note: See TracChangeset for help on using the changeset viewer.