Changeset 231952 in webkit


Ignore:
Timestamp:
May 18, 2018 7:30:44 AM (6 years ago)
Author:
Alan Bujtas
Message:

[LFC] Implement width computation for non-replaced floating elements.
https://bugs.webkit.org/show_bug.cgi?id=185759

Reviewed by Antti Koivisto.

  • layout/FormattingContext.cpp:

(WebCore::Layout::FormattingContext::computeFloatingWidth const):
(WebCore::Layout::FormattingContext::computeFloatingNonReplacedWidth const):

  • layout/FormattingContext.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r231950 r231952  
     12018-05-18  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC] Implement width computation for non-replaced floating elements.
     4        https://bugs.webkit.org/show_bug.cgi?id=185759
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * layout/FormattingContext.cpp:
     9        (WebCore::Layout::FormattingContext::computeFloatingWidth const):
     10        (WebCore::Layout::FormattingContext::computeFloatingNonReplacedWidth const):
     11        * layout/FormattingContext.h:
     12
    1132018-05-18  Antoine Quint  <graouts@apple.com>
    214
  • trunk/Source/WebCore/layout/FormattingContext.cpp

    r231897 r231952  
    9191{
    9292    if (!layoutBox.replaced()) {
    93         ASSERT_NOT_IMPLEMENTED_YET();
     93        computeFloatingNonReplacedWidth(layoutContext, layoutBox, displayBox);
    9494        return;
    9595    }
     
    296296}
    297297
     298void FormattingContext::computeFloatingNonReplacedWidth(LayoutContext& layoutContext, const Box& layoutBox, Display::Box& displayBox) const
     299{
     300    ASSERT(layoutBox.isFloatingPositioned() && !layoutBox.replaced());
     301    // 10.3.5 Floating, non-replaced elements
     302
     303    // If 'width' is computed as 'auto', the used value is the "shrink-to-fit" width.
     304    auto width = layoutBox.style().logicalWidth();
     305    displayBox.setWidth(width.isAuto() ? shrinkToFitWidth(layoutContext, layoutBox) : LayoutUnit(width.value()));
     306}
     307
    298308void FormattingContext::computeOutOfFlowNonReplacedWidth(LayoutContext& layoutContext, const Box& layoutBox, Display::Box& displayBox) const
    299309{
  • trunk/Source/WebCore/layout/FormattingContext.h

    r231894 r231952  
    9595    void computeOutOfFlowReplacedWidth(LayoutContext&, const Box&, Display::Box&) const;
    9696
     97    void computeFloatingNonReplacedWidth(LayoutContext&, const Box&, Display::Box&) const;
     98
    9799    LayoutUnit contentHeightForFormattingContextRoot(LayoutContext&, const Box&) const;
    98100    LayoutUnit shrinkToFitWidth(LayoutContext&, const Box&) const;
Note: See TracChangeset for help on using the changeset viewer.