Title: [257481] trunk
Revision
257481
Author
[email protected]
Date
2020-02-26 10:45:17 -0800 (Wed, 26 Feb 2020)

Log Message

Unreviewed, rolling out r257373.

This commit introduced one test that is a flaky failure on ios
bots and broke another test

Reverted changeset:

"[iPadOS] REGRESSION(r247667): Autosizing style changes don't
invalidate RenderText's preferred logical widths"
https://bugs.webkit.org/show_bug.cgi?id=208084
https://trac.webkit.org/changeset/257373

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (257480 => 257481)


--- trunk/LayoutTests/ChangeLog	2020-02-26 18:34:10 UTC (rev 257480)
+++ trunk/LayoutTests/ChangeLog	2020-02-26 18:45:17 UTC (rev 257481)
@@ -1,3 +1,17 @@
+2020-02-26  Jacob Uphoff  <[email protected]>
+
+        Unreviewed, rolling out r257373.
+
+        This commit introduced one test that is a flaky failure on ios
+        bots and broke another test
+
+        Reverted changeset:
+
+        "[iPadOS] REGRESSION(r247667): Autosizing style changes don't
+        invalidate RenderText's preferred logical widths"
+        https://bugs.webkit.org/show_bug.cgi?id=208084
+        https://trac.webkit.org/changeset/257373
+
 2020-02-26  Jason Lawrence  <[email protected]>
 
         [ iOS wk2 Release ] fast/text-autosizing/ios/idempotentmode/viewport-change-relayout.html is flaky failing.

Deleted: trunk/LayoutTests/fast/text-autosizing/ios/idempotentmode/viewport-change-relayout-expected.html (257480 => 257481)


--- trunk/LayoutTests/fast/text-autosizing/ios/idempotentmode/viewport-change-relayout-expected.html	2020-02-26 18:34:10 UTC (rev 257480)
+++ trunk/LayoutTests/fast/text-autosizing/ios/idempotentmode/viewport-change-relayout-expected.html	2020-02-26 18:45:17 UTC (rev 257481)
@@ -1,16 +0,0 @@
-<!DOCTYPE html><!-- webkit-test-runner [ useFlexibleViewport=true ] -->
-<html>
-<head>
-<meta id="viewport" name="viewport" content="width=400, initial-scale=0.70">
-<script>
-if (window.internals) {
-    internals.settings.setTextAutosizingEnabled(true);
-    internals.settings.setTextAutosizingUsesIdempotentMode(true);
-}
-</script>
-</head>
-<body style="font: 17px 'Arial'; width: 631px; -webkit-text-size-adjust: none;">
-<div><em id="em">Japan</em> with Everything about modern and traditional emphasis</div>
-<div style="height: 4000px; background: green;"></div>
-</body>
-</html>

Deleted: trunk/LayoutTests/fast/text-autosizing/ios/idempotentmode/viewport-change-relayout.html (257480 => 257481)


--- trunk/LayoutTests/fast/text-autosizing/ios/idempotentmode/viewport-change-relayout.html	2020-02-26 18:34:10 UTC (rev 257480)
+++ trunk/LayoutTests/fast/text-autosizing/ios/idempotentmode/viewport-change-relayout.html	2020-02-26 18:45:17 UTC (rev 257481)
@@ -1,40 +0,0 @@
-<!DOCTYPE html><!-- webkit-test-runner [ useFlexibleViewport=true ] -->
-<html>
-<head>
-<meta id="viewport" name="viewport" content="width=400, initial-scale=1">
-<script>
-if (window.testRunner)
-    testRunner.waitUntilDone();
-if (window.internals) {
-    internals.settings.setTextAutosizingEnabled(true);
-    internals.settings.setTextAutosizingUsesIdempotentMode(true);
-}
-</script>
-</head>
-<body style="font: 14px 'Arial'; width: 631px;">
-<div><em id="em">Japan</em> with Everything about modern and traditional emphasis</div>
-<div style="height: 4000px; background: green;"></div>
-<script>
-function _waitForCondition(condition, completionHandler)
-{
-  if (condition())
-    completionHandler();
-  else
-    setTimeout(_waitForCondition, 5, condition, completionHandler);
-}
-
-const em = document.getElementById("em");
-em.getBoundingClientRect();
-window.setTimeout(function() {
-    document.getElementById("viewport").content = "width=400, initial-scale=0.70";
-    em.getBoundingClientRect();
-}, 0);
-_waitForCondition(function() {
-    return window.getComputedStyle(document.getElementById("em")).getPropertyValue("font-size") != "14px";
-}, function() {
-    if (window.testRunner)
-        testRunner.notifyDone();
-});
-</script>
-</body>
-</html>

Modified: trunk/Source/WebCore/ChangeLog (257480 => 257481)


--- trunk/Source/WebCore/ChangeLog	2020-02-26 18:34:10 UTC (rev 257480)
+++ trunk/Source/WebCore/ChangeLog	2020-02-26 18:45:17 UTC (rev 257481)
@@ -1,5 +1,19 @@
 2020-02-26  Jacob Uphoff  <[email protected]>
 
+        Unreviewed, rolling out r257373.
+
+        This commit introduced one test that is a flaky failure on ios
+        bots and broke another test
+
+        Reverted changeset:
+
+        "[iPadOS] REGRESSION(r247667): Autosizing style changes don't
+        invalidate RenderText's preferred logical widths"
+        https://bugs.webkit.org/show_bug.cgi?id=208084
+        https://trac.webkit.org/changeset/257373
+
+2020-02-26  Jacob Uphoff  <[email protected]>
+
         Unreviewed, rolling out r257470.
 
         This broke the build for tvOS and watchOS

Modified: trunk/Source/WebCore/page/Page.cpp (257480 => 257481)


--- trunk/Source/WebCore/page/Page.cpp	2020-02-26 18:34:10 UTC (rev 257480)
+++ trunk/Source/WebCore/page/Page.cpp	2020-02-26 18:45:17 UTC (rev 257481)
@@ -2986,11 +2986,8 @@
         if (auto* renderView = document.renderView()) {
             for (auto& renderer : descendantsOfType<RenderElement>(*renderView)) {
                 if (auto* element = renderer.element()) {
-                    if (auto adjustment = Style::Adjuster::adjustmentForTextAutosizing(renderer.style(), *element)) {
-                        auto newStyle = RenderStyle::clone(renderer.style());
-                        Style::Adjuster::adjustForTextAutosizing(newStyle, *element, adjustment);
-                        renderer.setStyle(WTFMove(newStyle));
-                    }
+                    if (Style::Adjuster::adjustForTextAutosizing(renderer.mutableStyle(), *element))
+                        renderer.setNeedsLayout();
                 }
             }
         }

Modified: trunk/Source/WebCore/style/StyleAdjuster.cpp (257480 => 257481)


--- trunk/Source/WebCore/style/StyleAdjuster.cpp	2020-02-26 18:34:10 UTC (rev 257480)
+++ trunk/Source/WebCore/style/StyleAdjuster.cpp	2020-02-26 18:45:17 UTC (rev 257481)
@@ -568,16 +568,15 @@
     return false;
 }
 
-auto Adjuster::adjustmentForTextAutosizing(const RenderStyle& style, const Element& element) -> AdjustmentForTextAutosizing
+bool Adjuster::adjustForTextAutosizing(RenderStyle& style, const Element& element)
 {
-    AdjustmentForTextAutosizing adjustmentForTextAutosizing;
-
     auto& document = element.document();
     if (!document.settings().textAutosizingEnabled() || !document.settings().textAutosizingUsesIdempotentMode())
-        return adjustmentForTextAutosizing;
+        return false;
 
+    AutosizeStatus::updateStatus(style);
     if (style.textSizeAdjust().isNone())
-        return adjustmentForTextAutosizing;
+        return false;
 
     float initialScale = document.page() ? document.page()->initialScale() : 1;
     auto adjustLineHeightIfNeeded = [&](auto computedFontSize) {
@@ -594,7 +593,7 @@
         if (AutosizeStatus::probablyContainsASmallFixedNumberOfLines(style))
             return;
 
-        adjustmentForTextAutosizing.newLineHeight = minimumLineHeight;
+        style.setLineHeight({ minimumLineHeight, Fixed });
     };
 
     auto fontDescription = style.fontDescription();
@@ -602,16 +601,18 @@
     auto specifiedFontSize = fontDescription.specifiedSize();
     bool isCandidate = style.isIdempotentTextAutosizingCandidate();
     if (!isCandidate && WTF::areEssentiallyEqual(initialComputedFontSize, specifiedFontSize))
-        return adjustmentForTextAutosizing;
+        return false;
 
     auto adjustedFontSize = AutosizeStatus::idempotentTextSize(fontDescription.specifiedSize(), initialScale);
     if (isCandidate && WTF::areEssentiallyEqual(initialComputedFontSize, adjustedFontSize))
-        return adjustmentForTextAutosizing;
+        return false;
 
     if (!hasTextChild(element))
-        return adjustmentForTextAutosizing;
+        return false;
 
-    adjustmentForTextAutosizing.newFontSize = isCandidate ? adjustedFontSize : specifiedFontSize;
+    fontDescription.setComputedSize(isCandidate ? adjustedFontSize : specifiedFontSize);
+    style.setFontDescription(WTFMove(fontDescription));
+    style.fontCascade().update(&document.fontSelector());
 
     // FIXME: We should restore computed line height to its original value in the case where the element is not
     // an idempotent text autosizing candidate; otherwise, if an element that is a text autosizing candidate contains
@@ -619,27 +620,8 @@
     if (isCandidate)
         adjustLineHeightIfNeeded(adjustedFontSize);
 
-    return adjustmentForTextAutosizing;
+    return true;
 }
-
-bool Adjuster::adjustForTextAutosizing(RenderStyle& style, const Element& element, AdjustmentForTextAutosizing adjustment)
-{
-    AutosizeStatus::updateStatus(style);
-    if (auto newFontSize = adjustment.newFontSize) {
-        auto fontDescription = style.fontDescription();
-        fontDescription.setComputedSize(*newFontSize);
-        style.setFontDescription(WTFMove(fontDescription));
-        style.fontCascade().update(&element.document().fontSelector());
-    }
-    if (auto newLineHeight = adjustment.newLineHeight)
-        style.setLineHeight({ *newLineHeight, Fixed });
-    return adjustment.newFontSize || adjustment.newLineHeight;
-}
-
-bool Adjuster::adjustForTextAutosizing(RenderStyle& style, const Element& element)
-{
-    return adjustForTextAutosizing(style, element, adjustmentForTextAutosizing(style, element));
-}
 #endif
 
 }

Modified: trunk/Source/WebCore/style/StyleAdjuster.h (257480 => 257481)


--- trunk/Source/WebCore/style/StyleAdjuster.h	2020-02-26 18:34:10 UTC (rev 257480)
+++ trunk/Source/WebCore/style/StyleAdjuster.h	2020-02-26 18:45:17 UTC (rev 257481)
@@ -49,13 +49,6 @@
     static void adjustAnimatedStyle(RenderStyle&, const RenderStyle* parentBoxStyle, OptionSet<AnimationImpact>);
 
 #if ENABLE(TEXT_AUTOSIZING)
-    struct AdjustmentForTextAutosizing {
-        Optional<float> newFontSize;
-        Optional<float> newLineHeight;
-        explicit operator bool() const { return newFontSize || newLineHeight; }
-    };
-    static AdjustmentForTextAutosizing adjustmentForTextAutosizing(const RenderStyle&, const Element&);
-    static bool adjustForTextAutosizing(RenderStyle&, const Element&, AdjustmentForTextAutosizing);
     static bool adjustForTextAutosizing(RenderStyle&, const Element&);
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to