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

Changeset 238480 in webkit


Ignore:
Timestamp:
Nov 25, 2018, 1:30:34 PM (8 years ago)
Author:
Alan Bujtas
Message:

[LFC] Floating code should use typed positions (PositionInContextRoot).
https://bugs.webkit.org/show_bug.cgi?id=191949

Reviewed by Antti Koivisto.

Use PositionInContextRoot instead of LayoutUnit.

  • layout/floats/FloatingState.cpp:

(WebCore::Layout::FloatingState::constraints const):
(WebCore::Layout::FloatingState::bottom const):

  • layout/floats/FloatingState.h:

(WebCore::Layout::FloatingState::leftBottom const):
(WebCore::Layout::FloatingState::rightBottom const):
(WebCore::Layout::FloatingState::bottom const):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r238479 r238480  
     12018-11-25  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC] Floating code should use typed positions (PositionInContextRoot).
     4        https://bugs.webkit.org/show_bug.cgi?id=191949
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Use PositionInContextRoot instead of LayoutUnit.
     9
     10        * layout/floats/FloatingState.cpp:
     11        (WebCore::Layout::FloatingState::constraints const):
     12        (WebCore::Layout::FloatingState::bottom const):
     13        * layout/floats/FloatingState.h:
     14        (WebCore::Layout::FloatingState::leftBottom const):
     15        (WebCore::Layout::FloatingState::rightBottom const):
     16        (WebCore::Layout::FloatingState::bottom const):
     17
    1182018-11-25  Zalan Bujtas  <zalan@apple.com>
    219
  • trunk/Source/WebCore/layout/floats/FloatingState.cpp

    r237631 r238480  
    8787}
    8888
    89 FloatingState::Constraints FloatingState::constraints(LayoutUnit verticalPosition, const Box& formattingContextRoot) const
     89FloatingState::Constraints FloatingState::constraints(PositionInContextRoot verticalPosition, const Box& formattingContextRoot) const
    9090{
    9191    if (isEmpty())
     
    135135}
    136136
    137 std::optional<LayoutUnit> FloatingState::bottom(const Box& formattingContextRoot, Clear type) const
     137std::optional<PositionInContextRoot> FloatingState::bottom(const Box& formattingContextRoot, Clear type) const
    138138{
    139139    if (m_floats.isEmpty())
     
    142142    // TODO: Currently this is only called once for each formatting context root with floats per layout.
    143143    // Cache the value if we end up calling it more frequently (and update it at append/remove).
    144     std::optional<LayoutUnit> bottom;
     144    std::optional<PositionInContextRoot> bottom;
    145145    for (auto& floatItem : m_floats) {
    146146        // Ignore floats from other formatting contexts when the floating state is inherited.
  • trunk/Source/WebCore/layout/floats/FloatingState.h

    r237631 r238480  
    5555    const Box& root() const { return *m_formattingContextRoot; }
    5656
    57     std::optional<LayoutUnit> leftBottom(const Box& formattingContextRoot) const;
    58     std::optional<LayoutUnit> rightBottom(const Box& formattingContextRoot) const;
    59     std::optional<LayoutUnit> bottom(const Box& formattingContextRoot) const;
     57    std::optional<PositionInContextRoot> leftBottom(const Box& formattingContextRoot) const;
     58    std::optional<PositionInContextRoot> rightBottom(const Box& formattingContextRoot) const;
     59    std::optional<PositionInContextRoot> bottom(const Box& formattingContextRoot) const;
    6060
    6161    struct Constraints {
    62         std::optional<LayoutUnit> left;
    63         std::optional<LayoutUnit> right;
     62        std::optional<PositionInContextRoot> left;
     63        std::optional<PositionInContextRoot> right;
    6464    };
    65     Constraints constraints(LayoutUnit verticalPosition, const Box& formattingContextRoot) const;
     65    Constraints constraints(PositionInContextRoot verticalPosition, const Box& formattingContextRoot) const;
    6666
    6767    class FloatItem {
     
    9191    LayoutState& layoutState() const { return m_layoutState; }
    9292
    93     std::optional<LayoutUnit> bottom(const Box& formattingContextRoot, Clear) const;
     93    std::optional<PositionInContextRoot> bottom(const Box& formattingContextRoot, Clear) const;
    9494
    9595    LayoutState& m_layoutState;
     
    9898};
    9999
    100 inline std::optional<LayoutUnit> FloatingState::leftBottom(const Box& formattingContextRoot) const
     100inline std::optional<PositionInContextRoot> FloatingState::leftBottom(const Box& formattingContextRoot) const
    101101{
    102102    ASSERT(formattingContextRoot.establishesFormattingContext());
     
    104104}
    105105
    106 inline std::optional<LayoutUnit> FloatingState::rightBottom(const Box& formattingContextRoot) const
     106inline std::optional<PositionInContextRoot> FloatingState::rightBottom(const Box& formattingContextRoot) const
    107107{
    108108    ASSERT(formattingContextRoot.establishesFormattingContext());
     
    110110}
    111111
    112 inline std::optional<LayoutUnit> FloatingState::bottom(const Box& formattingContextRoot) const
     112inline std::optional<PositionInContextRoot> FloatingState::bottom(const Box& formattingContextRoot) const
    113113{
    114114    ASSERT(formattingContextRoot.establishesFormattingContext());
Note: See TracChangeset for help on using the changeset viewer.