Title: [267461] trunk/Source/WebCore
- Revision
- 267461
- Author
- [email protected]
- Date
- 2020-09-22 20:50:31 -0700 (Tue, 22 Sep 2020)
Log Message
[LFC][Integration] Move RuntimeEnabledFeatures::layoutFormattingContextIntegrationEnabled() check out from LineBuilder::constraintsForLine
https://bugs.webkit.org/show_bug.cgi?id=216862
Reviewed by Simon Fraser.
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::setIsIntegratedRootBoxFirstChild):
* layout/LayoutState.h:
(WebCore::Layout::LayoutState::isIntegratedRootBoxFirstChild const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::constraintsForLine):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (267460 => 267461)
--- trunk/Source/WebCore/ChangeLog 2020-09-23 03:48:22 UTC (rev 267460)
+++ trunk/Source/WebCore/ChangeLog 2020-09-23 03:50:31 UTC (rev 267461)
@@ -1,5 +1,21 @@
2020-09-22 Zalan Bujtas <[email protected]>
+ [LFC][Integration] Move RuntimeEnabledFeatures::layoutFormattingContextIntegrationEnabled() check out from LineBuilder::constraintsForLine
+ https://bugs.webkit.org/show_bug.cgi?id=216862
+
+ Reviewed by Simon Fraser.
+
+ * layout/LayoutState.cpp:
+ (WebCore::Layout::LayoutState::setIsIntegratedRootBoxFirstChild):
+ * layout/LayoutState.h:
+ (WebCore::Layout::LayoutState::isIntegratedRootBoxFirstChild const):
+ * layout/inlineformatting/InlineFormattingContext.cpp:
+ (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
+ * layout/inlineformatting/InlineLineBuilder.cpp:
+ (WebCore::Layout::LineBuilder::constraintsForLine):
+
+2020-09-22 Zalan Bujtas <[email protected]>
+
[LFC][Floats] Remove the redundant RuntimeEnabledFeatures::layoutFormattingContextIntegrationEnabled() check from FloatingState::append
https://bugs.webkit.org/show_bug.cgi?id=216866
Modified: trunk/Source/WebCore/layout/LayoutState.cpp (267460 => 267461)
--- trunk/Source/WebCore/layout/LayoutState.cpp 2020-09-23 03:48:22 UTC (rev 267460)
+++ trunk/Source/WebCore/layout/LayoutState.cpp 2020-09-23 03:50:31 UTC (rev 267461)
@@ -236,7 +236,7 @@
void LayoutState::setIsIntegratedRootBoxFirstChild(bool value)
{
ASSERT(RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled());
- m_isIntegratedRootBoxFirstChild = value;
+ m_isIntegratedRootBoxFirstChild = value ? IsIntegratedRootBoxFirstChild::Yes : IsIntegratedRootBoxFirstChild::No;
}
}
Modified: trunk/Source/WebCore/layout/LayoutState.h (267460 => 267461)
--- trunk/Source/WebCore/layout/LayoutState.h 2020-09-23 03:48:22 UTC (rev 267460)
+++ trunk/Source/WebCore/layout/LayoutState.h 2020-09-23 03:50:31 UTC (rev 267461)
@@ -89,7 +89,8 @@
// LFC integration only. Full LFC has proper ICB access.
void setViewportSize(const LayoutSize&);
LayoutSize viewportSize() const;
- bool isIntegratedRootBoxFirstChild() const { return m_isIntegratedRootBoxFirstChild; }
+ enum IsIntegratedRootBoxFirstChild { Yes, No, NotApplicable };
+ IsIntegratedRootBoxFirstChild isIntegratedRootBoxFirstChild() const { return m_isIntegratedRootBoxFirstChild; }
void setIsIntegratedRootBoxFirstChild(bool);
private:
@@ -113,7 +114,7 @@
// LFC integration only.
LayoutSize m_viewportSize;
- bool m_isIntegratedRootBoxFirstChild { false };
+ IsIntegratedRootBoxFirstChild m_isIntegratedRootBoxFirstChild { IsIntegratedRootBoxFirstChild::NotApplicable };
};
inline bool LayoutState::hasBoxGeometry(const Box& layoutBox) const
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp (267460 => 267461)
--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp 2020-09-23 03:48:22 UTC (rev 267460)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp 2020-09-23 03:50:31 UTC (rev 267461)
@@ -485,6 +485,7 @@
formattingState.addLine({ lineLogicalRect, lineBoxLogicalRect, lineBoxVerticalOffset + lineBox.alignmentBaseline(), lineBox.horizontalAlignmentOffset().valueOr(InlineLayoutUnit { }) });
};
constructLineGeometry();
+
return lineLogicalRect;
}
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp (267460 => 267461)
--- trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp 2020-09-23 03:48:22 UTC (rev 267460)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp 2020-09-23 03:50:31 UTC (rev 267461)
@@ -429,9 +429,11 @@
// Unless otherwise specified by the each-line and/or hanging keywords, only lines that are the first formatted line
// of an element are affected.
// For example, the first line of an anonymous block box is only affected if it is the first child of its parent element.
- isFormattingContextRootCandidateToTextIndent = RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled()
- ? layoutState().isIntegratedRootBoxFirstChild()
- : root.parent().firstInFlowChild() == &root;
+ auto isIntegratedRootBoxFirstChild = layoutState().isIntegratedRootBoxFirstChild();
+ if (isIntegratedRootBoxFirstChild == LayoutState::IsIntegratedRootBoxFirstChild::NotApplicable)
+ isFormattingContextRootCandidateToTextIndent = root.parent().firstInFlowChild() == &root;
+ else
+ isFormattingContextRootCandidateToTextIndent = isIntegratedRootBoxFirstChild == LayoutState::IsIntegratedRootBoxFirstChild::Yes;
}
if (!isFormattingContextRootCandidateToTextIndent)
return { };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes