Title: [281711] trunk/Source/WebCore
- Revision
- 281711
- Author
- za...@apple.com
- Date
- 2021-08-27 12:13:40 -0700 (Fri, 27 Aug 2021)
Log Message
[IFC][Integration] Generate runs for the root inlinebox
https://bugs.webkit.org/show_bug.cgi?id=229599
Reviewed by Antti Koivisto.
This is in preparation for using runs only for all the boxes.
* layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
* layout/integration/LayoutIntegrationInlineContentBuilder.cpp:
(WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLineRuns const):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (281710 => 281711)
--- trunk/Source/WebCore/ChangeLog 2021-08-27 18:53:07 UTC (rev 281710)
+++ trunk/Source/WebCore/ChangeLog 2021-08-27 19:13:40 UTC (rev 281711)
@@ -1,3 +1,17 @@
+2021-08-27 Alan Bujtas <za...@apple.com>
+
+ [IFC][Integration] Generate runs for the root inlinebox
+ https://bugs.webkit.org/show_bug.cgi?id=229599
+
+ Reviewed by Antti Koivisto.
+
+ This is in preparation for using runs only for all the boxes.
+
+ * layout/formattingContexts/inline/InlineFormattingContext.cpp:
+ (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
+ * layout/integration/LayoutIntegrationInlineContentBuilder.cpp:
+ (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLineRuns const):
+
2021-08-27 Antti Koivisto <an...@apple.com>
[CSS Cascade Layers] Initial support
Modified: trunk/Source/WebCore/display/DisplayTreeBuilder.cpp (281710 => 281711)
--- trunk/Source/WebCore/display/DisplayTreeBuilder.cpp 2021-08-27 18:53:07 UTC (rev 281710)
+++ trunk/Source/WebCore/display/DisplayTreeBuilder.cpp 2021-08-27 19:13:40 UTC (rev 281711)
@@ -306,6 +306,11 @@
auto& inlineFormattingState = layoutState.establishedInlineFormattingState(inlineFormattingRoot);
for (auto& run : inlineFormattingState.lineRuns()) {
+ if (run.isRootInlineBox()) {
+ // Not supported yet.
+ continue;
+ }
+
if (run.text()) {
auto& lineGeometry = inlineFormattingState.lines().at(run.lineIndex());
auto textBox = m_boxFactory.displayBoxForTextRun(run, lineGeometry, positioningContext().inFlowContainingBlockContext());
Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp (281710 => 281711)
--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp 2021-08-27 18:53:07 UTC (rev 281710)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp 2021-08-27 19:13:40 UTC (rev 281711)
@@ -579,6 +579,9 @@
const auto& lineBox = formattingState.lineBoxes().last();
auto lineBoxLogicalRect = lineBoxAndGeometry.lineGeometry.lineBoxLogicalRect();
+ // Every line starts with a root run, even the empty ones.
+ formattingState.addLineRun({ lineIndex, LineRun::Type::RootInlineBox, root(), lineBox.logicalRectForRootInlineBox(), { }, { }, lineBox.rootInlineBox().hasContent()});
+
if (!lineBox.hasContent()) {
// Fast path for lines with no content e.g. <div><span></span><span></span></div> or <span><div></div></span> where we construct empty pre and post blocks.
ASSERT(!lineBox.rootInlineBox().hasContent() && !lineBoxLogicalRect.height());
@@ -606,7 +609,6 @@
}
// Spanning inline boxes start at the very beginning of the line.
- // FIXME: Offset it with the run for the root inline box, when we start constructing runs for them.
auto lineSpanningInlineBoxIndex = formattingState.lineRuns().size();
HashSet<const Box*> inlineBoxStartSet;
auto constructLineRunsAndUpdateBoxGeometry = [&] {
Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContentBuilder.cpp (281710 => 281711)
--- trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContentBuilder.cpp 2021-08-27 18:53:07 UTC (rev 281710)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContentBuilder.cpp 2021-08-27 19:13:40 UTC (rev 281711)
@@ -249,6 +249,10 @@
Vector<bool> hasAdjustedTrailingLineList(lines.size(), false);
auto createDisplayBoxRun = [&](auto& lineRun) {
+ if (lineRun.isRootInlineBox()) {
+ // FIXME: Teach the run iterators to ignore the root inline box runs.
+ return;
+ }
auto& layoutBox = lineRun.layoutBox();
auto lineIndex = lineRun.lineIndex();
auto& lineBoxLogicalRect = lines[lineIndex].lineBoxLogicalRect();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes