Title: [281432] trunk
Revision
281432
Author
za...@apple.com
Date
2021-08-22 20:55:38 -0700 (Sun, 22 Aug 2021)

Log Message

[LFC][IFC] Add support for vertical-align: super
https://bugs.webkit.org/show_bug.cgi?id=228235

Reviewed by Antti Koivisto.

Source/WebCore:

* layout/formattingContexts/inline/InlineFormattingGeometry.cpp:
(WebCore::Layout::LineBoxBuilder::computeLineBoxHeightAndAlignInlineLevelBoxesVertically):
* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::canUseForChild):

LayoutTests:

* platform/mac/css1/text_properties/vertical_align-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (281431 => 281432)


--- trunk/LayoutTests/ChangeLog	2021-08-23 02:24:23 UTC (rev 281431)
+++ trunk/LayoutTests/ChangeLog	2021-08-23 03:55:38 UTC (rev 281432)
@@ -1,3 +1,12 @@
+2021-08-22  Alan Bujtas  <za...@apple.com>
+
+        [LFC][IFC] Add support for vertical-align: super
+        https://bugs.webkit.org/show_bug.cgi?id=228235
+
+        Reviewed by Antti Koivisto.
+
+        * platform/mac/css1/text_properties/vertical_align-expected.txt:
+
 2021-08-22  Kate Cheney  <katherine_che...@apple.com>
 
         Report correct blocked URI in CSP violation report

Modified: trunk/LayoutTests/platform/ios/css1/text_properties/vertical_align-expected.txt (281431 => 281432)


--- trunk/LayoutTests/platform/ios/css1/text_properties/vertical_align-expected.txt	2021-08-23 02:24:23 UTC (rev 281431)
+++ trunk/LayoutTests/platform/ios/css1/text_properties/vertical_align-expected.txt	2021-08-23 03:55:38 UTC (rev 281432)
@@ -54,9 +54,9 @@
           text run at (0,59) width 262: "different from that of the parent element."
       RenderBlock {P} at (0,414) size 784x75
         RenderImage {IMG} at (0,0) size 15x50
-        RenderInline {SPAN} at (0,0) size 129x20
-          RenderText {#text} at (15,28) size 129x20
-            text run at (15,28) width 129: "The first four words"
+        RenderInline {SPAN} at (0,0) size 129x19
+          RenderText {#text} at (15,29) size 129x19
+            text run at (15,29) width 129: "The first four words"
         RenderText {#text} at (143,35) size 766x39
           text run at (143,35) width 304: " in this sentence should be superscript-aligned. "
           text run at (446,35) width 320: "The font size of the subscripted text should not be"
@@ -397,9 +397,9 @@
                   text run at (0,59) width 281: "be different from that of the parent element."
               RenderBlock {P} at (4,99) size 762x75
                 RenderImage {IMG} at (0,0) size 15x50
-                RenderInline {SPAN} at (0,0) size 129x20
-                  RenderText {#text} at (15,28) size 129x20
-                    text run at (15,28) width 129: "The first four words"
+                RenderInline {SPAN} at (0,0) size 129x19
+                  RenderText {#text} at (15,29) size 129x19
+                    text run at (15,29) width 129: "The first four words"
                 RenderText {#text} at (143,35) size 747x39
                   text run at (143,35) width 304: " in this sentence should be superscript-aligned. "
                   text run at (446,35) width 301: "The font size of the subscripted text should not"

Modified: trunk/LayoutTests/platform/mac/css1/text_properties/vertical_align-expected.txt (281431 => 281432)


--- trunk/LayoutTests/platform/mac/css1/text_properties/vertical_align-expected.txt	2021-08-23 02:24:23 UTC (rev 281431)
+++ trunk/LayoutTests/platform/mac/css1/text_properties/vertical_align-expected.txt	2021-08-23 03:55:38 UTC (rev 281432)
@@ -54,9 +54,9 @@
           text run at (0,58) width 262: "different from that of the parent element."
       RenderBlock {P} at (0,427) size 769x72
         RenderImage {IMG} at (0,0) size 15x50
-        RenderInline {SPAN} at (0,0) size 128x19
-          RenderText {#text} at (15,29) size 128x19
-            text run at (15,29) width 128: "The first four words"
+        RenderInline {SPAN} at (0,0) size 128x18
+          RenderText {#text} at (15,30) size 128x18
+            text run at (15,30) width 128: "The first four words"
         RenderText {#text} at (142,36) size 766x36
           text run at (142,36) width 304: " in this sentence should be superscript-aligned. "
           text run at (445,36) width 321: "The font size of the subscripted text should not be"
@@ -400,9 +400,9 @@
                   text run at (0,58) width 281: "be different from that of the parent element."
               RenderBlock {P} at (4,96) size 747x72
                 RenderImage {IMG} at (0,0) size 15x50
-                RenderInline {SPAN} at (0,0) size 128x19
-                  RenderText {#text} at (15,29) size 128x19
-                    text run at (15,29) width 128: "The first four words"
+                RenderInline {SPAN} at (0,0) size 128x18
+                  RenderText {#text} at (15,30) size 128x18
+                    text run at (15,30) width 128: "The first four words"
                 RenderText {#text} at (142,36) size 746x36
                   text run at (142,36) width 304: " in this sentence should be superscript-aligned. "
                   text run at (445,36) width 301: "The font size of the subscripted text should not"

Modified: trunk/Source/WebCore/ChangeLog (281431 => 281432)


--- trunk/Source/WebCore/ChangeLog	2021-08-23 02:24:23 UTC (rev 281431)
+++ trunk/Source/WebCore/ChangeLog	2021-08-23 03:55:38 UTC (rev 281432)
@@ -1,3 +1,15 @@
+2021-08-22  Alan Bujtas  <za...@apple.com>
+
+        [LFC][IFC] Add support for vertical-align: super
+        https://bugs.webkit.org/show_bug.cgi?id=228235
+
+        Reviewed by Antti Koivisto.
+
+        * layout/formattingContexts/inline/InlineFormattingGeometry.cpp:
+        (WebCore::Layout::LineBoxBuilder::computeLineBoxHeightAndAlignInlineLevelBoxesVertically):
+        * layout/integration/LayoutIntegrationCoverage.cpp:
+        (WebCore::LayoutIntegration::canUseForChild):
+
 2021-08-22  Kate Cheney  <katherine_che...@apple.com>
 
         Report correct blocked URI in CSP violation report

Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingGeometry.cpp (281431 => 281432)


--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingGeometry.cpp	2021-08-23 02:24:23 UTC (rev 281431)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingGeometry.cpp	2021-08-23 03:55:38 UTC (rev 281432)
@@ -477,6 +477,11 @@
                 logicalTop = parentInlineBox.layoutBounds().ascent - logicalTopOffsetFromParentBaseline;
                 break;
             }
+            case VerticalAlign::Super: {
+                auto logicalTopOffsetFromParentBaseline = inlineLevelBox.layoutBounds().ascent + parentInlineBox.style().fontCascade().size() / 3 + 1;
+                logicalTop = parentInlineBox.layoutBounds().ascent - logicalTopOffsetFromParentBaseline;
+                break;
+            }
             default:
                 ASSERT_NOT_IMPLEMENTED_YET();
                 break;
@@ -549,6 +554,9 @@
                 case VerticalAlign::Sub:
                     baselineOffsetFromParentBaseline = -(parentInlineBox.style().fontCascade().size() / 5 + 1);
                     break;
+                case VerticalAlign::Super:
+                    baselineOffsetFromParentBaseline = parentInlineBox.style().fontCascade().size() / 3 + 1;
+                    break;
                 default:
                     ASSERT_NOT_IMPLEMENTED_YET();
                     break;
@@ -620,6 +628,11 @@
                 logicalTop = parentInlineBox.baseline() - logicalTopOffsetFromParentBaseline;
                 break;
             }
+            case VerticalAlign::Super: {
+                auto logicalTopOffsetFromParentBaseline = inlineLevelBox.baseline() + parentInlineBox.style().fontCascade().size() / 3 + 1;
+                logicalTop = parentInlineBox.baseline() - logicalTopOffsetFromParentBaseline;
+                break;
+            }
             // Note that (text)top/bottom align their layout bounds.
             case VerticalAlign::TextTop:
                 logicalTop = inlineLevelBox.layoutBounds().ascent - inlineLevelBox.baseline();

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp (281431 => 281432)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp	2021-08-23 02:24:23 UTC (rev 281431)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp	2021-08-23 03:55:38 UTC (rev 281432)
@@ -566,8 +566,6 @@
 
 #if ALLOW_IMAGES || ALLOW_ALL_REPLACED || ALLOW_INLINE_BLOCK
     auto isSupportedStyle = [] (const auto& style) {
-        if (style.verticalAlign() == VerticalAlign::Super)
-            return false;
         if (style.boxShadow())
             return false;
         if (!style.hangingPunctuation().isEmpty())
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to