Title: [269056] trunk/Source/WebCore
Revision
269056
Author
[email protected]
Date
2020-10-27 10:59:07 -0700 (Tue, 27 Oct 2020)

Log Message

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

Reviewed by Antti Koivisto.

"-webkit-baseline-middle: The center of the element is aligned with the baseline of the text."
https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariCSSRef/Articles/StandardCSSProperties.html
This patch makes LayoutTests/dom/html/level2/html/ cases not assert.

* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::LineBoxBuilder::alignInlineLevelBoxesVerticallyAndComputeLineBoxHeight):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (269055 => 269056)


--- trunk/Source/WebCore/ChangeLog	2020-10-27 17:58:41 UTC (rev 269055)
+++ trunk/Source/WebCore/ChangeLog	2020-10-27 17:59:07 UTC (rev 269056)
@@ -1,3 +1,17 @@
+2020-10-27  Zalan Bujtas  <[email protected]>
+
+        [LFC][IFC] Add support for vertical-align: -webkit-baseline-middle
+        https://bugs.webkit.org/show_bug.cgi?id=218243
+
+        Reviewed by Antti Koivisto.
+
+        "-webkit-baseline-middle: The center of the element is aligned with the baseline of the text."
+        https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariCSSRef/Articles/StandardCSSProperties.html
+        This patch makes LayoutTests/dom/html/level2/html/ cases not assert.
+
+        * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
+        (WebCore::Layout::LineBoxBuilder::alignInlineLevelBoxesVerticallyAndComputeLineBoxHeight):
+
 2020-10-27  Philippe Normand  <[email protected]>
 
         [GStreamer] Bad handling of audio files in the ImageDecoder

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp (269055 => 269056)


--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp	2020-10-27 17:58:41 UTC (rev 269055)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp	2020-10-27 17:59:07 UTC (rev 269056)
@@ -351,6 +351,10 @@
                 offsetFromParentInlineBoxBaseline = (inlineLevelBox->layoutBounds().height() / 2 + parentInlineBox.fontMetrics().xHeight() / 2);
                 logicalTop = parentInlineBox.baseline() - offsetFromParentInlineBoxBaseline;
                 break;
+            case VerticalAlign::BaselineMiddle:
+                offsetFromParentInlineBoxBaseline = inlineLevelBox->layoutBounds().height() / 2;
+                logicalTop = parentInlineBox.baseline() - offsetFromParentInlineBoxBaseline;
+                break;
             case VerticalAlign::Length: {
                 auto& style = layoutBox.style();
                 offsetFromParentInlineBoxBaseline = floatValueForLength(style.verticalAlignLength(), style.computedLineHeight());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to