<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[197986] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/197986">197986</a></dd>
<dt>Author</dt> <dd>n_wang@apple.com</dd>
<dt>Date</dt> <dd>2016-03-10 19:57:52 -0800 (Thu, 10 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>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:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorwk2TestExpectations">trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreConfigurationsWebCoreTestSupportxcconfig">trunk/Source/WebCore/Configurations/WebCoreTestSupport.xcconfig</a></li>
<li><a href="#trunkSourceWebCorepageViewportConfigurationcpp">trunk/Source/WebCore/page/ViewportConfiguration.cpp</a></li>
<li><a href="#trunkSourceWebCorepageViewportConfigurationh">trunk/Source/WebCore/page/ViewportConfiguration.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsh">trunk/Source/WebCore/testing/Internals.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsidl">trunk/Source/WebCore/testing/Internals.idl</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2ConfigurationsWebKitxcconfig">trunk/Source/WebKit2/Configurations/WebKit.xcconfig</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewInternalh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm">trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagemessagesin">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastviewportiosforcealwaysuserscalableexpectedtxt">trunk/LayoutTests/fast/viewport/ios/force-always-user-scalable-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastviewportiosforcealwaysuserscalablehtml">trunk/LayoutTests/fast/viewport/ios/force-always-user-scalable.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (197985 => 197986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-03-11 03:52:15 UTC (rev 197985)
+++ trunk/LayoutTests/ChangeLog        2016-03-11 03:57:52 UTC (rev 197986)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-03-10  Nan Wang  &lt;n_wang@apple.com&gt;
+
+        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:
+
</ins><span class="cx"> 2016-03-10  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebKit should not be redirected to an invalid URL
</span></span></pre></div>
<a id="trunkLayoutTestsfastviewportiosforcealwaysuserscalableexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/viewport/ios/force-always-user-scalable-expected.txt (0 => 197986)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+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 &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Final zoom scale was: 3.5
+Maximum zoom scale was: 5
+Maximum zoom scale was reset to: 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastviewportiosforcealwaysuserscalablehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/viewport/ios/force-always-user-scalable.html (0 => 197986)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, maximum-scale=1&quot;&gt;
+&lt;script id=&quot;ui-script&quot; type=&quot;text/plain&quot;&gt;
+    (function() {
+        uiController.zoomToScale(3.5, function() {
+            uiController.uiScriptComplete(uiController.zoomScale);
+        });
+    })();
+&lt;/script&gt;
+
+&lt;script id=&quot;ui-script2&quot; type=&quot;text/plain&quot;&gt;
+    (function() {
+        uiController.uiScriptComplete(uiController.maximumZoomScale);
+    })();
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;runTest();&quot;&gt;
+&lt;p id=&quot;result&quot;&gt;This test has to run in iOS WebKitTestRunner.&lt;/p&gt;
+
+&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+
+&lt;script&gt;
+    description(&quot;This tests that after we set forceAlwaysUserScalable, maximum-scale will be ignored.&quot;);
+
+    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(&quot;Final zoom scale was: &quot; + 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(&quot;Maximum zoom scale was: &quot; + result);
+                    
+                    window.internals.setViewportForceAlwaysUserScalable(false);
+                    testRunner.runUIScript(uiScript2, function(result) {
+                        debug(&quot;Maximum zoom scale was reset to: &quot; + result);
+                        finishJSTest();
+                    });
+                });
+            });
+        }
+    }
+&lt;/script&gt;
+
+&lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorwk2TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations (197985 => 197986)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1947,3 +1947,6 @@
</span><span class="cx"> webkit.org/b/153050 http/tests/security/cross-frame-access-custom.html [ Pass Failure ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/155201 storage/domstorage/events/basic-body-attribute.html [ Pass Failure ]
</span><ins>+
+# 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 ]
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (197985 => 197986)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2016-03-10  Nan Wang  &lt;n_wang@apple.com&gt;
+
+        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:
+
</ins><span class="cx"> 2016-03-10  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebKit should not be redirected to an invalid URL
</span></span></pre></div>
<a id="trunkSourceWebCoreConfigurationsWebCoreTestSupportxcconfig"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Configurations/WebCoreTestSupport.xcconfig (197985 => 197986)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -49,4 +49,6 @@
</span><span class="cx"> EXPORTED_SYMBOLS_FILE = ;
</span><span class="cx"> GCC_SYMBOLS_PRIVATE_EXTERN = YES;
</span><span class="cx"> OTHER_LDFLAGS = $(ASAN_OTHER_LDFLAGS);
</span><ins>+OTHER_LDFLAGS[sdk=iphoneos*] = $(ASAN_OTHER_LDFLAGS) -lAccessibility;
+OTHER_LDFLAGS[sdk=iphonesimulator*] = $(ASAN_OTHER_LDFLAGS) -lAccessibility;
</ins><span class="cx"> SECT_ORDER_FLAGS = ;
</span></span></pre></div>
<a id="trunkSourceWebCorepageViewportConfigurationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ViewportConfiguration.cpp (197985 => 197986)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -189,6 +189,9 @@
</span><span class="cx"> 
</span><span class="cx">     // If not, we still need to sanity check our value.
</span><span class="cx">     double minimumScale = m_configuration.minimumScale;
</span><ins>+    
+    if (m_forceAlwaysUserScalable)
+        minimumScale = std::min(minimumScale, forceAlwaysUserScalableMinimumScale);
</ins><span class="cx"> 
</span><span class="cx">     const FloatSize&amp; minimumLayoutSize = m_minimumLayoutSize;
</span><span class="cx">     double contentWidth = m_contentSize.width();
</span></span></pre></div>
<a id="trunkSourceWebCorepageViewportConfigurationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ViewportConfiguration.h (197985 => 197986)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -33,6 +33,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+static const double forceAlwaysUserScalableMaximumScale = 5.0;
+static const double forceAlwaysUserScalableMinimumScale = 1.0;
+
</ins><span class="cx"> class TextStream;
</span><span class="cx"> 
</span><span class="cx"> class ViewportConfiguration {
</span><span class="lines">@@ -88,7 +91,7 @@
</span><span class="cx">     WEBCORE_EXPORT double initialScale() const;
</span><span class="cx">     WEBCORE_EXPORT double initialScaleIgnoringContentSize() const;
</span><span class="cx">     WEBCORE_EXPORT double minimumScale() const;
</span><del>-    double maximumScale() const { return m_configuration.maximumScale; }
</del><ins>+    double maximumScale() const { return m_forceAlwaysUserScalable ? forceAlwaysUserScalableMaximumScale : m_configuration.maximumScale; }
</ins><span class="cx">     WEBCORE_EXPORT bool allowsUserScaling() const;
</span><span class="cx">     bool allowsShrinkToFit() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (197985 => 197986)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -207,6 +207,16 @@
</span><span class="cx"> #include &quot;MediaPlaybackTargetContext.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS) &amp;&amp; __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 100000
+#if __has_include(&lt;AccessibilitySupport.h&gt;)
+#include &lt;AccessibilitySupport.h&gt;
+#else
+extern &quot;C&quot; {
+void _AXSSetForceAllowWebScaling(Boolean);
+}
+#endif
+#endif
+
</ins><span class="cx"> using JSC::CallData;
</span><span class="cx"> using JSC::CallType;
</span><span class="cx"> using JSC::CodeBlock;
</span><span class="lines">@@ -405,6 +415,10 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     page-&gt;setShowAllPlugins(false);
</span><ins>+    
+#if PLATFORM(IOS) &amp;&amp; __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 100000
+    _AXSSetForceAllowWebScaling(false);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Internals::Internals(Document* document)
</span><span class="lines">@@ -3520,4 +3534,13 @@
</span><span class="cx">     return WebCore::composedTreeAsText(downcast&lt;ContainerNode&gt;(*node));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void Internals::setViewportForceAlwaysUserScalable(bool scalable)
+{
+#if PLATFORM(IOS) &amp;&amp; __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 100000
+    _AXSSetForceAllowWebScaling(scalable);
+#else
+    UNUSED_PARAM(scalable);
+#endif
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (197985 => 197986)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -475,6 +475,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     String composedTreeAsText(Node*);
</span><ins>+    
+    void setViewportForceAlwaysUserScalable(bool);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     explicit Internals(Document*);
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (197985 => 197986)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -443,4 +443,6 @@
</span><span class="cx">     [RaisesException] void setCanShowModalDialogOverride(boolean allow);
</span><span class="cx"> 
</span><span class="cx">     DOMString composedTreeAsText(Node parent);
</span><ins>+
+    void setViewportForceAlwaysUserScalable(boolean scalable);
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (197985 => 197986)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2016-03-10  Nan Wang  &lt;n_wang@apple.com&gt;
+
+        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):
+
</ins><span class="cx"> 2016-03-10  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Font antialiasing (smoothing) changes when elements are rendered into compositing layers
</span></span></pre></div>
<a id="trunkSourceWebKit2ConfigurationsWebKitxcconfig"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Configurations/WebKit.xcconfig (197985 => 197986)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -45,6 +45,8 @@
</span><span class="cx"> 
</span><span class="cx"> OTHER_LDFLAGS = $(inherited) $(UNEXPORTED_SYMBOL_LDFLAGS) $(ASAN_OTHER_LDFLAGS) $(FRAMEWORK_AND_LIBRARY_LDFLAGS) $(OTHER_LDFLAGS_PLATFORM) -framework WebKitLegacy -sub_umbrella WebKitLegacy;
</span><span class="cx"> OTHER_LDFLAGS_PLATFORM[sdk=macosx*] = -sub_umbrella WebCore;
</span><ins>+OTHER_LDFLAGS_PLATFORM[sdk=iphoneos*] = -l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY) -lAccessibility;
+OTHER_LDFLAGS_PLATFORM[sdk=iphonesimulator*] = -l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY) -lAccessibility;
</ins><span class="cx"> 
</span><span class="cx"> SECTORDER_FLAGS = $(SECTORDER_FLAGS_$(CONFIGURATION));
</span><span class="cx"> SECTORDER_FLAGS_Production[sdk=iphoneos*] = -Wl,-order_file,$(SDKROOT)/AppleInternal/OrderFiles/WebKit.order;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (197985 => 197986)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -112,6 +112,16 @@
</span><span class="cx"> #import &lt;WebCore/InspectorOverlay.h&gt;
</span><span class="cx"> #import &lt;WebCore/QuartzCoreSPI.h&gt;
</span><span class="cx"> 
</span><ins>+#if __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 100000
+#if __has_include(&lt;AccessibilitySupport.h&gt;)
+#include &lt;AccessibilitySupport.h&gt;
+#else
+extern &quot;C&quot; {
+CFStringRef kAXSAllowForceWebScalingEnabledNotification;
+}
+#endif
+#endif
+
</ins><span class="cx"> @interface UIScrollView (UIScrollViewInternal)
</span><span class="cx"> - (void)_adjustForAutomaticKeyboardInfo:(NSDictionary*)info animated:(BOOL)animated lastAdjustment:(CGFloat*)lastAdjustment;
</span><span class="cx"> - (BOOL)_isScrollingToTop;
</span><span class="lines">@@ -314,8 +324,17 @@
</span><span class="cx">     return shouldAllowPictureInPictureMediaPlayback;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 100000
+static void forceAlwaysUserScalableChangedCallback(CFNotificationCenterRef, void* observer, CFStringRef, const void*, CFDictionaryRef)
+{
+    ASSERT(observer);
+    WKWebView* webview = static_cast&lt;WKWebView*&gt;(observer);
+    [webview _updateForceAlwaysUserScalable];
+}
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#endif
+
</ins><span class="cx"> #if ENABLE(DATA_DETECTION)
</span><span class="cx"> static WebCore::DataDetectorTypes fromWKDataDetectorTypes(uint64_t types)
</span><span class="cx"> {
</span><span class="lines">@@ -459,6 +478,10 @@
</span><span class="cx">     [center addObserver:self selector:@selector(_windowDidRotate:) name:UIWindowDidRotateNotification object:nil];
</span><span class="cx">     [center addObserver:self selector:@selector(_contentSizeCategoryDidChange:) name:UIContentSizeCategoryDidChangeNotification object:nil];
</span><span class="cx">     _page-&gt;contentSizeCategoryDidChange([self _contentSizeCategory]);
</span><ins>+    
+#if __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 100000
+    CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), (__bridge const void *)(self), forceAlwaysUserScalableChangedCallback, kAXSAllowForceWebScalingEnabledNotification, 0, CFNotificationSuspensionBehaviorDeliverImmediately);
+#endif
</ins><span class="cx"> 
</span><span class="cx">     [[_configuration _contentProviderRegistry] addPage:*_page];
</span><span class="cx"> #endif
</span><span class="lines">@@ -543,6 +566,9 @@
</span><span class="cx"> 
</span><span class="cx">     [_remoteObjectRegistry _invalidate];
</span><span class="cx">     [[_configuration _contentProviderRegistry] removePage:*_page];
</span><ins>+#if PLATFORM(IOS) &amp;&amp; __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 100000
+    CFNotificationCenterRemoveObserver(CFNotificationCenterGetDarwinNotifyCenter(), (__bridge const void *)(self), nullptr, nullptr);
+#endif
</ins><span class="cx">     [[NSNotificationCenter defaultCenter] removeObserver:self];
</span><span class="cx">     [_scrollView setInternalDelegate:nil];
</span><span class="cx"> #endif
</span><span class="lines">@@ -2048,6 +2074,11 @@
</span><span class="cx">     _frozenUnobscuredContentRect = Nullopt;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_updateForceAlwaysUserScalable
+{
+    _page-&gt;updateForceAlwaysUserScalable();
+}
+
</ins><span class="cx"> #endif // PLATFORM(IOS)
</span><span class="cx"> 
</span><span class="cx"> #pragma mark OS X-specific methods
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h (197985 => 197986)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -111,6 +111,8 @@
</span><span class="cx"> - (void)_navigationGestureDidBegin;
</span><span class="cx"> - (void)_navigationGestureDidEnd;
</span><span class="cx"> 
</span><ins>+- (void)_updateForceAlwaysUserScalable;
+
</ins><span class="cx"> @property (nonatomic, readonly) BOOL _isBackground;
</span><span class="cx"> 
</span><span class="cx"> @property (nonatomic, readonly) WKWebViewContentProviderRegistry *_contentProviderRegistry;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (197985 => 197986)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -520,6 +520,7 @@
</span><span class="cx">     void contentSizeCategoryDidChange(const String&amp; contentSizeCategory);
</span><span class="cx">     void getLookupContextAtPoint(const WebCore::IntPoint&amp;, std::function&lt;void(const String&amp;, CallbackBase::Error)&gt;);
</span><span class="cx">     void handleTwoFingerTapAtPoint(const WebCore::IntPoint&amp;, std::function&lt;void(const String&amp;, CallbackBase::Error)&gt;);
</span><ins>+    void updateForceAlwaysUserScalable();
</ins><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(DATA_DETECTION)
</span><span class="cx">     void setDataDetectionResult(const DataDetectionResult&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (197985 => 197986)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -315,6 +315,11 @@
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::SetViewportConfigurationMinimumLayoutSize(size), m_pageID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPageProxy::updateForceAlwaysUserScalable()
+{
+    m_process-&gt;send(Messages::WebPage::UpdateForceAlwaysUserScalable(), m_pageID);
+}
+
</ins><span class="cx"> void WebPageProxy::setMaximumUnobscuredSize(const WebCore::FloatSize&amp; size)
</span><span class="cx"> {
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::SetMaximumUnobscuredSize(size), m_pageID);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (197985 => 197986)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -3081,7 +3081,8 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     m_ignoreViewportScalingConstraints = store.getBoolValueForKey(WebPreferencesKey::ignoreViewportScalingConstraintsKey());
</span><span class="cx">     m_viewportConfiguration.setCanIgnoreScalingConstraints(m_ignoreViewportScalingConstraints);
</span><del>-    m_viewportConfiguration.setForceAlwaysUserScalable(store.getBoolValueForKey(WebPreferencesKey::forceAlwaysUserScalableKey()));
</del><ins>+    m_forceAlwaysUserScalable = store.getBoolValueForKey(WebPreferencesKey::forceAlwaysUserScalableKey());
+    updateForceAlwaysUserScalable();
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (197985 => 197986)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -574,6 +574,8 @@
</span><span class="cx"> 
</span><span class="cx">     void enableInspectorNodeSearch();
</span><span class="cx">     void disableInspectorNodeSearch();
</span><ins>+    
+    void updateForceAlwaysUserScalable();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void setLayerTreeStateIsFrozen(bool);
</span><span class="lines">@@ -1395,6 +1397,7 @@
</span><span class="cx">     bool m_hasPendingBlurNotification;
</span><span class="cx">     bool m_useTestingViewportConfiguration;
</span><span class="cx">     bool m_isInStableState;
</span><ins>+    bool m_forceAlwaysUserScalable { false };
</ins><span class="cx">     std::chrono::milliseconds m_oldestNonStableUpdateVisibleContentRectsTimestamp;
</span><span class="cx">     std::chrono::milliseconds m_estimatedLatency;
</span><span class="cx">     WebCore::FloatSize m_screenSize;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagemessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (197985 => 197986)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -93,6 +93,7 @@
</span><span class="cx">     GetLookupContextAtPoint(WebCore::IntPoint point, uint64_t callbackID)
</span><span class="cx">     SetAllowsMediaDocumentInlinePlayback(bool allows)
</span><span class="cx">     HandleTwoFingerTapAtPoint(WebCore::IntPoint point, uint64_t callbackID)
</span><ins>+    UpdateForceAlwaysUserScalable()
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     SetControlledByAutomation(bool controlled)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (197985 => 197986)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -101,6 +101,16 @@
</span><span class="cx"> #import &lt;wtf/MathExtras.h&gt;
</span><span class="cx"> #import &lt;wtf/TemporaryChange.h&gt;
</span><span class="cx"> 
</span><ins>+#if __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 100000
+#if __has_include(&lt;AccessibilitySupport.h&gt;) 
+#include &lt;AccessibilitySupport.h&gt;
+#else
+extern &quot;C&quot; {
+Boolean _AXSForceAllowWebScaling();
+}
+#endif
+#endif
+
</ins><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -786,6 +796,15 @@
</span><span class="cx">     send(Messages::WebPageProxy::DisableInspectorNodeSearch());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPage::updateForceAlwaysUserScalable()
+{
+    bool forceAlwaysUserScalable = m_forceAlwaysUserScalable;
+#if __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 100000
+    forceAlwaysUserScalable |= _AXSForceAllowWebScaling();
+#endif
+    m_viewportConfiguration.setForceAlwaysUserScalable(forceAlwaysUserScalable);
+}
+
</ins><span class="cx"> static FloatQuad innerFrameQuad(const Frame&amp; frame, const Node&amp; assistedNode)
</span><span class="cx"> {
</span><span class="cx">     frame.document()-&gt;updateLayoutIgnorePendingStylesheets();
</span></span></pre>
</div>
</div>

</body>
</html>