Title: [238480] trunk/Source/WebCore
- Revision
- 238480
- Author
- [email protected]
- Date
- 2018-11-25 13:30:34 -0800 (Sun, 25 Nov 2018)
Log 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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (238479 => 238480)
--- trunk/Source/WebCore/ChangeLog 2018-11-25 21:28:33 UTC (rev 238479)
+++ trunk/Source/WebCore/ChangeLog 2018-11-25 21:30:34 UTC (rev 238480)
@@ -1,5 +1,22 @@
2018-11-25 Zalan Bujtas <[email protected]>
+ [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):
+
+2018-11-25 Zalan Bujtas <[email protected]>
+
Fix build after r238472.
* layout/inlineformatting/InlineFormattingContext.cpp:
Modified: trunk/Source/WebCore/layout/floats/FloatingState.cpp (238479 => 238480)
--- trunk/Source/WebCore/layout/floats/FloatingState.cpp 2018-11-25 21:28:33 UTC (rev 238479)
+++ trunk/Source/WebCore/layout/floats/FloatingState.cpp 2018-11-25 21:30:34 UTC (rev 238480)
@@ -86,7 +86,7 @@
m_floats.append({ layoutBox, *this });
}
-FloatingState::Constraints FloatingState::constraints(LayoutUnit verticalPosition, const Box& formattingContextRoot) const
+FloatingState::Constraints FloatingState::constraints(PositionInContextRoot verticalPosition, const Box& formattingContextRoot) const
{
if (isEmpty())
return { };
@@ -134,7 +134,7 @@
return constraints;
}
-std::optional<LayoutUnit> FloatingState::bottom(const Box& formattingContextRoot, Clear type) const
+std::optional<PositionInContextRoot> FloatingState::bottom(const Box& formattingContextRoot, Clear type) const
{
if (m_floats.isEmpty())
return { };
@@ -141,7 +141,7 @@
// TODO: Currently this is only called once for each formatting context root with floats per layout.
// Cache the value if we end up calling it more frequently (and update it at append/remove).
- std::optional<LayoutUnit> bottom;
+ std::optional<PositionInContextRoot> bottom;
for (auto& floatItem : m_floats) {
// Ignore floats from other formatting contexts when the floating state is inherited.
if (!floatItem.inFormattingContext(formattingContextRoot))
Modified: trunk/Source/WebCore/layout/floats/FloatingState.h (238479 => 238480)
--- trunk/Source/WebCore/layout/floats/FloatingState.h 2018-11-25 21:28:33 UTC (rev 238479)
+++ trunk/Source/WebCore/layout/floats/FloatingState.h 2018-11-25 21:30:34 UTC (rev 238480)
@@ -54,15 +54,15 @@
const Box& root() const { return *m_formattingContextRoot; }
- std::optional<LayoutUnit> leftBottom(const Box& formattingContextRoot) const;
- std::optional<LayoutUnit> rightBottom(const Box& formattingContextRoot) const;
- std::optional<LayoutUnit> bottom(const Box& formattingContextRoot) const;
+ std::optional<PositionInContextRoot> leftBottom(const Box& formattingContextRoot) const;
+ std::optional<PositionInContextRoot> rightBottom(const Box& formattingContextRoot) const;
+ std::optional<PositionInContextRoot> bottom(const Box& formattingContextRoot) const;
struct Constraints {
- std::optional<LayoutUnit> left;
- std::optional<LayoutUnit> right;
+ std::optional<PositionInContextRoot> left;
+ std::optional<PositionInContextRoot> right;
};
- Constraints constraints(LayoutUnit verticalPosition, const Box& formattingContextRoot) const;
+ Constraints constraints(PositionInContextRoot verticalPosition, const Box& formattingContextRoot) const;
class FloatItem {
public:
@@ -90,7 +90,7 @@
LayoutState& layoutState() const { return m_layoutState; }
- std::optional<LayoutUnit> bottom(const Box& formattingContextRoot, Clear) const;
+ std::optional<PositionInContextRoot> bottom(const Box& formattingContextRoot, Clear) const;
LayoutState& m_layoutState;
WeakPtr<const Box> m_formattingContextRoot;
@@ -97,19 +97,19 @@
FloatList m_floats;
};
-inline std::optional<LayoutUnit> FloatingState::leftBottom(const Box& formattingContextRoot) const
+inline std::optional<PositionInContextRoot> FloatingState::leftBottom(const Box& formattingContextRoot) const
{
ASSERT(formattingContextRoot.establishesFormattingContext());
return bottom(formattingContextRoot, Clear::Left);
}
-inline std::optional<LayoutUnit> FloatingState::rightBottom(const Box& formattingContextRoot) const
+inline std::optional<PositionInContextRoot> FloatingState::rightBottom(const Box& formattingContextRoot) const
{
ASSERT(formattingContextRoot.establishesFormattingContext());
return bottom(formattingContextRoot, Clear::Right);
}
-inline std::optional<LayoutUnit> FloatingState::bottom(const Box& formattingContextRoot) const
+inline std::optional<PositionInContextRoot> FloatingState::bottom(const Box& formattingContextRoot) const
{
ASSERT(formattingContextRoot.establishesFormattingContext());
return bottom(formattingContextRoot, Clear::Both);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes