Title: [281292] trunk/Source/WebCore
Revision
281292
Author
[email protected]
Date
2021-08-19 20:53:48 -0700 (Thu, 19 Aug 2021)

Log Message

[IFC][Integration] The root inlinebox's style is always the IFC's root style
https://bugs.webkit.org/show_bug.cgi?id=228062

Reviewed by Antti Koivisto.

This is in preparation for keeping the inline box structure private to the layout code.

* layout/integration/LayoutIntegrationInlineContentBuilder.cpp:
(WebCore::LayoutIntegration::InlineContentBuilder::computeLineLevelVisualAdjustmentsForRuns const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (281291 => 281292)


--- trunk/Source/WebCore/ChangeLog	2021-08-20 03:21:05 UTC (rev 281291)
+++ trunk/Source/WebCore/ChangeLog	2021-08-20 03:53:48 UTC (rev 281292)
@@ -1,3 +1,15 @@
+2021-08-19  Alan Bujtas  <[email protected]>
+
+        [IFC][Integration] The root inlinebox's style is always the IFC's root style
+        https://bugs.webkit.org/show_bug.cgi?id=228062
+
+        Reviewed by Antti Koivisto.
+
+        This is in preparation for keeping the inline box structure private to the layout code.
+
+        * layout/integration/LayoutIntegrationInlineContentBuilder.cpp:
+        (WebCore::LayoutIntegration::InlineContentBuilder::computeLineLevelVisualAdjustmentsForRuns const):
+
 2021-08-19  Myles C. Maxfield  <[email protected]>
 
         [Cocoa] Stop treating the system font as a non-variable font

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContentBuilder.cpp (281291 => 281292)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContentBuilder.cpp	2021-08-20 03:21:05 UTC (rev 281291)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContentBuilder.cpp	2021-08-20 03:53:48 UTC (rev 281292)
@@ -179,11 +179,10 @@
     auto& rootStyle = m_layoutState.root().style();
     auto shouldCheckHorizontalOverflowForContentReplacement = rootStyle.overflowX() == Overflow::Hidden && rootStyle.textOverflow() != TextOverflow::Clip;
 
-    LineLevelVisualAdjustmentsForRunsList lineLevelVisualAdjustmentsForRuns(lines.size());
+    auto lineLevelVisualAdjustmentsForRuns = LineLevelVisualAdjustmentsForRunsList { lines.size() };
     for (size_t lineIndex = 0; lineIndex < lines.size(); ++lineIndex) {
         auto lineNeedsLegacyIntegralVerticalPosition = [&] {
             // Legacy inline tree integral rounds the vertical position for certain content (see LegacyInlineFlowBox::placeBoxesInBlockDirection and ::addToLine).
-            auto& rootInlineBox = inlineFormattingState.lineBoxes()[lineIndex].rootInlineBox();
             auto& nonRootInlineLevelBoxList = inlineFormattingState.lineBoxes()[lineIndex].nonRootInlineLevelBoxes();
             if (nonRootInlineLevelBoxList.isEmpty()) {
                 // This is text content only with root inline box.
@@ -195,15 +194,14 @@
                 if (contentPreventsIntegralSnapping)
                     return false;
 
-                auto& rootInlineBoxStyle = rootInlineBox.style();
                 auto& inlineLevelBoxStyle = inlineLevelBox.style();
-                auto stylePreventsIntegralSnapping = rootInlineBoxStyle.lineHeight() != inlineLevelBoxStyle.lineHeight() || inlineLevelBoxStyle.verticalAlign() != VerticalAlign::Baseline;
+                auto stylePreventsIntegralSnapping = rootStyle.lineHeight() != inlineLevelBoxStyle.lineHeight() || inlineLevelBoxStyle.verticalAlign() != VerticalAlign::Baseline;
                 if (stylePreventsIntegralSnapping)
                     return false;
 
-                auto& rootInlineBoxFontMetrics = rootInlineBoxStyle.fontCascade().fontMetrics();
+                auto& rootFontMetrics = rootStyle.fontCascade().fontMetrics();
                 auto& inlineLevelBoxFontMetrics = inlineLevelBoxStyle.fontCascade().fontMetrics();
-                auto fontPreventsIntegralSnapping = !rootInlineBoxFontMetrics.hasIdenticalAscentDescentAndLineGap(inlineLevelBoxFontMetrics);
+                auto fontPreventsIntegralSnapping = !rootFontMetrics.hasIdenticalAscentDescentAndLineGap(inlineLevelBoxFontMetrics);
                 if (fontPreventsIntegralSnapping)
                     return false;
             }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to