Title: [266375] trunk/Source/WebCore
Revision
266375
Author
wenson_hs...@apple.com
Date
2020-08-31 16:34:09 -0700 (Mon, 31 Aug 2020)

Log Message

Avoid computing metadata for idempotent text autosizing on macOS
https://bugs.webkit.org/show_bug.cgi?id=216011

Reviewed by Darin Adler.

Avoids an unnecessary call to `adjustForTextAutosizing` during style resolution on macOS, where idempotent text
autosizing is disabled. This function call populates the `AutosizeStatus` fields on `RenderStyle` that are used
by the idempotent text autosizing heuristic. This function call appears consistently in traces taken while
running the Multiply subtest of MotionMark, if only for a relatively small number of samples. While
`AutosizeStatus::computeStatus` is designed to be very cheap, it ends up being called around 1.6 million times
over the course of the subtest.

* style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjust const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (266374 => 266375)


--- trunk/Source/WebCore/ChangeLog	2020-08-31 23:24:43 UTC (rev 266374)
+++ trunk/Source/WebCore/ChangeLog	2020-08-31 23:34:09 UTC (rev 266375)
@@ -1,3 +1,20 @@
+2020-08-31  Wenson Hsieh  <wenson_hs...@apple.com>
+
+        Avoid computing metadata for idempotent text autosizing on macOS
+        https://bugs.webkit.org/show_bug.cgi?id=216011
+
+        Reviewed by Darin Adler.
+
+        Avoids an unnecessary call to `adjustForTextAutosizing` during style resolution on macOS, where idempotent text
+        autosizing is disabled. This function call populates the `AutosizeStatus` fields on `RenderStyle` that are used
+        by the idempotent text autosizing heuristic. This function call appears consistently in traces taken while
+        running the Multiply subtest of MotionMark, if only for a relatively small number of samples. While
+        `AutosizeStatus::computeStatus` is designed to be very cheap, it ends up being called around 1.6 million times
+        over the course of the subtest.
+
+        * style/StyleAdjuster.cpp:
+        (WebCore::Style::Adjuster::adjust const):
+
 2020-08-31  Joonghun Park  <jh718.p...@samsung.com>
 
         Unreviewed. Remove the unused variable build warning since r238538.

Modified: trunk/Source/WebCore/style/StyleAdjuster.cpp (266374 => 266375)


--- trunk/Source/WebCore/style/StyleAdjuster.cpp	2020-08-31 23:24:43 UTC (rev 266374)
+++ trunk/Source/WebCore/style/StyleAdjuster.cpp	2020-08-31 23:34:09 UTC (rev 266375)
@@ -490,7 +490,7 @@
         style.setEventListenerRegionTypes(computeEventListenerRegionTypes(*m_element, m_parentStyle.eventListenerRegionTypes()));
 
 #if ENABLE(TEXT_AUTOSIZING)
-    if (m_element)
+    if (m_element && m_document.settings().textAutosizingUsesIdempotentMode())
         adjustForTextAutosizing(style, *m_element);
 #endif
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to