WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-260832-20230831102032.patch (text/plain), 9.57 KB, created by
alan
on 2023-08-31 10:20:33 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
alan
Created:
2023-08-31 10:20:33 PDT
Size:
9.57 KB
patch
obsolete
>From cca9a0ba97b0171119fbb13f12fc644980de04a0 Mon Sep 17 00:00:00 2001 >From: Alan Baradlay <zalan@apple.com> >Date: Wed, 30 Aug 2023 12:07:39 -0700 >Subject: [PATCH] [IFC] Add support for out-of-flow static positioning in bidi > content https://bugs.webkit.org/show_bug.cgi?id=260832 > >Reviewed by Antti Koivisto. > >* Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp: >(WebCore::Layout::InlineDisplayContentBuilder::processBidiContent): >(WebCore::Layout::InlineDisplayContentBuilder::setGeometryForBlockLevelOutOfFlowBoxes): >* Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.h: >(WebCore::Layout::InlineDisplayContentBuilder::setGeometryForBlockLevelOutOfFlowBoxes): >* Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp: >(WebCore::LayoutIntegration::printReason): >(WebCore::LayoutIntegration::canUseForChild): >* Source/WebCore/layout/integration/LayoutIntegrationCoverage.h: >--- > .../display/InlineDisplayContentBuilder.cpp | 23 ++++++++++++------- > .../display/InlineDisplayContentBuilder.h | 2 +- > .../integration/LayoutIntegrationCoverage.cpp | 17 +------------- > .../integration/LayoutIntegrationCoverage.h | 2 +- > 4 files changed, 18 insertions(+), 26 deletions(-) > >diff --git a/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp b/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp >index 33c359a9a8f3..493d9d5a47d4 100644 >--- a/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp >+++ b/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp >@@ -691,9 +691,10 @@ void InlineDisplayContentBuilder::processBidiContent(const LineLayoutResult& lin > auto hasInlineBox = false; > auto createDisplayBoxesInVisualOrder = [&] { > >- auto rootInlineBoxVidsualRectInInlineDirection = lineBox.logicalRectForRootInlineBox(); >- rootInlineBoxVidsualRectInInlineDirection.setLeft(m_displayLine.contentLogicalLeftIgnoringInlineDirection()); >- appendRootInlineBoxDisplayBox(flipRootInlineBoxRectToVisualForWritingMode(rootInlineBoxVidsualRectInInlineDirection, root().style().writingMode()), lineBox.rootInlineBox().hasContent(), boxes); >+ Vector<size_t> blockLevelOutOfFlowBoxList; >+ auto rootInlineBoxVisualRectInInlineDirection = lineBox.logicalRectForRootInlineBox(); >+ rootInlineBoxVisualRectInInlineDirection.setLeft(m_displayLine.contentLogicalLeftIgnoringInlineDirection()); >+ appendRootInlineBoxDisplayBox(flipRootInlineBoxRectToVisualForWritingMode(rootInlineBoxVisualRectInInlineDirection, root().style().writingMode()), lineBox.rootInlineBox().hasContent(), boxes); > > auto contentRightInInlineDirectionVisualOrder = contentStartInInlineDirectionVisualOrder; > auto& inlineContent = lineLayoutResult.inlineContent; >@@ -774,13 +775,18 @@ void InlineDisplayContentBuilder::processBidiContent(const LineLayoutResult& lin > continue; > } > if (lineRun.isOpaque()) { >- // Set geometry for this opaque box. >- formattingState().boxGeometry(layoutBox).setLogicalTopLeft({ }); >- continue; >+ auto& boxGeometry = formattingState().boxGeometry(layoutBox); >+ if (layoutBox.style().isOriginalDisplayInlineType()) { >+ auto logicalTopLeft = lineBox.logicalRectForOpaqueBox(lineRun, boxGeometry).topLeft(); >+ logicalTopLeft.moveBy(lineBox.logicalRect().topLeft()); >+ boxGeometry.setLogicalTopLeft(toLayoutPoint(logicalTopLeft)); >+ } else >+ blockLevelOutOfFlowBoxList.append(visualOrder); > continue; > } > ASSERT_NOT_REACHED(); > } >+ setGeometryForBlockLevelOutOfFlowBoxes(blockLevelOutOfFlowBoxList, lineBox, inlineContent, lineLayoutResult.directionality.visualOrderList); > }; > createDisplayBoxesInVisualOrder(); > >@@ -880,7 +886,7 @@ void InlineDisplayContentBuilder::collectInkOverflowForInlineBoxes(InlineDisplay > } > } > >-void InlineDisplayContentBuilder::setGeometryForBlockLevelOutOfFlowBoxes(const Vector<size_t> indexList, const LineBox& lineBox, const Line::RunList& lineRuns) >+void InlineDisplayContentBuilder::setGeometryForBlockLevelOutOfFlowBoxes(const Vector<size_t> indexList, const LineBox& lineBox, const Line::RunList& lineRuns, const Vector<int32_t>& visualOrderList) > { > auto& formattingContext = this->formattingContext(); > auto outOfFlowContentHasPreviousInFlowSiblingWithContentOrDecoration = false; >@@ -893,7 +899,8 @@ void InlineDisplayContentBuilder::setGeometryForBlockLevelOutOfFlowBoxes(const V > if (outOfFlowContentHasPreviousInFlowSiblingWithContentOrDecoration) > return true; > for (size_t runIndex = i ? outOfFlowBoxIndex + 1 : 0; runIndex < outOfFlowBoxIndex; ++runIndex) { >- if (Line::Run::isContentfulOrHasDecoration(lineRuns[runIndex], formattingContext)) { >+ auto& previousRun = visualOrderList.isEmpty() ? lineRuns[runIndex] : lineRuns[visualOrderList[runIndex]]; >+ if (Line::Run::isContentfulOrHasDecoration(previousRun, formattingContext)) { > outOfFlowContentHasPreviousInFlowSiblingWithContentOrDecoration = true; > return true; > } >diff --git a/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.h b/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.h >index cbd5d9d8c43d..f1224e1080e3 100644 >--- a/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.h >+++ b/Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.h >@@ -73,7 +73,7 @@ private: > void setRightForWritingMode(InlineDisplay::Box&, InlineLayoutUnit logicalRight, WritingMode) const; > InlineLayoutPoint movePointHorizontallyForWritingMode(const InlineLayoutPoint& topLeft, InlineLayoutUnit horizontalOffset, WritingMode) const; > InlineLayoutUnit outsideListMarkerVisualPosition(const ElementBox&) const; >- void setGeometryForBlockLevelOutOfFlowBoxes(const Vector<size_t> indexList, const LineBox&, const Line::RunList&); >+ void setGeometryForBlockLevelOutOfFlowBoxes(const Vector<size_t> indexList, const LineBox&, const Line::RunList&, const Vector<int32_t>& visualOrderList = { }); > > bool isLineFullyTruncatedInBlockDirection() const { return m_lineIsFullyTruncatedInBlockDirection; } > >diff --git a/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp b/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp >index 8e112298cd7d..f75a9e95f11a 100644 >--- a/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp >+++ b/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp >@@ -125,9 +125,6 @@ static void printReason(AvoidanceReason reason, TextStream& stream) > case AvoidanceReason::MultiColumnFlowIsFloating: > stream << "column with floating objects"; > break; >- case AvoidanceReason::ChildBoxIsFloatingOrPositioned: >- stream << "child box is floating or positioned"; >- break; > case AvoidanceReason::ContentIsSVG: > stream << "SVG content"; > break; >@@ -352,20 +349,8 @@ static OptionSet<AvoidanceReason> canUseForChild(const RenderBlockFlow& flow, co > if (renderer.isRubyRun()) > SET_REASON_AND_RETURN_IF_NEEDED(ContentIsRuby, reasons, includeReasons); > #endif >- if (is<RenderBlockFlow>(renderer) || is<RenderGrid>(renderer) || is<RenderFlexibleBox>(renderer) || is<RenderDeprecatedFlexibleBox>(renderer) || is<RenderReplaced>(renderer) || is<RenderListItem>(renderer) || is<RenderTable>(renderer)) { >- auto isSupportedFloatingOrPositioned = [&] (auto& renderer) { >- if (renderer.isOutOfFlowPositioned()) { >- if (!renderer.parent()->style().isLeftToRightDirection() || renderer.parent()->style().unicodeBidi() != UnicodeBidi::Normal) >- return false; >- if (is<RenderLayerModelObject>(renderer.parent()) && downcast<RenderLayerModelObject>(*renderer.parent()).shouldPlaceVerticalScrollbarOnLeft()) >- return false; >- } >- return true; >- }; >- if (!isSupportedFloatingOrPositioned(renderer)) >- SET_REASON_AND_RETURN_IF_NEEDED(ChildBoxIsFloatingOrPositioned, reasons, includeReasons) >+ if (is<RenderBlockFlow>(renderer) || is<RenderGrid>(renderer) || is<RenderFlexibleBox>(renderer) || is<RenderDeprecatedFlexibleBox>(renderer) || is<RenderReplaced>(renderer) || is<RenderListItem>(renderer) || is<RenderTable>(renderer)) > return reasons; >- } > > if (is<RenderListMarker>(renderer)) > return reasons; >diff --git a/Source/WebCore/layout/integration/LayoutIntegrationCoverage.h b/Source/WebCore/layout/integration/LayoutIntegrationCoverage.h >index d75ac6a0edc7..944f3f7b5557 100644 >--- a/Source/WebCore/layout/integration/LayoutIntegrationCoverage.h >+++ b/Source/WebCore/layout/integration/LayoutIntegrationCoverage.h >@@ -94,7 +94,7 @@ enum class AvoidanceReason : uint64_t { > // Unused = 1LLU << 52, > // Unused = 1LLU << 53, > // Unused = 1LLU << 54, >- ChildBoxIsFloatingOrPositioned = 1LLU << 55, >+ // Unused = 1LLU << 55, > ContentIsSVG = 1LLU << 56, > // Unused = 1LLU << 57, > // Unused = 1LLU << 58,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 260832
:
467473
|
467477
|
467498
|
467509
|
467514
|
467515
|
467669
|
467670