<!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>[211103] branches/safari-603-branch</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/211103">211103</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2017-01-24 13:22:50 -0800 (Tue, 24 Jan 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/211045">r211045</a>. rdar://problem/29486368</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari603branchSourceWebCoreChangeLog">branches/safari-603-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari603branchSourceWebCoreplatformaudioiosMediaSessionManagerIOSh">branches/safari-603-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h</a></li>
<li><a href="#branchessafari603branchSourceWebCoreplatformaudioiosMediaSessionManagerIOSmm">branches/safari-603-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm</a></li>
<li><a href="#branchessafari603branchSourceWebKit2ChangeLog">branches/safari-603-branch/Source/WebKit2/ChangeLog</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessAPICocoaWKWebViewmm">branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh">branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessPageClienth">branches/safari-603-branch/Source/WebKit2/UIProcess/PageClient.h</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessWebPageProxycpp">branches/safari-603-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessWebPageProxyh">branches/safari-603-branch/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessWebPageProxymessagesin">branches/safari-603-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessiosPageClientImplIOSh">branches/safari-603-branch/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessiosPageClientImplIOSmm">branches/safari-603-branch/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm</a></li>
<li><a href="#branchessafari603branchSourceWebKit2WebProcessWebPageCocoaWebPageCocoamm">branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/Cocoa/WebPageCocoa.mm</a></li>
<li><a href="#branchessafari603branchSourceWebKit2WebProcessWebPageWebPageh">branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#branchessafari603branchSourceWebKit2WebProcessWebPageWebPagemessagesin">branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in</a></li>
<li><a href="#branchessafari603branchSourceWebKit2WebProcessWebPagemacWebPageMacmm">branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm</a></li>
<li><a href="#branchessafari603branchToolsChangeLog">branches/safari-603-branch/Tools/ChangeLog</a></li>
<li><a href="#branchessafari603branchToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">branches/safari-603-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
<li><a href="#branchessafari603branchToolsTestWebKitAPITestsWebKit2CocoaNowPlayingControlsTestsmm">branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/NowPlayingControlsTests.mm</a></li>
<li><a href="#branchessafari603branchToolsTestWebKitAPITestsWebKit2CocoaSnapshotStoremm">branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/SnapshotStore.mm</a></li>
<li><a href="#branchessafari603branchToolsTestWebKitAPITestsWebKit2CocoaVideoControlsManagermm">branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm</a></li>
<li><a href="#branchessafari603branchToolsTestWebKitAPITestsWebKit2CocoaWKWebViewCandidateTestsmm">branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewCandidateTests.mm</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari603branchToolsTestWebKitAPIcocoaTestWKWebViewh">branches/safari-603-branch/Tools/TestWebKitAPI/cocoa/TestWKWebView.h</a></li>
<li><a href="#branchessafari603branchToolsTestWebKitAPIcocoaTestWKWebViewmm">branches/safari-603-branch/Tools/TestWebKitAPI/cocoa/TestWKWebView.mm</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#branchessafari603branchToolsTestWebKitAPImacTestWKWebViewMach">branches/safari-603-branch/Tools/TestWebKitAPI/mac/TestWKWebViewMac.h</a></li>
<li><a href="#branchessafari603branchToolsTestWebKitAPImacTestWKWebViewMacmm">branches/safari-603-branch/Tools/TestWebKitAPI/mac/TestWKWebViewMac.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari603branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/ChangeLog (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/ChangeLog        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Source/WebCore/ChangeLog        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -1,5 +1,30 @@
</span><span class="cx"> 2017-01-24 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><ins>+ Merge r211045. rdar://problem/29486368
+
+ 2017-01-23 Jer Noble <jer.noble@apple.com>
+
+ REGRESSION (r208149): Video details does not apear and missing scrubber in Control Center
+ https://bugs.webkit.org/show_bug.cgi?id=167233
+
+ Reviewed by Alex Christensen.
+
+ Test: In TestWebKitAPI, NowPlayingControlsTests.NowPlayingControlsIOS
+
+ In r208149, we introduced a new media type, Video, and renamed the old type to
+ VideoAudio (to be able to distinguish between video-with-audio and silent-video).
+ But we missed one place where that type needs to be renamed.
+
+ For testing purposes, overload methods from PlatformMediaSessionManager which WebKit2 uses
+ to report the current now playing session and it's information.
+
+ * platform/audio/ios/MediaSessionManagerIOS.h:
+ * platform/audio/ios/MediaSessionManagerIOS.mm:
+ (WebCore::MediaSessionManageriOS::nowPlayingEligibleSession):
+ (WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
+
+2017-01-24 Matthew Hanson <matthew_hanson@apple.com>
+
</ins><span class="cx"> Merge r211028. rdar://problem/30060378
</span><span class="cx">
</span><span class="cx"> 2017-01-20 Dean Jackson <dino@apple.com>
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoreplatformaudioiosMediaSessionManagerIOSh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -70,11 +70,17 @@
</span><span class="cx">
</span><span class="cx"> bool sessionCanLoadMedia(const PlatformMediaSession&) const override;
</span><span class="cx">
</span><ins>+ bool hasActiveNowPlayingSession() const final { return m_nowPlayingActive; }
+ String lastUpdatedNowPlayingTitle() const final { return m_reportedTitle; }
+ double lastUpdatedNowPlayingDuration() const final { return m_reportedDuration; }
+ double lastUpdatedNowPlayingElapsedTime() const final { return m_reportedCurrentTime; }
+
</ins><span class="cx"> PlatformMediaSession* nowPlayingEligibleSession();
</span><span class="cx">
</span><span class="cx"> RetainPtr<WebMediaSessionHelper> m_objcObserver;
</span><span class="cx"> double m_reportedRate { 0 };
</span><span class="cx"> double m_reportedDuration { 0 };
</span><ins>+ double m_reportedCurrentTime { 0 };
</ins><span class="cx"> String m_reportedTitle;
</span><span class="cx"> bool m_nowPlayingActive { false };
</span><span class="cx"> bool m_isInBackground { false };
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoreplatformaudioiosMediaSessionManagerIOSmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -219,7 +219,7 @@
</span><span class="cx"> {
</span><span class="cx"> return findSession([] (PlatformMediaSession& session, size_t) {
</span><span class="cx"> PlatformMediaSession::MediaType type = session.mediaType();
</span><del>- if (type != PlatformMediaSession::Video && type != PlatformMediaSession::Audio)
</del><ins>+ if (type != PlatformMediaSession::VideoAudio && type != PlatformMediaSession::Audio)
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> if (session.characteristics() & PlatformMediaSession::HasAudio)
</span><span class="lines">@@ -249,6 +249,7 @@
</span><span class="cx"> String title = currentSession->title();
</span><span class="cx"> double duration = currentSession->duration();
</span><span class="cx"> double rate = currentSession->state() == PlatformMediaSession::Playing ? 1 : 0;
</span><ins>+ double currentTime = currentSession->currentTime();
</ins><span class="cx"> if (m_reportedTitle == title && m_reportedRate == rate && m_reportedDuration == duration) {
</span><span class="cx"> LOG(Media, "MediaSessionManageriOS::updateNowPlayingInfo - nothing new to show");
</span><span class="cx"> return;
</span><span class="lines">@@ -257,6 +258,7 @@
</span><span class="cx"> m_reportedRate = rate;
</span><span class="cx"> m_reportedDuration = duration;
</span><span class="cx"> m_reportedTitle = title;
</span><ins>+ m_reportedCurrentTime = currentTime;
</ins><span class="cx">
</span><span class="cx"> auto info = adoptNS([[NSMutableDictionary alloc] init]);
</span><span class="cx"> if (!title.isEmpty())
</span><span class="lines">@@ -265,7 +267,6 @@
</span><span class="cx"> info.get()[MPMediaItemPropertyPlaybackDuration] = @(duration);
</span><span class="cx"> info.get()[MPNowPlayingInfoPropertyPlaybackRate] = @(rate);
</span><span class="cx">
</span><del>- double currentTime = currentSession->currentTime();
</del><span class="cx"> if (std::isfinite(currentTime) && currentTime != MediaPlayer::invalidTime())
</span><span class="cx"> info.get()[MPNowPlayingInfoPropertyElapsedPlaybackTime] = @(currentTime);
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/ChangeLog (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/ChangeLog        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Source/WebKit2/ChangeLog        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -1,5 +1,39 @@
</span><span class="cx"> 2017-01-24 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><ins>+ Merge r211045. rdar://problem/29486368
+
+ 2017-01-23 Jer Noble <jer.noble@apple.com>
+
+ Video details does not apear and missing scrubber in Control Center
+ https://bugs.webkit.org/show_bug.cgi?id=167233
+
+ Reviewed by Alex Christensen.
+
+ Make requestActiveNowPlayingSessionInfo() and handleActiveNowPlayingSessionInfoResponse()
+ work in PLATFORM(IOS).
+
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (-[WKWebView _requestActiveNowPlayingSessionInfo]):
+ (-[WKWebView _handleActiveNowPlayingSessionInfoResponse:title:duration:elapsedTime:]):
+ * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+ * UIProcess/PageClient.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo):
+ (WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse):
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in:
+ * UIProcess/ios/PageClientImplIOS.h:
+ * UIProcess/ios/PageClientImplIOS.mm:
+ (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse):
+ * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
+ (WebKit::WebPage::requestActiveNowPlayingSessionInfo):
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/WebPage.messages.in:
+ * WebProcess/WebPage/mac/WebPageMac.mm:
+ (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Deleted.
+
+2017-01-24 Matthew Hanson <matthew_hanson@apple.com>
+
</ins><span class="cx"> Merge r211007. rdar://problem/28620919
</span><span class="cx">
</span><span class="cx"> 2017-01-20 Brady Eidson <beidson@apple.com>
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -4861,17 +4861,6 @@
</span><span class="cx"> return _impl->shouldRequestCandidates();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-- (void)_requestActiveNowPlayingSessionInfo
-{
- if (_page)
- _page->requestActiveNowPlayingSessionInfo();
-}
-
-- (void)_handleActiveNowPlayingSessionInfoResponse:(BOOL)hasActiveSession title:(NSString *)title duration:(double)duration elapsedTime:(double)elapsedTime
-{
- // Overridden by subclasses.
-}
-
</del><span class="cx"> - (void)_insertText:(id)string replacementRange:(NSRange)replacementRange
</span><span class="cx"> {
</span><span class="cx"> [self insertText:string replacementRange:replacementRange];
</span><span class="lines">@@ -4889,6 +4878,17 @@
</span><span class="cx">
</span><span class="cx"> #endif // PLATFORM(MAC)
</span><span class="cx">
</span><ins>+- (void)_requestActiveNowPlayingSessionInfo
+{
+ if (_page)
+ _page->requestActiveNowPlayingSessionInfo();
+}
+
+- (void)_handleActiveNowPlayingSessionInfoResponse:(BOOL)hasActiveSession title:(NSString *)title duration:(double)duration elapsedTime:(double)elapsedTime
+{
+ // Overridden by subclasses.
+}
+
</ins><span class="cx"> - (void)_setPageScale:(CGFloat)scale withOrigin:(CGPoint)origin
</span><span class="cx"> {
</span><span class="cx"> _page->scalePage(scale, WebCore::roundedIntPoint(origin));
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -308,9 +308,6 @@
</span><span class="cx"> - (void)_forceRequestCandidates WK_API_AVAILABLE(macosx(WK_MAC_TBA));
</span><span class="cx"> - (void)_didUpdateCandidateListVisibility:(BOOL)visible WK_API_AVAILABLE(macosx(WK_MAC_TBA));
</span><span class="cx"> @property (nonatomic, readonly) BOOL _shouldRequestCandidates WK_API_AVAILABLE(macosx(WK_MAC_TBA));
</span><del>-- (void)_requestActiveNowPlayingSessionInfo WK_API_AVAILABLE(macosx(WK_MAC_TBA));
-- (void)_handleActiveNowPlayingSessionInfoResponse:(BOOL)hasActiveSession title:(NSString *)title duration:(double)duration elapsedTime:(double)elapsedTime WK_API_AVAILABLE(macosx(WK_MAC_TBA));
-
</del><span class="cx"> - (void)_insertText:(id)string replacementRange:(NSRange)replacementRange WK_API_AVAILABLE(macosx(WK_MAC_TBA));
</span><span class="cx">
</span><span class="cx"> - (void)_setHeaderBannerHeight:(int)height WK_API_AVAILABLE(macosx(WK_MAC_TBA));
</span><span class="lines">@@ -317,6 +314,9 @@
</span><span class="cx"> - (void)_setFooterBannerHeight:(int)height WK_API_AVAILABLE(macosx(WK_MAC_TBA));
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+- (void)_requestActiveNowPlayingSessionInfo WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
+- (void)_handleActiveNowPlayingSessionInfoResponse:(BOOL)hasActiveSession title:(NSString *)title duration:(double)duration elapsedTime:(double)elapsedTime WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
+
</ins><span class="cx"> - (void)_setPageScale:(CGFloat)scale withOrigin:(CGPoint)origin WK_API_AVAILABLE(ios(WK_IOS_TBA));
</span><span class="cx"> - (CGFloat)_pageScale WK_API_AVAILABLE(ios(WK_IOS_TBA));
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/PageClient.h (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/PageClient.h        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/PageClient.h        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -253,7 +253,6 @@
</span><span class="cx"> virtual void recommendedScrollbarStyleDidChange(WebCore::ScrollbarStyle) = 0;
</span><span class="cx"> virtual void removeNavigationGestureSnapshot() = 0;
</span><span class="cx"> virtual void handleControlledElementIDResponse(const String&) = 0;
</span><del>- virtual void handleActiveNowPlayingSessionInfoResponse(bool hasActiveSession, const String& title, double duration, double elapsedTime) = 0;
</del><span class="cx">
</span><span class="cx"> virtual CGRect boundsOfLayerInLayerBackedWindowCoordinates(CALayer *) const = 0;
</span><span class="cx">
</span><span class="lines">@@ -284,6 +283,10 @@
</span><span class="cx"> virtual void setEditableElementIsFocused(bool) = 0;
</span><span class="cx"> #endif // PLATFORM(MAC)
</span><span class="cx">
</span><ins>+#if PLATFORM(COCOA)
+ virtual void handleActiveNowPlayingSessionInfoResponse(bool hasActiveSession, const String& title, double duration, double elapsedTime) = 0;
+#endif
+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> virtual void commitPotentialTapFailed() = 0;
</span><span class="cx"> virtual void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color&, const Vector<WebCore::FloatQuad>& highlightedQuads, const WebCore::IntSize& topLeftRadius, const WebCore::IntSize& topRightRadius, const WebCore::IntSize& bottomLeftRadius, const WebCore::IntSize& bottomRightRadius) = 0;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -6468,16 +6468,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPageProxy::requestActiveNowPlayingSessionInfo()
-{
- m_process->send(Messages::WebPage::RequestActiveNowPlayingSessionInfo(), m_pageID);
-}
-
-void WebPageProxy::handleActiveNowPlayingSessionInfoResponse(bool hasActiveSession, const String& title, double duration, double elapsedTime) const
-{
- m_pageClient.handleActiveNowPlayingSessionInfoResponse(hasActiveSession, title, duration, elapsedTime);
-}
-
</del><span class="cx"> void WebPageProxy::handleControlledElementIDResponse(const String& identifier) const
</span><span class="cx"> {
</span><span class="cx"> m_pageClient.handleControlledElementIDResponse(identifier);
</span><span class="lines">@@ -6493,6 +6483,18 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if PLATFORM(COCOA)
+void WebPageProxy::requestActiveNowPlayingSessionInfo()
+{
+ m_process->send(Messages::WebPage::RequestActiveNowPlayingSessionInfo(), m_pageID);
+}
+
+void WebPageProxy::handleActiveNowPlayingSessionInfoResponse(bool hasActiveSession, const String& title, double duration, double elapsedTime) const
+{
+ m_pageClient.handleActiveNowPlayingSessionInfoResponse(hasActiveSession, title, duration, elapsedTime);
+}
+#endif
+
</ins><span class="cx"> #if ENABLE(MEDIA_SESSION)
</span><span class="cx"> void WebPageProxy::hasMediaSessionWithActiveMediaElementsDidChange(bool state)
</span><span class="cx"> {
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/WebPageProxy.h (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/WebPageProxy.h        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/WebPageProxy.h        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -1064,9 +1064,12 @@
</span><span class="cx"> bool hasActiveVideoForControlsManager() const;
</span><span class="cx"> void requestControlledElementID() const;
</span><span class="cx"> void handleControlledElementIDResponse(const String&) const;
</span><ins>+ bool isPlayingVideoInEnhancedFullscreen() const;
+#endif
+
+#if PLATFORM(COCOA)
</ins><span class="cx"> void requestActiveNowPlayingSessionInfo();
</span><span class="cx"> void handleActiveNowPlayingSessionInfoResponse(bool hasActiveSession, const String& title, double duration, double elapsedTime) const;
</span><del>- bool isPlayingVideoInEnhancedFullscreen() const;
</del><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(MEDIA_SESSION)
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -483,6 +483,9 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> DidHandleAcceptedCandidate()
</span><ins>+#endif
+
+#if PLATFORM(COCOA)
</ins><span class="cx"> HandleActiveNowPlayingSessionInfoResponse(bool hasActiveSession, String title, double duration, double elapsedTime)
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessiosPageClientImplIOSh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -194,6 +194,8 @@
</span><span class="cx">
</span><span class="cx"> WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() override;
</span><span class="cx">
</span><ins>+ void handleActiveNowPlayingSessionInfoResponse(bool hasActiveSession, const String& title, double duration, double elapsedTime) override;
+
</ins><span class="cx"> WKContentView *m_contentView;
</span><span class="cx"> WKWebView *m_webView;
</span><span class="cx"> RetainPtr<WKEditorUndoTargetObjC> m_undoTarget;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessiosPageClientImplIOSmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #import "InteractionInformationAtPosition.h"
</span><span class="cx"> #import "NativeWebKeyboardEvent.h"
</span><span class="cx"> #import "NavigationState.h"
</span><ins>+#import "StringUtilities.h"
</ins><span class="cx"> #import "UIKitSPI.h"
</span><span class="cx"> #import "ViewSnapshotStore.h"
</span><span class="cx"> #import "WKContentView.h"
</span><span class="lines">@@ -749,6 +750,11 @@
</span><span class="cx"> return ValidationBubble::create(m_contentView, message);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void PageClientImpl::handleActiveNowPlayingSessionInfoResponse(bool hasActiveSession, const String& title, double duration, double elapsedTime)
+{
+ [m_webView _handleActiveNowPlayingSessionInfoResponse:hasActiveSession title:nsStringFromWebCoreString(title) duration:duration elapsedTime:elapsedTime];
+}
+
</ins><span class="cx"> } // namespace WebKit
</span><span class="cx">
</span><span class="cx"> #endif // PLATFORM(IOS)
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2WebProcessWebPageCocoaWebPageCocoamm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/Cocoa/WebPageCocoa.mm (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/Cocoa/WebPageCocoa.mm        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/Cocoa/WebPageCocoa.mm        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -27,6 +27,8 @@
</span><span class="cx"> #import "WebPage.h"
</span><span class="cx">
</span><span class="cx"> #import "LoadParameters.h"
</span><ins>+#import "WebPageProxyMessages.h"
+#import <WebCore/PlatformMediaSessionManager.h>
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">
</span><span class="lines">@@ -39,6 +41,22 @@
</span><span class="cx"> m_dataDetectionContext = loadParameters.dataDetectionContext;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebPage::requestActiveNowPlayingSessionInfo()
+{
+ bool hasActiveSession = false;
+ String title = emptyString();
+ double duration = NAN;
+ double elapsedTime = NAN;
+ if (auto* sharedManager = WebCore::PlatformMediaSessionManager::sharedManagerIfExists()) {
+ hasActiveSession = sharedManager->hasActiveNowPlayingSession();
+ title = sharedManager->lastUpdatedNowPlayingTitle();
+ duration = sharedManager->lastUpdatedNowPlayingDuration();
+ elapsedTime = sharedManager->lastUpdatedNowPlayingElapsedTime();
+ }
+
+ send(Messages::WebPageProxy::HandleActiveNowPlayingSessionInfoResponse(hasActiveSession, title, duration, elapsedTime));
+}
+
</ins><span class="cx"> } // namespace WebKit
</span><span class="cx">
</span><span class="cx"> #endif // PLATFORM(COCOA)
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -1221,6 +1221,9 @@
</span><span class="cx"> void dataDetectorsDidHideUI(WebCore::PageOverlay::PageOverlayID);
</span><span class="cx">
</span><span class="cx"> void handleAcceptedCandidate(WebCore::TextCheckingResult);
</span><ins>+#endif
+
+#if PLATFORM(COCOA)
</ins><span class="cx"> void requestActiveNowPlayingSessionInfo();
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2WebProcessWebPageWebPagemessagesin"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -422,12 +422,15 @@
</span><span class="cx"> DataDetectorsDidHideUI(WebCore::PageOverlay::PageOverlayID pageOverlay)
</span><span class="cx">
</span><span class="cx"> HandleAcceptedCandidate(struct WebCore::TextCheckingResult acceptedCandidate)
</span><del>- RequestActiveNowPlayingSessionInfo()
</del><span class="cx">
</span><span class="cx"> SetHeaderBannerHeightForTesting(int height);
</span><span class="cx"> SetFooterBannerHeightForTesting(int height);
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if PLATFORM(COCOA)
+ RequestActiveNowPlayingSessionInfo()
+#endif
+
</ins><span class="cx"> SetShouldDispatchFakeMouseMoveEvents(bool shouldDispatchFakeMouseMoveEvents)
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2WebProcessWebPagemacWebPageMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -76,7 +76,6 @@
</span><span class="cx"> #import <WebCore/Page.h>
</span><span class="cx"> #import <WebCore/PageOverlayController.h>
</span><span class="cx"> #import <WebCore/PlatformKeyboardEvent.h>
</span><del>-#import <WebCore/PlatformMediaSessionManager.h>
</del><span class="cx"> #import <WebCore/PluginDocument.h>
</span><span class="cx"> #import <WebCore/RenderElement.h>
</span><span class="cx"> #import <WebCore/RenderObject.h>
</span><span class="lines">@@ -162,22 +161,6 @@
</span><span class="cx"> send(Messages::WebPageProxy::DidHandleAcceptedCandidate());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPage::requestActiveNowPlayingSessionInfo()
-{
- bool hasActiveSession = false;
- String title = emptyString();
- double duration = NAN;
- double elapsedTime = NAN;
- if (auto* sharedManager = WebCore::PlatformMediaSessionManager::sharedManagerIfExists()) {
- hasActiveSession = sharedManager->hasActiveNowPlayingSession();
- title = sharedManager->lastUpdatedNowPlayingTitle();
- duration = sharedManager->lastUpdatedNowPlayingDuration();
- elapsedTime = sharedManager->lastUpdatedNowPlayingElapsedTime();
- }
-
- send(Messages::WebPageProxy::HandleActiveNowPlayingSessionInfoResponse(hasActiveSession, title, duration, elapsedTime));
-}
-
</del><span class="cx"> NSObject *WebPage::accessibilityObjectForMainFramePlugin()
</span><span class="cx"> {
</span><span class="cx"> if (!m_page)
</span></span></pre></div>
<a id="branchessafari603branchToolsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/ChangeLog (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/ChangeLog        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Tools/ChangeLog        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2017-01-24 Matthew Hanson <matthew_hanson@apple.com>
+
+ Merge r211045. rdar://problem/29486368
+
+ 2017-01-23 Jer Noble <jer.noble@apple.com>
+
+ Video details does not apear and missing scrubber in Control Center
+ https://bugs.webkit.org/show_bug.cgi?id=167233
+
+ Reviewed by Alex Christensen.
+
+ Refactor TestWKWebViewMac to work on PLATFORM(IOS). Add a new test to
+ NowPlayingControlTests for iOS.
+
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/WebKit2Cocoa/NowPlayingControlsTests.mm:
+ (-[NowPlayingTestWebView setWindowVisible:]):
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/Tests/WebKit2Cocoa/SnapshotStore.mm:
+ * TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm:
+ * TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewCandidateTests.mm:
+ * TestWebKitAPI/cocoa/TestWKWebView.h: Renamed from Tools/TestWebKitAPI/mac/TestWKWebViewMac.h.
+ * TestWebKitAPI/cocoa/TestWKWebView.mm: Renamed from Tools/TestWebKitAPI/mac/TestWKWebViewMac.mm.
+ (SOFT_LINK_CLASS):
+ (-[TestMessageHandler addMessage:withHandler:]):
+ (-[TestMessageHandler userContentController:didReceiveScriptMessage:]):
+ (__simulated_forceClickAssociatedEventsMask):
+ (-[TestWKWebViewHostWindow _mouseDownAtPoint:simulatePressure:]):
+ (-[TestWKWebViewHostWindow isKeyWindow]):
+ (-[TestWKWebViewHostWindow makeKeyWindow]):
+ (-[TestWKWebViewHostWindow resignKeyWindow]):
+ (-[TestWKWebView initWithFrame:]):
+ (-[TestWKWebView initWithFrame:configuration:]):
+ (-[TestWKWebView _setUpTestWindow:]):
+ (-[TestWKWebView performAfterReceivingMessage:action:]):
+ (-[TestWKWebView loadTestPageNamed:]):
+ (-[TestWKWebView synchronouslyLoadTestPageNamed:]):
+ (-[TestWKWebView stringByEvaluatingJavaScript:]):
+ (-[TestWKWebView waitForMessage:]):
+ (-[TestWKWebView performAfterLoading:]):
+ (-[TestWKWebView mouseDownAtPoint:simulatePressure:]):
+ (-[TestWKWebView typeCharacter:]):
+
</ins><span class="cx"> 2017-01-20 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r210949. rdar://problem/30108531
</span></span></pre></div>
<a id="branchessafari603branchToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx">                 2EFF06C51D8867760004BB30 /* change-video-source-on-click.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 2EFF06C41D8867700004BB30 /* change-video-source-on-click.html */; };
</span><span class="cx">                 2EFF06C71D886A580004BB30 /* change-video-source-on-end.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 2EFF06C61D886A560004BB30 /* change-video-source-on-end.html */; };
</span><span class="cx">                 2EFF06CD1D8A429A0004BB30 /* input-field-in-scrollable-document.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 2EFF06CC1D8A42910004BB30 /* input-field-in-scrollable-document.html */; };
</span><del>-                2EFF06D41D8AEDBB0004BB30 /* TestWKWebViewMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2EFF06D31D8AEDBB0004BB30 /* TestWKWebViewMac.mm */; };
</del><ins>+                2EFF06D41D8AEDBB0004BB30 /* TestWKWebView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2EFF06D31D8AEDBB0004BB30 /* TestWKWebView.mm */; };
</ins><span class="cx">                 2EFF06D71D8AF34A0004BB30 /* WKWebViewCandidateTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2EFF06D61D8AF34A0004BB30 /* WKWebViewCandidateTests.mm */; };
</span><span class="cx">                 315118101DB1AE4000176304 /* ExtendedColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3151180F1DB1ADD500176304 /* ExtendedColor.cpp */; };
</span><span class="cx">                 33BE5AF9137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33BE5AF8137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp */; };
</span><span class="lines">@@ -875,8 +875,8 @@
</span><span class="cx">                 2EFF06C41D8867700004BB30 /* change-video-source-on-click.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "change-video-source-on-click.html"; sourceTree = "<group>"; };
</span><span class="cx">                 2EFF06C61D886A560004BB30 /* change-video-source-on-end.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "change-video-source-on-end.html"; sourceTree = "<group>"; };
</span><span class="cx">                 2EFF06CC1D8A42910004BB30 /* input-field-in-scrollable-document.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "input-field-in-scrollable-document.html"; sourceTree = "<group>"; };
</span><del>-                2EFF06D21D8AEDBB0004BB30 /* TestWKWebViewMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestWKWebViewMac.h; sourceTree = "<group>"; };
-                2EFF06D31D8AEDBB0004BB30 /* TestWKWebViewMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TestWKWebViewMac.mm; sourceTree = "<group>"; };
</del><ins>+                2EFF06D21D8AEDBB0004BB30 /* TestWKWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestWKWebView.h; path = cocoa/TestWKWebView.h; sourceTree = "<group>"; };
+                2EFF06D31D8AEDBB0004BB30 /* TestWKWebView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TestWKWebView.mm; path = cocoa/TestWKWebView.mm; sourceTree = "<group>"; };
</ins><span class="cx">                 2EFF06D61D8AF34A0004BB30 /* WKWebViewCandidateTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewCandidateTests.mm; sourceTree = "<group>"; };
</span><span class="cx">                 3151180F1DB1ADD500176304 /* ExtendedColor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExtendedColor.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PreventEmptyUserAgent.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -1423,6 +1423,8 @@
</span><span class="cx">                                 2D1C04A61D76298B000A6816 /* TestNavigationDelegate.mm */,
</span><span class="cx">                                 A14FC58D1B8AE36500D107EB /* TestProtocol.h */,
</span><span class="cx">                                 A14FC58E1B8AE36500D107EB /* TestProtocol.mm */,
</span><ins>+                                2EFF06D21D8AEDBB0004BB30 /* TestWKWebView.h */,
+                                2EFF06D31D8AEDBB0004BB30 /* TestWKWebView.mm */,
</ins><span class="cx">                                 7C83E0391D0A602700FEBCF3 /* UtilitiesCocoa.mm */,
</span><span class="cx">                                 A14FC5841B89739100D107EB /* WKWebViewConfigurationExtras.h */,
</span><span class="cx">                                 A14FC5831B89739100D107EB /* WKWebViewConfigurationExtras.mm */,
</span><span class="lines">@@ -1993,8 +1995,6 @@
</span><span class="cx">                                 C081224413FC19EC00DC39AE /* SyntheticBackingScaleFactorWindow.m */,
</span><span class="cx">                                 29AB8AA3164C7A9300D49BEC /* TestBrowsingContextLoadDelegate.h */,
</span><span class="cx">                                 29AB8AA2164C7A9300D49BEC /* TestBrowsingContextLoadDelegate.mm */,
</span><del>-                                2EFF06D21D8AEDBB0004BB30 /* TestWKWebViewMac.h */,
-                                2EFF06D31D8AEDBB0004BB30 /* TestWKWebViewMac.mm */,
</del><span class="cx">                                 C08587BE13FE956C001EF4E5 /* WebKitAgnosticTest.h */,
</span><span class="cx">                                 C08587BD13FE956C001EF4E5 /* WebKitAgnosticTest.mm */,
</span><span class="cx">                         );
</span><span class="lines">@@ -2548,7 +2548,7 @@
</span><span class="cx">                                 8349D3C21DB96DDE004A9F65 /* ContextMenuDownload.mm in Sources */,
</span><span class="cx">                                 7CCE7EFC1A411AE600447C4C /* InjectedBundleFrameHitTest.cpp in Sources */,
</span><span class="cx">                                 7CCE7EFD1A411AE600447C4C /* InjectedBundleInitializationUserDataCallbackWins.cpp in Sources */,
</span><del>-                                2EFF06D41D8AEDBB0004BB30 /* TestWKWebViewMac.mm in Sources */,
</del><ins>+                                2EFF06D41D8AEDBB0004BB30 /* TestWKWebView.mm in Sources */,
</ins><span class="cx">                                 7C83E0B81D0A64BD00FEBCF3 /* InjectedBundleMakeAllShadowRootsOpen.cpp in Sources */,
</span><span class="cx">                                 7CCE7EC31A411A7E00447C4C /* InspectorBar.mm in Sources */,
</span><span class="cx">                                 7CCE7EDA1A411A8700447C4C /* InstanceMethodSwizzler.mm in Sources */,
</span></span></pre></div>
<a id="branchessafari603branchToolsTestWebKitAPITestsWebKit2CocoaNowPlayingControlsTestsmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/NowPlayingControlsTests.mm (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/NowPlayingControlsTests.mm        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/NowPlayingControlsTests.mm        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -26,12 +26,12 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx">
</span><span class="cx"> #import "PlatformUtilities.h"
</span><del>-#import "TestWKWebViewMac.h"
</del><ins>+#import "TestWKWebView.h"
</ins><span class="cx">
</span><span class="cx"> #import <WebKit/WKWebViewConfigurationPrivate.h>
</span><span class="cx"> #import <WebKit/WKWebViewPrivate.h>
</span><span class="cx">
</span><del>-#if WK_API_ENABLED && PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101201
</del><ins>+#if WK_API_ENABLED && (PLATFORM(IOS) || __MAC_OS_X_VERSION_MAX_ALLOWED >= 101201)
</ins><span class="cx">
</span><span class="cx"> @interface NowPlayingTestWebView : TestWKWebView
</span><span class="cx"> @property (nonatomic, readonly) BOOL hasActiveNowPlayingSession;
</span><span class="lines">@@ -93,10 +93,20 @@
</span><span class="cx">
</span><span class="cx"> _receivedNowPlayingInfoResponse = true;
</span><span class="cx"> }
</span><ins>+
+- (void)setWindowVisible:(BOOL)isVisible
+{
+#if PLATFORM(MAC)
+ [self.window setIsVisible:isVisible];
+#else
+ self.window.hidden = !isVisible;
+#endif
+}
</ins><span class="cx"> @end
</span><span class="cx">
</span><span class="cx"> namespace TestWebKitAPI {
</span><span class="cx">
</span><ins>+#if PLATFORM(MAC)
</ins><span class="cx"> TEST(NowPlayingControlsTests, NowPlayingControlsDoNotShowForForegroundPage)
</span><span class="cx"> {
</span><span class="cx"> WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init];
</span><span class="lines">@@ -105,7 +115,7 @@
</span><span class="cx"> [webView loadTestPageNamed:@"large-video-test-now-playing"];
</span><span class="cx"> [webView waitForMessage:@"playing"];
</span><span class="cx">
</span><del>- [webView.window setIsVisible:YES];
</del><ins>+ [webView setWindowVisible:YES];
</ins><span class="cx"> [webView.window makeKeyWindow];
</span><span class="cx"> [webView expectHasActiveNowPlayingSession:NO];
</span><span class="cx">
</span><span class="lines">@@ -122,7 +132,7 @@
</span><span class="cx"> [webView loadTestPageNamed:@"large-video-test-now-playing"];
</span><span class="cx"> [webView waitForMessage:@"playing"];
</span><span class="cx">
</span><del>- [webView.window setIsVisible:NO];
</del><ins>+ [webView setWindowVisible:NO];
</ins><span class="cx"> [webView.window resignKeyWindow];
</span><span class="cx"> [webView expectHasActiveNowPlayingSession:YES];
</span><span class="cx">
</span><span class="lines">@@ -139,12 +149,12 @@
</span><span class="cx"> [webView loadTestPageNamed:@"large-video-test-now-playing"];
</span><span class="cx"> [webView waitForMessage:@"playing"];
</span><span class="cx">
</span><del>- [webView.window setIsVisible:NO];
</del><ins>+ [webView setWindowVisible:NO];
</ins><span class="cx"> [webView.window resignKeyWindow];
</span><span class="cx">
</span><span class="cx"> [webView expectHasActiveNowPlayingSession:YES];
</span><span class="cx">
</span><del>- [webView.window setIsVisible:YES];
</del><ins>+ [webView setWindowVisible:YES];
</ins><span class="cx"> [webView.window makeKeyWindow];
</span><span class="cx">
</span><span class="cx"> [webView expectHasActiveNowPlayingSession:NO];
</span><span class="lines">@@ -162,8 +172,8 @@
</span><span class="cx"> [webView loadTestPageNamed:@"large-video-test-now-playing"];
</span><span class="cx"> [webView waitForMessage:@"playing"];
</span><span class="cx">
</span><del>- [webView mouseDownAtPoint:NSMakePoint(240, 160) simulatePressure:YES];
- [webView.window setIsVisible:NO];
</del><ins>+ [webView stringByEvaluatingJavaScript:@"document.querySelector('video').muted = true"];
+ [webView setWindowVisible:NO];
</ins><span class="cx"> [webView.window resignKeyWindow];
</span><span class="cx">
</span><span class="cx"> [webView waitForNowPlayingInfoToChange];
</span><span class="lines">@@ -172,7 +182,24 @@
</span><span class="cx"> ASSERT_TRUE(isnan(webView.lastUpdatedDuration));
</span><span class="cx"> ASSERT_TRUE(isnan(webView.lastUpdatedElapsedTime));
</span><span class="cx"> }
</span><ins>+#endif // PLATFORM(MAC)
</ins><span class="cx">
</span><ins>+#if PLATFORM(IOS)
+TEST(NowPlayingControlsTests, NowPlayingControlsIOS)
+{
+ WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init];
+ configuration.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeNone;
+ NowPlayingTestWebView *webView = [[NowPlayingTestWebView alloc] initWithFrame:NSMakeRect(0, 0, 480, 320) configuration:configuration];
+ [webView loadTestPageNamed:@"large-video-test-now-playing"];
+ [webView waitForMessage:@"playing"];
+
+ [webView expectHasActiveNowPlayingSession:YES];
+ ASSERT_STREQ("foo", webView.lastUpdatedTitle.UTF8String);
+ ASSERT_EQ(10, webView.lastUpdatedDuration);
+ ASSERT_GE(webView.lastUpdatedElapsedTime, 0);
+}
+#endif
+
</ins><span class="cx"> } // namespace TestWebKitAPI
</span><span class="cx">
</span><del>-#endif // WK_API_ENABLED && PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101201
</del><ins>+#endif // WK_API_ENABLED && (PLATFORM(IOS) || __MAC_OS_X_VERSION_MAX_ALLOWED >= 101201)
</ins></span></pre></div>
<a id="branchessafari603branchToolsTestWebKitAPITestsWebKit2CocoaSnapshotStoremm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/SnapshotStore.mm (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/SnapshotStore.mm        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/SnapshotStore.mm        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> #import "PlatformUtilities.h"
</span><span class="cx"> #import "Test.h"
</span><span class="cx"> #import "TestNavigationDelegate.h"
</span><del>-#import "TestWKWebViewMac.h"
</del><ins>+#import "TestWKWebView.h"
</ins><span class="cx"> #import <WebKit/WKBackForwardListItemPrivate.h>
</span><span class="cx"> #import <WebKit/WKPage.h>
</span><span class="cx"> #import <WebKit/WKPagePrivate.h>
</span></span></pre></div>
<a id="branchessafari603branchToolsTestWebKitAPITestsWebKit2CocoaVideoControlsManagermm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx">
</span><span class="cx"> #import "PlatformUtilities.h"
</span><del>-#import "TestWKWebViewMac.h"
</del><ins>+#import "TestWKWebView.h"
</ins><span class="cx">
</span><span class="cx"> #import <WebKit/WKWebViewConfigurationPrivate.h>
</span><span class="cx"> #import <WebKit/WKWebViewPrivate.h>
</span></span></pre></div>
<a id="branchessafari603branchToolsTestWebKitAPITestsWebKit2CocoaWKWebViewCandidateTestsmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewCandidateTests.mm (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewCandidateTests.mm        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewCandidateTests.mm        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> #if WK_API_ENABLED && PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101201
</span><span class="cx">
</span><span class="cx"> #import "PlatformUtilities.h"
</span><del>-#import "TestWKWebViewMac.h"
</del><ins>+#import "TestWKWebView.h"
</ins><span class="cx">
</span><span class="cx"> #import <Carbon/Carbon.h>
</span><span class="cx"> #import <WebKit/WebKitPrivate.h>
</span></span></pre></div>
<a id="branchessafari603branchToolsTestWebKitAPIcocoaTestWKWebViewhfromrev211102branchessafari603branchToolsTestWebKitAPImacTestWKWebViewMach"></a>
<div class="copfile"><h4>Copied: branches/safari-603-branch/Tools/TestWebKitAPI/cocoa/TestWKWebView.h (from rev 211102, branches/safari-603-branch/Tools/TestWebKitAPI/mac/TestWKWebViewMac.h) (0 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/TestWebKitAPI/cocoa/TestWKWebView.h         (rev 0)
+++ branches/safari-603-branch/Tools/TestWebKitAPI/cocoa/TestWKWebView.h        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <WebKit/WebKit.h>
+
+#if WK_API_ENABLED
+
+@interface TestMessageHandler : NSObject <WKScriptMessageHandler>
+- (void)addMessage:(NSString *)message withHandler:(dispatch_block_t)handler;
+@end
+
+@interface TestWKWebView : WKWebView
+- (void)performAfterReceivingMessage:(NSString *)message action:(dispatch_block_t)action;
+- (void)loadTestPageNamed:(NSString *)pageName;
+- (void)synchronouslyLoadTestPageNamed:(NSString *)pageName;
+- (NSString *)stringByEvaluatingJavaScript:(NSString *)script;
+- (void)waitForMessage:(NSString *)message;
+- (void)performAfterLoading:(dispatch_block_t)actions;
+@end
+
+#if PLATFORM(MAC)
+@interface TestWKWebView (MacOnly)
+// Simulates clicking with a pressure-sensitive device, if possible.
+- (void)mouseDownAtPoint:(NSPoint)point simulatePressure:(BOOL)simulatePressure;
+- (void)typeCharacter:(char)character;
+@end
+#endif
+
+#endif // WK_API_ENABLED
+
</ins></span></pre></div>
<a id="branchessafari603branchToolsTestWebKitAPIcocoaTestWKWebViewmmfromrev211102branchessafari603branchToolsTestWebKitAPImacTestWKWebViewMacmm"></a>
<div class="copfile"><h4>Copied: branches/safari-603-branch/Tools/TestWebKitAPI/cocoa/TestWKWebView.mm (from rev 211102, branches/safari-603-branch/Tools/TestWebKitAPI/mac/TestWKWebViewMac.mm) (0 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/TestWebKitAPI/cocoa/TestWKWebView.mm         (rev 0)
+++ branches/safari-603-branch/Tools/TestWebKitAPI/cocoa/TestWKWebView.mm        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -0,0 +1,263 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "TestWKWebView.h"
+
+#if WK_API_ENABLED
+
+#import "TestNavigationDelegate.h"
+#import "Utilities.h"
+
+#import <WebKit/WebKitPrivate.h>
+#import <objc/runtime.h>
+#import <wtf/RetainPtr.h>
+
+#if PLATFORM(MAC)
+#import <AppKit/AppKit.h>
+#import <Carbon/Carbon.h>
+#import <wtf/mac/AppKitCompatibilityDeclarations.h>
+#endif
+
+#if PLATFORM(IOS)
+#import <WebCore/SoftLinking.h>
+SOFT_LINK_FRAMEWORK(UIKit)
+SOFT_LINK_CLASS(UIKit, UIWindow)
+#endif
+
+@implementation TestMessageHandler {
+ NSMutableDictionary<NSString *, dispatch_block_t> *_messageHandlers;
+}
+
+- (void)addMessage:(NSString *)message withHandler:(dispatch_block_t)handler
+{
+ if (!_messageHandlers)
+ _messageHandlers = [NSMutableDictionary dictionary];
+
+ _messageHandlers[message] = [handler copy];
+}
+
+- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message
+{
+ dispatch_block_t handler = _messageHandlers[message.body];
+ if (handler)
+ handler();
+}
+
+@end
+
+#if PLATFORM(MAC)
+@interface TestWKWebViewHostWindow : NSWindow
+#else
+@interface TestWKWebViewHostWindow : UIWindow
+#endif // PLATFORM(MAC)
+@end
+
+@implementation TestWKWebViewHostWindow {
+ BOOL _forceKeyWindow;
+}
+
+#if PLATFORM(MAC)
+static int gEventNumber = 1;
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101003
+NSEventMask __simulated_forceClickAssociatedEventsMask(id self, SEL _cmd)
+{
+ return NSEventMaskPressure | NSEventMaskLeftMouseDown | NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged;
+}
+#endif
+
+- (void)_mouseDownAtPoint:(NSPoint)point simulatePressure:(BOOL)simulatePressure
+{
+ NSEventType mouseEventType = NSEventTypeLeftMouseDown;
+
+ NSEventMask modifierFlags = 0;
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101003
+ if (simulatePressure)
+ modifierFlags |= NSEventMaskPressure;
+#else
+ simulatePressure = NO;
+#endif
+
+ NSEvent *event = [NSEvent mouseEventWithType:mouseEventType location:point modifierFlags:modifierFlags timestamp:GetCurrentEventTime() windowNumber:self.windowNumber context:[NSGraphicsContext currentContext] eventNumber:++gEventNumber clickCount:1 pressure:simulatePressure];
+ if (!simulatePressure) {
+ [self sendEvent:event];
+ return;
+ }
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101003
+ IMP simulatedAssociatedEventsMaskImpl = (IMP)__simulated_forceClickAssociatedEventsMask;
+ Method associatedEventsMaskMethod = class_getInstanceMethod([NSEvent class], @selector(associatedEventsMask));
+ IMP originalAssociatedEventsMaskImpl = method_setImplementation(associatedEventsMaskMethod, simulatedAssociatedEventsMaskImpl);
+ @try {
+ [self sendEvent:event];
+ } @finally {
+ // In the case where event sending raises an exception, we still want to restore the original implementation
+ // to prevent subsequent event sending tests from being affected.
+ method_setImplementation(associatedEventsMaskMethod, originalAssociatedEventsMaskImpl);
+ }
+#endif
+}
+#endif // PLATFORM(MAC)
+
+- (BOOL)isKeyWindow
+{
+ return _forceKeyWindow || [super isKeyWindow];
+}
+
+- (void)makeKeyWindow
+{
+ if (_forceKeyWindow)
+ return;
+
+ _forceKeyWindow = YES;
+#if PLATFORM(MAC)
+ [[NSNotificationCenter defaultCenter] postNotificationName:NSWindowDidBecomeKeyNotification object:self];
+#else
+ [[NSNotificationCenter defaultCenter] postNotificationName:UIWindowDidBecomeKeyNotification object:self];
+#endif
+}
+
+- (void)resignKeyWindow
+{
+ _forceKeyWindow = NO;
+ [super resignKeyWindow];
+}
+
+@end
+
+@implementation TestWKWebView {
+ TestWKWebViewHostWindow *_hostWindow;
+ RetainPtr<TestMessageHandler> _testHandler;
+}
+
+- (instancetype)initWithFrame:(CGRect)frame
+{
+ WKWebViewConfiguration *defaultConfiguration = [[WKWebViewConfiguration alloc] init];
+ return [self initWithFrame:frame configuration:defaultConfiguration];
+}
+
+- (instancetype)initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration *)configuration
+{
+ if (self = [super initWithFrame:frame configuration:configuration])
+ [self _setUpTestWindow:frame];
+
+ return self;
+}
+
+- (void)_setUpTestWindow:(NSRect)frame
+{
+#if PLATFORM(MAC)
+ _hostWindow = [[TestWKWebViewHostWindow alloc] initWithContentRect:frame styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
+ [_hostWindow setFrameOrigin:NSMakePoint(0, 0)];
+ [_hostWindow setIsVisible:YES];
+ [[_hostWindow contentView] addSubview:self];
+ [_hostWindow makeKeyAndOrderFront:self];
+#else
+ _hostWindow = [[TestWKWebViewHostWindow alloc] initWithFrame:frame];
+ _hostWindow.hidden = NO;
+ [_hostWindow addSubview:self];
+#endif
+}
+
+- (void)performAfterReceivingMessage:(NSString *)message action:(dispatch_block_t)action
+{
+ if (!_testHandler) {
+ _testHandler = adoptNS([[TestMessageHandler alloc] init]);
+ [[[self configuration] userContentController] addScriptMessageHandler:_testHandler.get() name:@"testHandler"];
+ }
+
+ [_testHandler addMessage:message withHandler:action];
+}
+
+- (void)loadTestPageNamed:(NSString *)pageName
+{
+ NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:pageName withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];
+ [self loadRequest:request];
+}
+
+- (void)synchronouslyLoadTestPageNamed:(NSString *)pageName
+{
+ [self loadTestPageNamed:pageName];
+ [self _test_waitForDidFinishNavigation];
+}
+
+- (NSString *)stringByEvaluatingJavaScript:(NSString *)script
+{
+ __block bool isWaitingForJavaScript = false;
+ __block NSString *evalResult = nil;
+ [self evaluateJavaScript:script completionHandler:^(id result, NSError *error)
+ {
+ evalResult = [NSString stringWithFormat:@"%@", result];
+ isWaitingForJavaScript = true;
+ EXPECT_TRUE(!error);
+ }];
+
+ TestWebKitAPI::Util::run(&isWaitingForJavaScript);
+ return evalResult;
+}
+
+- (void)waitForMessage:(NSString *)message
+{
+ __block bool isDoneWaiting = false;
+ [self performAfterReceivingMessage:message action:^()
+ {
+ isDoneWaiting = true;
+ }];
+ TestWebKitAPI::Util::run(&isDoneWaiting);
+}
+
+- (void)performAfterLoading:(dispatch_block_t)actions {
+ TestMessageHandler *handler = [[TestMessageHandler alloc] init];
+ [handler addMessage:@"loaded" withHandler:actions];
+
+ NSString *onloadScript = @"window.onload = () => window.webkit.messageHandlers.onloadHandler.postMessage('loaded')";
+ WKUserScript *script = [[WKUserScript alloc] initWithSource:onloadScript injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:NO];
+
+ WKUserContentController* contentController = [[self configuration] userContentController];
+ [contentController addUserScript:script];
+ [contentController addScriptMessageHandler:handler name:@"onloadHandler"];
+}
+
+@end
+
+#if PLATFORM(MAC)
+@implementation TestWKWebView (MacOnly)
+- (void)mouseDownAtPoint:(NSPoint)point simulatePressure:(BOOL)simulatePressure
+{
+ [_hostWindow _mouseDownAtPoint:point simulatePressure:simulatePressure];
+}
+
+- (void)typeCharacter:(char)character {
+ NSString *characterAsString = [NSString stringWithFormat:@"%c" , character];
+ NSEventType keyDownEventType = NSEventTypeKeyDown;
+ NSEventType keyUpEventType = NSEventTypeKeyUp;
+ [self keyDown:[NSEvent keyEventWithType:keyDownEventType location:NSZeroPoint modifierFlags:0 timestamp:GetCurrentEventTime() windowNumber:_hostWindow.windowNumber context:nil characters:characterAsString charactersIgnoringModifiers:characterAsString isARepeat:NO keyCode:character]];
+ [self keyUp:[NSEvent keyEventWithType:keyUpEventType location:NSZeroPoint modifierFlags:0 timestamp:GetCurrentEventTime() windowNumber:_hostWindow.windowNumber context:nil characters:characterAsString charactersIgnoringModifiers:characterAsString isARepeat:NO keyCode:character]];
+}
+@end
+#endif
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="branchessafari603branchToolsTestWebKitAPImacTestWKWebViewMach"></a>
<div class="delfile"><h4>Deleted: branches/safari-603-branch/Tools/TestWebKitAPI/mac/TestWKWebViewMac.h (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/TestWebKitAPI/mac/TestWKWebViewMac.h        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Tools/TestWebKitAPI/mac/TestWKWebViewMac.h        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -1,51 +0,0 @@
</span><del>-/*
- * Copyright (C) 2016 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.
- */
-
-#ifndef TestWKWebViewMac_h
-#define TestWKWebViewMac_h
-
-#import <WebKit/WebKit.h>
-
-#if WK_API_ENABLED && PLATFORM(MAC)
-
-@interface TestMessageHandler : NSObject <WKScriptMessageHandler>
-- (void)addMessage:(NSString *)message withHandler:(dispatch_block_t)handler;
-@end
-
-@interface TestWKWebView : WKWebView
-// Simulates clicking with a pressure-sensitive device, if possible.
-- (void)mouseDownAtPoint:(NSPoint)point simulatePressure:(BOOL)simulatePressure;
-- (void)performAfterReceivingMessage:(NSString *)message action:(dispatch_block_t)action;
-- (void)loadTestPageNamed:(NSString *)pageName;
-- (void)synchronouslyLoadTestPageNamed:(NSString *)pageName;
-- (void)typeCharacter:(char)character;
-- (NSString *)stringByEvaluatingJavaScript:(NSString *)script;
-- (void)waitForMessage:(NSString *)message;
-- (void)performAfterLoading:(dispatch_block_t)actions;
-@end
-
-#endif /* WK_API_ENABLED && PLATFORM(MAC) */
-
-#endif /* TestWKWebViewMac_h */
</del></span></pre></div>
<a id="branchessafari603branchToolsTestWebKitAPImacTestWKWebViewMacmm"></a>
<div class="delfile"><h4>Deleted: branches/safari-603-branch/Tools/TestWebKitAPI/mac/TestWKWebViewMac.mm (211102 => 211103)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/TestWebKitAPI/mac/TestWKWebViewMac.mm        2017-01-24 21:22:42 UTC (rev 211102)
+++ branches/safari-603-branch/Tools/TestWebKitAPI/mac/TestWKWebViewMac.mm        2017-01-24 21:22:50 UTC (rev 211103)
</span><span class="lines">@@ -1,234 +0,0 @@
</span><del>-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "TestWKWebViewMac.h"
-
-#if WK_API_ENABLED && PLATFORM(MAC)
-
-#import "TestNavigationDelegate.h"
-#import "Utilities.h"
-
-#import <AppKit/AppKit.h>
-#import <Carbon/Carbon.h>
-#import <WebKit/WebKitPrivate.h>
-#import <objc/runtime.h>
-#import <wtf/RetainPtr.h>
-#import <wtf/mac/AppKitCompatibilityDeclarations.h>
-
-@implementation TestMessageHandler {
- NSMutableDictionary<NSString *, dispatch_block_t> *_messageHandlers;
-}
-
-- (void)addMessage:(NSString *)message withHandler:(dispatch_block_t)handler
-{
- if (!_messageHandlers)
- _messageHandlers = [NSMutableDictionary dictionary];
-
- _messageHandlers[message] = [handler copy];
-}
-
-- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message
-{
- dispatch_block_t handler = _messageHandlers[message.body];
- if (handler)
- handler();
-}
-
-@end
-
-@interface TestWKWebViewHostWindow : NSWindow
-@end
-
-@implementation TestWKWebViewHostWindow {
- BOOL _forceKeyWindow;
-}
-
-static int gEventNumber = 1;
-
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101003
-NSEventMask __simulated_forceClickAssociatedEventsMask(id self, SEL _cmd)
-{
- return NSEventMaskPressure | NSEventMaskLeftMouseDown | NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged;
-}
-#endif
-
-- (void)_mouseDownAtPoint:(NSPoint)point simulatePressure:(BOOL)simulatePressure
-{
- NSEventType mouseEventType = NSEventTypeLeftMouseDown;
-
- NSEventMask modifierFlags = 0;
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101003
- if (simulatePressure)
- modifierFlags |= NSEventMaskPressure;
-#else
- simulatePressure = NO;
-#endif
-
- NSEvent *event = [NSEvent mouseEventWithType:mouseEventType location:point modifierFlags:modifierFlags timestamp:GetCurrentEventTime() windowNumber:self.windowNumber context:[NSGraphicsContext currentContext] eventNumber:++gEventNumber clickCount:1 pressure:simulatePressure];
- if (!simulatePressure) {
- [self sendEvent:event];
- return;
- }
-
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101003
- IMP simulatedAssociatedEventsMaskImpl = (IMP)__simulated_forceClickAssociatedEventsMask;
- Method associatedEventsMaskMethod = class_getInstanceMethod([NSEvent class], @selector(associatedEventsMask));
- IMP originalAssociatedEventsMaskImpl = method_setImplementation(associatedEventsMaskMethod, simulatedAssociatedEventsMaskImpl);
- @try {
- [self sendEvent:event];
- } @finally {
- // In the case where event sending raises an exception, we still want to restore the original implementation
- // to prevent subsequent event sending tests from being affected.
- method_setImplementation(associatedEventsMaskMethod, originalAssociatedEventsMaskImpl);
- }
-#endif
-}
-
-- (BOOL)isKeyWindow
-{
- return _forceKeyWindow || [super isKeyWindow];
-}
-
-- (void)makeKeyWindow
-{
- if (_forceKeyWindow)
- return;
-
- _forceKeyWindow = YES;
- [[NSNotificationCenter defaultCenter] postNotificationName:NSWindowDidBecomeKeyNotification object:self];
-}
-
-- (void)resignKeyWindow
-{
- _forceKeyWindow = NO;
- [super resignKeyWindow];
-}
-
-@end
-
-@implementation TestWKWebView {
- TestWKWebViewHostWindow *_hostWindow;
- RetainPtr<TestMessageHandler> _testHandler;
-}
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
- WKWebViewConfiguration *defaultConfiguration = [[WKWebViewConfiguration alloc] init];
- return [self initWithFrame:frame configuration:defaultConfiguration];
-}
-
-- (instancetype)initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration *)configuration
-{
- if (self = [super initWithFrame:frame configuration:configuration])
- [self _setUpTestWindow:frame];
-
- return self;
-}
-
-- (void)_setUpTestWindow:(NSRect)frame
-{
- _hostWindow = [[TestWKWebViewHostWindow alloc] initWithContentRect:frame styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
- [_hostWindow setFrameOrigin:NSMakePoint(0, 0)];
- [[_hostWindow contentView] addSubview:self];
- [_hostWindow setIsVisible:YES];
- [_hostWindow makeKeyAndOrderFront:self];
-}
-
-- (void)mouseDownAtPoint:(NSPoint)point simulatePressure:(BOOL)simulatePressure
-{
- [_hostWindow _mouseDownAtPoint:point simulatePressure:simulatePressure];
-}
-
-- (void)performAfterReceivingMessage:(NSString *)message action:(dispatch_block_t)action
-{
- if (!_testHandler) {
- _testHandler = adoptNS([[TestMessageHandler alloc] init]);
- [[[self configuration] userContentController] addScriptMessageHandler:_testHandler.get() name:@"testHandler"];
- }
-
- [_testHandler addMessage:message withHandler:action];
-}
-
-- (void)loadTestPageNamed:(NSString *)pageName
-{
- NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:pageName withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];
- [self loadRequest:request];
-}
-
-- (void)synchronouslyLoadTestPageNamed:(NSString *)pageName
-{
- [self loadTestPageNamed:pageName];
- [self _test_waitForDidFinishNavigation];
-}
-
-- (void)typeCharacter:(char)character {
- NSString *characterAsString = [NSString stringWithFormat:@"%c" , character];
- NSEventType keyDownEventType = NSEventTypeKeyDown;
- NSEventType keyUpEventType = NSEventTypeKeyUp;
- [self keyDown:[NSEvent keyEventWithType:keyDownEventType location:NSZeroPoint modifierFlags:0 timestamp:GetCurrentEventTime() windowNumber:_hostWindow.windowNumber context:nil characters:characterAsString charactersIgnoringModifiers:characterAsString isARepeat:NO keyCode:character]];
- [self keyUp:[NSEvent keyEventWithType:keyUpEventType location:NSZeroPoint modifierFlags:0 timestamp:GetCurrentEventTime() windowNumber:_hostWindow.windowNumber context:nil characters:characterAsString charactersIgnoringModifiers:characterAsString isARepeat:NO keyCode:character]];
-}
-
-- (NSString *)stringByEvaluatingJavaScript:(NSString *)script
-{
- __block bool isWaitingForJavaScript = false;
- __block NSString *evalResult = nil;
- [self evaluateJavaScript:script completionHandler:^(id result, NSError *error)
- {
- evalResult = [NSString stringWithFormat:@"%@", result];
- isWaitingForJavaScript = true;
- EXPECT_TRUE(!error);
- }];
-
- TestWebKitAPI::Util::run(&isWaitingForJavaScript);
- return evalResult;
-}
-
-- (void)waitForMessage:(NSString *)message
-{
- __block bool isDoneWaiting = false;
- [self performAfterReceivingMessage:message action:^()
- {
- isDoneWaiting = true;
- }];
- TestWebKitAPI::Util::run(&isDoneWaiting);
-}
-
-- (void)performAfterLoading:(dispatch_block_t)actions {
- TestMessageHandler *handler = [[TestMessageHandler alloc] init];
- [handler addMessage:@"loaded" withHandler:actions];
-
- NSString *onloadScript = @"window.onload = () => window.webkit.messageHandlers.onloadHandler.postMessage('loaded')";
- WKUserScript *script = [[WKUserScript alloc] initWithSource:onloadScript injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:NO];
-
- WKUserContentController* contentController = [[self configuration] userContentController];
- [contentController addUserScript:script];
- [contentController addScriptMessageHandler:handler name:@"onloadHandler"];
-}
-
-@end
-
-#endif /* WK_API_ENABLED && PLATFORM(MAC) */
</del></span></pre>
</div>
</div>
</body>
</html>