Title: [281978] trunk/Source/WebCore
Revision
281978
Author
za...@apple.com
Date
2021-09-02 21:34:59 -0700 (Thu, 02 Sep 2021)

Log Message

Let content with newlineCharacter be measured by FontCascade::widthForSimpleText
https://bugs.webkit.org/show_bug.cgi?id=229849

Reviewed by Simon Fraser.

This logic was added as part of r281423 to make sure we properly compute the advance width of certain characters by
avoiding the simplified measuring codepath.

However in case of newlineCharacter/carriageReturn:
1. they are treated as _space_ when preserved
2. the _space_ character takes the simplified codepath
We should be fine taking the simplified codepath when such characters are present.
This also caused regression on certain text heavy micro-benchmarks on perf.webkit.org.

Let's restore the pre-r281423 (long time) behavior while figuring out what to do with such characters.

* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::characterCanUseSimplifiedTextMeasuring):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (281977 => 281978)


--- trunk/Source/WebCore/ChangeLog	2021-09-03 03:36:18 UTC (rev 281977)
+++ trunk/Source/WebCore/ChangeLog	2021-09-03 04:34:59 UTC (rev 281978)
@@ -1,3 +1,24 @@
+2021-09-02  Alan Bujtas  <za...@apple.com>
+
+        Let content with newlineCharacter be measured by FontCascade::widthForSimpleText
+        https://bugs.webkit.org/show_bug.cgi?id=229849
+
+        Reviewed by Simon Fraser.
+
+        This logic was added as part of r281423 to make sure we properly compute the advance width of certain characters by
+        avoiding the simplified measuring codepath.
+
+        However in case of newlineCharacter/carriageReturn: 
+        1. they are treated as _space_ when preserved
+        2. the _space_ character takes the simplified codepath
+        We should be fine taking the simplified codepath when such characters are present.
+        This also caused regression on certain text heavy micro-benchmarks on perf.webkit.org.
+
+        Let's restore the pre-r281423 (long time) behavior while figuring out what to do with such characters. 
+
+        * platform/graphics/WidthIterator.cpp:
+        (WebCore::WidthIterator::characterCanUseSimplifiedTextMeasuring):
+
 2021-09-02  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         The CSS Font Loading API shouldn't be able to delete a CSS-connected font

Modified: trunk/Source/WebCore/platform/graphics/WidthIterator.cpp (281977 => 281978)


--- trunk/Source/WebCore/platform/graphics/WidthIterator.cpp	2021-09-03 03:36:18 UTC (rev 281977)
+++ trunk/Source/WebCore/platform/graphics/WidthIterator.cpp	2021-09-03 04:34:59 UTC (rev 281978)
@@ -528,8 +528,6 @@
         break;
     case noBreakSpace:
     case softHyphen:
-    case newlineCharacter:
-    case carriageReturn:
     case leftToRightMark:
     case rightToLeftMark:
     case leftToRightEmbed:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to