Changeset 238480 in webkit
- Timestamp:
- Nov 25, 2018, 1:30:34 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
layout/floats/FloatingState.cpp (modified) (3 diffs)
-
layout/floats/FloatingState.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r238479 r238480 1 2018-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 1 18 2018-11-25 Zalan Bujtas <zalan@apple.com> 2 19 -
trunk/Source/WebCore/layout/floats/FloatingState.cpp
r237631 r238480 87 87 } 88 88 89 FloatingState::Constraints FloatingState::constraints( LayoutUnit verticalPosition, const Box& formattingContextRoot) const89 FloatingState::Constraints FloatingState::constraints(PositionInContextRoot verticalPosition, const Box& formattingContextRoot) const 90 90 { 91 91 if (isEmpty()) … … 135 135 } 136 136 137 std::optional< LayoutUnit> FloatingState::bottom(const Box& formattingContextRoot, Clear type) const137 std::optional<PositionInContextRoot> FloatingState::bottom(const Box& formattingContextRoot, Clear type) const 138 138 { 139 139 if (m_floats.isEmpty()) … … 142 142 // TODO: Currently this is only called once for each formatting context root with floats per layout. 143 143 // 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; 145 145 for (auto& floatItem : m_floats) { 146 146 // Ignore floats from other formatting contexts when the floating state is inherited. -
trunk/Source/WebCore/layout/floats/FloatingState.h
r237631 r238480 55 55 const Box& root() const { return *m_formattingContextRoot; } 56 56 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; 60 60 61 61 struct Constraints { 62 std::optional< LayoutUnit> left;63 std::optional< LayoutUnit> right;62 std::optional<PositionInContextRoot> left; 63 std::optional<PositionInContextRoot> right; 64 64 }; 65 Constraints constraints( LayoutUnit verticalPosition, const Box& formattingContextRoot) const;65 Constraints constraints(PositionInContextRoot verticalPosition, const Box& formattingContextRoot) const; 66 66 67 67 class FloatItem { … … 91 91 LayoutState& layoutState() const { return m_layoutState; } 92 92 93 std::optional< LayoutUnit> bottom(const Box& formattingContextRoot, Clear) const;93 std::optional<PositionInContextRoot> bottom(const Box& formattingContextRoot, Clear) const; 94 94 95 95 LayoutState& m_layoutState; … … 98 98 }; 99 99 100 inline std::optional< LayoutUnit> FloatingState::leftBottom(const Box& formattingContextRoot) const100 inline std::optional<PositionInContextRoot> FloatingState::leftBottom(const Box& formattingContextRoot) const 101 101 { 102 102 ASSERT(formattingContextRoot.establishesFormattingContext()); … … 104 104 } 105 105 106 inline std::optional< LayoutUnit> FloatingState::rightBottom(const Box& formattingContextRoot) const106 inline std::optional<PositionInContextRoot> FloatingState::rightBottom(const Box& formattingContextRoot) const 107 107 { 108 108 ASSERT(formattingContextRoot.establishesFormattingContext()); … … 110 110 } 111 111 112 inline std::optional< LayoutUnit> FloatingState::bottom(const Box& formattingContextRoot) const112 inline std::optional<PositionInContextRoot> FloatingState::bottom(const Box& formattingContextRoot) const 113 113 { 114 114 ASSERT(formattingContextRoot.establishesFormattingContext());
Note:
See TracChangeset
for help on using the changeset viewer.