Title: [247593] branches/safari-608-branch
Revision
247593
Author
kocsen_ch...@apple.com
Date
2019-07-18 13:23:53 -0700 (Thu, 18 Jul 2019)

Log Message

Cherry-pick r247484. rdar://problem/53229757

    [Text autosizing] [iPadOS] Paragraph text on the front page of LinkedIn.com is not boosted
    https://bugs.webkit.org/show_bug.cgi?id=199827
    <rdar://problem/53152660>

    Reviewed by Zalan Bujtas.

    Source/WebCore:

    After r247467, we try to avoid boosting some text that might cause vertical overflow due to line height
    increasing inside a container that expects a fixed integer number of lines. However, in the case of
    linkedin.com, the line height specified is a fixed value of 26px, which greatly exceeds the specified font size
    of 14px. In this case, it's safe to boost font size, since doing so would not affect the line height at all.

    To handle this case, don't avoid text autosizing due to the "fixed number of lines" heuristic if the line height
    is fixed, and is much larger than the font size.

    Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html

    * rendering/style/TextSizeAdjustment.cpp:
    (WebCore::AutosizeStatus::updateStatus):

    LayoutTests:

    Add a new test case, inspired by paragraph text in a post on linkedin.com. This text should get autosized.

    * fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates-expected.txt:
    * fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html:

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247484 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-608-branch/LayoutTests/ChangeLog (247592 => 247593)


--- branches/safari-608-branch/LayoutTests/ChangeLog	2019-07-18 20:23:50 UTC (rev 247592)
+++ branches/safari-608-branch/LayoutTests/ChangeLog	2019-07-18 20:23:53 UTC (rev 247593)
@@ -1,5 +1,53 @@
 2019-07-17  Kocsen Chung  <kocsen_ch...@apple.com>
 
+        Cherry-pick r247484. rdar://problem/53229757
+
+    [Text autosizing] [iPadOS] Paragraph text on the front page of LinkedIn.com is not boosted
+    https://bugs.webkit.org/show_bug.cgi?id=199827
+    <rdar://problem/53152660>
+    
+    Reviewed by Zalan Bujtas.
+    
+    Source/WebCore:
+    
+    After r247467, we try to avoid boosting some text that might cause vertical overflow due to line height
+    increasing inside a container that expects a fixed integer number of lines. However, in the case of
+    linkedin.com, the line height specified is a fixed value of 26px, which greatly exceeds the specified font size
+    of 14px. In this case, it's safe to boost font size, since doing so would not affect the line height at all.
+    
+    To handle this case, don't avoid text autosizing due to the "fixed number of lines" heuristic if the line height
+    is fixed, and is much larger than the font size.
+    
+    Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html
+    
+    * rendering/style/TextSizeAdjustment.cpp:
+    (WebCore::AutosizeStatus::updateStatus):
+    
+    LayoutTests:
+    
+    Add a new test case, inspired by paragraph text in a post on linkedin.com. This text should get autosized.
+    
+    * fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates-expected.txt:
+    * fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247484 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-07-16  Wenson Hsieh  <wenson_hs...@apple.com>
+
+            [Text autosizing] [iPadOS] Paragraph text on the front page of LinkedIn.com is not boosted
+            https://bugs.webkit.org/show_bug.cgi?id=199827
+            <rdar://problem/53152660>
+
+            Reviewed by Zalan Bujtas.
+
+            Add a new test case, inspired by paragraph text in a post on linkedin.com. This text should get autosized.
+
+            * fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates-expected.txt:
+            * fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html:
+
+2019-07-17  Kocsen Chung  <kocsen_ch...@apple.com>
+
         Cherry-pick r247474. rdar://problem/53229615
 
     JSGlobalObject type macros should support feature flags and WeakRef should have one

Modified: branches/safari-608-branch/LayoutTests/fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates-expected.txt (247592 => 247593)


--- branches/safari-608-branch/LayoutTests/fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates-expected.txt	2019-07-18 20:23:50 UTC (rev 247592)
+++ branches/safari-608-branch/LayoutTests/fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates-expected.txt	2019-07-18 20:23:53 UTC (rev 247593)
@@ -34,6 +34,8 @@
 PASS result is 12
 Checking target18:
 PASS result is 12
+Checking target19:
+PASS result is >= 13
 PASS successfullyParsed is true
 
 TEST COMPLETE
@@ -56,3 +58,4 @@
 Test 
 Test 
 Test
+Test

Modified: branches/safari-608-branch/LayoutTests/fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html (247592 => 247593)


--- branches/safari-608-branch/LayoutTests/fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html	2019-07-18 20:23:50 UTC (rev 247592)
+++ branches/safari-608-branch/LayoutTests/fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html	2019-07-18 20:23:53 UTC (rev 247593)
@@ -35,6 +35,7 @@
     <br>
     <span>Test</span>
 </div>
+<div style="background: green; line-height: 20px; max-height: 20px; font-size: 12px;" id="target19">Test</div>
 <script>
 let result;
 function check(name, shouldGetAutosized) {
@@ -77,6 +78,7 @@
 check("target16", true);
 check("target17", false);
 check("target18", false);
+check("target19", true);
 </script>
 <script src=""
 </body>

Modified: branches/safari-608-branch/Source/WebCore/ChangeLog (247592 => 247593)


--- branches/safari-608-branch/Source/WebCore/ChangeLog	2019-07-18 20:23:50 UTC (rev 247592)
+++ branches/safari-608-branch/Source/WebCore/ChangeLog	2019-07-18 20:23:53 UTC (rev 247593)
@@ -1,5 +1,61 @@
 2019-07-17  Kocsen Chung  <kocsen_ch...@apple.com>
 
+        Cherry-pick r247484. rdar://problem/53229757
+
+    [Text autosizing] [iPadOS] Paragraph text on the front page of LinkedIn.com is not boosted
+    https://bugs.webkit.org/show_bug.cgi?id=199827
+    <rdar://problem/53152660>
+    
+    Reviewed by Zalan Bujtas.
+    
+    Source/WebCore:
+    
+    After r247467, we try to avoid boosting some text that might cause vertical overflow due to line height
+    increasing inside a container that expects a fixed integer number of lines. However, in the case of
+    linkedin.com, the line height specified is a fixed value of 26px, which greatly exceeds the specified font size
+    of 14px. In this case, it's safe to boost font size, since doing so would not affect the line height at all.
+    
+    To handle this case, don't avoid text autosizing due to the "fixed number of lines" heuristic if the line height
+    is fixed, and is much larger than the font size.
+    
+    Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html
+    
+    * rendering/style/TextSizeAdjustment.cpp:
+    (WebCore::AutosizeStatus::updateStatus):
+    
+    LayoutTests:
+    
+    Add a new test case, inspired by paragraph text in a post on linkedin.com. This text should get autosized.
+    
+    * fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates-expected.txt:
+    * fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247484 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-07-16  Wenson Hsieh  <wenson_hs...@apple.com>
+
+            [Text autosizing] [iPadOS] Paragraph text on the front page of LinkedIn.com is not boosted
+            https://bugs.webkit.org/show_bug.cgi?id=199827
+            <rdar://problem/53152660>
+
+            Reviewed by Zalan Bujtas.
+
+            After r247467, we try to avoid boosting some text that might cause vertical overflow due to line height
+            increasing inside a container that expects a fixed integer number of lines. However, in the case of
+            linkedin.com, the line height specified is a fixed value of 26px, which greatly exceeds the specified font size
+            of 14px. In this case, it's safe to boost font size, since doing so would not affect the line height at all.
+
+            To handle this case, don't avoid text autosizing due to the "fixed number of lines" heuristic if the line height
+            is fixed, and is much larger than the font size.
+
+            Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html
+
+            * rendering/style/TextSizeAdjustment.cpp:
+            (WebCore::AutosizeStatus::updateStatus):
+
+2019-07-17  Kocsen Chung  <kocsen_ch...@apple.com>
+
         Cherry-pick r247483. rdar://problem/53229618
 
     [ContentChangeObserver] Cancel ongoing content observation when tap is failed/cancelled

Modified: branches/safari-608-branch/Source/WebCore/rendering/style/TextSizeAdjustment.cpp (247592 => 247593)


--- branches/safari-608-branch/Source/WebCore/rendering/style/TextSizeAdjustment.cpp	2019-07-18 20:23:50 UTC (rev 247592)
+++ branches/safari-608-branch/Source/WebCore/rendering/style/TextSizeAdjustment.cpp	2019-07-18 20:23:53 UTC (rev 247593)
@@ -53,6 +53,10 @@
         if (!style.lineHeight().isSpecified() || style.whiteSpace() == WhiteSpace::NoWrap)
             return false;
 
+        const float maximumDifferenceBetweenFixedLineHeightAndFontSize = 6;
+        if (style.lineHeight().isFixed() && style.lineHeight().value() - style.fontDescription().specifiedSize() > maximumDifferenceBetweenFixedLineHeightAndFontSize)
+            return false;
+
         Optional<Length> heightOrMaxHeightAsLength;
         if (style.height().isFixed() && style.maxHeight().isAuto())
             heightOrMaxHeightAsLength = style.height();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to