Diff
Modified: trunk/Source/WebCore/ChangeLog (282901 => 282902)
--- trunk/Source/WebCore/ChangeLog 2021-09-23 01:48:46 UTC (rev 282901)
+++ trunk/Source/WebCore/ChangeLog 2021-09-23 02:39:34 UTC (rev 282902)
@@ -1,5 +1,39 @@
2021-09-22 Alan Bujtas <za...@apple.com>
+ [LFC][IFC] Move LineGeometry under InlineDisplay namespace
+ https://bugs.webkit.org/show_bug.cgi?id=230635
+
+ Reviewed by Antti Koivisto.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * display/css/DisplayBoxFactory.cpp:
+ (WebCore::Display::BoxFactory::displayBoxForTextRun const):
+ * display/css/DisplayBoxFactory.h:
+ * layout/formattingContexts/inline/InlineFormattingContext.cpp:
+ (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
+ * layout/formattingContexts/inline/InlineFormattingState.h:
+ (WebCore::Layout::InlineFormattingState::lines const):
+ (WebCore::Layout::InlineFormattingState::lines):
+ (WebCore::Layout::InlineFormattingState::addLine):
+ (WebCore::Layout::InlineFormattingState::clearLineAndRuns):
+ (WebCore::Layout::InlineFormattingState::shrinkToFit):
+ * layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
+ (WebCore::Layout::LineBoxBuilder::build):
+ * layout/formattingContexts/inline/InlineLineBoxBuilder.h:
+ * layout/formattingContexts/inline/display/InlineDisplayLine.h: Renamed from Source/WebCore/layout/formattingContexts/inline/display/InlineLineGeometry.h.
+ (WebCore::InlineDisplay::Line::lineBoxLogicalRect const):
+ (WebCore::InlineDisplay::Line::scrollableOverflow const):
+ (WebCore::InlineDisplay::Line::enclosingTopAndBottom const):
+ (WebCore::InlineDisplay::Line::baseline const):
+ (WebCore::InlineDisplay::Line::contentLogicalLeft const):
+ (WebCore::InlineDisplay::Line::contentLogicalWidth const):
+ (WebCore::InlineDisplay::Line::moveVertically):
+ (WebCore::InlineDisplay::Line::Line):
+ * layout/integration/LayoutIntegrationInlineContentBuilder.cpp:
+ (WebCore::LayoutIntegration::operator+):
+
+2021-09-22 Alan Bujtas <za...@apple.com>
+
[LFC][IFC] Move LineGeometry and LineRun files under /inline/display
https://bugs.webkit.org/show_bug.cgi?id=230632
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (282901 => 282902)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2021-09-23 01:48:46 UTC (rev 282901)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2021-09-23 02:39:34 UTC (rev 282902)
@@ -2195,7 +2195,7 @@
6F6EE74326D44EE300374CDA /* InlineLineBoxVerticalAligner.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F6EE74126D44EE200374CDA /* InlineLineBoxVerticalAligner.h */; settings = {ATTRIBUTES = (Private, ); }; };
6F7CA3C6208C2957002F29AB /* LayoutState.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F7CA3C4208C2956002F29AB /* LayoutState.h */; settings = {ATTRIBUTES = (Private, ); }; };
6F7CA3CA208C2B2E002F29AB /* InlineFormattingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F7CA3C8208C2B2E002F29AB /* InlineFormattingContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 6F91421125152138004E4FEA /* InlineLineGeometry.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F91420F25152137004E4FEA /* InlineLineGeometry.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 6F91421125152138004E4FEA /* InlineDisplayLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F91420F25152137004E4FEA /* InlineDisplayLine.h */; settings = {ATTRIBUTES = (Private, ); }; };
6F995A161A70756200A735F4 /* WebGLSync.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F995A141A70756200A735F4 /* WebGLSync.h */; };
6F995A201A7078B100A735F4 /* WebGLQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F995A181A7078B100A735F4 /* WebGLQuery.h */; };
6F995A221A7078B100A735F4 /* WebGLSampler.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F995A1A1A7078B100A735F4 /* WebGLSampler.h */; };
@@ -10173,7 +10173,7 @@
6F7CA3C9208C2B2E002F29AB /* InlineFormattingContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InlineFormattingContext.cpp; sourceTree = "<group>"; };
6F8F460121B03BB40041AC3A /* FormattingQuirks.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FormattingQuirks.cpp; sourceTree = "<group>"; };
6F8F460321B03BC60041AC3A /* BlockFormattingQuirks.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = BlockFormattingQuirks.cpp; sourceTree = "<group>"; };
- 6F91420F25152137004E4FEA /* InlineLineGeometry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineLineGeometry.h; sourceTree = "<group>"; };
+ 6F91420F25152137004E4FEA /* InlineDisplayLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineDisplayLine.h; sourceTree = "<group>"; };
6F995A091A7070E600A735F4 /* WebGLQuery.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebGLQuery.idl; sourceTree = "<group>"; };
6F995A0A1A7070E600A735F4 /* WebGLSampler.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebGLSampler.idl; sourceTree = "<group>"; };
6F995A0B1A7070E600A735F4 /* WebGLSync.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebGLSync.idl; sourceTree = "<group>"; };
@@ -18307,7 +18307,7 @@
11A1E6FB26FBB6CE00435D36 /* display */ = {
isa = PBXGroup;
children = (
- 6F91420F25152137004E4FEA /* InlineLineGeometry.h */,
+ 6F91420F25152137004E4FEA /* InlineDisplayLine.h */,
6FC3F9452516756600A49BEA /* InlineLineRun.h */,
);
path = display;
@@ -32916,7 +32916,7 @@
11C3227D26D958CE00328F4D /* InlineLineBoxBuilder.h in Headers */,
6F6EE74326D44EE300374CDA /* InlineLineBoxVerticalAligner.h in Headers */,
6F26EB48234004A5006906E2 /* InlineLineBuilder.h in Headers */,
- 6F91421125152138004E4FEA /* InlineLineGeometry.h in Headers */,
+ 6F91421125152138004E4FEA /* InlineDisplayLine.h in Headers */,
6FC3F9472516756700A49BEA /* InlineLineRun.h in Headers */,
F45775CE241437D5002DF1A0 /* InlinePathData.h in Headers */,
6F40DA822513033A00EC04B7 /* InlineRect.h in Headers */,
Modified: trunk/Source/WebCore/display/css/DisplayBoxFactory.cpp (282901 => 282902)
--- trunk/Source/WebCore/display/css/DisplayBoxFactory.cpp 2021-09-23 01:48:46 UTC (rev 282901)
+++ trunk/Source/WebCore/display/css/DisplayBoxFactory.cpp 2021-09-23 02:39:34 UTC (rev 282902)
@@ -39,7 +39,7 @@
#include "DisplayTree.h"
#include "DisplayTreeBuilder.h"
#include "FloatPoint3D.h"
-#include "InlineLineGeometry.h"
+#include "InlineDisplayLine.h"
#include "LayoutBoxGeometry.h"
#include "LayoutContainerBox.h"
#include "LayoutInitialContainingBlock.h"
@@ -143,9 +143,9 @@
return makeUnique<Box>(m_treeBuilder.tree(), pixelSnappedBorderBoxRect, WTFMove(style), flags);
}
-std::unique_ptr<Box> BoxFactory::displayBoxForTextRun(const Layout::Run& run, const Layout::LineGeometry& lineGeometry, const ContainingBlockContext& containingBlockContext) const
+std::unique_ptr<Box> BoxFactory::displayBoxForTextRun(const Layout::Run& run, const InlineDisplay::Line& line, const ContainingBlockContext& containingBlockContext) const
{
- UNUSED_PARAM(lineGeometry);
+ UNUSED_PARAM(line);
ASSERT(run.text());
auto runRect = LayoutRect { run.logicalLeft(), run.logicalTop(), run.logicalWidth(), run.logicalHeight() };
Modified: trunk/Source/WebCore/display/css/DisplayBoxFactory.h (282901 => 282902)
--- trunk/Source/WebCore/display/css/DisplayBoxFactory.h 2021-09-23 01:48:46 UTC (rev 282901)
+++ trunk/Source/WebCore/display/css/DisplayBoxFactory.h 2021-09-23 02:39:34 UTC (rev 282902)
@@ -40,10 +40,13 @@
class Box;
class BoxGeometry;
class ContainerBox;
-class LineGeometry;
struct Run;
}
+namespace InlineDisplay {
+class Line;
+}
+
namespace Display {
class Box;
@@ -74,7 +77,7 @@
std::unique_ptr<Box> displayBoxForBodyBox(const Layout::Box&, const Layout::BoxGeometry&, const ContainingBlockContext&, RootBackgroundPropagation) const;
std::unique_ptr<Box> displayBoxForLayoutBox(const Layout::Box&, const Layout::BoxGeometry&, const ContainingBlockContext&) const;
- std::unique_ptr<Box> displayBoxForTextRun(const Layout::Run&, const Layout::LineGeometry&, const ContainingBlockContext&) const;
+ std::unique_ptr<Box> displayBoxForTextRun(const Layout::Run&, const InlineDisplay::Line&, const ContainingBlockContext&) const;
private:
std::unique_ptr<Box> displayBoxForLayoutBox(const Layout::Box&, const Layout::BoxGeometry&, const ContainingBlockContext&, const RenderStyle* styleForBackground, Style&&) const;
Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp (282901 => 282902)
--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp 2021-09-23 01:48:46 UTC (rev 282901)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp 2021-09-23 02:39:34 UTC (rev 282902)
@@ -572,14 +572,14 @@
InlineRect InlineFormattingContext::computeGeometryForLineContent(const LineBuilder::LineContent& lineContent)
{
auto& formattingState = this->formattingState();
- auto lineBoxAndGeometry = LineBoxBuilder(*this).build(lineContent);
- auto lineBoxLogicalRect = lineBoxAndGeometry.lineGeometry.lineBoxLogicalRect();
+ auto lineAndLineBox = LineBoxBuilder(*this).build(lineContent);
+ auto lineBoxLogicalRect = lineAndLineBox.line.lineBoxLogicalRect();
auto inlineContentBuilder = InlineDisplayContentBuilder { root(), formattingState };
auto currentLineIndex = formattingState.lines().size();
- formattingState.addRuns(inlineContentBuilder.build(lineContent, lineBoxAndGeometry.lineBox, lineBoxLogicalRect.topLeft(), currentLineIndex));
- formattingState.addLineBox(WTFMove(lineBoxAndGeometry.lineBox));
- formattingState.addLine(lineBoxAndGeometry.lineGeometry);
+ formattingState.addRuns(inlineContentBuilder.build(lineContent, lineAndLineBox.lineBox, lineBoxLogicalRect.topLeft(), currentLineIndex));
+ formattingState.addLineBox(WTFMove(lineAndLineBox.lineBox));
+ formattingState.addLine(lineAndLineBox.line);
return lineBoxLogicalRect;
}
Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingState.h (282901 => 282902)
--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingState.h 2021-09-23 01:48:46 UTC (rev 282901)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingState.h 2021-09-23 02:39:34 UTC (rev 282902)
@@ -28,9 +28,9 @@
#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
#include "FormattingState.h"
+#include "InlineDisplayLine.h"
#include "InlineItem.h"
#include "InlineLineBox.h"
-#include "InlineLineGeometry.h"
#include "InlineLineRun.h"
#include <wtf/IsoMalloc.h>
@@ -38,7 +38,7 @@
namespace Layout {
using InlineItems = Vector<InlineItem>;
-using InlineLines = Vector<LineGeometry>;
+using DisplayLines = Vector<InlineDisplay::Line>;
using InlineLineBoxes = Vector<LineBox>;
using InlineRuns = Vector<Run>;
@@ -53,9 +53,9 @@
const InlineItems& inlineItems() const { return m_inlineItems; }
void addInlineItem(InlineItem&& inlineItem) { m_inlineItems.append(WTFMove(inlineItem)); }
- const InlineLines& lines() const { return m_lines; }
- InlineLines& lines() { return m_lines; }
- void addLine(const LineGeometry& line) { m_lines.append(line); }
+ const DisplayLines& lines() const { return m_displayLines; }
+ DisplayLines& lines() { return m_displayLines; }
+ void addLine(const InlineDisplay::Line& line) { m_displayLines.append(line); }
const InlineLineBoxes& lineBoxes() const { return m_lineBoxes; }
void addLineBox(LineBox&& lineBox) { m_lineBoxes.append(WTFMove(lineBox)); }
@@ -74,7 +74,7 @@
private:
// Cacheable input to line layout.
InlineItems m_inlineItems;
- InlineLines m_lines;
+ DisplayLines m_displayLines;
InlineLineBoxes m_lineBoxes;
InlineRuns m_runs;
InlineLayoutUnit m_clearGapAfterLastLine { 0 };
@@ -88,7 +88,7 @@
inline void InlineFormattingState::clearLineAndRuns()
{
- m_lines.clear();
+ m_displayLines.clear();
m_lineBoxes.clear();
m_runs.clear();
m_clearGapAfterLastLine = { };
@@ -97,7 +97,7 @@
inline void InlineFormattingState::shrinkToFit()
{
m_inlineItems.shrinkToFit();
- m_lines.shrinkToFit();
+ m_displayLines.shrinkToFit();
m_lineBoxes.shrinkToFit();
m_runs.shrinkToFit();
}
Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp (282901 => 282902)
--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp 2021-09-23 01:48:46 UTC (rev 282901)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp 2021-09-23 02:39:34 UTC (rev 282902)
@@ -109,7 +109,7 @@
{
}
-LineBoxBuilder::LineBoxAndGeometry LineBoxBuilder::build(const LineBuilder::LineContent& lineContent)
+LineBoxBuilder::LineAndLineBox LineBoxBuilder::build(const LineBuilder::LineContent& lineContent)
{
auto& runs = lineContent.runs;
auto contentLogicalWidth = lineContent.contentLogicalWidth;
@@ -118,11 +118,11 @@
auto lineBoxLogicalHeight = constructAndAlignInlineLevelBoxes(lineBox, runs);
- auto lineGeometry = [&] {
+ auto line = [&] {
auto lineBoxLogicalRect = InlineRect { lineContent.logicalTopLeft, lineContent.lineLogicalWidth, lineBoxLogicalHeight };
auto scrollableOverflowRect = lineBoxLogicalRect;
auto& rootInlineBox = lineBox.rootInlineBox();
- auto enclosingTopAndBottom = LineGeometry::EnclosingTopAndBottom { lineBoxLogicalRect.top() + rootInlineBox.logicalTop(), lineBoxLogicalRect.top() + rootInlineBox.logicalBottom() };
+ auto enclosingTopAndBottom = InlineDisplay::Line::EnclosingTopAndBottom { lineBoxLogicalRect.top() + rootInlineBox.logicalTop(), lineBoxLogicalRect.top() + rootInlineBox.logicalBottom() };
for (auto& inlineLevelBox : lineBox.nonRootInlineLevelBoxes()) {
if (!inlineLevelBox.isAtomicInlineLevelBox() && !inlineLevelBox.isInlineBox())
@@ -153,9 +153,9 @@
enclosingTopAndBottom.top = std::min(enclosingTopAndBottom.top, borderBox.top());
enclosingTopAndBottom.bottom = std::max(enclosingTopAndBottom.bottom, borderBox.bottom());
}
- return LineGeometry { lineBoxLogicalRect, scrollableOverflowRect, enclosingTopAndBottom, rootInlineBox.logicalTop() + rootInlineBox.baseline(), rootInlineBox.logicalLeft(), rootInlineBox.logicalWidth() };
+ return InlineDisplay::Line { lineBoxLogicalRect, scrollableOverflowRect, enclosingTopAndBottom, rootInlineBox.logicalTop() + rootInlineBox.baseline(), rootInlineBox.logicalLeft(), rootInlineBox.logicalWidth() };
};
- return { lineBox, lineGeometry() };
+ return { line(), lineBox };
}
void LineBoxBuilder::adjustVerticalGeometryForInlineBoxWithFallbackFonts(InlineLevelBox& inlineBox, const TextUtil::FallbackFontList& fallbackFontsForContent) const
Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.h (282901 => 282902)
--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.h 2021-09-23 01:48:46 UTC (rev 282901)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.h 2021-09-23 02:39:34 UTC (rev 282902)
@@ -27,10 +27,10 @@
#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+#include "InlineDisplayLine.h"
#include "InlineFormattingContext.h"
#include "InlineLineBox.h"
#include "InlineLineBuilder.h"
-#include "InlineLineGeometry.h"
#include "TextUtil.h"
namespace WebCore {
@@ -44,11 +44,11 @@
public:
LineBoxBuilder(const InlineFormattingContext&);
- struct LineBoxAndGeometry {
+ struct LineAndLineBox {
+ InlineDisplay::Line line;
LineBox lineBox;
- LineGeometry lineGeometry;
};
- LineBoxAndGeometry build(const LineBuilder::LineContent&);
+ LineAndLineBox build(const LineBuilder::LineContent&);
private:
void setInitialVerticalGeometryForInlineBox(InlineLevelBox&) const;
Copied: trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayLine.h (from rev 282901, trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineLineGeometry.h) (0 => 282902)
--- trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayLine.h (rev 0)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayLine.h 2021-09-23 02:39:34 UTC (rev 282902)
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2020 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+
+#include "InlineRect.h"
+
+namespace WebCore {
+namespace InlineDisplay {
+
+class Line {
+ WTF_MAKE_FAST_ALLOCATED;
+public:
+ struct EnclosingTopAndBottom {
+ // This values encloses the root inline box and any other inline level box's border box.
+ Layout::InlineLayoutUnit top { 0 };
+ Layout::InlineLayoutUnit bottom { 0 };
+ };
+ Line(const Layout::InlineRect& lineBoxLogicalRect, const Layout::InlineRect& scrollableOverflow, EnclosingTopAndBottom, Layout::InlineLayoutUnit aligmentBaseline, Layout::InlineLayoutUnit contentLogicalLeft, Layout::InlineLayoutUnit contentLogicalWidth);
+
+ const Layout::InlineRect& lineBoxLogicalRect() const { return m_lineBoxLogicalRect; }
+ const Layout::InlineRect& scrollableOverflow() const { return m_scrollableOverflow; }
+
+ EnclosingTopAndBottom enclosingTopAndBottom() const { return m_enclosingTopAndBottom; }
+
+ Layout::InlineLayoutUnit baseline() const { return m_aligmentBaseline; }
+
+ Layout::InlineLayoutUnit contentLogicalLeft() const { return m_contentLogicalLeft; }
+ Layout::InlineLayoutUnit contentLogicalWidth() const { return m_contentLogicalWidth; }
+
+ void moveVertically(Layout::InlineLayoutUnit offset) { m_lineBoxLogicalRect.moveVertically(offset); }
+
+private:
+ // This is line box geometry (see https://www.w3.org/TR/css-inline-3/#line-box).
+ Layout::InlineRect m_lineBoxLogicalRect;
+ Layout::InlineRect m_scrollableOverflow;
+ // Enclosing top and bottom includes all inline level boxes (border box) vertically.
+ // While the line box usually enclose them as well, its vertical geometry is based on
+ // the layout bounds of the inline level boxes which may be different when line-height is present.
+ EnclosingTopAndBottom m_enclosingTopAndBottom;
+ Layout::InlineLayoutUnit m_aligmentBaseline { 0 };
+ Layout::InlineLayoutUnit m_contentLogicalLeft { 0 };
+ Layout::InlineLayoutUnit m_contentLogicalWidth { 0 };
+};
+
+inline Line::Line(const Layout::InlineRect& lineBoxLogicalRect, const Layout::InlineRect& scrollableOverflow, EnclosingTopAndBottom enclosingTopAndBottom, Layout::InlineLayoutUnit aligmentBaseline, Layout::InlineLayoutUnit contentLogicalLeft, Layout::InlineLayoutUnit contentLogicalWidth)
+ : m_lineBoxLogicalRect(lineBoxLogicalRect)
+ , m_scrollableOverflow(scrollableOverflow)
+ , m_enclosingTopAndBottom(enclosingTopAndBottom)
+ , m_aligmentBaseline(aligmentBaseline)
+ , m_contentLogicalLeft(contentLogicalLeft)
+ , m_contentLogicalWidth(contentLogicalWidth)
+{
+}
+
+}
+}
+
+#endif
Deleted: trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineLineGeometry.h (282901 => 282902)
--- trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineLineGeometry.h 2021-09-23 01:48:46 UTC (rev 282901)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/display/InlineLineGeometry.h 2021-09-23 02:39:34 UTC (rev 282902)
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2020 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
-
-#include "InlineRect.h"
-
-namespace WebCore {
-namespace Layout {
-
-class LineGeometry {
- WTF_MAKE_FAST_ALLOCATED;
-public:
- struct EnclosingTopAndBottom {
- // This values encloses the root inline box and any other inline level box's border box.
- InlineLayoutUnit top { 0 };
- InlineLayoutUnit bottom { 0 };
- };
- LineGeometry(const InlineRect& lineBoxLogicalRect, const InlineRect& scrollableOverflow, EnclosingTopAndBottom, InlineLayoutUnit aligmentBaseline, InlineLayoutUnit contentLogicalLeft, InlineLayoutUnit contentLogicalWidth);
-
- const InlineRect& lineBoxLogicalRect() const { return m_lineBoxLogicalRect; }
- const InlineRect& scrollableOverflow() const { return m_scrollableOverflow; }
-
- EnclosingTopAndBottom enclosingTopAndBottom() const { return m_enclosingTopAndBottom; }
-
- InlineLayoutUnit baseline() const { return m_aligmentBaseline; }
-
- InlineLayoutUnit contentLogicalLeft() const { return m_contentLogicalLeft; }
- InlineLayoutUnit contentLogicalWidth() const { return m_contentLogicalWidth; }
-
- void moveVertically(InlineLayoutUnit offset) { m_lineBoxLogicalRect.moveVertically(offset); }
-
-private:
- // This is line box geometry (see https://www.w3.org/TR/css-inline-3/#line-box).
- InlineRect m_lineBoxLogicalRect;
- InlineRect m_scrollableOverflow;
- // Enclosing top and bottom includes all inline level boxes (border box) vertically.
- // While the line box usually enclose them as well, its vertical geometry is based on
- // 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_contentLogicalLeft { 0 };
- InlineLayoutUnit m_contentLogicalWidth { 0 };
-};
-
-inline LineGeometry::LineGeometry(const InlineRect& lineBoxLogicalRect, const InlineRect& scrollableOverflow, EnclosingTopAndBottom enclosingTopAndBottom, InlineLayoutUnit aligmentBaseline, InlineLayoutUnit contentLogicalLeft, InlineLayoutUnit contentLogicalWidth)
- : m_lineBoxLogicalRect(lineBoxLogicalRect)
- , m_scrollableOverflow(scrollableOverflow)
- , m_enclosingTopAndBottom(enclosingTopAndBottom)
- , m_aligmentBaseline(aligmentBaseline)
- , m_contentLogicalLeft(contentLogicalLeft)
- , m_contentLogicalWidth(contentLogicalWidth)
-{
-}
-
-}
-}
-
-#endif
Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContentBuilder.cpp (282901 => 282902)
--- trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContentBuilder.cpp 2021-09-23 01:48:46 UTC (rev 282901)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContentBuilder.cpp 2021-09-23 02:39:34 UTC (rev 282902)
@@ -41,7 +41,7 @@
namespace WebCore {
namespace LayoutIntegration {
-inline Layout::LineGeometry::EnclosingTopAndBottom operator+(const Layout::LineGeometry::EnclosingTopAndBottom enclosingTopAndBottom, float offset)
+inline InlineDisplay::Line::EnclosingTopAndBottom operator+(const InlineDisplay::Line::EnclosingTopAndBottom enclosingTopAndBottom, float offset)
{
return { enclosingTopAndBottom.top + offset, enclosingTopAndBottom.bottom + offset };
}