Title: [197986] trunk
Revision
197986
Author
n_w...@apple.com
Date
2016-03-10 19:57:52 -0800 (Thu, 10 Mar 2016)

Log Message

AX: Force allow user zoom
https://bugs.webkit.org/show_bug.cgi?id=155056

Reviewed by Simon Fraser.

Source/WebCore:

Override the maximum/minimum scale factor when forceAlwaysUserScalable is true.

Test: fast/viewport/ios/force-always-user-scalable.html

* Configurations/WebCoreTestSupport.xcconfig:
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::minimumScale):
* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::maximumScale):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::Internals):
(WebCore::Internals::composedTreeAsText):
(WebCore::Internals::setViewportForceAlwaysUserScalable):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit2:

Linked libAccessibility library so that we can observe the accessibility
setting change for the force always user scalable feature.

* Configurations/WebKit.xcconfig:
* UIProcess/API/Cocoa/WKWebView.mm:
(shouldAllowPictureInPictureMediaPlayback):
(forceAlwaysUserScalableChangedCallback):
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView dealloc]):
(-[WKWebView _navigationGestureDidEnd]):
(-[WKWebView _updateForceAlwaysUserScalable]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
(WebKit::WebPageProxy::updateForceAlwaysUserScalable):
(WebKit::WebPageProxy::setMaximumUnobscuredSize):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::disableInspectorNodeSearch):
(WebKit::WebPage::updateForceAlwaysUserScalable):
(WebKit::innerFrameQuad):

LayoutTests:

* fast/viewport/ios/force-always-user-scalable-expected.txt: Added.
* fast/viewport/ios/force-always-user-scalable.html: Added.
* platform/ios-simulator-wk2/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (197985 => 197986)


--- trunk/LayoutTests/ChangeLog	2016-03-11 03:52:15 UTC (rev 197985)
+++ trunk/LayoutTests/ChangeLog	2016-03-11 03:57:52 UTC (rev 197986)
@@ -1,3 +1,14 @@
+2016-03-10  Nan Wang  <n_w...@apple.com>
+
+        AX: Force allow user zoom
+        https://bugs.webkit.org/show_bug.cgi?id=155056
+
+        Reviewed by Simon Fraser.
+
+        * fast/viewport/ios/force-always-user-scalable-expected.txt: Added.
+        * fast/viewport/ios/force-always-user-scalable.html: Added.
+        * platform/ios-simulator-wk2/TestExpectations:
+
 2016-03-10  Jiewen Tan  <jiewen_...@apple.com>
 
         WebKit should not be redirected to an invalid URL

Added: trunk/LayoutTests/fast/viewport/ios/force-always-user-scalable-expected.txt (0 => 197986)


--- trunk/LayoutTests/fast/viewport/ios/force-always-user-scalable-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/viewport/ios/force-always-user-scalable-expected.txt	2016-03-11 03:57:52 UTC (rev 197986)
@@ -0,0 +1,14 @@
+This test has to run in iOS WebKitTestRunner.
+
+This tests that after we set forceAlwaysUserScalable, maximum-scale will be ignored.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Final zoom scale was: 3.5
+Maximum zoom scale was: 5
+Maximum zoom scale was reset to: 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/viewport/ios/force-always-user-scalable.html (0 => 197986)


--- trunk/LayoutTests/fast/viewport/ios/force-always-user-scalable.html	                        (rev 0)
+++ trunk/LayoutTests/fast/viewport/ios/force-always-user-scalable.html	2016-03-11 03:57:52 UTC (rev 197986)
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<meta name="viewport" content="width=device-width, maximum-scale=1">
+<script id="ui-script" type="text/plain">
+    (function() {
+        uiController.zoomToScale(3.5, function() {
+            uiController.uiScriptComplete(uiController.zoomScale);
+        });
+    })();
+</script>
+
+<script id="ui-script2" type="text/plain">
+    (function() {
+        uiController.uiScriptComplete(uiController.maximumZoomScale);
+    })();
+</script>
+</head>
+
+<body _onload_="runTest();">
+<p id="result">This test has to run in iOS WebKitTestRunner.</p>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+    description("This tests that after we set forceAlwaysUserScalable, maximum-scale will be ignored.");
+
+    window.internals.setViewportForceAlwaysUserScalable(true);
+    if (window.testRunner) {
+        window.jsTestIsAsync = true;
+    }
+
+    function runTest()
+    {
+        if (testRunner.runUIScript) {
+            var uiScript = document.getElementById('ui-script').text;
+            testRunner.runUIScript(uiScript, function(result) {
+                debug("Final zoom scale was: " + result);
+                
+                // Reset user scalable, the maximumScale should be reset to the author specified value.
+                var uiScript2 = document.getElementById('ui-script2').text;
+                testRunner.runUIScript(uiScript2, function(result) {
+                    debug("Maximum zoom scale was: " + result);
+                    
+                    window.internals.setViewportForceAlwaysUserScalable(false);
+                    testRunner.runUIScript(uiScript2, function(result) {
+                        debug("Maximum zoom scale was reset to: " + result);
+                        finishJSTest();
+                    });
+                });
+            });
+        }
+    }
+</script>
+
+<script src=""
+</body>
+</html>
\ No newline at end of file

Modified: trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations (197985 => 197986)


--- trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations	2016-03-11 03:52:15 UTC (rev 197985)
+++ trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations	2016-03-11 03:57:52 UTC (rev 197986)
@@ -1947,3 +1947,6 @@
 webkit.org/b/153050 http/tests/security/cross-frame-access-custom.html [ Pass Failure ]
 
 webkit.org/b/155201 storage/domstorage/events/basic-body-attribute.html [ Pass Failure ]
+
+# Forcing always allow user scalable is not supported on certain OS version.
+webkit.org/b/155056 fast/viewport/ios/force-always-user-scalable.html [ Skip ]

Modified: trunk/Source/WebCore/ChangeLog (197985 => 197986)


--- trunk/Source/WebCore/ChangeLog	2016-03-11 03:52:15 UTC (rev 197985)
+++ trunk/Source/WebCore/ChangeLog	2016-03-11 03:57:52 UTC (rev 197986)
@@ -1,3 +1,27 @@
+2016-03-10  Nan Wang  <n_w...@apple.com>
+
+        AX: Force allow user zoom
+        https://bugs.webkit.org/show_bug.cgi?id=155056
+
+        Reviewed by Simon Fraser.
+
+        Override the maximum/minimum scale factor when forceAlwaysUserScalable is true.
+
+        Test: fast/viewport/ios/force-always-user-scalable.html
+
+        * Configurations/WebCoreTestSupport.xcconfig:
+        * page/ViewportConfiguration.cpp:
+        (WebCore::ViewportConfiguration::minimumScale):
+        * page/ViewportConfiguration.h:
+        (WebCore::ViewportConfiguration::maximumScale):
+        * testing/Internals.cpp:
+        (WebCore::Internals::resetToConsistentState):
+        (WebCore::Internals::Internals):
+        (WebCore::Internals::composedTreeAsText):
+        (WebCore::Internals::setViewportForceAlwaysUserScalable):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
 2016-03-10  Jiewen Tan  <jiewen_...@apple.com>
 
         WebKit should not be redirected to an invalid URL

Modified: trunk/Source/WebCore/Configurations/WebCoreTestSupport.xcconfig (197985 => 197986)


--- trunk/Source/WebCore/Configurations/WebCoreTestSupport.xcconfig	2016-03-11 03:52:15 UTC (rev 197985)
+++ trunk/Source/WebCore/Configurations/WebCoreTestSupport.xcconfig	2016-03-11 03:57:52 UTC (rev 197986)
@@ -49,4 +49,6 @@
 EXPORTED_SYMBOLS_FILE = ;
 GCC_SYMBOLS_PRIVATE_EXTERN = YES;
 OTHER_LDFLAGS = $(ASAN_OTHER_LDFLAGS);
+OTHER_LDFLAGS[sdk=iphoneos*] = $(ASAN_OTHER_LDFLAGS) -lAccessibility;
+OTHER_LDFLAGS[sdk=iphonesimulator*] = $(ASAN_OTHER_LDFLAGS) -lAccessibility;
 SECT_ORDER_FLAGS = ;

Modified: trunk/Source/WebCore/page/ViewportConfiguration.cpp (197985 => 197986)


--- trunk/Source/WebCore/page/ViewportConfiguration.cpp	2016-03-11 03:52:15 UTC (rev 197985)
+++ trunk/Source/WebCore/page/ViewportConfiguration.cpp	2016-03-11 03:57:52 UTC (rev 197986)
@@ -189,6 +189,9 @@
 
     // If not, we still need to sanity check our value.
     double minimumScale = m_configuration.minimumScale;
+    
+    if (m_forceAlwaysUserScalable)
+        minimumScale = std::min(minimumScale, forceAlwaysUserScalableMinimumScale);
 
     const FloatSize& minimumLayoutSize = m_minimumLayoutSize;
     double contentWidth = m_contentSize.width();

Modified: trunk/Source/WebCore/page/ViewportConfiguration.h (197985 => 197986)


--- trunk/Source/WebCore/page/ViewportConfiguration.h	2016-03-11 03:52:15 UTC (rev 197985)
+++ trunk/Source/WebCore/page/ViewportConfiguration.h	2016-03-11 03:57:52 UTC (rev 197986)
@@ -33,6 +33,9 @@
 
 namespace WebCore {
 
+static const double forceAlwaysUserScalableMaximumScale = 5.0;
+static const double forceAlwaysUserScalableMinimumScale = 1.0;
+
 class TextStream;
 
 class ViewportConfiguration {
@@ -88,7 +91,7 @@
     WEBCORE_EXPORT double initialScale() const;
     WEBCORE_EXPORT double initialScaleIgnoringContentSize() const;
     WEBCORE_EXPORT double minimumScale() const;
-    double maximumScale() const { return m_configuration.maximumScale; }
+    double maximumScale() const { return m_forceAlwaysUserScalable ? forceAlwaysUserScalableMaximumScale : m_configuration.maximumScale; }
     WEBCORE_EXPORT bool allowsUserScaling() const;
     bool allowsShrinkToFit() const;
 

Modified: trunk/Source/WebCore/testing/Internals.cpp (197985 => 197986)


--- trunk/Source/WebCore/testing/Internals.cpp	2016-03-11 03:52:15 UTC (rev 197985)
+++ trunk/Source/WebCore/testing/Internals.cpp	2016-03-11 03:57:52 UTC (rev 197986)
@@ -207,6 +207,16 @@
 #include "MediaPlaybackTargetContext.h"
 #endif
 
+#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
+#if __has_include(<AccessibilitySupport.h>)
+#include <AccessibilitySupport.h>
+#else
+extern "C" {
+void _AXSSetForceAllowWebScaling(Boolean);
+}
+#endif
+#endif
+
 using JSC::CallData;
 using JSC::CallType;
 using JSC::CodeBlock;
@@ -405,6 +415,10 @@
 #endif
 
     page->setShowAllPlugins(false);
+    
+#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
+    _AXSSetForceAllowWebScaling(false);
+#endif
 }
 
 Internals::Internals(Document* document)
@@ -3520,4 +3534,13 @@
     return WebCore::composedTreeAsText(downcast<ContainerNode>(*node));
 }
 
+void Internals::setViewportForceAlwaysUserScalable(bool scalable)
+{
+#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
+    _AXSSetForceAllowWebScaling(scalable);
+#else
+    UNUSED_PARAM(scalable);
+#endif
 }
+
+}

Modified: trunk/Source/WebCore/testing/Internals.h (197985 => 197986)


--- trunk/Source/WebCore/testing/Internals.h	2016-03-11 03:52:15 UTC (rev 197985)
+++ trunk/Source/WebCore/testing/Internals.h	2016-03-11 03:57:52 UTC (rev 197986)
@@ -475,6 +475,8 @@
 #endif
 
     String composedTreeAsText(Node*);
+    
+    void setViewportForceAlwaysUserScalable(bool);
 
 private:
     explicit Internals(Document*);

Modified: trunk/Source/WebCore/testing/Internals.idl (197985 => 197986)


--- trunk/Source/WebCore/testing/Internals.idl	2016-03-11 03:52:15 UTC (rev 197985)
+++ trunk/Source/WebCore/testing/Internals.idl	2016-03-11 03:57:52 UTC (rev 197986)
@@ -443,4 +443,6 @@
     [RaisesException] void setCanShowModalDialogOverride(boolean allow);
 
     DOMString composedTreeAsText(Node parent);
+
+    void setViewportForceAlwaysUserScalable(boolean scalable);
 };

Modified: trunk/Source/WebKit2/ChangeLog (197985 => 197986)


--- trunk/Source/WebKit2/ChangeLog	2016-03-11 03:52:15 UTC (rev 197985)
+++ trunk/Source/WebKit2/ChangeLog	2016-03-11 03:57:52 UTC (rev 197986)
@@ -1,3 +1,36 @@
+2016-03-10  Nan Wang  <n_w...@apple.com>
+
+        AX: Force allow user zoom
+        https://bugs.webkit.org/show_bug.cgi?id=155056
+
+        Reviewed by Simon Fraser.
+
+        Linked libAccessibility library so that we can observe the accessibility
+        setting change for the force always user scalable feature.
+
+        * Configurations/WebKit.xcconfig:
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (shouldAllowPictureInPictureMediaPlayback):
+        (forceAlwaysUserScalableChangedCallback):
+        (-[WKWebView _initializeWithConfiguration:]):
+        (-[WKWebView dealloc]):
+        (-[WKWebView _navigationGestureDidEnd]):
+        (-[WKWebView _updateForceAlwaysUserScalable]):
+        * UIProcess/API/Cocoa/WKWebViewInternal.h:
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
+        (WebKit::WebPageProxy::updateForceAlwaysUserScalable):
+        (WebKit::WebPageProxy::setMaximumUnobscuredSize):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::disableInspectorNodeSearch):
+        (WebKit::WebPage::updateForceAlwaysUserScalable):
+        (WebKit::innerFrameQuad):
+
 2016-03-10  Simon Fraser  <simon.fra...@apple.com>
 
         Font antialiasing (smoothing) changes when elements are rendered into compositing layers

Modified: trunk/Source/WebKit2/Configurations/WebKit.xcconfig (197985 => 197986)


--- trunk/Source/WebKit2/Configurations/WebKit.xcconfig	2016-03-11 03:52:15 UTC (rev 197985)
+++ trunk/Source/WebKit2/Configurations/WebKit.xcconfig	2016-03-11 03:57:52 UTC (rev 197986)
@@ -45,6 +45,8 @@
 
 OTHER_LDFLAGS = $(inherited) $(UNEXPORTED_SYMBOL_LDFLAGS) $(ASAN_OTHER_LDFLAGS) $(FRAMEWORK_AND_LIBRARY_LDFLAGS) $(OTHER_LDFLAGS_PLATFORM) -framework WebKitLegacy -sub_umbrella WebKitLegacy;
 OTHER_LDFLAGS_PLATFORM[sdk=macosx*] = -sub_umbrella WebCore;
+OTHER_LDFLAGS_PLATFORM[sdk=iphoneos*] = -l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY) -lAccessibility;
+OTHER_LDFLAGS_PLATFORM[sdk=iphonesimulator*] = -l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY) -lAccessibility;
 
 SECTORDER_FLAGS = $(SECTORDER_FLAGS_$(CONFIGURATION));
 SECTORDER_FLAGS_Production[sdk=iphoneos*] = -Wl,-order_file,$(SDKROOT)/AppleInternal/OrderFiles/WebKit.order;

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (197985 => 197986)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2016-03-11 03:52:15 UTC (rev 197985)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2016-03-11 03:57:52 UTC (rev 197986)
@@ -112,6 +112,16 @@
 #import <WebCore/InspectorOverlay.h>
 #import <WebCore/QuartzCoreSPI.h>
 
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
+#if __has_include(<AccessibilitySupport.h>)
+#include <AccessibilitySupport.h>
+#else
+extern "C" {
+CFStringRef kAXSAllowForceWebScalingEnabledNotification;
+}
+#endif
+#endif
+
 @interface UIScrollView (UIScrollViewInternal)
 - (void)_adjustForAutomaticKeyboardInfo:(NSDictionary*)info animated:(BOOL)animated lastAdjustment:(CGFloat*)lastAdjustment;
 - (BOOL)_isScrollingToTop;
@@ -314,8 +324,17 @@
     return shouldAllowPictureInPictureMediaPlayback;
 }
 
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
+static void forceAlwaysUserScalableChangedCallback(CFNotificationCenterRef, void* observer, CFStringRef, const void*, CFDictionaryRef)
+{
+    ASSERT(observer);
+    WKWebView* webview = static_cast<WKWebView*>(observer);
+    [webview _updateForceAlwaysUserScalable];
+}
 #endif
 
+#endif
+
 #if ENABLE(DATA_DETECTION)
 static WebCore::DataDetectorTypes fromWKDataDetectorTypes(uint64_t types)
 {
@@ -459,6 +478,10 @@
     [center addObserver:self selector:@selector(_windowDidRotate:) name:UIWindowDidRotateNotification object:nil];
     [center addObserver:self selector:@selector(_contentSizeCategoryDidChange:) name:UIContentSizeCategoryDidChangeNotification object:nil];
     _page->contentSizeCategoryDidChange([self _contentSizeCategory]);
+    
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
+    CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), (__bridge const void *)(self), forceAlwaysUserScalableChangedCallback, kAXSAllowForceWebScalingEnabledNotification, 0, CFNotificationSuspensionBehaviorDeliverImmediately);
+#endif
 
     [[_configuration _contentProviderRegistry] addPage:*_page];
 #endif
@@ -543,6 +566,9 @@
 
     [_remoteObjectRegistry _invalidate];
     [[_configuration _contentProviderRegistry] removePage:*_page];
+#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
+    CFNotificationCenterRemoveObserver(CFNotificationCenterGetDarwinNotifyCenter(), (__bridge const void *)(self), nullptr, nullptr);
+#endif
     [[NSNotificationCenter defaultCenter] removeObserver:self];
     [_scrollView setInternalDelegate:nil];
 #endif
@@ -2048,6 +2074,11 @@
     _frozenUnobscuredContentRect = Nullopt;
 }
 
+- (void)_updateForceAlwaysUserScalable
+{
+    _page->updateForceAlwaysUserScalable();
+}
+
 #endif // PLATFORM(IOS)
 
 #pragma mark OS X-specific methods

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h (197985 => 197986)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h	2016-03-11 03:52:15 UTC (rev 197985)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h	2016-03-11 03:57:52 UTC (rev 197986)
@@ -111,6 +111,8 @@
 - (void)_navigationGestureDidBegin;
 - (void)_navigationGestureDidEnd;
 
+- (void)_updateForceAlwaysUserScalable;
+
 @property (nonatomic, readonly) BOOL _isBackground;
 
 @property (nonatomic, readonly) WKWebViewContentProviderRegistry *_contentProviderRegistry;

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (197985 => 197986)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2016-03-11 03:52:15 UTC (rev 197985)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2016-03-11 03:57:52 UTC (rev 197986)
@@ -520,6 +520,7 @@
     void contentSizeCategoryDidChange(const String& contentSizeCategory);
     void getLookupContextAtPoint(const WebCore::IntPoint&, std::function<void(const String&, CallbackBase::Error)>);
     void handleTwoFingerTapAtPoint(const WebCore::IntPoint&, std::function<void(const String&, CallbackBase::Error)>);
+    void updateForceAlwaysUserScalable();
 #endif
 #if ENABLE(DATA_DETECTION)
     void setDataDetectionResult(const DataDetectionResult&);

Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (197985 => 197986)


--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm	2016-03-11 03:52:15 UTC (rev 197985)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm	2016-03-11 03:57:52 UTC (rev 197986)
@@ -315,6 +315,11 @@
     m_process->send(Messages::WebPage::SetViewportConfigurationMinimumLayoutSize(size), m_pageID);
 }
 
+void WebPageProxy::updateForceAlwaysUserScalable()
+{
+    m_process->send(Messages::WebPage::UpdateForceAlwaysUserScalable(), m_pageID);
+}
+
 void WebPageProxy::setMaximumUnobscuredSize(const WebCore::FloatSize& size)
 {
     m_process->send(Messages::WebPage::SetMaximumUnobscuredSize(size), m_pageID);

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (197985 => 197986)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-03-11 03:52:15 UTC (rev 197985)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-03-11 03:57:52 UTC (rev 197986)
@@ -3081,7 +3081,8 @@
 #if PLATFORM(IOS)
     m_ignoreViewportScalingConstraints = store.getBoolValueForKey(WebPreferencesKey::ignoreViewportScalingConstraintsKey());
     m_viewportConfiguration.setCanIgnoreScalingConstraints(m_ignoreViewportScalingConstraints);
-    m_viewportConfiguration.setForceAlwaysUserScalable(store.getBoolValueForKey(WebPreferencesKey::forceAlwaysUserScalableKey()));
+    m_forceAlwaysUserScalable = store.getBoolValueForKey(WebPreferencesKey::forceAlwaysUserScalableKey());
+    updateForceAlwaysUserScalable();
 #endif
 }
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (197985 => 197986)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2016-03-11 03:52:15 UTC (rev 197985)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2016-03-11 03:57:52 UTC (rev 197986)
@@ -574,6 +574,8 @@
 
     void enableInspectorNodeSearch();
     void disableInspectorNodeSearch();
+    
+    void updateForceAlwaysUserScalable();
 #endif
 
     void setLayerTreeStateIsFrozen(bool);
@@ -1395,6 +1397,7 @@
     bool m_hasPendingBlurNotification;
     bool m_useTestingViewportConfiguration;
     bool m_isInStableState;
+    bool m_forceAlwaysUserScalable { false };
     std::chrono::milliseconds m_oldestNonStableUpdateVisibleContentRectsTimestamp;
     std::chrono::milliseconds m_estimatedLatency;
     WebCore::FloatSize m_screenSize;

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (197985 => 197986)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in	2016-03-11 03:52:15 UTC (rev 197985)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in	2016-03-11 03:57:52 UTC (rev 197986)
@@ -93,6 +93,7 @@
     GetLookupContextAtPoint(WebCore::IntPoint point, uint64_t callbackID)
     SetAllowsMediaDocumentInlinePlayback(bool allows)
     HandleTwoFingerTapAtPoint(WebCore::IntPoint point, uint64_t callbackID)
+    UpdateForceAlwaysUserScalable()
 #endif
 
     SetControlledByAutomation(bool controlled)

Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (197985 => 197986)


--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2016-03-11 03:52:15 UTC (rev 197985)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2016-03-11 03:57:52 UTC (rev 197986)
@@ -101,6 +101,16 @@
 #import <wtf/MathExtras.h>
 #import <wtf/TemporaryChange.h>
 
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
+#if __has_include(<AccessibilitySupport.h>) 
+#include <AccessibilitySupport.h>
+#else
+extern "C" {
+Boolean _AXSForceAllowWebScaling();
+}
+#endif
+#endif
+
 using namespace WebCore;
 
 namespace WebKit {
@@ -786,6 +796,15 @@
     send(Messages::WebPageProxy::DisableInspectorNodeSearch());
 }
 
+void WebPage::updateForceAlwaysUserScalable()
+{
+    bool forceAlwaysUserScalable = m_forceAlwaysUserScalable;
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
+    forceAlwaysUserScalable |= _AXSForceAllowWebScaling();
+#endif
+    m_viewportConfiguration.setForceAlwaysUserScalable(forceAlwaysUserScalable);
+}
+
 static FloatQuad innerFrameQuad(const Frame& frame, const Node& assistedNode)
 {
     frame.document()->updateLayoutIgnorePendingStylesheets();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to