<!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>[243798] trunk/Source</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/243798">243798</a></dd>
<dt>Author</dt> <dd>wenson_hsieh@apple.com</dd>
<dt>Date</dt> <dd>2019-04-03 08:22:10 -0700 (Wed, 03 Apr 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Introduce and add plumbing for a website policy for meta viewport tag handling
https://bugs.webkit.org/show_bug.cgi?id=196285

Reviewed by Tim Horton.

Source/WebCore:

Add MetaViewportPolicy to DocumentLoader. See WebKit ChangeLog for more detail.

* loader/DocumentLoader.h:
(WebCore::DocumentLoader::metaViewportPolicy const):
(WebCore::DocumentLoader::setMetaViewportPolicy):

Source/WebKit:

Add WebsiteMetaViewportPolicy, a bit that can be used to determine whether to respect or ignore the meta
viewport tag and use native web page parameters instead of the default parameters.

* Shared/WebsiteMetaViewportPolicy.h: Copied from Source/WebKit/Shared/WebsitePoliciesData.h.
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
(WebKit::WebsitePoliciesData::applyToDocumentLoader):

Convert WebKit::WebsiteMetaViewportPolicy into WebCore::MetaViewportPolicy.

* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:

Add additional plumbing for the policy flag.

* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::resetViewportDefaultConfiguration):

Use native web page parameters if either "shouldIgnoreMetaViewport" is enabled, or the new policy is set.
Eventually, the policy should completely replace the former preference once no internal clients depend on it.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentLoaderh">trunk/Source/WebCore/loader/DocumentLoader.h</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitSharedWebsitePoliciesDatacpp">trunk/Source/WebKit/Shared/WebsitePoliciesData.cpp</a></li>
<li><a href="#trunkSourceWebKitSharedWebsitePoliciesDatah">trunk/Source/WebKit/Shared/WebsitePoliciesData.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIAPIWebsitePoliciescpp">trunk/Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIAPIWebsitePoliciesh">trunk/Source/WebKit/UIProcess/API/APIWebsitePolicies.h</a></li>
<li><a href="#trunkSourceWebKitWebKitxcodeprojprojectpbxproj">trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitSharedWebsiteMetaViewportPolicyh">trunk/Source/WebKit/Shared/WebsiteMetaViewportPolicy.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (243797 => 243798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-04-03 15:02:07 UTC (rev 243797)
+++ trunk/Source/WebCore/ChangeLog      2019-04-03 15:22:10 UTC (rev 243798)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Introduce and add plumbing for a website policy for meta viewport tag handling
+        https://bugs.webkit.org/show_bug.cgi?id=196285
+
+        Reviewed by Tim Horton.
+
+        Add MetaViewportPolicy to DocumentLoader. See WebKit ChangeLog for more detail.
+
+        * loader/DocumentLoader.h:
+        (WebCore::DocumentLoader::metaViewportPolicy const):
+        (WebCore::DocumentLoader::setMetaViewportPolicy):
+
</ins><span class="cx"> 2019-04-03  Joseph Pecoraro  <pecoraro@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Remote Inspector indicate callback should always happen on the main thread
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.h (243797 => 243798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.h     2019-04-03 15:02:07 UTC (rev 243797)
+++ trunk/Source/WebCore/loader/DocumentLoader.h        2019-04-03 15:22:10 UTC (rev 243798)
</span><span class="lines">@@ -112,6 +112,12 @@
</span><span class="cx">     Block,
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+enum class MetaViewportPolicy {
+    Default,
+    Respect,
+    Ignore,
+};
+
</ins><span class="cx"> class DocumentLoader
</span><span class="cx">     : public RefCounted<DocumentLoader>
</span><span class="cx">     , public FrameDestructionObserver
</span><span class="lines">@@ -283,6 +289,9 @@
</span><span class="cx">     PopUpPolicy popUpPolicy() const { return m_popUpPolicy; }
</span><span class="cx">     void setPopUpPolicy(PopUpPolicy popUpPolicy) { m_popUpPolicy = popUpPolicy; }
</span><span class="cx"> 
</span><ins>+    MetaViewportPolicy metaViewportPolicy() const { return m_metaViewportPolicy; }
+    void setMetaViewportPolicy(MetaViewportPolicy policy) { m_metaViewportPolicy = policy; }
+
</ins><span class="cx">     void addSubresourceLoader(ResourceLoader*);
</span><span class="cx">     void removeSubresourceLoader(LoadCompletionType, ResourceLoader*);
</span><span class="cx">     void addPlugInStreamLoader(ResourceLoader&);
</span><span class="lines">@@ -556,6 +565,7 @@
</span><span class="cx">     AutoplayPolicy m_autoplayPolicy { AutoplayPolicy::Default };
</span><span class="cx">     OptionSet<AutoplayQuirk> m_allowedAutoplayQuirks;
</span><span class="cx">     PopUpPolicy m_popUpPolicy { PopUpPolicy::Default };
</span><ins>+    MetaViewportPolicy m_metaViewportPolicy { MetaViewportPolicy::Default };
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx">     Optional<ServiceWorkerRegistrationData> m_serviceWorkerRegistrationData;
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (243797 => 243798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2019-04-03 15:02:07 UTC (rev 243797)
+++ trunk/Source/WebKit/ChangeLog       2019-04-03 15:22:10 UTC (rev 243798)
</span><span class="lines">@@ -1,5 +1,37 @@
</span><span class="cx"> 2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
</span><span class="cx"> 
</span><ins>+        Introduce and add plumbing for a website policy for meta viewport tag handling
+        https://bugs.webkit.org/show_bug.cgi?id=196285
+
+        Reviewed by Tim Horton.
+
+        Add WebsiteMetaViewportPolicy, a bit that can be used to determine whether to respect or ignore the meta
+        viewport tag and use native web page parameters instead of the default parameters.
+
+        * Shared/WebsiteMetaViewportPolicy.h: Copied from Source/WebKit/Shared/WebsitePoliciesData.h.
+        * Shared/WebsitePoliciesData.cpp:
+        (WebKit::WebsitePoliciesData::encode const):
+        (WebKit::WebsitePoliciesData::decode):
+        (WebKit::WebsitePoliciesData::applyToDocumentLoader):
+
+        Convert WebKit::WebsiteMetaViewportPolicy into WebCore::MetaViewportPolicy.
+
+        * Shared/WebsitePoliciesData.h:
+        * UIProcess/API/APIWebsitePolicies.cpp:
+        (API::WebsitePolicies::data):
+        * UIProcess/API/APIWebsitePolicies.h:
+
+        Add additional plumbing for the policy flag.
+
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::resetViewportDefaultConfiguration):
+
+        Use native web page parameters if either "shouldIgnoreMetaViewport" is enabled, or the new policy is set.
+        Eventually, the policy should completely replace the former preference once no internal clients depend on it.
+
+2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
+
</ins><span class="cx">         Add plumbing for a compatibility mode preference in WebKit
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=196005
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitSharedWebsiteMetaViewportPolicyhfromrev243797trunkSourceWebKitSharedWebsitePoliciesDatah"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/Shared/WebsiteMetaViewportPolicy.h (from rev 243797, trunk/Source/WebKit/Shared/WebsitePoliciesData.h) (0 => 243798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/WebsiteMetaViewportPolicy.h                           (rev 0)
+++ trunk/Source/WebKit/Shared/WebsiteMetaViewportPolicy.h      2019-04-03 15:22:10 UTC (rev 243798)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+/*
+ * 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.
+ */
+
+#pragma once
+
+#include <wtf/Forward.h>
+
+namespace WebKit {
+
+enum class WebsiteMetaViewportPolicy {
+    Default,
+    Respect,
+    Ignore,
+};
+
+}
+
+namespace WTF {
+
+template<> struct EnumTraits<WebKit::WebsiteMetaViewportPolicy> {
+    using values = EnumValues<
+        WebKit::WebsiteMetaViewportPolicy,
+        WebKit::WebsiteMetaViewportPolicy::Default,
+        WebKit::WebsiteMetaViewportPolicy::Respect,
+        WebKit::WebsiteMetaViewportPolicy::Ignore
+    >;
+};
+
+} // namespace WTF
</ins></span></pre></div>
<a id="trunkSourceWebKitSharedWebsitePoliciesDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/WebsitePoliciesData.cpp (243797 => 243798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/WebsitePoliciesData.cpp       2019-04-03 15:02:07 UTC (rev 243797)
+++ trunk/Source/WebKit/Shared/WebsitePoliciesData.cpp  2019-04-03 15:22:10 UTC (rev 243798)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx">     encoder << customUserAgent;
</span><span class="cx">     encoder << customJavaScriptUserAgentAsSiteSpecificQuirks;
</span><span class="cx">     encoder << customNavigatorPlatform;
</span><ins>+    encoder << metaViewportPolicy;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Optional<WebsitePoliciesData> WebsitePoliciesData::decode(IPC::Decoder& decoder)
</span><span class="lines">@@ -99,6 +100,11 @@
</span><span class="cx">     decoder >> customNavigatorPlatform;
</span><span class="cx">     if (!customNavigatorPlatform)
</span><span class="cx">         return WTF::nullopt;
</span><ins>+
+    Optional<WebsiteMetaViewportPolicy> metaViewportPolicy;
+    decoder >> metaViewportPolicy;
+    if (!metaViewportPolicy)
+        return WTF::nullopt;
</ins><span class="cx">     
</span><span class="cx">     return { {
</span><span class="cx">         WTFMove(*contentBlockersEnabled),
</span><span class="lines">@@ -111,6 +117,7 @@
</span><span class="cx">         WTFMove(*customUserAgent),
</span><span class="cx">         WTFMove(*customJavaScriptUserAgentAsSiteSpecificQuirks),
</span><span class="cx">         WTFMove(*customNavigatorPlatform),
</span><ins>+        WTFMove(*metaViewportPolicy),
</ins><span class="cx">     } };
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -170,6 +177,18 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    switch (websitePolicies.metaViewportPolicy) {
+    case WebsiteMetaViewportPolicy::Default:
+        documentLoader.setMetaViewportPolicy(WebCore::MetaViewportPolicy::Default);
+        break;
+    case WebsiteMetaViewportPolicy::Respect:
+        documentLoader.setMetaViewportPolicy(WebCore::MetaViewportPolicy::Respect);
+        break;
+    case WebsiteMetaViewportPolicy::Ignore:
+        documentLoader.setMetaViewportPolicy(WebCore::MetaViewportPolicy::Ignore);
+        break;
+    }
+
</ins><span class="cx">     if (websitePolicies.websiteDataStoreParameters) {
</span><span class="cx">         if (auto* frame = documentLoader.frame()) {
</span><span class="cx">             if (auto* page = frame->page())
</span></span></pre></div>
<a id="trunkSourceWebKitSharedWebsitePoliciesDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/WebsitePoliciesData.h (243797 => 243798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/WebsitePoliciesData.h 2019-04-03 15:02:07 UTC (rev 243797)
+++ trunk/Source/WebKit/Shared/WebsitePoliciesData.h    2019-04-03 15:22:10 UTC (rev 243798)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #include "WebsiteAutoplayPolicy.h"
</span><span class="cx"> #include "WebsiteAutoplayQuirk.h"
</span><span class="cx"> #include "WebsiteDataStoreParameters.h"
</span><ins>+#include "WebsiteMetaViewportPolicy.h"
</ins><span class="cx"> #include "WebsitePopUpPolicy.h"
</span><span class="cx"> #include <WebCore/HTTPHeaderField.h>
</span><span class="cx"> #include <wtf/OptionSet.h>
</span><span class="lines">@@ -56,6 +57,7 @@
</span><span class="cx">     String customUserAgent;
</span><span class="cx">     String customJavaScriptUserAgentAsSiteSpecificQuirks;
</span><span class="cx">     String customNavigatorPlatform;
</span><ins>+    WebsiteMetaViewportPolicy metaViewportPolicy { WebsiteMetaViewportPolicy::Default };
</ins><span class="cx"> 
</span><span class="cx">     void encode(IPC::Encoder&) const;
</span><span class="cx">     static Optional<WebsitePoliciesData> decode(IPC::Decoder&);
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIAPIWebsitePoliciescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp (243797 => 243798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp 2019-04-03 15:02:07 UTC (rev 243797)
+++ trunk/Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp    2019-04-03 15:22:10 UTC (rev 243798)
</span><span class="lines">@@ -53,11 +53,19 @@
</span><span class="cx"> 
</span><span class="cx"> WebKit::WebsitePoliciesData WebsitePolicies::data()
</span><span class="cx"> {
</span><del>-    Optional<WebKit::WebsiteDataStoreParameters> parameters;
-    if (m_websiteDataStore)
-        parameters = m_websiteDataStore->websiteDataStore().parameters();
-    return { contentBlockersEnabled(), allowedAutoplayQuirks(), autoplayPolicy(), deviceOrientationAndMotionAccessState(),
-        customHeaderFields(), popUpPolicy(), WTFMove(parameters), m_customUserAgent, m_customJavaScriptUserAgentAsSiteSpecificQuirks, m_customNavigatorPlatform };
</del><ins>+    return {
+        contentBlockersEnabled(),
+        allowedAutoplayQuirks(),
+        autoplayPolicy(),
+        deviceOrientationAndMotionAccessState(),
+        customHeaderFields(),
+        popUpPolicy(),
+        m_websiteDataStore ? Optional<WebKit::WebsiteDataStoreParameters> { m_websiteDataStore->websiteDataStore().parameters() } : WTF::nullopt,
+        m_customUserAgent,
+        m_customJavaScriptUserAgentAsSiteSpecificQuirks,
+        m_customNavigatorPlatform,
+        m_metaViewportPolicy,
+    };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIAPIWebsitePoliciesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/APIWebsitePolicies.h (243797 => 243798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/APIWebsitePolicies.h   2019-04-03 15:02:07 UTC (rev 243797)
+++ trunk/Source/WebKit/UIProcess/API/APIWebsitePolicies.h      2019-04-03 15:22:10 UTC (rev 243798)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include "WebCompatibilityMode.h"
</span><span class="cx"> #include "WebsiteAutoplayPolicy.h"
</span><span class="cx"> #include "WebsiteAutoplayQuirk.h"
</span><ins>+#include "WebsiteMetaViewportPolicy.h"
</ins><span class="cx"> #include "WebsitePopUpPolicy.h"
</span><span class="cx"> #include <WebCore/HTTPHeaderField.h>
</span><span class="cx"> #include <wtf/OptionSet.h>
</span><span class="lines">@@ -84,6 +85,9 @@
</span><span class="cx">     WebKit::WebCompatibilityMode preferredCompatibilityMode() const { return m_preferredCompatibilityMode; }
</span><span class="cx">     void setPreferredCompatibilityMode(WebKit::WebCompatibilityMode mode) { m_preferredCompatibilityMode = mode; }
</span><span class="cx"> 
</span><ins>+    WebKit::WebsiteMetaViewportPolicy metaViewportPolicy() const { return m_metaViewportPolicy; }
+    void setMetaViewportPolicy(WebKit::WebsiteMetaViewportPolicy policy) { m_metaViewportPolicy = policy; }
+
</ins><span class="cx"> private:
</span><span class="cx">     WebsitePolicies(bool contentBlockersEnabled, OptionSet<WebKit::WebsiteAutoplayQuirk>, WebKit::WebsiteAutoplayPolicy, Vector<WebCore::HTTPHeaderField>&&, WebKit::WebsitePopUpPolicy, RefPtr<WebsiteDataStore>&&);
</span><span class="cx"> 
</span><span class="lines">@@ -98,6 +102,7 @@
</span><span class="cx">     WTF::String m_customJavaScriptUserAgentAsSiteSpecificQuirks;
</span><span class="cx">     WTF::String m_customNavigatorPlatform;
</span><span class="cx">     WebKit::WebCompatibilityMode m_preferredCompatibilityMode { WebKit::WebCompatibilityMode::Default };
</span><ins>+    WebKit::WebsiteMetaViewportPolicy m_metaViewportPolicy { WebKit::WebsiteMetaViewportPolicy::Default };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace API
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (243797 => 243798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj     2019-04-03 15:02:07 UTC (rev 243797)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2019-04-03 15:22:10 UTC (rev 243798)
</span><span class="lines">@@ -1636,6 +1636,7 @@
</span><span class="cx">          ECA680D81E690E2500731D20 /* WebProcessCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = ECA680D71E690DF800731D20 /* WebProcessCocoa.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          ED82A7F2128C6FAF004477B3 /* WKBundlePageOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A22F0FF1289FCD90085E74F /* WKBundlePageOverlay.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          F409BA181E6E64BC009DA28E /* WKDragDestinationAction.h in Headers */ = {isa = PBXBuildFile; fileRef = F409BA171E6E64B3009DA28E /* WKDragDestinationAction.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+               F430E9422247335F005FE053 /* WebsiteMetaViewportPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = F430E941224732A9005FE053 /* WebsiteMetaViewportPolicy.h */; };
</ins><span class="cx">           F430E94422473DFF005FE053 /* WebCompatibilityMode.h in Headers */ = {isa = PBXBuildFile; fileRef = F430E94322473DB8005FE053 /* WebCompatibilityMode.h */; };
</span><span class="cx">          F438CD1C2241421400DE6DDA /* WKWebpagePreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = F438CD1B224140A600DE6DDA /* WKWebpagePreferences.h */; settings = {ATTRIBUTES = (Public, ); }; };
</span><span class="cx">          F438CD1F22414D4000DE6DDA /* WKWebpagePreferencesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = F438CD1E22414D4000DE6DDA /* WKWebpagePreferencesInternal.h */; };
</span><span class="lines">@@ -4572,6 +4573,7 @@
</span><span class="cx">          F409BA171E6E64B3009DA28E /* WKDragDestinationAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDragDestinationAction.h; sourceTree = "<group>"; };
</span><span class="cx">          F40D1B68220BDC0F00B49A01 /* WebAutocorrectionContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WebAutocorrectionContext.h; path = ios/WebAutocorrectionContext.h; sourceTree = "<group>"; };
</span><span class="cx">          F41056612130699A0092281D /* APIAttachmentCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = APIAttachmentCocoa.mm; sourceTree = "<group>"; };
</span><ins>+               F430E941224732A9005FE053 /* WebsiteMetaViewportPolicy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebsiteMetaViewportPolicy.h; sourceTree = "<group>"; };
</ins><span class="cx">           F430E94322473DB8005FE053 /* WebCompatibilityMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebCompatibilityMode.h; sourceTree = "<group>"; };
</span><span class="cx">          F438CD1B224140A600DE6DDA /* WKWebpagePreferences.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKWebpagePreferences.h; sourceTree = "<group>"; };
</span><span class="cx">          F438CD1D22414AD600DE6DDA /* WKWebpagePreferences.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebpagePreferences.mm; sourceTree = "<group>"; };
</span><span class="lines">@@ -5228,6 +5230,7 @@
</span><span class="cx">                          511F7D401EB1BCEE00E47B83 /* WebsiteDataStoreParameters.h */,
</span><span class="cx">                          5C3AEA8E1FE1F1DF002318D3 /* WebsitePoliciesData.cpp */,
</span><span class="cx">                          5C13024A1FE341A7000D9B31 /* WebsitePoliciesData.h */,
</span><ins>+                               F430E941224732A9005FE053 /* WebsiteMetaViewportPolicy.h */,
</ins><span class="cx">                           0EDE85022004E74900030560 /* WebsitePopUpPolicy.h */,
</span><span class="cx">                          8360349D1ACB34D600626549 /* WebSQLiteDatabaseTracker.cpp */,
</span><span class="cx">                          8360349E1ACB34D600626549 /* WebSQLiteDatabaseTracker.h */,
</span><span class="lines">@@ -9820,6 +9823,7 @@
</span><span class="cx">                          BC4075F8124FF0270068F20A /* WKData.h in Headers */,
</span><span class="cx">                          37A709A71E3EA0FD00CA5969 /* WKDataDetectorTypes.h in Headers */,
</span><span class="cx">                          37A709A91E3EA40C00CA5969 /* WKDataDetectorTypesInternal.h in Headers */,
</span><ins>+                               F430E9422247335F005FE053 /* WebsiteMetaViewportPolicy.h in Headers */,
</ins><span class="cx">                           2E94FC1620351A6D00974BA0 /* WKDatePickerViewController.h in Headers */,
</span><span class="cx">                          377EAD4517E2C51A002D193D /* WKDeclarationSpecifiers.h in Headers */,
</span><span class="cx">                          5C359C0D2154739F009E7948 /* WKDeprecated.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (243797 => 243798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm 2019-04-03 15:02:07 UTC (rev 243797)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm    2019-04-03 15:22:10 UTC (rev 243798)
</span><span class="lines">@@ -63,6 +63,7 @@
</span><span class="cx"> #import <WebCore/DataDetection.h>
</span><span class="cx"> #import <WebCore/DiagnosticLoggingClient.h>
</span><span class="cx"> #import <WebCore/DiagnosticLoggingKeys.h>
</span><ins>+#import <WebCore/DocumentLoader.h>
</ins><span class="cx"> #import <WebCore/DragController.h>
</span><span class="cx"> #import <WebCore/Editing.h>
</span><span class="cx"> #import <WebCore/Editor.h>
</span><span class="lines">@@ -2965,10 +2966,16 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     auto parametersForStandardFrame = [&] {
</span><ins>+        bool shouldIgnoreMetaViewport = false;
+        if (auto* mainDocument = m_page->mainFrame().document()) {
+            auto* loader = mainDocument->loader();
+            shouldIgnoreMetaViewport = loader && loader->metaViewportPolicy() == WebCore::MetaViewportPolicy::Ignore;
+        }
+
</ins><span class="cx">         if (m_page->settings().shouldIgnoreMetaViewport())
</span><del>-            return m_viewportConfiguration.nativeWebpageParameters();
</del><ins>+            shouldIgnoreMetaViewport = true;
</ins><span class="cx"> 
</span><del>-        return ViewportConfiguration::webpageParameters();
</del><ins>+        return shouldIgnoreMetaViewport ? m_viewportConfiguration.nativeWebpageParameters() : ViewportConfiguration::webpageParameters();
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     if (!frame) {
</span></span></pre>
</div>
</div>

</body>
</html>