ASSERTION FAILED: settings().textAutosizingEnabled() && settings().textAutosizingUses...
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Jul 2019 18:04:20 +0000 (18:04 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Jul 2019 18:04:20 +0000 (18:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200079
<rdar://problem/53474325>

Reviewed by Wenson Hsieh.

Source/WebKit:

Do not reset idempotent values when the text autosizing is off.

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetTextAutosizingUsesIdempotentMode):
(WKPreferencesGetTextAutosizingUsesIdempotentMode):
* UIProcess/API/C/WKPreferencesRef.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::resetIdempotentTextAutosizingIfNeeded):

Tools:

Reset textAutosizingUsesIdempotentMode when transitioning to a new test.

* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformResetPreferencesToConsistentValues):

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/C/WKPreferences.cpp
Source/WebKit/UIProcess/API/C/WKPreferencesRef.h
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
Tools/ChangeLog
Tools/WebKitTestRunner/ios/TestControllerIOS.mm

index 12a91a5..6b353c3 100644 (file)
@@ -1,3 +1,20 @@
+2019-07-24  Zalan Bujtas  <zalan@apple.com>
+
+        ASSERTION FAILED: settings().textAutosizingEnabled() && settings().textAutosizingUsesIdempotentMode() in WebCore::Page::recomputeTextAutoSizingInAllFrames()
+        https://bugs.webkit.org/show_bug.cgi?id=200079
+        <rdar://problem/53474325>
+
+        Reviewed by Wenson Hsieh.
+
+        Do not reset idempotent values when the text autosizing is off.
+
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetTextAutosizingUsesIdempotentMode):
+        (WKPreferencesGetTextAutosizingUsesIdempotentMode):
+        * UIProcess/API/C/WKPreferencesRef.h:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::resetIdempotentTextAutosizingIfNeeded):
+
 2019-07-24  Chris Dumez  <cdumez@apple.com>
 
         Unreviewed, rolling out r247766.
index 09422f0..91c0a8c 100644 (file)
@@ -1200,6 +1200,16 @@ bool WKPreferencesGetTextAutosizingEnabled(WKPreferencesRef preferencesRef)
     return toImpl(preferencesRef)->textAutosizingEnabled();
 }
 
+void WKPreferencesSetTextAutosizingUsesIdempotentMode(WKPreferencesRef preferencesRef, bool textAutosizingUsesIdempotentModeEnabled)
+{
+    toImpl(preferencesRef)->setTextAutosizingUsesIdempotentMode(textAutosizingUsesIdempotentModeEnabled);
+}
+
+bool WKPreferencesGetTextAutosizingUsesIdempotentMode(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->textAutosizingUsesIdempotentMode();
+}
+
 void WKPreferencesSetAggressiveTileRetentionEnabled(WKPreferencesRef preferencesRef, bool enabled)
 {
     toImpl(preferencesRef)->setAggressiveTileRetentionEnabled(enabled);
index 12f6a89..df548d4 100644 (file)
@@ -244,6 +244,10 @@ WK_EXPORT bool WKPreferencesGetEncodingDetectorEnabled(WKPreferencesRef preferen
 WK_EXPORT void WKPreferencesSetTextAutosizingEnabled(WKPreferencesRef preferences, bool textAutosizingEnabled);
 WK_EXPORT bool WKPreferencesGetTextAutosizingEnabled(WKPreferencesRef preferences);
 
+// Defaults to false.
+WK_EXPORT void WKPreferencesSetTextAutosizingUsesIdempotentMode(WKPreferencesRef preferences, bool textAutosizingUsesIdempotentModeEnabled);
+WK_EXPORT bool WKPreferencesGetTextAutosizingUsesIdempotentMode(WKPreferencesRef preferences);
+
 // Defaults to true.
 WK_EXPORT void WKPreferencesSetQTKitEnabled(WKPreferencesRef preferencesRef, bool enabled);
 WK_EXPORT bool WKPreferencesGetQTKitEnabled(WKPreferencesRef preferencesRef);
index db02001..2322432 100644 (file)
@@ -3334,7 +3334,7 @@ void WebPage::resetViewportDefaultConfiguration(WebFrame* frame, bool hasMobileD
 #if ENABLE(TEXT_AUTOSIZING)
 void WebPage::resetIdempotentTextAutosizingIfNeeded(double previousInitialScale)
 {
-    if (!m_page->settings().textAutosizingUsesIdempotentMode())
+    if (!m_page->settings().textAutosizingEnabled() || !m_page->settings().textAutosizingUsesIdempotentMode())
         return;
 
     const float minimumScaleChangeBeforeRecomputingTextAutosizing = 0.01;
index aed9bad..0447b9e 100644 (file)
@@ -1,3 +1,16 @@
+2019-07-24  Zalan Bujtas  <zalan@apple.com>
+
+        ASSERTION FAILED: settings().textAutosizingEnabled() && settings().textAutosizingUsesIdempotentMode() in WebCore::Page::recomputeTextAutoSizingInAllFrames()
+        https://bugs.webkit.org/show_bug.cgi?id=200079
+        <rdar://problem/53474325>
+
+        Reviewed by Wenson Hsieh.
+
+        Reset textAutosizingUsesIdempotentMode when transitioning to a new test.
+
+        * WebKitTestRunner/ios/TestControllerIOS.mm:
+        (WTR::TestController::platformResetPreferencesToConsistentValues):
+
 2019-07-23  Fujii Hironori  <Hironori.Fujii@sony.com>
 
         [webkitperl] prepare-ChangeLog_unittest/parser_unittests.pl is failing on Windows Perl
index 7370631..6a61df8 100644 (file)
@@ -133,6 +133,7 @@ void TestController::platformResetPreferencesToConsistentValues()
 {
     WKPreferencesRef preferences = platformPreferences();
     WKPreferencesSetTextAutosizingEnabled(preferences, false);
+    WKPreferencesSetTextAutosizingUsesIdempotentMode(preferences, false);
     WKPreferencesSetContentChangeObserverEnabled(preferences, false);
     [(__bridge WKPreferences *)preferences _setShouldIgnoreMetaViewport:NO];
 }