<!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>[169869] 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/169869">169869</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2014-06-11 19:03:34 -0700 (Wed, 11 Jun 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>[iOS WK2] Give WebKitTestRunner a viewport configuration with initial scale=1 for testing
https://bugs.webkit.org/show_bug.cgi?id=133779
Reviewed by Benjamin Poulain.
Source/WebCore:
Add a "testing" viewport configuration with initial scale of 1.
* WebCore.exp.in:
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::testingParameters):
* page/ViewportConfiguration.h:
Source/WebKit2:
Support a custom viewport configuration for testing, on iOS.
* UIProcess/API/ios/WKViewIOS.mm:
(-[WKView _frameOrBoundsChanged]): Call setViewportConfigurationMinimumLayoutSize()
just as WKWebView does.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetUseTestingViewportConfiguration): New SPI to set a viewport config for testing.
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: Ditto.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::setUseTestingViewportConfiguration):
(WebKit::WebPage::isUsingTestingViewportConfiguration):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::resetViewportDefaultConfiguration):
Tools:
Tell the WebPage to use the testing viewport configuration from the injected bundle.
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessage): Code cleanup.
* WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm:
(WTR::InjectedBundlePage::platformDidStartProvisionalLoadForFrame): Call WKBundlePageSetUseTestingViewportConfiguration()
on iOS.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</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="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIiosWKViewIOSmm">trunk/Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePagecpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePagePrivateh">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h</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="#trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlecpp">trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundlecocoaInjectedBundlePageCocoamm">trunk/Tools/WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (169868 => 169869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-06-12 00:46:49 UTC (rev 169868)
+++ trunk/Source/WebCore/ChangeLog        2014-06-12 02:03:34 UTC (rev 169869)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-06-11 Simon Fraser <simon.fraser@apple.com>
+
+ [iOS WK2] Give WebKitTestRunner a viewport configuration with initial scale=1 for testing
+ https://bugs.webkit.org/show_bug.cgi?id=133779
+
+ Reviewed by Benjamin Poulain.
+
+ Add a "testing" viewport configuration with initial scale of 1.
+
+ * WebCore.exp.in:
+ * page/ViewportConfiguration.cpp:
+ (WebCore::ViewportConfiguration::testingParameters):
+ * page/ViewportConfiguration.h:
+
</ins><span class="cx"> 2014-06-11 Pratik Solanki <psolanki@apple.com>
</span><span class="cx">
</span><span class="cx"> Keep CFDataRefs in SharedBuffer instead of merging them
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (169868 => 169869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-06-12 00:46:49 UTC (rev 169868)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-06-12 02:03:34 UTC (rev 169869)
</span><span class="lines">@@ -924,6 +924,7 @@
</span><span class="cx"> __ZN7WebCore21UserContentURLPattern5parseERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore21ViewportConfiguration14resetMinimalUIEv
</span><span class="cx"> __ZN7WebCore21ViewportConfiguration15setContentsSizeERKNS_7IntSizeE
</span><ins>+__ZN7WebCore21ViewportConfiguration17testingParametersEv
</ins><span class="cx"> __ZN7WebCore21ViewportConfiguration17webpageParametersEv
</span><span class="cx"> __ZN7WebCore21ViewportConfiguration20setMinimumLayoutSizeERKNS_9FloatSizeE
</span><span class="cx"> __ZN7WebCore21ViewportConfiguration20setViewportArgumentsERKNS_17ViewportArgumentsE
</span></span></pre></div>
<a id="trunkSourceWebCorepageViewportConfigurationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ViewportConfiguration.cpp (169868 => 169869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ViewportConfiguration.cpp        2014-06-12 00:46:49 UTC (rev 169868)
+++ trunk/Source/WebCore/page/ViewportConfiguration.cpp        2014-06-12 02:03:34 UTC (rev 169869)
</span><span class="lines">@@ -218,6 +218,16 @@
</span><span class="cx"> return parameters;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ViewportConfiguration::Parameters ViewportConfiguration::testingParameters()
+{
+ Parameters parameters;
+ parameters.initialScale = 1;
+ parameters.initialScaleIsSet = true;
+ parameters.minimumScale = 1;
+ parameters.maximumScale = 5;
+ return parameters;
+}
+
</ins><span class="cx"> static inline bool viewportArgumentValueIsValid(float value)
</span><span class="cx"> {
</span><span class="cx"> return value > 0;
</span></span></pre></div>
<a id="trunkSourceWebCorepageViewportConfigurationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ViewportConfiguration.h (169868 => 169869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ViewportConfiguration.h        2014-06-12 00:46:49 UTC (rev 169868)
+++ trunk/Source/WebCore/page/ViewportConfiguration.h        2014-06-12 02:03:34 UTC (rev 169869)
</span><span class="lines">@@ -96,6 +96,7 @@
</span><span class="cx"> static Parameters textDocumentParameters();
</span><span class="cx"> static Parameters imageDocumentParameters();
</span><span class="cx"> static Parameters xhtmlMobileParameters();
</span><ins>+ static Parameters testingParameters();
</ins><span class="cx">
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> WTF::CString description() const;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (169868 => 169869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-06-12 00:46:49 UTC (rev 169868)
+++ trunk/Source/WebKit2/ChangeLog        2014-06-12 02:03:34 UTC (rev 169869)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2014-06-11 Simon Fraser <simon.fraser@apple.com>
+
+ [iOS WK2] Give WebKitTestRunner a viewport configuration with initial scale=1 for testing
+ https://bugs.webkit.org/show_bug.cgi?id=133779
+
+ Reviewed by Benjamin Poulain.
+
+ Support a custom viewport configuration for testing, on iOS.
+
+ * UIProcess/API/ios/WKViewIOS.mm:
+ (-[WKView _frameOrBoundsChanged]): Call setViewportConfigurationMinimumLayoutSize()
+ just as WKWebView does.
+ * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+ (WKBundlePageSetUseTestingViewportConfiguration): New SPI to set a viewport config for testing.
+ * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: Ditto.
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::WebPage):
+ * WebProcess/WebPage/WebPage.h:
+ (WebKit::WebPage::setUseTestingViewportConfiguration):
+ (WebKit::WebPage::isUsingTestingViewportConfiguration):
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::WebPage::resetViewportDefaultConfiguration):
+
</ins><span class="cx"> 2014-06-11 Timothy Horton <timothy_horton@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove unused VisibleContentRectUpdateInfo update ID
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIiosWKViewIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm (169868 => 169869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm        2014-06-12 00:46:49 UTC (rev 169868)
+++ trunk/Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm        2014-06-12 02:03:34 UTC (rev 169869)
</span><span class="lines">@@ -131,7 +131,7 @@
</span><span class="cx">
</span><span class="cx"> _allowsBackForwardNavigationGestures = allowsBackForwardNavigationGestures;
</span><span class="cx">
</span><del>- WebPageProxy *webPageProxy = [_contentView page];
</del><ins>+ WebPageProxy* webPageProxy = [_contentView page];
</ins><span class="cx">
</span><span class="cx"> if (allowsBackForwardNavigationGestures) {
</span><span class="cx"> if (!_gestureController) {
</span><span class="lines">@@ -243,6 +243,13 @@
</span><span class="cx"> - (void)_frameOrBoundsChanged
</span><span class="cx"> {
</span><span class="cx"> CGRect bounds = [self bounds];
</span><ins>+
+ WebPageProxy* webPageProxy = [_contentView page];
+ WebCore::FloatSize size(bounds.size);
+ webPageProxy->setViewportConfigurationMinimumLayoutSize(size);
+ webPageProxy->setViewportConfigurationMinimumLayoutSizeForMinimalUI(size);
+ webPageProxy->setMaximumUnobscuredSize(size);
+
</ins><span class="cx"> [_scrollView setFrame:bounds];
</span><span class="cx"> [_contentView setMinimumSize:bounds.size];
</span><span class="cx"> [self _updateVisibleContentRects];
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp (169868 => 169869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp        2014-06-12 00:46:49 UTC (rev 169868)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp        2014-06-12 02:03:34 UTC (rev 169869)
</span><span class="lines">@@ -565,3 +565,10 @@
</span><span class="cx"> {
</span><span class="cx"> return toImpl(pageRef)->usesEphemeralSession();
</span><span class="cx"> }
</span><ins>+
+#if TARGET_OS_IPHONE
+void WKBundlePageSetUseTestingViewportConfiguration(WKBundlePageRef pageRef, bool useTestingViewportConfiguration)
+{
+ toImpl(pageRef)->setUseTestingViewportConfiguration(useTestingViewportConfiguration);
+}
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePagePrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h (169868 => 169869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h        2014-06-12 00:46:49 UTC (rev 169868)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h        2014-06-12 02:03:34 UTC (rev 169869)
</span><span class="lines">@@ -93,6 +93,10 @@
</span><span class="cx"> WK_EXPORT WKRenderingSuppressionToken WKBundlePageExtendIncrementalRenderingSuppression(WKBundlePageRef);
</span><span class="cx"> WK_EXPORT void WKBundlePageStopExtendingIncrementalRenderingSuppression(WKBundlePageRef, WKRenderingSuppressionToken);
</span><span class="cx">
</span><ins>+#if TARGET_OS_IPHONE
+WK_EXPORT void WKBundlePageSetUseTestingViewportConfiguration(WKBundlePageRef, bool);
+#endif
+
</ins><span class="cx"> #ifdef __cplusplus
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (169868 => 169869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-06-12 00:46:49 UTC (rev 169868)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-06-12 02:03:34 UTC (rev 169869)
</span><span class="lines">@@ -298,6 +298,7 @@
</span><span class="cx"> , m_userHasChangedPageScaleFactor(false)
</span><span class="cx"> , m_userIsInteracting(false)
</span><span class="cx"> , m_hasPendingBlurNotification(false)
</span><ins>+ , m_useTestingViewportConfiguration(false)
</ins><span class="cx"> , m_screenSize(parameters.screenSize)
</span><span class="cx"> , m_availableScreenSize(parameters.availableScreenSize)
</span><span class="cx"> , m_deviceOrientation(0)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (169868 => 169869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-06-12 00:46:49 UTC (rev 169868)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-06-12 02:03:34 UTC (rev 169869)
</span><span class="lines">@@ -459,6 +459,9 @@
</span><span class="cx"> void didReceiveMobileDocType(bool);
</span><span class="cx"> void restorePageState(double scale, bool userHasChangedPageScaleFactor, const WebCore::IntPoint& exposedOrigin);
</span><span class="cx">
</span><ins>+ void setUseTestingViewportConfiguration(bool useTestingViewport) { m_useTestingViewportConfiguration = useTestingViewport; }
+ bool isUsingTestingViewportConfiguration() const { return m_useTestingViewportConfiguration; }
+
</ins><span class="cx"> double minimumPageScaleFactor() const;
</span><span class="cx"> double maximumPageScaleFactor() const;
</span><span class="cx"> bool allowsUserScaling() const;
</span><span class="lines">@@ -1220,6 +1223,7 @@
</span><span class="cx"> bool m_userHasChangedPageScaleFactor;
</span><span class="cx"> bool m_userIsInteracting;
</span><span class="cx"> bool m_hasPendingBlurNotification;
</span><ins>+ bool m_useTestingViewportConfiguration;
</ins><span class="cx"> WebCore::FloatSize m_screenSize;
</span><span class="cx"> WebCore::FloatSize m_availableScreenSize;
</span><span class="cx"> RefPtr<WebCore::Range> m_currentBlockSelection;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (169868 => 169869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-06-12 00:46:49 UTC (rev 169868)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-06-12 02:03:34 UTC (rev 169869)
</span><span class="lines">@@ -2189,6 +2189,11 @@
</span><span class="cx">
</span><span class="cx"> void WebPage::resetViewportDefaultConfiguration(WebFrame* frame)
</span><span class="cx"> {
</span><ins>+ if (m_useTestingViewportConfiguration) {
+ m_viewportConfiguration.setDefaultConfiguration(ViewportConfiguration::testingParameters());
+ return;
+ }
+
</ins><span class="cx"> if (!frame) {
</span><span class="cx"> m_viewportConfiguration.setDefaultConfiguration(ViewportConfiguration::webpageParameters());
</span><span class="cx"> return;
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (169868 => 169869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-06-12 00:46:49 UTC (rev 169868)
+++ trunk/Tools/ChangeLog        2014-06-12 02:03:34 UTC (rev 169869)
</span><span class="lines">@@ -1,5 +1,20 @@
</span><span class="cx"> 2014-06-11 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><ins>+ [iOS WK2] Give WebKitTestRunner a viewport configuration with initial scale=1 for testing
+ https://bugs.webkit.org/show_bug.cgi?id=133779
+
+ Reviewed by Benjamin Poulain.
+
+ Tell the WebPage to use the testing viewport configuration from the injected bundle.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::didReceiveMessage): Code cleanup.
+ * WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm:
+ (WTR::InjectedBundlePage::platformDidStartProvisionalLoadForFrame): Call WKBundlePageSetUseTestingViewportConfiguration()
+ on iOS.
+
+2014-06-11 Simon Fraser <simon.fraser@apple.com>
+
</ins><span class="cx"> WTR cleanup: push per-test viewport configuration into TestController, where platforms can customize it
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=133770
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (169868 => 169869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp        2014-06-12 00:46:49 UTC (rev 169868)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp        2014-06-12 02:03:34 UTC (rev 169869)
</span><span class="lines">@@ -157,7 +157,9 @@
</span><span class="cx">
</span><span class="cx"> beginTesting(messageBodyDictionary);
</span><span class="cx"> return;
</span><del>- } else if (WKStringIsEqualToUTF8CString(messageName, "Reset")) {
</del><ins>+ }
+
+ if (WKStringIsEqualToUTF8CString(messageName, "Reset")) {
</ins><span class="cx"> ASSERT(messageBody);
</span><span class="cx"> ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
</span><span class="cx"> WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
</span><span class="lines">@@ -178,22 +180,27 @@
</span><span class="cx">
</span><span class="cx"> return;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> if (WKStringIsEqualToUTF8CString(messageName, "CallAddChromeInputFieldCallback")) {
</span><span class="cx"> m_testRunner->callAddChromeInputFieldCallback();
</span><span class="cx"> return;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> if (WKStringIsEqualToUTF8CString(messageName, "CallRemoveChromeInputFieldCallback")) {
</span><span class="cx"> m_testRunner->callRemoveChromeInputFieldCallback();
</span><span class="cx"> return;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> if (WKStringIsEqualToUTF8CString(messageName, "CallFocusWebViewCallback")) {
</span><span class="cx"> m_testRunner->callFocusWebViewCallback();
</span><span class="cx"> return;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> if (WKStringIsEqualToUTF8CString(messageName, "CallSetBackingScaleFactorCallback")) {
</span><span class="cx"> m_testRunner->callSetBackingScaleFactorCallback();
</span><span class="cx"> return;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> if (WKStringIsEqualToUTF8CString(messageName, "WorkQueueProcessedCallback")) {
</span><span class="cx"> if (!topLoadingFrame() && !m_testRunner->waitToDump())
</span><span class="cx"> page()->dump();
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundlecocoaInjectedBundlePageCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm (169868 => 169869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm        2014-06-12 00:46:49 UTC (rev 169868)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm        2014-06-12 02:03:34 UTC (rev 169869)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #import "CrashReporterInfo.h"
</span><span class="cx"> #import <WebKit/WKBundleFrame.h>
</span><ins>+#import <WebKit/WKBundlePagePrivate.h>
</ins><span class="cx"> #import <WebKit/WKURLCF.h>
</span><span class="cx">
</span><span class="cx"> namespace WTR {
</span><span class="lines">@@ -41,6 +42,10 @@
</span><span class="cx">
</span><span class="cx"> WKRetainPtr<WKURLRef> mainFrameURL = adoptWK(WKBundleFrameCopyProvisionalURL(frame));
</span><span class="cx"> setCrashReportApplicationSpecificInformationToURL(mainFrameURL.get());
</span><ins>+
+#if PLATFORM(IOS)
+ WKBundlePageSetUseTestingViewportConfiguration(page(), true);
+#endif
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WTR
</span></span></pre>
</div>
</div>
</body>
</html>