Title: [247035] trunk/Source/WebCore
Revision
247035
Author
za...@apple.com
Date
2019-07-01 22:10:54 -0700 (Mon, 01 Jul 2019)

Log Message

[Text autosizing] [iPadOS] AutosizeStatus::idempotentTextSize returns the computed font size in certain cases.
https://bugs.webkit.org/show_bug.cgi?id=199382
<rdar://problem/52483097>

Reviewed by Wenson Hsieh.

Adjust the font size on the style only when the autosized value is different from the computed value.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (247034 => 247035)


--- trunk/Source/WebCore/ChangeLog	2019-07-02 04:34:59 UTC (rev 247034)
+++ trunk/Source/WebCore/ChangeLog	2019-07-02 05:10:54 UTC (rev 247035)
@@ -1,3 +1,16 @@
+2019-07-01  Zalan Bujtas  <za...@apple.com>
+
+        [Text autosizing] [iPadOS] AutosizeStatus::idempotentTextSize returns the computed font size in certain cases.
+        https://bugs.webkit.org/show_bug.cgi?id=199382
+        <rdar://problem/52483097>
+
+        Reviewed by Wenson Hsieh.
+
+        Adjust the font size on the style only when the autosized value is different from the computed value. 
+
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):
+
 2019-07-01  Chris Dumez  <cdu...@apple.com>
 
         It should not be possible to trigger a load while in the middle of restoring a page in PageCache

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (247034 => 247035)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2019-07-02 04:34:59 UTC (rev 247034)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2019-07-02 05:10:54 UTC (rev 247035)
@@ -913,11 +913,13 @@
     auto fontDescription = style.fontDescription();
     auto initialComputedFontSize = fontDescription.computedSize(); 
     auto adjustedFontSize = AutosizeStatus::idempotentTextSize(fontDescription.specifiedSize(), initialScale);
+    if (initialComputedFontSize == adjustedFontSize)
+        return;
+
     fontDescription.setComputedSize(adjustedFontSize);
     style.setFontDescription(WTFMove(fontDescription));
     style.fontCascade().update(&document().fontSelector());
-    if (initialComputedFontSize != adjustedFontSize)
-        adjustLineHeightIfNeeded(adjustedFontSize);
+    adjustLineHeightIfNeeded(adjustedFontSize);
 }
 #endif
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to