Title: [270135] trunk/Source/WebCore
- Revision
- 270135
- Author
- [email protected]
- Date
- 2020-11-20 15:03:53 -0800 (Fri, 20 Nov 2020)
Log Message
[LFC][IFC] Assign top/left to LineBox
https://bugs.webkit.org/show_bug.cgi?id=219218
Reviewed by Antti Koivisto.
It makes the LineBox class more aligned with the spec (https://www.w3.org/TR/css-inline-3/#line-box).
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::LineBoxBuilder::build):
(WebCore::Layout::InlineFormattingContext::Geometry::computedLineLogicalRect const):
* layout/inlineformatting/InlineLineBox.cpp:
(WebCore::Layout::LineBox::LineBox):
* layout/inlineformatting/InlineLineBox.h:
(WebCore::Layout::LineBox::logicalWidth const):
(WebCore::Layout::LineBox::logicalHeight const):
(WebCore::Layout::LineBox::logicalTopLeft const):
(WebCore::Layout::LineBox::logicalSize const):
(WebCore::Layout::LineBox::setLogicalHeight):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (270134 => 270135)
--- trunk/Source/WebCore/ChangeLog 2020-11-20 22:37:00 UTC (rev 270134)
+++ trunk/Source/WebCore/ChangeLog 2020-11-20 23:03:53 UTC (rev 270135)
@@ -1,3 +1,24 @@
+2020-11-20 Zalan Bujtas <[email protected]>
+
+ [LFC][IFC] Assign top/left to LineBox
+ https://bugs.webkit.org/show_bug.cgi?id=219218
+
+ Reviewed by Antti Koivisto.
+
+ It makes the LineBox class more aligned with the spec (https://www.w3.org/TR/css-inline-3/#line-box).
+
+ * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
+ (WebCore::Layout::LineBoxBuilder::build):
+ (WebCore::Layout::InlineFormattingContext::Geometry::computedLineLogicalRect const):
+ * layout/inlineformatting/InlineLineBox.cpp:
+ (WebCore::Layout::LineBox::LineBox):
+ * layout/inlineformatting/InlineLineBox.h:
+ (WebCore::Layout::LineBox::logicalWidth const):
+ (WebCore::Layout::LineBox::logicalHeight const):
+ (WebCore::Layout::LineBox::logicalTopLeft const):
+ (WebCore::Layout::LineBox::logicalSize const):
+ (WebCore::Layout::LineBox::setLogicalHeight):
+
2020-11-20 Simon Fraser <[email protected]>
Dispatch main-thread overflow scrolls to the scrolling thread as we do for page scrolls
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp (270134 => 270135)
--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp 2020-11-20 22:37:00 UTC (rev 270134)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp 2020-11-20 23:03:53 UTC (rev 270135)
@@ -157,7 +157,7 @@
auto lineLogicalWidth = lineContent.lineLogicalWidth;
auto contentLogicalWidth = lineContent.lineContentLogicalWidth;
auto isLineConsideredEmpty = lineContent.isLineConsideredEmpty ? LineBox::IsLineConsideredEmpty::Yes : LineBox::IsLineConsideredEmpty::No;
- auto lineBox = LineBox { contentLogicalWidth, isLineConsideredEmpty };
+ auto lineBox = LineBox { lineContent.logicalTopLeft, contentLogicalWidth, isLineConsideredEmpty };
if (auto horizontalAlignmentOffset = Layout::horizontalAlignmentOffset(runs, rootBox().style().textAlign(), lineLogicalWidth, contentLogicalWidth, lineContent.isLastLineWithInlineContent))
lineBox.setHorizontalAlignmentOffset(*horizontalAlignmentOffset);
@@ -530,7 +530,7 @@
InlineRect InlineFormattingContext::Geometry::computedLineLogicalRect(const LineBox& lineBox, const LineBuilder::LineContent& lineContent) const
{
- return { lineContent.logicalTopLeft, lineContent.lineLogicalWidth, lineBox.logicalHeight() };
+ return { lineBox.logicalTopLeft(), lineContent.lineLogicalWidth, lineBox.logicalHeight() };
}
InlineLayoutUnit InlineFormattingContext::Geometry::logicalTopForNextLine(const LineBuilder::LineContent& lineContent, InlineLayoutUnit previousLineLogicalBottom, const FloatingContext& floatingContext) const
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.cpp (270134 => 270135)
--- trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.cpp 2020-11-20 22:37:00 UTC (rev 270134)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.cpp 2020-11-20 23:03:53 UTC (rev 270135)
@@ -75,8 +75,8 @@
return verticalAlignment == VerticalAlign::Top || verticalAlignment == VerticalAlign::Bottom;
}
-LineBox::LineBox(InlineLayoutUnit contentLogicalWidth, IsLineConsideredEmpty isLineConsideredEmpty)
- : m_logicalSize(contentLogicalWidth, { })
+LineBox::LineBox(const InlineLayoutPoint& logicalTopleft, InlineLayoutUnit contentLogicalWidth, IsLineConsideredEmpty isLineConsideredEmpty)
+ : m_logicalRect(logicalTopleft, InlineLayoutSize { contentLogicalWidth, { } })
, m_isConsideredEmpty(isLineConsideredEmpty == IsLineConsideredEmpty::Yes)
{
}
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.h (270134 => 270135)
--- trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.h 2020-11-20 22:37:00 UTC (rev 270134)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.h 2020-11-20 23:03:53 UTC (rev 270135)
@@ -129,11 +129,12 @@
};
enum class IsLineConsideredEmpty { No, Yes };
- LineBox(InlineLayoutUnit logicalWidth, IsLineConsideredEmpty);
+ LineBox(const InlineLayoutPoint& logicalTopLeft, InlineLayoutUnit logicalWidth, IsLineConsideredEmpty);
- InlineLayoutUnit logicalWidth() const { return m_logicalSize.width(); }
- InlineLayoutUnit logicalHeight() const { return m_logicalSize.height(); }
- InlineLayoutSize logicalSize() const { return m_logicalSize; }
+ InlineLayoutUnit logicalWidth() const { return logicalSize().width(); }
+ InlineLayoutUnit logicalHeight() const { return logicalSize().height(); }
+ InlineLayoutPoint logicalTopLeft() const { return m_logicalRect.topLeft(); }
+ InlineLayoutSize logicalSize() const { return m_logicalRect.size(); }
Optional<InlineLayoutUnit> horizontalAlignmentOffset() const { return m_horizontalAlignmentOffset; }
bool isConsideredEmpty() const { return m_isConsideredEmpty; }
@@ -155,7 +156,7 @@
private:
friend class LineBoxBuilder;
- void setLogicalHeight(InlineLayoutUnit logicalHeight) { m_logicalSize.setHeight(logicalHeight); }
+ void setLogicalHeight(InlineLayoutUnit logicalHeight) { m_logicalRect.setHeight(logicalHeight); }
void setHorizontalAlignmentOffset(InlineLayoutUnit horizontalAlignmentOffset) { m_horizontalAlignmentOffset = horizontalAlignmentOffset; }
void addRootInlineBox(std::unique_ptr<InlineLevelBox>&&);
@@ -166,7 +167,7 @@
InlineLevelBox& inlineLevelBoxForLayoutBox(const Box& layoutBox) { return *m_inlineLevelBoxRectMap.get(&layoutBox); }
private:
- InlineLayoutSize m_logicalSize;
+ InlineRect m_logicalRect;
Optional<InlineLayoutUnit> m_horizontalAlignmentOffset;
bool m_isConsideredEmpty { true };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes