Title: [275326] trunk
Revision
275326
Author
hey...@apple.com
Date
2021-03-31 17:33:29 -0700 (Wed, 31 Mar 2021)

Log Message

Avoid creating any complex text runs when font-size is zero.
https://bugs.webkit.org/show_bug.cgi?id=223983

Reviewed by Myles C. Maxfield.

Source/WebCore:

We have existing checks to handle `font-size: 0` on the simple
text path, but not for complex text.  Handle this by creating
no complex text runs for text with zero size.

Test: fast/text/font-size-zero-complex.html

* platform/graphics/ComplexTextController.cpp:
(WebCore::ComplexTextController::collectComplexTextRuns):

LayoutTests:

* fast/text/font-size-zero-complex-expected.html: Added.
* fast/text/font-size-zero-complex.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (275325 => 275326)


--- trunk/LayoutTests/ChangeLog	2021-04-01 00:30:14 UTC (rev 275325)
+++ trunk/LayoutTests/ChangeLog	2021-04-01 00:33:29 UTC (rev 275326)
@@ -1,3 +1,13 @@
+2021-03-31  Cameron McCormack  <hey...@apple.com>
+
+        Avoid creating any complex text runs when font-size is zero.
+        https://bugs.webkit.org/show_bug.cgi?id=223983
+
+        Reviewed by Myles C. Maxfield.
+
+        * fast/text/font-size-zero-complex-expected.html: Added.
+        * fast/text/font-size-zero-complex.html: Added.
+
 2021-03-31  Mark Lam  <mark....@apple.com>
 
         Placate exception check validation below convertVariadicArguments().

Added: trunk/LayoutTests/fast/text/font-size-zero-complex-expected.html (0 => 275326)


--- trunk/LayoutTests/fast/text/font-size-zero-complex-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/font-size-zero-complex-expected.html	2021-04-01 00:33:29 UTC (rev 275326)
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+This text should be left aligned.

Added: trunk/LayoutTests/fast/text/font-size-zero-complex.html (0 => 275326)


--- trunk/LayoutTests/fast/text/font-size-zero-complex.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/font-size-zero-complex.html	2021-04-01 00:33:29 UTC (rev 275326)
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<span style="font-size: 0; font-feature-settings: 'tnum';">xxxxx</span>This text should be left aligned.

Modified: trunk/Source/WebCore/ChangeLog (275325 => 275326)


--- trunk/Source/WebCore/ChangeLog	2021-04-01 00:30:14 UTC (rev 275325)
+++ trunk/Source/WebCore/ChangeLog	2021-04-01 00:33:29 UTC (rev 275326)
@@ -1,3 +1,19 @@
+2021-03-31  Cameron McCormack  <hey...@apple.com>
+
+        Avoid creating any complex text runs when font-size is zero.
+        https://bugs.webkit.org/show_bug.cgi?id=223983
+
+        Reviewed by Myles C. Maxfield.
+
+        We have existing checks to handle `font-size: 0` on the simple
+        text path, but not for complex text.  Handle this by creating
+        no complex text runs for text with zero size.
+
+        Test: fast/text/font-size-zero-complex.html
+
+        * platform/graphics/ComplexTextController.cpp:
+        (WebCore::ComplexTextController::collectComplexTextRuns):
+
 2021-03-31  Mark Lam  <mark....@apple.com>
 
         Placate exception check validation below convertVariadicArguments().

Modified: trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp (275325 => 275326)


--- trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp	2021-04-01 00:30:14 UTC (rev 275325)
+++ trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp	2021-04-01 00:33:29 UTC (rev 275326)
@@ -342,7 +342,7 @@
 
 void ComplexTextController::collectComplexTextRuns()
 {
-    if (!m_end)
+    if (!m_end || !m_font.size())
         return;
 
     // We break up glyph run generation for the string by Font.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to