Title: [174391] releases/WebKitGTK/webkit-2.6
Revision
174391
Author
carlo...@webkit.org
Date
2014-10-07 00:26:41 -0700 (Tue, 07 Oct 2014)

Log Message

Merge r174002 - [GTK] Fix support for the initial-letter CSS property to first-letter
https://bugs.webkit.org/show_bug.cgi?id=137108

Patch by Lorenzo Tilve <lti...@igalia.com> on 2014-09-26
Reviewed by Alejandro G. Castro.

Source/WebCore:

Add support for cap-height to the font system.

* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::SimpleFontData::platformInit):

LayoutTests:

Add missing GTK test expectation files after http://webkit.org/b/136484

* platform/gtk/fast/css-generated-content/initial-letter-basic-expected.txt: Added.
* platform/gtk/fast/css-generated-content/initial-letter-border-padding-expected.txt: Added.
* platform/gtk/fast/css-generated-content/initial-letter-clearance-expected.txt: Added.
* platform/gtk/fast/css-generated-content/initial-letter-descender-expected.txt: Added.
* platform/gtk/fast/css-generated-content/initial-letter-raised-expected.txt: Added.
* platform/gtk/fast/css-generated-content/initial-letter-sunken-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.6/LayoutTests/ChangeLog (174390 => 174391)


--- releases/WebKitGTK/webkit-2.6/LayoutTests/ChangeLog	2014-10-07 07:23:14 UTC (rev 174390)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/ChangeLog	2014-10-07 07:26:41 UTC (rev 174391)
@@ -1,3 +1,19 @@
+2014-09-26  Lorenzo Tilve  <lti...@igalia.com>
+
+        [GTK] Fix support for the initial-letter CSS property to first-letter
+        https://bugs.webkit.org/show_bug.cgi?id=137108
+
+        Reviewed by Alejandro G. Castro.
+
+        Add missing GTK test expectation files after http://webkit.org/b/136484
+
+        * platform/gtk/fast/css-generated-content/initial-letter-basic-expected.txt: Added.
+        * platform/gtk/fast/css-generated-content/initial-letter-border-padding-expected.txt: Added.
+        * platform/gtk/fast/css-generated-content/initial-letter-clearance-expected.txt: Added.
+        * platform/gtk/fast/css-generated-content/initial-letter-descender-expected.txt: Added.
+        * platform/gtk/fast/css-generated-content/initial-letter-raised-expected.txt: Added.
+        * platform/gtk/fast/css-generated-content/initial-letter-sunken-expected.txt: Added.
+
 2014-09-22  David Hyatt  <hy...@apple.com>
 
         Bad cast in isValidColumnSpanner.

Added: releases/WebKitGTK/webkit-2.6/LayoutTests/platform/gtk/fast/css-generated-content/initial-letter-basic-expected.txt (0 => 174391)


--- releases/WebKitGTK/webkit-2.6/LayoutTests/platform/gtk/fast/css-generated-content/initial-letter-basic-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/platform/gtk/fast/css-generated-content/initial-letter-basic-expected.txt	2014-10-07 07:26:41 UTC (rev 174391)
@@ -0,0 +1,27 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,16) size 784x568
+      RenderBlock {DIV} at (16,0) size 400x85
+        RenderBlock (floating) at (2,-3) size 33x52
+          RenderText {#text} at (0,10) size 33x51
+            text run at (0,10) width 33: "A"
+        RenderText {#text} at (37,0) size 398x85
+          text run at (37,0) width 358: "n example of first-letter. This letter should span 3 lines of"
+          text run at (37,17) width 334: "text, and so it should align itself cleanly with the cap-"
+          text run at (37,34) width 348: "height of the A lining up with the cap-height of the first"
+          text run at (0,51) width 398: "line, and the baseline of the A lining up with the baseline of the"
+          text run at (0,68) width 60: "third line."
+      RenderBlock {SPAN} at (0,101) size 784x85
+        RenderBlock {DIV} at (368,0) size 400x85
+          RenderBlock (floating) at (365,-3) size 33x52
+            RenderText {#text} at (0,10) size 33x51
+              text run at (0,10) width 33: "A"
+          RenderText {#text} at (20,0) size 390x85
+            text run at (20,0) width 343: "n RTL example of first-letter. This letter should span 3"
+            text run at (10,17) width 353: "lines of text, and so it should align itself cleanly with the"
+            text run at (16,34) width 347: "cap-height of the A lining up with the cap-height of the"
+            text run at (14,51) width 386: "first line, and the baseline of the A lining up with the baseline"
+            text run at (300,68) width 4 RTL: "."
+            text run at (304,68) width 96: "of the third line"

Added: releases/WebKitGTK/webkit-2.6/LayoutTests/platform/gtk/fast/css-generated-content/initial-letter-border-padding-expected.txt (0 => 174391)


--- releases/WebKitGTK/webkit-2.6/LayoutTests/platform/gtk/fast/css-generated-content/initial-letter-border-padding-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/platform/gtk/fast/css-generated-content/initial-letter-border-padding-expected.txt	2014-10-07 07:26:41 UTC (rev 174391)
@@ -0,0 +1,27 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,16) size 784x568
+      RenderBlock {DIV} at (16,0) size 400x102
+        RenderBlock (floating) at (2,-6) size 39x58 [color=#FF0000] [border: (2px solid #FF0000)]
+          RenderText {#text} at (3,13) size 33x51
+            text run at (3,13) width 33: "A"
+        RenderText {#text} at (43,17) size 398x85
+          text run at (43,17) width 341: "n example of first-letter. This letter should span 3 lines"
+          text run at (43,34) width 351: "of text, and so it should align itself cleanly with the cap-"
+          text run at (43,51) width 348: "height of the A lining up with the cap-height of the first"
+          text run at (0,68) width 398: "line, and the baseline of the A lining up with the baseline of the"
+          text run at (0,85) width 60: "third line."
+      RenderBlock {SPAN} at (0,118) size 784x102
+        RenderBlock {DIV} at (368,0) size 400x102
+          RenderBlock (floating) at (359,-6) size 39x58 [color=#FF0000] [border: (2px solid #FF0000)]
+            RenderText {#text} at (3,13) size 33x51
+              text run at (3,13) width 33: "A"
+          RenderText {#text} at (14,17) size 396x85
+            text run at (14,17) width 343: "n RTL example of first-letter. This letter should span 3"
+            text run at (4,34) width 353: "lines of text, and so it should align itself cleanly with the"
+            text run at (10,51) width 347: "cap-height of the A lining up with the cap-height of the"
+            text run at (14,68) width 386: "first line, and the baseline of the A lining up with the baseline"
+            text run at (300,85) width 4 RTL: "."
+            text run at (304,85) width 96: "of the third line"

Added: releases/WebKitGTK/webkit-2.6/LayoutTests/platform/gtk/fast/css-generated-content/initial-letter-clearance-expected.txt (0 => 174391)


--- releases/WebKitGTK/webkit-2.6/LayoutTests/platform/gtk/fast/css-generated-content/initial-letter-clearance-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/platform/gtk/fast/css-generated-content/initial-letter-clearance-expected.txt	2014-10-07 07:26:41 UTC (rev 174391)
@@ -0,0 +1,22 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,16) size 784x568
+      RenderBlock {DIV} at (16,0) size 400x51
+        RenderBlock (floating) at (2,-3) size 24x69
+          RenderText {#text} at (0,13) size 24x68
+            text run at (0,13) width 24: "J"
+        RenderText {#text} at (28,34) size 289x17
+          text run at (28,34) width 289: "ust an example of first-letter. Short paragraph!"
+      RenderBlock {DIV} at (16,67) size 400x136
+        RenderBlock (floating) at (2,-3) size 24x69
+          RenderText {#text} at (0,13) size 24x68
+            text run at (0,13) width 24: "J"
+        RenderText {#text} at (28,34) size 400x102
+          text run at (28,34) width 370: "ust an example of first-letter. This letter should span 3 lines"
+          text run at (28,51) width 351: "of text, and so it should align itself cleanly with the cap-"
+          text run at (0,68) width 400: "height of the J lining up with the cap-height of the first line, and"
+          text run at (0,85) width 398: "the baseline of the J lining up with the baseline of the third line."
+          text run at (0,102) width 390: "The descender of the J is still avoided by following lines. This"
+          text run at (0,119) width 241: "paragraph cleared the short paragraph."

Added: releases/WebKitGTK/webkit-2.6/LayoutTests/platform/gtk/fast/css-generated-content/initial-letter-descender-expected.txt (0 => 174391)


--- releases/WebKitGTK/webkit-2.6/LayoutTests/platform/gtk/fast/css-generated-content/initial-letter-descender-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/platform/gtk/fast/css-generated-content/initial-letter-descender-expected.txt	2014-10-07 07:26:41 UTC (rev 174391)
@@ -0,0 +1,15 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,16) size 784x568
+      RenderBlock {DIV} at (16,0) size 400x119
+        RenderBlock (floating) at (2,-3) size 24x69
+          RenderText {#text} at (0,13) size 24x68
+            text run at (0,13) width 24: "J"
+        RenderText {#text} at (28,34) size 398x85
+          text run at (28,34) width 370: "ust an example of first-letter. This letter should span 3 lines"
+          text run at (28,51) width 351: "of text, and so it should align itself cleanly with the cap-"
+          text run at (0,68) width 379: "height of the H lining up with the cap-height of the first line,"
+          text run at (0,85) width 394: "and the baseline of the J lining up with the baseline of the third"
+          text run at (0,102) width 389: "line. The descender of the J is still avoided by following lines."

Added: releases/WebKitGTK/webkit-2.6/LayoutTests/platform/gtk/fast/css-generated-content/initial-letter-raised-expected.txt (0 => 174391)


--- releases/WebKitGTK/webkit-2.6/LayoutTests/platform/gtk/fast/css-generated-content/initial-letter-raised-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/platform/gtk/fast/css-generated-content/initial-letter-raised-expected.txt	2014-10-07 07:26:41 UTC (rev 174391)
@@ -0,0 +1,27 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,16) size 784x568
+      RenderBlock {DIV} at (16,0) size 400x102
+        RenderBlock (floating) at (2,-3) size 33x52
+          RenderText {#text} at (0,10) size 33x51
+            text run at (0,10) width 33: "A"
+        RenderText {#text} at (37,17) size 400x85
+          text run at (37,17) width 358: "n example of first-letter. This letter should span 3 lines of"
+          text run at (37,34) width 334: "text, and so it should align itself cleanly with the cap-"
+          text run at (0,51) width 379: "height of the A lining up with the cap-height of the first line,"
+          text run at (0,68) width 400: "and the baseline of the A lining up with the baseline of the third"
+          text run at (0,85) width 27: "line."
+      RenderBlock {SPAN} at (0,118) size 784x102
+        RenderBlock {DIV} at (368,0) size 400x102
+          RenderBlock (floating) at (365,-3) size 33x52
+            RenderText {#text} at (0,10) size 33x51
+              text run at (0,10) width 33: "A"
+          RenderText {#text} at (20,17) size 398x85
+            text run at (20,17) width 343: "n RTL example of first-letter. This letter should span 3"
+            text run at (10,34) width 353: "lines of text, and so it should align itself cleanly with the"
+            text run at (25,51) width 375: "cap-height of the A lining up with the cap-height of the first"
+            text run at (2,68) width 398: "line, and the baseline of the A lining up with the baseline of the"
+            text run at (340,85) width 4 RTL: "."
+            text run at (344,85) width 56: "third line"

Added: releases/WebKitGTK/webkit-2.6/LayoutTests/platform/gtk/fast/css-generated-content/initial-letter-sunken-expected.txt (0 => 174391)


--- releases/WebKitGTK/webkit-2.6/LayoutTests/platform/gtk/fast/css-generated-content/initial-letter-sunken-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/platform/gtk/fast/css-generated-content/initial-letter-sunken-expected.txt	2014-10-07 07:26:41 UTC (rev 174391)
@@ -0,0 +1,27 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,16) size 784x568
+      RenderBlock {DIV} at (16,0) size 400x85
+        RenderBlock (floating) at (2,14) size 22x34
+          RenderText {#text} at (0,6) size 22x33
+            text run at (0,6) width 22: "A"
+        RenderText {#text} at (26,0) size 399x85
+          text run at (26,0) width 358: "n example of first-letter. This letter should span 3 lines of"
+          text run at (26,17) width 373: "text, and so it should align itself cleanly with the cap-height"
+          text run at (26,34) width 363: "of the A lining up with the cap-height of the first line, and"
+          text run at (0,51) width 373: "the baseline of the A lining up with the baseline of the third"
+          text run at (0,68) width 27: "line."
+      RenderBlock {SPAN} at (0,101) size 784x85
+        RenderBlock {DIV} at (368,0) size 400x85
+          RenderBlock (floating) at (376,14) size 22x34
+            RenderText {#text} at (0,6) size 22x33
+              text run at (0,6) width 22: "A"
+          RenderText {#text} at (31,0) size 386x85
+            text run at (31,0) width 343: "n RTL example of first-letter. This letter should span 3"
+            text run at (21,17) width 353: "lines of text, and so it should align itself cleanly with the"
+            text run at (27,34) width 347: "cap-height of the A lining up with the cap-height of the"
+            text run at (14,51) width 386: "first line, and the baseline of the A lining up with the baseline"
+            text run at (300,68) width 4 RTL: "."
+            text run at (304,68) width 96: "of the third line"

Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog (174390 => 174391)


--- releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog	2014-10-07 07:23:14 UTC (rev 174390)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog	2014-10-07 07:26:41 UTC (rev 174391)
@@ -1,3 +1,15 @@
+2014-09-26  Lorenzo Tilve  <lti...@igalia.com>
+
+        [GTK] Fix support for the initial-letter CSS property to first-letter
+        https://bugs.webkit.org/show_bug.cgi?id=137108
+
+        Reviewed by Alejandro G. Castro.
+
+        Add support for cap-height to the font system.
+
+        * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
+        (WebCore::SimpleFontData::platformInit):
+
 2014-09-22  Alexey Proskuryakov  <a...@apple.com>
 
         WebSocket crash when a connection is closed from server side

Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp (174390 => 174391)


--- releases/WebKitGTK/webkit-2.6/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp	2014-10-07 07:23:14 UTC (rev 174390)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp	2014-10-07 07:26:41 UTC (rev 174391)
@@ -63,10 +63,12 @@
 
     float ascent = narrowPrecisionToFloat(fontExtents.ascent);
     float descent = narrowPrecisionToFloat(fontExtents.descent);
+    float capHeight = narrowPrecisionToFloat(fontExtents.height);
     float lineGap = narrowPrecisionToFloat(fontExtents.height - fontExtents.ascent - fontExtents.descent);
 
     m_fontMetrics.setAscent(ascent);
     m_fontMetrics.setDescent(descent);
+    m_fontMetrics.setCapHeight(capHeight);
 
 #if PLATFORM(EFL)
     m_fontMetrics.setLineSpacing(ascent + descent + lineGap);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to