Diff
Modified: trunk/Source/WebCore/ChangeLog (273639 => 273640)
--- trunk/Source/WebCore/ChangeLog 2021-02-28 20:56:37 UTC (rev 273639)
+++ trunk/Source/WebCore/ChangeLog 2021-03-01 00:13:12 UTC (rev 273640)
@@ -1,3 +1,35 @@
+2021-02-28 Zalan Bujtas <[email protected]>
+
+ [LFC][IFC] Content left offset means just content left
+ https://bugs.webkit.org/show_bug.cgi?id=222522
+
+ Reviewed by Antti Koivisto.
+
+ * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
+ (WebCore::Layout::LineBoxBuilder::build):
+ * layout/inlineformatting/InlineLineBox.cpp:
+ (WebCore::Layout::LineBox::LineBox):
+ (WebCore::Layout::m_contentLogicalWidth):
+ * layout/inlineformatting/InlineLineBox.h:
+ * layout/inlineformatting/InlineLineGeometry.h:
+ (WebCore::Layout::InlineLineGeometry::contentLogicalLeft const):
+ (WebCore::Layout::InlineLineGeometry::InlineLineGeometry):
+ (WebCore::Layout::InlineLineGeometry::contentLogicalLeftOffset const): Deleted.
+ * layout/integration/LayoutIntegrationInlineContentBuilder.cpp:
+ (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLines const):
+ * layout/integration/LayoutIntegrationLine.h:
+ (WebCore::LayoutIntegration::Line::Line):
+ (WebCore::LayoutIntegration::Line::contentLeft const):
+ (WebCore::LayoutIntegration::Line::contentLeftOffset const): Deleted.
+ * layout/integration/LayoutIntegrationLineIteratorModernPath.h:
+ (WebCore::LayoutIntegration::LineIteratorModernPath::contentLogicalLeft const):
+ * layout/integration/LayoutIntegrationLineLayout.cpp:
+ (WebCore::LayoutIntegration::LineLayout::paint):
+ * layout/integration/LayoutIntegrationPagination.cpp:
+ (WebCore::LayoutIntegration::makeAdjustedContent):
+ * layout/integration/LayoutIntegrationRunIteratorModernPath.h:
+ (WebCore::LayoutIntegration::RunIteratorModernPath::createTextRun const):
+
2021-02-28 Darin Adler <[email protected]>
[iOS] Reduce use of retain/release in WAKWindow and remove unneeded methods from that class
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp (273639 => 273640)
--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp 2021-02-28 20:56:37 UTC (rev 273639)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp 2021-03-01 00:13:12 UTC (rev 273640)
@@ -158,7 +158,7 @@
auto lineLogicalWidth = lineContent.lineLogicalWidth;
auto contentLogicalWidth = lineContent.contentLogicalWidth;
auto horizontalAlignmentOffset = Layout::horizontalAlignmentOffset(runs, rootBox().style().textAlign(), lineLogicalWidth, contentLogicalWidth, lineContent.isLastLineWithInlineContent);
- auto lineBox = LineBox { rootBox(), lineContent.logicalTopLeft, lineLogicalWidth, contentLogicalWidth, horizontalAlignmentOffset, runs.size() };
+ auto lineBox = LineBox { rootBox(), lineContent.logicalTopLeft, lineLogicalWidth, horizontalAlignmentOffset.valueOr(InlineLayoutUnit { }), contentLogicalWidth, runs.size() };
constructInlineLevelBoxes(lineBox, runs);
if (m_inlineLevelBoxesNeedVerticalAlignment)
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.cpp (273639 => 273640)
--- trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.cpp 2021-02-28 20:56:37 UTC (rev 273639)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.cpp 2021-03-01 00:13:12 UTC (rev 273640)
@@ -83,10 +83,10 @@
return verticalAlignment == VerticalAlign::Top || verticalAlignment == VerticalAlign::Bottom;
}
-LineBox::LineBox(const Box& rootLayoutBox, const InlineLayoutPoint& logicalTopleft, InlineLayoutUnit lineLogicalWidth, InlineLayoutUnit contentLogicalWidth, Optional<InlineLayoutUnit> horizontalAlignmentOffset, size_t numberOfRuns)
+LineBox::LineBox(const Box& rootLayoutBox, const InlineLayoutPoint& logicalTopleft, InlineLayoutUnit lineLogicalWidth, InlineLayoutUnit contentLogicalLeft, InlineLayoutUnit contentLogicalWidth, size_t numberOfRuns)
: m_logicalRect(logicalTopleft, InlineLayoutSize { lineLogicalWidth, { } })
, m_contentLogicalWidth(contentLogicalWidth)
- , m_rootInlineBox(makeUniqueRef<LineBox::InlineLevelBox>(rootLayoutBox, horizontalAlignmentOffset.valueOr(InlineLayoutUnit { }), InlineLayoutSize { contentLogicalWidth, { } }, InlineLevelBox::Type::RootInlineBox))
+ , m_rootInlineBox(makeUniqueRef<LineBox::InlineLevelBox>(rootLayoutBox, contentLogicalLeft, InlineLayoutSize { contentLogicalWidth, { } }, InlineLevelBox::Type::RootInlineBox))
{
m_nonRootInlineLevelBoxList.reserveInitialCapacity(numberOfRuns);
m_inlineLevelBoxRectMap.reserveInitialCapacity(numberOfRuns);
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.h (273639 => 273640)
--- trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.h 2021-02-28 20:56:37 UTC (rev 273639)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.h 2021-03-01 00:13:12 UTC (rev 273640)
@@ -131,7 +131,7 @@
Type m_type { Type::InlineBox };
};
- LineBox(const Box& rootLayoutBox, const InlineLayoutPoint& logicalTopLeft, InlineLayoutUnit lineLogicalWidth, InlineLayoutUnit contentLogicalWidth, Optional<InlineLayoutUnit> horizontalAlignmentOffset, size_t numberOfRuns);
+ LineBox(const Box& rootLayoutBox, const InlineLayoutPoint& logicalTopLeft, InlineLayoutUnit contentLogicalLeft, InlineLayoutUnit lineLogicalWidth, InlineLayoutUnit contentLogicalWidth, size_t numberOfRuns);
const InlineRect& logicalRect() const { return m_logicalRect; }
InlineLayoutUnit logicalWidth() const { return logicalSize().width(); }
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLineGeometry.h (273639 => 273640)
--- trunk/Source/WebCore/layout/inlineformatting/InlineLineGeometry.h 2021-02-28 20:56:37 UTC (rev 273639)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLineGeometry.h 2021-03-01 00:13:12 UTC (rev 273640)
@@ -40,7 +40,7 @@
InlineLayoutUnit top { 0 };
InlineLayoutUnit bottom { 0 };
};
- InlineLineGeometry(const InlineRect& lineBoxLogicalRect, EnclosingTopAndBottom, InlineLayoutUnit aligmentBaseline, InlineLayoutUnit contentLogicalLeftOffset, InlineLayoutUnit contentLogicalWidth);
+ InlineLineGeometry(const InlineRect& lineBoxLogicalRect, EnclosingTopAndBottom, InlineLayoutUnit aligmentBaseline, InlineLayoutUnit contentLogicalLeft, InlineLayoutUnit contentLogicalWidth);
const InlineRect& lineBoxLogicalRect() const { return m_lineBoxLogicalRect; }
@@ -48,7 +48,7 @@
InlineLayoutUnit baseline() const { return m_aligmentBaseline; }
- InlineLayoutUnit contentLogicalLeftOffset() const { return m_contentLogicalLeftOffset; }
+ InlineLayoutUnit contentLogicalLeft() const { return m_contentLogicalLeft; }
InlineLayoutUnit contentLogicalWidth() const { return m_contentLogicalWidth; }
void moveVertically(InlineLayoutUnit offset) { m_lineBoxLogicalRect.moveVertically(offset); }
@@ -61,15 +61,15 @@
// the layout bounds of the inline level boxes which may be different when line-height is present.
EnclosingTopAndBottom m_enclosingTopAndBottom;
InlineLayoutUnit m_aligmentBaseline { 0 };
- InlineLayoutUnit m_contentLogicalLeftOffset { 0 };
+ InlineLayoutUnit m_contentLogicalLeft { 0 };
InlineLayoutUnit m_contentLogicalWidth { 0 };
};
-inline InlineLineGeometry::InlineLineGeometry(const InlineRect& lineBoxLogicalRect, EnclosingTopAndBottom enclosingTopAndBottom, InlineLayoutUnit aligmentBaseline, InlineLayoutUnit contentLogicalLeftOffset, InlineLayoutUnit contentLogicalWidth)
+inline InlineLineGeometry::InlineLineGeometry(const InlineRect& lineBoxLogicalRect, EnclosingTopAndBottom enclosingTopAndBottom, InlineLayoutUnit aligmentBaseline, InlineLayoutUnit contentLogicalLeft, InlineLayoutUnit contentLogicalWidth)
: m_lineBoxLogicalRect(lineBoxLogicalRect)
, m_enclosingTopAndBottom(enclosingTopAndBottom)
, m_aligmentBaseline(aligmentBaseline)
- , m_contentLogicalLeftOffset(contentLogicalLeftOffset)
+ , m_contentLogicalLeft(contentLogicalLeft)
, m_contentLogicalWidth(contentLogicalWidth)
{
}
Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContentBuilder.cpp (273639 => 273640)
--- trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContentBuilder.cpp 2021-02-28 20:56:37 UTC (rev 273639)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContentBuilder.cpp 2021-03-01 00:13:12 UTC (rev 273640)
@@ -359,7 +359,7 @@
enclosingTopAndBottom.bottom = roundToInt(enclosingTopAndBottom.bottom);
}
auto runCount = runIndex - firstRunIndex;
- inlineContent.lines.append({ firstRunIndex, runCount, adjustedLineBoxRect, enclosingTopAndBottom.top, enclosingTopAndBottom.bottom, scrollableOverflowRect, lineInkOverflowRect, line.baseline(), line.contentLogicalLeftOffset(), line.contentLogicalWidth() });
+ inlineContent.lines.append({ firstRunIndex, runCount, adjustedLineBoxRect, enclosingTopAndBottom.top, enclosingTopAndBottom.bottom, scrollableOverflowRect, lineInkOverflowRect, line.baseline(), line.contentLogicalLeft(), line.contentLogicalWidth() });
}
}
Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLine.h (273639 => 273640)
--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLine.h 2021-02-28 20:56:37 UTC (rev 273639)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLine.h 2021-03-01 00:13:12 UTC (rev 273640)
@@ -36,7 +36,7 @@
class Line {
WTF_MAKE_FAST_ALLOCATED;
public:
- Line(size_t firstRunIndex, size_t runCount, const FloatRect& lineBoxRect, float enclosingContentTop, float enclosingContentBottom, const FloatRect& scrollableOverflow, const FloatRect& inkOverflow, float baseline, float contentLeftOffset, float contentWidth)
+ Line(size_t firstRunIndex, size_t runCount, const FloatRect& lineBoxRect, float enclosingContentTop, float enclosingContentBottom, const FloatRect& scrollableOverflow, const FloatRect& inkOverflow, float baseline, float contentLeft, float contentWidth)
: m_firstRunIndex(firstRunIndex)
, m_runCount(runCount)
, m_lineBoxRect(lineBoxRect)
@@ -45,7 +45,7 @@
, m_scrollableOverflow(scrollableOverflow)
, m_inkOverflow(inkOverflow)
, m_baseline(baseline)
- , m_contentLeftOffset(contentLeftOffset)
+ , m_contentLeft(contentLeft)
, m_contentWidth(contentWidth)
{
}
@@ -66,7 +66,7 @@
float baseline() const { return m_baseline; }
- float contentLeftOffset() const { return m_contentLeftOffset; }
+ float contentLeft() const { return m_contentLeft; }
float contentWidth() const { return m_contentWidth; }
private:
@@ -82,7 +82,7 @@
FloatRect m_scrollableOverflow;
FloatRect m_inkOverflow;
float m_baseline { 0 };
- float m_contentLeftOffset { 0 };
+ float m_contentLeft { 0 };
float m_contentWidth { 0 };
};
Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorModernPath.h (273639 => 273640)
--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorModernPath.h 2021-02-28 20:56:37 UTC (rev 273639)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorModernPath.h 2021-03-01 00:13:12 UTC (rev 273640)
@@ -59,7 +59,7 @@
LayoutUnit selectionTopForHitTesting() const { return top(); }
LayoutUnit selectionBottom() const { return bottom(); }
- float contentLogicalLeft() const { return line().lineBoxLeft() + line().contentLeftOffset(); }
+ float contentLogicalLeft() const { return line().lineBoxLeft() + line().contentLeft(); }
float contentLogicalRight() const { return contentLogicalLeft() + line().contentWidth(); }
float y() const { return lineBoxTop(); }
float logicalHeight() const { return lineBoxBottom() - lineBoxTop(); }
Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (273639 => 273640)
--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp 2021-02-28 20:56:37 UTC (rev 273639)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp 2021-03-01 00:13:12 UTC (rev 273640)
@@ -493,7 +493,7 @@
// TextRun expects the xPos to be adjusted with the aligment offset (e.g. when the line is center aligned
// and the run starts at 100px, due to the horizontal aligment, the xpos is supposed to be at 0px).
auto& fontCascade = style.fontCascade();
- auto xPos = rect.x() - (line.lineBoxLeft() + line.contentLeftOffset());
+ auto xPos = rect.x() - (line.lineBoxLeft() + line.contentLeft());
WebCore::TextRun textRun { textContent.renderedContent(), xPos, expansion.horizontalExpansion, expansion.behavior };
textRun.setTabSize(!style.collapseWhiteSpace(), style.tabSize());
Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationPagination.cpp (273639 => 273640)
--- trunk/Source/WebCore/layout/integration/LayoutIntegrationPagination.cpp 2021-02-28 20:56:37 UTC (rev 273639)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationPagination.cpp 2021-03-01 00:13:12 UTC (rev 273640)
@@ -135,7 +135,7 @@
moveVertically(line.scrollableOverflow(), offset),
moveVertically(line.inkOverflow(), offset),
line.baseline(),
- line.contentLeftOffset(),
+ line.contentLeft(),
line.contentWidth()
};
};
Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIteratorModernPath.h (273639 => 273640)
--- trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIteratorModernPath.h 2021-02-28 20:56:37 UTC (rev 273639)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIteratorModernPath.h 2021-03-01 00:13:12 UTC (rev 273640)
@@ -221,7 +221,7 @@
auto& style = run().style();
auto expansion = run().expansion();
auto rect = this->rect();
- auto xPos = rect.x() - (line().lineBoxLeft() + line().contentLeftOffset());
+ auto xPos = rect.x() - (line().lineBoxLeft() + line().contentLeft());
auto textForRun = [&] {
if (hyphenMode == HyphenMode::Ignore || !hasHyphen())