WebKit Bugzilla
Attachment 371124 Details for
Bug 198460
: Implement an internal switch to turn idempotent text autosizing and viewport rules off
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198460-20190601152523.patch (text/plain), 13.49 KB, created by
Wenson Hsieh
on 2019-06-01 15:25:24 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2019-06-01 15:25:24 PDT
Size:
13.49 KB
patch
obsolete
>Subversion Revision: 246014 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3c90c41e1c61c3f857652ed35d1320ff6e9d0071..0dfe88970e89596b70338566588206654affd91a 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,16 @@ >+2019-06-01 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ Implement an internal switch to turn idempotent text autosizing and viewport rules off >+ https://bugs.webkit.org/show_bug.cgi?id=198460 >+ <rdar://problem/51324526> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a new WebCore setting for viewport shrink-to-fit-content heuristics; additionally, tweak the existing >+ idempotent text autosizing setting to default to false (this is overridden by preferences at the WebKit layer). >+ >+ * page/Settings.yaml: >+ > 2019-06-01 Andy Estes <aestes@apple.com> > > [Apple Pay] Every PaymentCoordinator client should explicitly decide whether they support unrestricted Apple Pay >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 0d9ca5ad48c2be6edd7a200a6aa61438f0eb433b..86b5b8b912cdfc5a2f04fc5e6856f403d43b70eb 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,39 @@ >+2019-06-01 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ Implement an internal switch to turn idempotent text autosizing and viewport rules off >+ https://bugs.webkit.org/show_bug.cgi?id=198460 >+ <rdar://problem/51324526> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Shared/WebPreferences.yaml: >+ >+ Add new preferences to control viewport shrink-to-fit-content and idempotent text autosizing. >+ >+ * Shared/WebPreferencesDefaultValues.cpp: >+ >+ Add the non-iOS implementation of defaultTextAutosizingUsesIdempotentMode, and also wrap these functions in the >+ WebKit namespace. >+ >+ (WebKit::defaultTextAutosizingUsesIdempotentMode): >+ (defaultPassiveTouchListenersAsDefaultOnDocument): Deleted. >+ (defaultCustomPasteboardDataEnabled): Deleted. >+ * Shared/WebPreferencesDefaultValues.h: >+ >+ Move some existing default preference value helper functions into the WebKit namespace. >+ >+ * Shared/ios/WebPreferencesDefaultValuesIOS.mm: Copied from Source/WebKit/Shared/WebPreferencesDefaultValues.cpp. >+ >+ Add an iOS-specific file for WebPreferencesDefaultValues, so that we can check for the user interface idiom. >+ >+ (WebKit::defaultTextAutosizingUsesIdempotentMode): >+ * SourcesCocoa.txt: >+ * WebKit.xcodeproj/project.pbxproj: >+ * WebProcess/WebPage/ios/WebPageIOS.mm: >+ (WebKit::WebPage::immediatelyShrinkToFitContent): >+ >+ Add an early return for the case where shrink-to-fit-content is explicitly disabled via the new preference. >+ > 2019-05-31 Megan Gardner <megan_gardner@apple.com> > > Ensure keyboard editing is up to date >diff --git a/Source/WebCore/page/Settings.yaml b/Source/WebCore/page/Settings.yaml >index a34b82d30e64c2ee36b46d92cf9700e1e45f806e..d4068ed8c405ad52f2f56020a92965b7da6640dc 100644 >--- a/Source/WebCore/page/Settings.yaml >+++ b/Source/WebCore/page/Settings.yaml >@@ -441,7 +441,7 @@ minimumZoomFontSize: > initial: defaultMinimumZoomFontSize() > conditional: TEXT_AUTOSIZING > textAutosizingUsesIdempotentMode: >- initial: defaultTextAutosizingUsesIdempotentMode() >+ initial: false > onChange: setNeedsRecalcStyleInAllFrames > conditional: TEXT_AUTOSIZING > >@@ -837,6 +837,9 @@ shouldDecidePolicyBeforeLoadingQuickLookPreview: > shouldDispatchSyntheticMouseEventsWhenModifyingSelection: > initial: false > >+allowViewportShrinkToFitContent: >+ initial: true >+ > # Deprecated > > iceCandidateFilteringEnabled: >diff --git a/Source/WebCore/page/SettingsBase.cpp b/Source/WebCore/page/SettingsBase.cpp >index 582f23b74bc32e2c802aa45864f2310d2c2170be..a3533e910eb3583057c2129f8a9c3ed2559122cb 100644 >--- a/Source/WebCore/page/SettingsBase.cpp >+++ b/Source/WebCore/page/SettingsBase.cpp >@@ -96,11 +96,6 @@ bool SettingsBase::defaultTextAutosizingEnabled() > { > return false; > } >- >-bool SettingsBase::defaultTextAutosizingUsesIdempotentMode() >-{ >- return false; >-} > #endif > > bool SettingsBase::defaultDownloadableBinaryFontsEnabled() >diff --git a/Source/WebCore/page/SettingsBase.h b/Source/WebCore/page/SettingsBase.h >index 42622f132c7d0c278a9cc218da982fcb200edfca..3533b8f9ad6371fc171df5d58b97b53f485d306a 100644 >--- a/Source/WebCore/page/SettingsBase.h >+++ b/Source/WebCore/page/SettingsBase.h >@@ -113,7 +113,6 @@ public: > static const SettingsBase::ForcedAccessibilityValue defaultForcedPrefersReducedMotionAccessibilityValue = ForcedAccessibilityValue::System; > > WEBCORE_EXPORT static bool defaultTextAutosizingEnabled(); >- static bool defaultTextAutosizingUsesIdempotentMode(); > WEBCORE_EXPORT static float defaultMinimumZoomFontSize(); > WEBCORE_EXPORT static bool defaultDownloadableBinaryFontsEnabled(); > WEBCORE_EXPORT static bool defaultContentChangeObserverEnabled(); >diff --git a/Source/WebCore/page/cocoa/SettingsBaseCocoa.mm b/Source/WebCore/page/cocoa/SettingsBaseCocoa.mm >index a27d30377700c935c26b16e3dc784d3783544474..4961615f61680e65ae661530126bb696a0c2bab8 100644 >--- a/Source/WebCore/page/cocoa/SettingsBaseCocoa.mm >+++ b/Source/WebCore/page/cocoa/SettingsBaseCocoa.mm >@@ -86,11 +86,6 @@ bool SettingsBase::defaultTextAutosizingEnabled() > return true; > } > >-bool SettingsBase::defaultTextAutosizingUsesIdempotentMode() >-{ >- return deviceHasIPadCapability() && ![[PAL::getUIApplicationClass() sharedApplication] _isClassic]; >-} >- > #endif > > const String& SettingsBase::defaultMediaContentTypesRequiringHardwareSupport() >diff --git a/Source/WebKit/Shared/WebPreferences.yaml b/Source/WebKit/Shared/WebPreferences.yaml >index 72798c16dfb5377744395ee402b393fb29c43556..1f1da18a9604110bb22626335fd4da92b86e1048 100644 >--- a/Source/WebKit/Shared/WebPreferences.yaml >+++ b/Source/WebKit/Shared/WebPreferences.yaml >@@ -1640,6 +1640,22 @@ MouseEventsSimulationEnabled: > category: internal > condition: ENABLE(TOUCH_EVENTS) > >+TextAutosizingUsesIdempotentMode: >+ type: bool >+ defaultValue: defaultTextAutosizingUsesIdempotentMode() >+ humanReadableName: "Idempotent Text Autosizing" >+ humanReadableDescription: "Use idempotent text autosizing mode" >+ category: internal >+ condition: ENABLE(TEXT_AUTOSIZING) >+ >+AllowViewportShrinkToFitContent: >+ type: bool >+ defaultValue: true >+ humanReadableName: "Allow Viewport Shrink to Fit Content" >+ humanReadableDescription: "Allow the viewport shrink to fit content heuristic when appropriate" >+ category: internal >+ condition: PLATFORM(IOS_FAMILY) >+ > ReferrerPolicyAttributeEnabled: > type: bool > defaultValue: false >diff --git a/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp b/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp >index fa1825104a6c8bee225a1675c1ef94335cb4c9d6..83f16000e7a327cdafc12d55b167709d2763a9ef 100644 >--- a/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp >+++ b/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp >@@ -35,6 +35,8 @@ > #include "VersionChecks.h" > #endif > >+namespace WebKit { >+ > bool defaultPassiveTouchListenersAsDefaultOnDocument() > { > #if PLATFORM(IOS_FAMILY) >@@ -59,3 +61,13 @@ bool defaultCustomPasteboardDataEnabled() > #endif > } > >+#if ENABLE(TEXT_AUTOSIZING) && !PLATFORM(IOS_FAMILY) >+ >+bool defaultTextAutosizingUsesIdempotentMode() >+{ >+ return false; >+} >+ >+#endif // ENABLE(TEXT_AUTOSIZING) && !PLATFORM(IOS_FAMILY) >+ >+} // namespace WebKit >diff --git a/Source/WebKit/Shared/WebPreferencesDefaultValues.h b/Source/WebKit/Shared/WebPreferencesDefaultValues.h >index 48e2eba43535443d1efe763d1fbd35015b3b5b0f..11857d8ea67810df242796445e59bdb33a4b5896 100644 >--- a/Source/WebKit/Shared/WebPreferencesDefaultValues.h >+++ b/Source/WebKit/Shared/WebPreferencesDefaultValues.h >@@ -236,9 +236,6 @@ > #define DEFAULT_CONIC_GRADIENT_ENABLED false > #endif > >-bool defaultPassiveTouchListenersAsDefaultOnDocument(); >-bool defaultCustomPasteboardDataEnabled(); >- > #if PLATFORM(MAC) > #define DEFAULT_CAPTURE_AUDIO_IN_UIPROCESS true > #else >@@ -278,3 +275,14 @@ bool defaultCustomPasteboardDataEnabled(); > #else > #define DEFAULT_WEB_AUTHENTICATION_ENABLED false > #endif >+ >+namespace WebKit { >+ >+bool defaultPassiveTouchListenersAsDefaultOnDocument(); >+bool defaultCustomPasteboardDataEnabled(); >+ >+#if ENABLE(TEXT_AUTOSIZING) >+bool defaultTextAutosizingUsesIdempotentMode(); >+#endif >+ >+} // namespace WebKit >diff --git a/Source/WebKit/Shared/ios/WebPreferencesDefaultValuesIOS.mm b/Source/WebKit/Shared/ios/WebPreferencesDefaultValuesIOS.mm >new file mode 100644 >index 0000000000000000000000000000000000000000..26ea590c46e2183afd970faf322e9b97ee07fe4c >--- /dev/null >+++ b/Source/WebKit/Shared/ios/WebPreferencesDefaultValuesIOS.mm >@@ -0,0 +1,46 @@ >+/* >+ * Copyright (C) 2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#import "config.h" >+#import "WebPreferencesDefaultValues.h" >+ >+#if PLATFORM(IOS_FAMILY) >+ >+#import "UIKitSPI.h" >+ >+namespace WebKit { >+ >+#if ENABLE(TEXT_AUTOSIZING) >+ >+bool defaultTextAutosizingUsesIdempotentMode() >+{ >+ return currentUserInterfaceIdiomIsPad(); >+} >+ >+#endif >+ >+} // namespace WebKit >+ >+#endif // PLATFORM(IOS_FAMILY) >diff --git a/Source/WebKit/SourcesCocoa.txt b/Source/WebKit/SourcesCocoa.txt >index ae6fe6ddc2f997778c49593a4cb1ec61f11a426e..326893348c84072f15427100d9a305f9f4348702 100644 >--- a/Source/WebKit/SourcesCocoa.txt >+++ b/Source/WebKit/SourcesCocoa.txt >@@ -176,6 +176,7 @@ Shared/ios/WebAutocorrectionData.mm > Shared/ios/WebIconUtilities.mm > Shared/ios/WebIOSEventFactory.mm > Shared/ios/WebPlatformTouchPointIOS.cpp >+Shared/ios/WebPreferencesDefaultValuesIOS.mm > Shared/ios/WebTouchEventIOS.cpp > > Shared/mac/AttributedString.mm >diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >index 4850ca7f6422ea2c1dcbab2c3e941d03fac2a54b..56e0df09cdfbfd85278fa06ce07f8fe8d3c2b6e0 100644 >--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj >+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >@@ -4645,6 +4645,7 @@ > F48D2A8421583A0200C6752B /* AppKitSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppKitSPI.h; sourceTree = "<group>"; }; > F496A42F1F58A272004C1757 /* DragDropInteractionState.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DragDropInteractionState.h; path = ios/DragDropInteractionState.h; sourceTree = "<group>"; }; > F496A4301F58A272004C1757 /* DragDropInteractionState.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = DragDropInteractionState.mm; path = ios/DragDropInteractionState.mm; sourceTree = "<group>"; }; >+ F4AC655E22A3140E00A05607 /* WebPreferencesDefaultValuesIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebPreferencesDefaultValuesIOS.mm; path = ios/WebPreferencesDefaultValuesIOS.mm; sourceTree = "<group>"; }; > F4B378D021DDBBAB0095A378 /* WebUndoStepID.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebUndoStepID.h; sourceTree = "<group>"; }; > F4CB09E4225D5A0300891487 /* WebsiteMediaSourcePolicy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebsiteMediaSourcePolicy.h; sourceTree = "<group>"; }; > F4D5F519206087A00038BBA8 /* WKTextInputListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKTextInputListViewController.h; path = ios/forms/WKTextInputListViewController.h; sourceTree = "<group>"; }; >@@ -5928,6 +5929,7 @@ > 2DA944991884E4F000ED86DB /* WebIOSEventFactory.h */, > 2DA9449A1884E4F000ED86DB /* WebIOSEventFactory.mm */, > 2DA9449B1884E4F000ED86DB /* WebPlatformTouchPointIOS.cpp */, >+ F4AC655E22A3140E00A05607 /* WebPreferencesDefaultValuesIOS.mm */, > 2DA9449C1884E4F000ED86DB /* WebTouchEventIOS.cpp */, > ); > name = ios; >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index c9ce18f1f2519cf8d8008bf6b95ee8c2f2c225e8..4c097417ff8720df1553efa6b96c2d9036f19560 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -3307,6 +3307,9 @@ bool WebPage::immediatelyShrinkToFitContent() > if (m_isClosed) > return false; > >+ if (!m_page->settings().allowViewportShrinkToFitContent()) >+ return false; >+ > if (!shouldIgnoreMetaViewport()) > return false; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198460
: 371124 |
371131