<!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>[202274] trunk/Source</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>Inlined some picture-in-picture code.
https://bugs.webkit.org/show_bug.cgi?id=158977

Reviewed by Eric Carlsson.

This code was written primarily by Ada Chan, and originally reviewed by Alex Christensen,
Anders Carlsson, Conrad Shultz, Dan Bernstein, Eric Carlson, Jer Noble, Jeremy Jones,
Jon Lee, Remy Demarest, and Zach Li.

Source/WebCore:

* English.lproj/Localizable.strings:
  Updated using update-webkit-localizable-strings.

* Modules/mediacontrols/mediaControlsApple.css:
(video:-webkit-full-screen::-webkit-media-controls-panel .picture-in-picture-button):

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.configureFullScreenControls):

* WebCore.xcodeproj/project.pbxproj: Added PIPSPI.h.

* html/HTMLMediaElement.cpp: Inlined code from HTMLMediaElementAdditions.cpp.

* html/HTMLVideoElement.cpp: Inlined code from HTMLVideoElementSupportsFullscreenAdditions.cpp.

* platform/LocalizedStrings.cpp:
(WebCore::contextMenuItemTagEnterVideoEnhancedFullscreen): Brought in from ContextMenuLocalizedStringsAdditions.cpp.
(WebCore::contextMenuItemTagExitVideoEnhancedFullscreen): Ditto.
(WebCore::AXARIAContentGroupText): Made updates that should have been part of <a href="http://trac.webkit.org/projects/webkit/changeset/198543">r198543</a>.

* platform/mac/WebVideoFullscreenInterfaceMac.h: Removed USE(APPLE_INTERNAL_SDK) guards.
* platform/mac/WebVideoFullscreenInterfaceMac.mm: Inlined WebVideoFullscreenInterfaceMacAdditions.mm.

* platform/spi/mac/PIPSPI.h: Added.

* rendering/HitTestResult.cpp: Inlined HitTestResultAdditions.cpp.

* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsStyleSheet): Removed include of
  RenderThemeMacMediaControlsStyleSheetAdditions.mm now that the content is in
  mediaControlsApple.css.
(WebCore::RenderThemeMac::mediaControlsScript): Removed include of
  RenderThemeMacMediaControlsScriptAdditions.mm now that the content is in mediaControlsApple.js.

Source/WebKit2:

* Shared/WebPreferencesStoreDefaultsAdditions.cpp:
  Define and use DEFAULT_ALLOWS_PICTURE_IN_PICTURE_MEDIA_PLAYBACK.

* Shared/WebPreferencesStore.cpp:
(WebKit::defaults): Removed include of WebPreferencesStoreDefaultsAdditions.cpp now that the
  default is defined correctly in WebPreferencesStoreDefaultsAdditions.cpp.

* UIProcess/API/C/WKPreferences.cpp: Inlined WKPreferencesAdditions.cpp.
* UIProcess/API/C/WKPreferencesRefPrivate.h: Ditto.

* WebProcess/cocoa/WebVideoFullscreenManager.mm: Inlined WebVideoFullscreenManagerSupportsVideoFullscreenMac.mm.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreEnglishlprojLocalizablestrings">trunk/Source/WebCore/English.lproj/Localizable.strings</a></li>
<li><a href="#trunkSourceWebCoreModulesmediacontrolsmediaControlsApplecss">trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.css</a></li>
<li><a href="#trunkSourceWebCoreModulesmediacontrolsmediaControlsApplejs">trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLVideoElementcpp">trunk/Source/WebCore/html/HTMLVideoElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformLocalizedStringscpp">trunk/Source/WebCore/platform/LocalizedStrings.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmacWebVideoFullscreenInterfaceMach">trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacWebVideoFullscreenInterfaceMacmm">trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingHitTestResultcpp">trunk/Source/WebCore/rendering/HitTestResult.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeMacmm">trunk/Source/WebCore/rendering/RenderThemeMac.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebPreferencesDefinitionsh">trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h</a></li>
<li><a href="#trunkSourceWebKit2SharedWebPreferencesStorecpp">trunk/Source/WebKit2/Shared/WebPreferencesStore.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPreferencescpp">trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPreferencesRefPrivateh">trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcesscocoaWebVideoFullscreenManagermm">trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformspimacPIPSPIh">trunk/Source/WebCore/platform/spi/mac/PIPSPI.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (202273 => 202274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-06-21 11:04:53 UTC (rev 202273)
+++ trunk/Source/WebCore/ChangeLog        2016-06-21 13:15:40 UTC (rev 202274)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2016-06-21  Dan Bernstein  &lt;mitz@apple.com&gt;
+
+        Inlined some picture-in-picture code.
+        https://bugs.webkit.org/show_bug.cgi?id=158977
+
+        Reviewed by Eric Carlsson.
+
+        This code was written primarily by Ada Chan, and originally reviewed by Alex Christensen,
+        Anders Carlsson, Conrad Shultz, Dan Bernstein, Eric Carlson, Jer Noble, Jeremy Jones,
+        Jon Lee, Remy Demarest, and Zach Li.
+
+        * English.lproj/Localizable.strings:
+          Updated using update-webkit-localizable-strings.
+
+        * Modules/mediacontrols/mediaControlsApple.css:
+        (video:-webkit-full-screen::-webkit-media-controls-panel .picture-in-picture-button):
+
+        * Modules/mediacontrols/mediaControlsApple.js:
+        (Controller.prototype.configureFullScreenControls):
+
+        * WebCore.xcodeproj/project.pbxproj: Added PIPSPI.h.
+
+        * html/HTMLMediaElement.cpp: Inlined code from HTMLMediaElementAdditions.cpp.
+
+        * html/HTMLVideoElement.cpp: Inlined code from HTMLVideoElementSupportsFullscreenAdditions.cpp.
+
+        * platform/LocalizedStrings.cpp:
+        (WebCore::contextMenuItemTagEnterVideoEnhancedFullscreen): Brought in from ContextMenuLocalizedStringsAdditions.cpp.
+        (WebCore::contextMenuItemTagExitVideoEnhancedFullscreen): Ditto.
+        (WebCore::AXARIAContentGroupText): Made updates that should have been part of r198543.
+
+        * platform/mac/WebVideoFullscreenInterfaceMac.h: Removed USE(APPLE_INTERNAL_SDK) guards.
+        * platform/mac/WebVideoFullscreenInterfaceMac.mm: Inlined WebVideoFullscreenInterfaceMacAdditions.mm.
+
+        * platform/spi/mac/PIPSPI.h: Added.
+
+        * rendering/HitTestResult.cpp: Inlined HitTestResultAdditions.cpp.
+
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::mediaControlsStyleSheet): Removed include of
+          RenderThemeMacMediaControlsStyleSheetAdditions.mm now that the content is in
+          mediaControlsApple.css.
+        (WebCore::RenderThemeMac::mediaControlsScript): Removed include of
+          RenderThemeMacMediaControlsScriptAdditions.mm now that the content is in mediaControlsApple.js.
+
</ins><span class="cx"> 2016-06-21  Miguel Gomez  &lt;magomez@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GStreamer] video orientation support
</span></span></pre></div>
<a id="trunkSourceWebCoreEnglishlprojLocalizablestrings"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/English.lproj/Localizable.strings (202273 => 202274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/English.lproj/Localizable.strings        2016-06-21 11:04:53 UTC (rev 202273)
+++ trunk/Source/WebCore/English.lproj/Localizable.strings        2016-06-21 13:15:40 UTC (rev 202274)
</span><span class="lines">@@ -238,9 +238,15 @@
</span><span class="cx"> /* Video Enter Fullscreen context menu item */
</span><span class="cx"> &quot;Enter Full Screen&quot; = &quot;Enter Full Screen&quot;;
</span><span class="cx"> 
</span><ins>+/* menu item */
+&quot;Enter Picture-in-Picture&quot; = &quot;Enter Picture-in-Picture&quot;;
+
</ins><span class="cx"> /* Video Exit Fullscreen context menu item */
</span><span class="cx"> &quot;Exit Full Screen&quot; = &quot;Exit Full Screen&quot;;
</span><span class="cx"> 
</span><ins>+/* menu item */
+&quot;Exit Picture-in-Picture&quot; = &quot;Exit Picture-in-Picture&quot;;
+
</ins><span class="cx"> /* Default application name for Open With context menu */
</span><span class="cx"> &quot;Finder&quot; = &quot;Finder&quot;;
</span><span class="cx"> 
</span><span class="lines">@@ -712,12 +718,6 @@
</span><span class="cx"> /* An ARIA accessibility group that acts as an alert. */
</span><span class="cx"> &quot;alert&quot; = &quot;alert&quot;;
</span><span class="cx"> 
</span><del>-/* An ARIA accessibility group that acts as an alert dialog. */
-&quot;alert dialog&quot; = &quot;web alert dialog&quot;;
-
-/* An ARIA accessibility group that acts as an application. */
-&quot;web application&quot; = &quot;web application&quot;;
-
</del><span class="cx"> /* An ARIA accessibility group that acts as a status update. */
</span><span class="cx"> &quot;application status&quot; = &quot;application status&quot;;
</span><span class="cx"> 
</span><span class="lines">@@ -790,9 +790,6 @@
</span><span class="cx"> /* accessibility role description of a description list */
</span><span class="cx"> &quot;description list&quot; = &quot;description list&quot;;
</span><span class="cx"> 
</span><del>-/* An ARIA accessibility group that acts as an dialog. */
-&quot;dialog&quot; = &quot;web dialog&quot;;
-
</del><span class="cx"> /* An ARIA accessibility group that acts as a document. */
</span><span class="cx"> &quot;document&quot; = &quot;document&quot;;
</span><span class="cx"> 
</span><span class="lines">@@ -1111,3 +1108,12 @@
</span><span class="cx"> /* accessibility label for video element controller */
</span><span class="cx"> &quot;video playback&quot; = &quot;video playback&quot;;
</span><span class="cx"> 
</span><ins>+/* An ARIA accessibility group that acts as an alert dialog. */
+&quot;web alert dialog&quot; = &quot;web alert dialog&quot;;
+
+/* An ARIA accessibility group that acts as an application. */
+&quot;web application&quot; = &quot;web application&quot;;
+
+/* An ARIA accessibility group that acts as an dialog. */
+&quot;web dialog&quot; = &quot;web dialog&quot;;
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesmediacontrolsmediaControlsApplecss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.css (202273 => 202274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.css        2016-06-21 11:04:53 UTC (rev 202273)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.css        2016-06-21 13:15:40 UTC (rev 202274)
</span><span class="lines">@@ -1136,3 +1136,9 @@
</span><span class="cx">     opacity: 0;
</span><span class="cx">     pointer-events: none;
</span><span class="cx"> }
</span><ins>+
+video:-webkit-full-screen::-webkit-media-controls-panel .picture-in-picture-button {
+    margin-top: 7px;
+    margin-right: 24px;
+    margin-left: 0px;
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesmediacontrolsmediaControlsApplejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js (202273 => 202274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js        2016-06-21 11:04:53 UTC (rev 202273)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js        2016-06-21 13:15:40 UTC (rev 202274)
</span><span class="lines">@@ -624,8 +624,10 @@
</span><span class="cx">         this.controls.panel.appendChild(this.controls.seekForwardButton);
</span><span class="cx">         this.controls.panel.appendChild(this.controls.wirelessTargetPicker);
</span><span class="cx">         this.controls.panel.appendChild(this.controls.captionButton);
</span><del>-        if (!this.isAudio())
</del><ins>+        if (!this.isAudio()) {
+            this.updatePictureInPictureButton();
</ins><span class="cx">             this.controls.panel.appendChild(this.controls.fullscreenButton);
</span><ins>+        }
</ins><span class="cx">         if (!this.isLive) {
</span><span class="cx">             this.controls.panel.appendChild(this.controls.timelineBox);
</span><span class="cx">             this.controls.timelineBox.appendChild(this.controls.currentTime);
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (202273 => 202274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-06-21 11:04:53 UTC (rev 202273)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-06-21 13:15:40 UTC (rev 202274)
</span><span class="lines">@@ -1452,6 +1452,7 @@
</span><span class="cx">                 379E61CB126CA5C400B63E8D /* BaseCheckableInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 379E61C7126CA5C300B63E8D /* BaseCheckableInputType.cpp */; };
</span><span class="cx">                 379E61CC126CA5C400B63E8D /* BaseCheckableInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = 379E61C8126CA5C300B63E8D /* BaseCheckableInputType.h */; };
</span><span class="cx">                 37ACCF690DA414E70089E602 /* FontDescription.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37ACCE620DA2AA960089E602 /* FontDescription.cpp */; };
</span><ins>+                37B327D31D17096A005737FA /* PIPSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 37B327D21D17096A005737FA /* PIPSPI.h */; };
</ins><span class="cx">                 37BAAE581980D1DD005DFE71 /* ProtectionSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 37BAAE571980D1DD005DFE71 /* ProtectionSpace.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 37C236101097EE7700EF9F72 /* ComplexTextController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37C2360E1097EE7700EF9F72 /* ComplexTextController.cpp */; };
</span><span class="cx">                 37C236111097EE7700EF9F72 /* ComplexTextController.h in Headers */ = {isa = PBXBuildFile; fileRef = 37C2360F1097EE7700EF9F72 /* ComplexTextController.h */; };
</span><span class="lines">@@ -8974,6 +8975,7 @@
</span><span class="cx">                 379E61C7126CA5C300B63E8D /* BaseCheckableInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseCheckableInputType.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 379E61C8126CA5C300B63E8D /* BaseCheckableInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseCheckableInputType.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 37ACCE620DA2AA960089E602 /* FontDescription.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontDescription.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                37B327D21D17096A005737FA /* PIPSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PIPSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 37BAAE571980D1DD005DFE71 /* ProtectionSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProtectionSpace.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 37C2360E1097EE7700EF9F72 /* ComplexTextController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ComplexTextController.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 37C2360F1097EE7700EF9F72 /* ComplexTextController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ComplexTextController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -19066,6 +19068,7 @@
</span><span class="cx">                                 2D77AC281BF2B9860072470A /* NSTextFinderSPI.h */,
</span><span class="cx">                                 2D77AC2C1BF2B9A00072470A /* NSViewSPI.h */,
</span><span class="cx">                                 2D0CF8161BCF5DE1007A4937 /* NSWindowSPI.h */,
</span><ins>+                                37B327D21D17096A005737FA /* PIPSPI.h */,
</ins><span class="cx">                                 1AA6BC4F1CF4F695003F6396 /* QTKitSPI.h */,
</span><span class="cx">                                 937F4CCB1A2D48C100BB39F5 /* QuickLookMacSPI.h */,
</span><span class="cx">                                 2D232BFF1A326EF9006BF2DB /* TUCallSPI.h */,
</span><span class="lines">@@ -25520,6 +25523,7 @@
</span><span class="cx">                                 A80E6CF20A1989CA007FB8C5 /* CSSRuleList.h in Headers */,
</span><span class="cx">                                 371F51A10D262FA000ECE0D5 /* CSSSegmentedFontFace.h in Headers */,
</span><span class="cx">                                 A80E73520A199C77007FB8C5 /* CSSSelector.h in Headers */,
</span><ins>+                                37B327D31D17096A005737FA /* PIPSPI.h in Headers */,
</ins><span class="cx">                                 E4C1789B0EE6903800824D69 /* CSSSelectorList.h in Headers */,
</span><span class="cx">                                 A80E6CE80A1989CA007FB8C5 /* CSSShadowValue.h in Headers */,
</span><span class="cx">                                 A80E6E0F0A19911C007FB8C5 /* CSSStyleDeclaration.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (202273 => 202274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-06-21 11:04:53 UTC (rev 202273)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-06-21 13:15:40 UTC (rev 202274)
</span><span class="lines">@@ -155,10 +155,6 @@
</span><span class="cx"> #include &lt;bindings/ScriptObject.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if USE(APPLE_INTERNAL_SDK)
-#include &lt;WebKitAdditions/HTMLMediaElementAdditions.cpp&gt;
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> static const double SeekRepeatDelay = 0.1;
</span><span class="lines">@@ -7101,7 +7097,6 @@
</span><span class="cx">         page-&gt;chrome().client().clearPlaybackControlsManager(*this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if !USE(APPLE_INTERNAL_SDK)
</del><span class="cx"> bool HTMLMediaElement::shouldOverrideBackgroundLoadingRestriction() const
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET)
</span><span class="lines">@@ -7109,14 +7104,17 @@
</span><span class="cx">         return true;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    return false;
</del><ins>+    return m_videoFullscreenMode == VideoFullscreenModePictureInPicture;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLMediaElement::fullscreenModeChanged(VideoFullscreenMode mode)
</span><span class="cx"> {
</span><ins>+    if (m_videoFullscreenMode == mode)
+        return;
+
</ins><span class="cx">     m_videoFullscreenMode = mode;
</span><ins>+    m_mediaSession-&gt;scheduleClientDataBufferingCheck();
</ins><span class="cx"> }
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLVideoElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLVideoElement.cpp (202273 => 202274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLVideoElement.cpp        2016-06-21 11:04:53 UTC (rev 202273)
+++ trunk/Source/WebCore/html/HTMLVideoElement.cpp        2016-06-21 13:15:40 UTC (rev 202274)
</span><span class="lines">@@ -149,9 +149,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool HTMLVideoElement::supportsFullscreen(HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode) const
</span><span class="cx"> {
</span><del>-#if USE(APPLE_INTERNAL_SDK)
-#include &lt;WebKitAdditions/HTMLVideoElementSupportsFullscreenAdditions.cpp&gt;
-#endif
</del><ins>+    if (videoFullscreenMode == HTMLMediaElementEnums::VideoFullscreenModePictureInPicture &amp;&amp; !mediaSession().allowsPictureInPicture(*this))
+        return false;
</ins><span class="cx"> 
</span><span class="cx">     Page* page = document().page();
</span><span class="cx">     if (!page) 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformLocalizedStringscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/LocalizedStrings.cpp (202273 => 202274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/LocalizedStrings.cpp        2016-06-21 11:04:53 UTC (rev 202273)
+++ trunk/Source/WebCore/platform/LocalizedStrings.cpp        2016-06-21 13:15:40 UTC (rev 202274)
</span><span class="lines">@@ -509,19 +509,15 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC) &amp;&amp; ENABLE(VIDEO_PRESENTATION_MODE)
</span><span class="cx"> 
</span><del>-#if USE(APPLE_INTERNAL_SDK)
-#include &lt;WebKitAdditions/ContextMenuLocalizedStringsAdditions.cpp&gt;
-#else
</del><span class="cx"> String contextMenuItemTagEnterVideoEnhancedFullscreen()
</span><span class="cx"> {
</span><del>-    return { };
</del><ins>+    return WEB_UI_STRING(&quot;Enter Picture-in-Picture&quot;, &quot;menu item&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String contextMenuItemTagExitVideoEnhancedFullscreen()
</span><span class="cx"> {
</span><del>-    return { };
</del><ins>+    return WEB_UI_STRING(&quot;Exit Picture-in-Picture&quot;, &quot;menu item&quot;);
</ins><span class="cx"> }
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -693,9 +689,9 @@
</span><span class="cx">     if (ariaType == &quot;ARIAApplicationAlert&quot;)
</span><span class="cx">         return WEB_UI_STRING(&quot;alert&quot;, &quot;An ARIA accessibility group that acts as an alert.&quot;);
</span><span class="cx">     if (ariaType == &quot;ARIAApplicationAlertDialog&quot;)
</span><del>-        return WEB_UI_STRING(&quot;alert dialog&quot;, &quot;An ARIA accessibility group that acts as an alert dialog.&quot;);
</del><ins>+        return WEB_UI_STRING(&quot;web alert dialog&quot;, &quot;An ARIA accessibility group that acts as an alert dialog.&quot;);
</ins><span class="cx">     if (ariaType == &quot;ARIAApplicationDialog&quot;)
</span><del>-        return WEB_UI_STRING(&quot;dialog&quot;, &quot;An ARIA accessibility group that acts as an dialog.&quot;);
</del><ins>+        return WEB_UI_STRING(&quot;web dialog&quot;, &quot;An ARIA accessibility group that acts as an dialog.&quot;);
</ins><span class="cx">     if (ariaType == &quot;ARIAApplicationLog&quot;)
</span><span class="cx">         return WEB_UI_STRING(&quot;log&quot;, &quot;An ARIA accessibility group that acts as a console log.&quot;);
</span><span class="cx">     if (ariaType == &quot;ARIAApplicationMarquee&quot;)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacWebVideoFullscreenInterfaceMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h (202273 => 202274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h        2016-06-21 11:04:53 UTC (rev 202273)
+++ trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h        2016-06-21 13:15:40 UTC (rev 202274)
</span><span class="lines">@@ -36,10 +36,7 @@
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> OBJC_CLASS NSWindow;
</span><del>-
-#if USE(APPLE_INTERNAL_SDK)
</del><span class="cx"> OBJC_CLASS WebVideoFullscreenInterfaceMacObjC;
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> class IntRect;
</span><span class="lines">@@ -100,9 +97,7 @@
</span><span class="cx"> 
</span><span class="cx">     void rateChanged(bool isPlaying, float playbackRate) override;
</span><span class="cx"> 
</span><del>-#if USE(APPLE_INTERNAL_SDK)
</del><span class="cx">     WEBCORE_EXPORT WebVideoFullscreenInterfaceMacObjC *videoFullscreenInterfaceObjC();
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     WebVideoFullscreenInterfaceMac(WebPlaybackSessionInterfaceMac&amp;);
</span><span class="lines">@@ -110,10 +105,7 @@
</span><span class="cx">     WebVideoFullscreenModel* m_videoFullscreenModel { nullptr };
</span><span class="cx">     WebVideoFullscreenChangeObserver* m_fullscreenChangeObserver { nullptr };
</span><span class="cx">     HTMLMediaElementEnums::VideoFullscreenMode m_mode { HTMLMediaElementEnums::VideoFullscreenModeNone };
</span><del>-
-#if USE(APPLE_INTERNAL_SDK)
</del><span class="cx">     RetainPtr&lt;WebVideoFullscreenInterfaceMacObjC&gt; m_webVideoFullscreenInterfaceObjC;
</span><del>-#endif
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacWebVideoFullscreenInterfaceMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm (202273 => 202274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm        2016-06-21 11:04:53 UTC (rev 202273)
+++ trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm        2016-06-21 13:15:40 UTC (rev 202274)
</span><span class="lines">@@ -30,7 +30,9 @@
</span><span class="cx"> 
</span><span class="cx"> #import &quot;AVKitSPI.h&quot;
</span><span class="cx"> #import &quot;IntRect.h&quot;
</span><ins>+#import &quot;Logging.h&quot;
</ins><span class="cx"> #import &quot;MediaTimeAVFoundation.h&quot;
</span><ins>+#import &quot;PIPSPI.h&quot;
</ins><span class="cx"> #import &quot;TimeRanges.h&quot;
</span><span class="cx"> #import &quot;WebPlaybackSessionInterfaceMac.h&quot;
</span><span class="cx"> #import &quot;WebVideoFullscreenChangeObserver.h&quot;
</span><span class="lines">@@ -42,10 +44,308 @@
</span><span class="cx"> SOFT_LINK_FRAMEWORK_OPTIONAL(AVKit)
</span><span class="cx"> SOFT_LINK_CLASS_OPTIONAL(AVKit, AVValueTiming)
</span><span class="cx"> 
</span><del>-#if USE(APPLE_INTERNAL_SDK)
-#include &lt;WebKitAdditions/WebVideoFullscreenInterfaceMacAdditions.mm&gt;
-#endif
</del><ins>+SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(PIP)
+SOFT_LINK_CLASS_OPTIONAL(PIP, PIPViewController)
</ins><span class="cx"> 
</span><ins>+using namespace WebCore;
+
+@class WebVideoViewContainer;
+
+@protocol WebVideoViewContainerDelegate &lt;NSObject&gt;
+
+- (void)boundsDidChangeForVideoViewContainer:(WebVideoViewContainer *)videoViewContainer;
+- (void)superviewDidChangeForVideoViewContainer:(WebVideoViewContainer *)videoViewContainer;
+
+@end
+
+@interface WebVideoViewContainer : NSView {
+    id &lt;WebVideoViewContainerDelegate&gt; _videoViewContainerDelegate;
+}
+
+@property (nonatomic, assign) id &lt;WebVideoViewContainerDelegate&gt; videoViewContainerDelegate;
+
+@end
+
+@implementation WebVideoViewContainer
+
+@synthesize videoViewContainerDelegate=_videoViewContainerDelegate;
+
+- (void)resizeWithOldSuperviewSize:(NSSize)oldBoundsSize
+{
+    [super resizeWithOldSuperviewSize:oldBoundsSize];
+
+    [_videoViewContainerDelegate boundsDidChangeForVideoViewContainer:self];
+}
+
+- (void)viewDidMoveToSuperview
+{
+    [super viewDidMoveToSuperview];
+
+    [_videoViewContainerDelegate superviewDidChangeForVideoViewContainer:self];
+}
+
+@end
+
+enum class PIPState {
+    NotInPIP,
+    InPIP,
+    ExitingPIP
+};
+
+@interface WebVideoFullscreenInterfaceMacObjC : NSObject &lt;PIPViewControllerDelegate, WebVideoViewContainerDelegate&gt; {
+    WebCore::WebVideoFullscreenInterfaceMac* _webVideoFullscreenInterfaceMac;
+    NSSize _videoDimensions;
+    RetainPtr&lt;PIPViewController&gt; _pipViewController;
+    RetainPtr&lt;NSViewController&gt; _videoViewContainerController;
+    RetainPtr&lt;WebVideoViewContainer&gt; _videoViewContainer;
+    PIPState _pipState;
+    RetainPtr&lt;NSWindow&gt; _returningWindow;
+    NSRect _returningRect;
+    BOOL _playing;
+    BOOL _didRequestExitingPIP;
+    BOOL _exitingToStandardFullscreen;
+}
+
+- (instancetype)initWithWebVideoFullscreenInterfaceMac:(WebCore::WebVideoFullscreenInterfaceMac*)webVideoFullscreenInterfaceMac;
+- (void)invalidateFullscreenState;
+- (void)invalidate;
+
+// Tracking video playback state
+@property (nonatomic) NSSize videoDimensions;
+@property (nonatomic, getter=isPlaying) BOOL playing;
+- (void)updateIsPlaying:(BOOL)isPlaying newPlaybackRate:(float)playbackRate;
+
+// Handling PIP transitions
+@property (nonatomic, readonly) BOOL didRequestExitingPIP;
+@property (nonatomic, getter=isExitingToStandardFullscreen) BOOL exitingToStandardFullscreen;
+
+- (void)setUpPIPForVideoView:(NSView *)videoView withFrame:(NSRect)frame inWindow:(NSWindow *)window;
+- (void)enterPIP;
+- (void)exitPIP;
+- (void)exitPIPAnimatingToRect:(NSRect)rect inWindow:(NSWindow *)window;
+
+@end
+
+@implementation WebVideoFullscreenInterfaceMacObjC
+
+@synthesize playing=_playing;
+@synthesize videoDimensions=_videoDimensions;
+@synthesize didRequestExitingPIP=_didRequestExitingPIP;
+@synthesize exitingToStandardFullscreen=_exitingToStandardFullscreen;
+
+- (instancetype)initWithWebVideoFullscreenInterfaceMac:(WebCore::WebVideoFullscreenInterfaceMac*)webVideoFullscreenInterfaceMac
+{
+    if (!(self = [super init]))
+        return nil;
+
+    _webVideoFullscreenInterfaceMac = webVideoFullscreenInterfaceMac;
+    _pipState = PIPState::NotInPIP;
+
+    return self;
+}
+
+- (void)invalidateFullscreenState
+{
+    [_pipViewController setDelegate:nil];
+    _pipViewController = nil;
+    [_videoViewContainer removeFromSuperview];
+    [_videoViewContainer setVideoViewContainerDelegate:nil];
+    _videoViewContainer = nil;
+    _videoViewContainerController = nil;
+    _pipState = PIPState::NotInPIP;
+    _didRequestExitingPIP = NO;
+    _exitingToStandardFullscreen = NO;
+    _returningWindow = nil;
+    _returningRect = NSZeroRect;
+}
+
+- (void)invalidate
+{
+    [self invalidateFullscreenState];
+    _webVideoFullscreenInterfaceMac = nullptr;
+    _videoDimensions = NSZeroSize;
+}
+
+- (void)updateIsPlaying:(BOOL)isPlaying newPlaybackRate:(float)playbackRate
+{
+    _playing = isPlaying &amp;&amp; playbackRate;
+
+    if ([_pipViewController respondsToSelector:@selector(setPlaying:)])
+        [_pipViewController setPlaying:_playing];
+}
+
+- (void)setVideoDimensions:(NSSize)videoDimensions
+{
+    _videoDimensions = videoDimensions;
+
+    if ([_pipViewController respondsToSelector:@selector(setAspectRatio:)])
+        [_pipViewController setAspectRatio:_videoDimensions];
+}
+
+- (void)setUpPIPForVideoView:(NSView *)videoView withFrame:(NSRect)frame inWindow:(NSWindow *)window
+{
+    ASSERT(!_pipViewController);
+    ASSERT(!_videoViewContainerController);
+    ASSERT(!_videoViewContainer);
+
+    _pipViewController = adoptNS([[getPIPViewControllerClass() alloc] init]);
+    [_pipViewController setDelegate:self];
+    if ([_pipViewController respondsToSelector:@selector(setUserCanResize:)])
+        [_pipViewController setUserCanResize:YES];
+    if ([_pipViewController respondsToSelector:@selector(setPlaying:)])
+        [_pipViewController setPlaying:_playing];
+    [self setVideoDimensions:NSEqualSizes(_videoDimensions, NSZeroSize) ? frame.size : _videoDimensions];
+    if (_webVideoFullscreenInterfaceMac &amp;&amp; _webVideoFullscreenInterfaceMac-&gt;webVideoFullscreenModel())
+        _webVideoFullscreenInterfaceMac-&gt;webVideoFullscreenModel()-&gt;setVideoLayerGravity(WebVideoFullscreenModel::VideoGravityResizeAspectFill);
+
+    _videoViewContainer = adoptNS([[WebVideoViewContainer alloc] initWithFrame:frame]);
+    [_videoViewContainer setVideoViewContainerDelegate:self];
+    [_videoViewContainer addSubview:videoView];
+    videoView.frame = [_videoViewContainer bounds];
+    videoView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
+
+    _videoViewContainerController = adoptNS([[NSViewController alloc] init]);
+    [_videoViewContainerController setView:_videoViewContainer.get()];
+    [window.contentView addSubview:_videoViewContainer.get() positioned:NSWindowAbove relativeTo:nil];
+}
+
+- (void)enterPIP
+{
+    if (_pipState == PIPState::InPIP)
+        return;
+
+    [_videoViewContainerController view].layer.backgroundColor = CGColorGetConstantColor(kCGColorBlack);
+    [_pipViewController presentViewControllerAsPictureInPicture:_videoViewContainerController.get()];
+    _pipState = PIPState::InPIP;
+}
+
+- (void)exitPIP
+{
+    if (_pipState != PIPState::InPIP || !_pipViewController || !_videoViewContainerController)
+        return;
+
+    _didRequestExitingPIP = YES;
+    [_videoViewContainerController view].layer.backgroundColor = CGColorGetConstantColor(kCGColorClear);
+    [_pipViewController dismissViewController:_videoViewContainerController.get()];
+    _pipState = PIPState::ExitingPIP;
+}
+
+- (void)exitPIPAnimatingToRect:(NSRect)rect inWindow:(NSWindow *)window
+{
+    _returningWindow = window;
+    _returningRect = rect;
+    
+    [_pipViewController setReplacementRect:rect];
+    [_pipViewController setReplacementWindow:window];
+
+    [self exitPIP];
+}
+
+// WebVideoViewContainerDelegate
+
+- (void)boundsDidChangeForVideoViewContainer:(WebVideoViewContainer *)videoViewContainer
+{
+    if (!_videoViewContainer || !_pipViewController)
+        return;
+
+    ASSERT_UNUSED(videoViewContainer, videoViewContainer == _videoViewContainer);
+
+    if (_webVideoFullscreenInterfaceMac &amp;&amp; _webVideoFullscreenInterfaceMac-&gt;webVideoFullscreenModel())
+        _webVideoFullscreenInterfaceMac-&gt;webVideoFullscreenModel()-&gt;setVideoLayerFrame([_videoViewContainer bounds]);
+}
+
+- (void)superviewDidChangeForVideoViewContainer:(WebVideoViewContainer *)videoViewContainer
+{
+    if (!_videoViewContainer || !_pipViewController)
+        return;
+
+    ASSERT(videoViewContainer == _videoViewContainer);
+
+    if (![videoViewContainer isDescendantOf:[_pipViewController view]])
+        return;
+
+    // Once the view is moved into the pip view, make sure it resizes with the pip view.
+    videoViewContainer.frame = [videoViewContainer superview].bounds;
+    videoViewContainer.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
+}
+
+// PIPViewControllerDelegate
+
+- (BOOL)pipShouldClose:(PIPViewController *)pip
+{
+    ASSERT_UNUSED(pip, pip == _pipViewController);
+
+    if (!_webVideoFullscreenInterfaceMac || !_webVideoFullscreenInterfaceMac-&gt;webVideoFullscreenChangeObserver())
+        return YES;
+
+    _didRequestExitingPIP = YES;
+    _webVideoFullscreenInterfaceMac-&gt;webVideoFullscreenChangeObserver()-&gt;fullscreenMayReturnToInline();
+
+    return NO;
+}
+
+- (void)pipDidClose:(PIPViewController *)pip
+{
+    ASSERT_UNUSED(pip, pip == _pipViewController);
+
+    if (_webVideoFullscreenInterfaceMac &amp;&amp; _webVideoFullscreenInterfaceMac-&gt;webVideoFullscreenModel() &amp;&amp; _videoViewContainer &amp;&amp; _returningWindow &amp;&amp; !NSEqualRects(_returningRect, NSZeroRect)) {
+        [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
+            context.allowsImplicitAnimation = NO;
+            [_videoViewContainer setFrame:_returningRect];
+            _webVideoFullscreenInterfaceMac-&gt;webVideoFullscreenModel()-&gt;setVideoLayerFrame([_videoViewContainer bounds]);
+            _webVideoFullscreenInterfaceMac-&gt;webVideoFullscreenModel()-&gt;setVideoLayerGravity(WebVideoFullscreenModel::VideoGravityResizeAspect);
+
+            [[_returningWindow contentView] addSubview:_videoViewContainer.get() positioned:NSWindowAbove relativeTo:nil];
+        } completionHandler:nil];
+    }
+
+    if (_webVideoFullscreenInterfaceMac) {
+        if (!self.isExitingToStandardFullscreen) {
+            if (WebVideoFullscreenModel* videoFullscreenModel = _webVideoFullscreenInterfaceMac-&gt;webVideoFullscreenModel()) {
+                videoFullscreenModel-&gt;requestFullscreenMode(HTMLMediaElementEnums::VideoFullscreenModeNone);
+                videoFullscreenModel-&gt;setVideoLayerGravity(WebVideoFullscreenModel::VideoGravityResizeAspect);
+            }
+        }
+
+        _webVideoFullscreenInterfaceMac-&gt;clearMode(HTMLMediaElementEnums::VideoFullscreenModePictureInPicture);
+
+        if (WebVideoFullscreenChangeObserver* fullscreenChangeObserver = _webVideoFullscreenInterfaceMac-&gt;webVideoFullscreenChangeObserver())
+            fullscreenChangeObserver-&gt;didExitFullscreen();
+    }
+}
+
+- (void)pipActionPlay:(PIPViewController *)pip
+{
+    ASSERT_UNUSED(pip, pip == _pipViewController);
+
+    if (_webVideoFullscreenInterfaceMac &amp;&amp; _webVideoFullscreenInterfaceMac-&gt;webPlaybackSessionModel())
+        _webVideoFullscreenInterfaceMac-&gt;webPlaybackSessionModel()-&gt;play();
+}
+
+- (void)pipActionPause:(PIPViewController *)pip
+{
+    ASSERT_UNUSED(pip, pip == _pipViewController);
+
+    if (_webVideoFullscreenInterfaceMac &amp;&amp; _webVideoFullscreenInterfaceMac-&gt;webPlaybackSessionModel())
+        _webVideoFullscreenInterfaceMac-&gt;webPlaybackSessionModel()-&gt;pause();
+}
+
+- (void)pipActionStop:(PIPViewController *)pip
+{
+    ASSERT_UNUSED(pip, pip == _pipViewController);
+
+    if (!_webVideoFullscreenInterfaceMac)
+        return;
+
+    if (WebPlaybackSessionModel* playbackSessionModel = _webVideoFullscreenInterfaceMac-&gt;webPlaybackSessionModel())
+        playbackSessionModel-&gt;pause();
+
+    // FIXME 25096170: Should animate only if the page with the video is unobscured. For now, always close without animation.
+    [self exitPIP];
+}
+
+@end
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> WebVideoFullscreenInterfaceMac::WebVideoFullscreenInterfaceMac(WebPlaybackSessionInterfaceMac&amp; playbackSessionInterface)
</span><span class="lines">@@ -109,12 +409,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebVideoFullscreenInterfaceMac::rateChanged(bool isPlaying, float playbackRate)
</span><span class="cx"> {
</span><del>-#if USE(APPLE_INTERNAL_SDK)
</del><span class="cx">     [videoFullscreenInterfaceObjC() updateIsPlaying:isPlaying newPlaybackRate:playbackRate];
</span><del>-#else
-    UNUSED_PARAM(isPlaying);
-    UNUSED_PARAM(playbackRate);
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebVideoFullscreenInterfaceMac::setSeekableRanges(const TimeRanges&amp; timeRanges)
</span><span class="lines">@@ -137,53 +432,144 @@
</span><span class="cx">     m_playbackSessionInterface-&gt;ensureControlsManager();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if !USE(APPLE_INTERNAL_SDK)
-void WebVideoFullscreenInterfaceMac::setupFullscreen(NSView&amp;, const IntRect&amp;, NSWindow *, HTMLMediaElementEnums::VideoFullscreenMode, bool)
</del><ins>+WebVideoFullscreenInterfaceMacObjC *WebVideoFullscreenInterfaceMac::videoFullscreenInterfaceObjC()
</ins><span class="cx"> {
</span><ins>+    if (!m_webVideoFullscreenInterfaceObjC)
+        m_webVideoFullscreenInterfaceObjC = adoptNS([[WebVideoFullscreenInterfaceMacObjC alloc] initWithWebVideoFullscreenInterfaceMac:this]);
+
+    return m_webVideoFullscreenInterfaceObjC.get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebVideoFullscreenInterfaceMac::setupFullscreen(NSView&amp; layerHostedView, const IntRect&amp; initialRect, NSWindow *parentWindow, HTMLMediaElementEnums::VideoFullscreenMode mode, bool allowsPictureInPicturePlayback)
+{
+    LOG(Fullscreen, &quot;WebVideoFullscreenInterfaceMac::setupFullscreen(%p), initialRect:{%d, %d, %d, %d}, parentWindow:%p, mode:%d&quot;, this, initialRect.x(), initialRect.y(), initialRect.width(), initialRect.height(), parentWindow, mode);
+
+    UNUSED_PARAM(allowsPictureInPicturePlayback);
+    ASSERT(mode == HTMLMediaElementEnums::VideoFullscreenModePictureInPicture);
+
+    m_mode = mode;
+
+    [videoFullscreenInterfaceObjC() setUpPIPForVideoView:&amp;layerHostedView withFrame:(NSRect)initialRect inWindow:parentWindow];
+
+    RefPtr&lt;WebVideoFullscreenInterfaceMac&gt; protectedThis(this);
+    dispatch_async(dispatch_get_main_queue(), [protectedThis, this] {
+        if (m_fullscreenChangeObserver)
+            m_fullscreenChangeObserver-&gt;didSetupFullscreen();
+    });
+}
+
</ins><span class="cx"> void WebVideoFullscreenInterfaceMac::enterFullscreen()
</span><span class="cx"> {
</span><ins>+    LOG(Fullscreen, &quot;WebVideoFullscreenInterfaceMac::enterFullscreen(%p)&quot;, this);
+
+    if (mode() == HTMLMediaElementEnums::VideoFullscreenModePictureInPicture) {
+        [m_webVideoFullscreenInterfaceObjC enterPIP];
+
+        if (m_fullscreenChangeObserver)
+            m_fullscreenChangeObserver-&gt;didEnterFullscreen();
+    } else
+        ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebVideoFullscreenInterfaceMac::exitFullscreen(const IntRect&amp;, NSWindow *)
</del><ins>+void WebVideoFullscreenInterfaceMac::exitFullscreen(const IntRect&amp; finalRect, NSWindow *parentWindow)
</ins><span class="cx"> {
</span><ins>+    LOG(Fullscreen, &quot;WebVideoFullscreenInterfaceMac::exitFullscreen(%p), finalRect:{%d, %d, %d, %d}, parentWindow:%p&quot;, this, finalRect.x(), finalRect.y(), finalRect.width(), finalRect.height(), parentWindow);
+
+    if ([m_webVideoFullscreenInterfaceObjC didRequestExitingPIP])
+        return;
+
+    if (finalRect.isEmpty())
+        [m_webVideoFullscreenInterfaceObjC exitPIP];
+    else
+        [m_webVideoFullscreenInterfaceObjC exitPIPAnimatingToRect:finalRect inWindow:parentWindow];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode(HTMLMediaElementEnums::VideoFullscreenMode)
</del><ins>+void WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode(HTMLMediaElementEnums::VideoFullscreenMode mode)
</ins><span class="cx"> {
</span><ins>+    LOG(Fullscreen, &quot;WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode(%p), mode:%d&quot;, this, mode);
+
+    if ([m_webVideoFullscreenInterfaceObjC didRequestExitingPIP])
+        return;
+
+    [m_webVideoFullscreenInterfaceObjC setExitingToStandardFullscreen:mode == HTMLMediaElementEnums::VideoFullscreenModeStandard];
+    [m_webVideoFullscreenInterfaceObjC exitPIP];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebVideoFullscreenInterfaceMac::cleanupFullscreen()
</span><span class="cx"> {
</span><ins>+    LOG(Fullscreen, &quot;WebVideoFullscreenInterfaceMac::cleanupFullscreen(%p)&quot;, this);
+
+    [m_webVideoFullscreenInterfaceObjC exitPIP];
+    [m_webVideoFullscreenInterfaceObjC invalidateFullscreenState];
+
+    if (m_fullscreenChangeObserver)
+        m_fullscreenChangeObserver-&gt;didCleanupFullscreen();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebVideoFullscreenInterfaceMac::invalidate()
</span><span class="cx"> {
</span><ins>+    LOG(Fullscreen, &quot;WebVideoFullscreenInterfaceMac::invalidate(%p)&quot;, this);
+
+    m_videoFullscreenModel = nil;
+    m_fullscreenChangeObserver = nil;
+
+    cleanupFullscreen();
+
+    [m_webVideoFullscreenInterfaceObjC invalidate];
+    m_webVideoFullscreenInterfaceObjC = nil;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebVideoFullscreenInterfaceMac::preparedToReturnToInline(bool, const IntRect&amp;, NSWindow *)
</del><ins>+#if !LOG_DISABLED
+static const char* boolString(bool val)
</ins><span class="cx"> {
</span><ins>+    return val ? &quot;true&quot; : &quot;false&quot;;
</ins><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><del>-void WebVideoFullscreenInterfaceMac::setVideoDimensions(bool, float, float)
</del><ins>+void WebVideoFullscreenInterfaceMac::preparedToReturnToInline(bool visible, const IntRect&amp; inlineRect, NSWindow *parentWindow)
</ins><span class="cx"> {
</span><ins>+    LOG(Fullscreen, &quot;WebVideoFullscreenInterfaceMac::preparedToReturnToInline(%p), visible:%s, inlineRect:{%d, %d, %d, %d}, parentWindow:%p&quot;, this, boolString(visible), inlineRect.x(), inlineRect.y(), inlineRect.width(), inlineRect.height(), parentWindow);
+
+    if (!visible) {
+        [m_webVideoFullscreenInterfaceObjC exitPIP];
+        return;
+    }
+
+    ASSERT(parentWindow);
+    [m_webVideoFullscreenInterfaceObjC exitPIPAnimatingToRect:(NSRect)inlineRect inWindow:parentWindow];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool WebVideoFullscreenInterfaceMac::isPlayingVideoInEnhancedFullscreen() const
</del><ins>+void WebVideoFullscreenInterfaceMac::setExternalPlayback(bool enabled, ExternalPlaybackTargetType, String)
</ins><span class="cx"> {
</span><del>-    return false;
</del><ins>+    LOG(Fullscreen, &quot;WebVideoFullscreenInterfaceMac::setExternalPlayback(%p), enabled:%s&quot;, this, boolString(enabled));
+
+    if (enabled &amp;&amp; m_mode == HTMLMediaElementEnums::VideoFullscreenModePictureInPicture)
+        exitFullscreen(IntRect(), nil);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebVideoFullscreenInterfaceMac::setExternalPlayback(bool, ExternalPlaybackTargetType, String)
</del><ins>+void WebVideoFullscreenInterfaceMac::setVideoDimensions(bool hasVideo, float width, float height)
</ins><span class="cx"> {
</span><ins>+    LOG(Fullscreen, &quot;WebVideoFullscreenInterfaceMac::setVideoDimensions(%p), hasVideo:%s, width:%.0f, height:%.0f&quot;, this, boolString(hasVideo), width, height);
+
+    if (!hasVideo) {
+        exitFullscreenWithoutAnimationToMode(HTMLMediaElementEnums::VideoFullscreenModeNone);
+        return;
+    }
+
+    // Width and height can be zero when we are transitioning from one video to another. Ignore zero values.
+    if (width &amp;&amp; height)
+        [m_webVideoFullscreenInterfaceObjC setVideoDimensions:NSMakeSize(width, height)];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool WebVideoFullscreenInterfaceMac::isPlayingVideoInEnhancedFullscreen() const
+{
+    return hasMode(WebCore::HTMLMediaElementEnums::VideoFullscreenModePictureInPicture) &amp;&amp; [m_webVideoFullscreenInterfaceObjC isPlaying];
+}
+
</ins><span class="cx"> bool supportsPictureInPicture()
</span><span class="cx"> {
</span><del>-    return false;
</del><ins>+    return PIPLibrary() &amp;&amp; getPIPViewControllerClass();
</ins><span class="cx"> }
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformspimacPIPSPIh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/spi/mac/PIPSPI.h (0 => 202274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/mac/PIPSPI.h                                (rev 0)
+++ trunk/Source/WebCore/platform/spi/mac/PIPSPI.h        2016-06-21 13:15:40 UTC (rev 202274)
</span><span class="lines">@@ -0,0 +1,62 @@
</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.
+ */
+
+#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
+
+#if USE(APPLE_INTERNAL_SDK)
+#import &lt;PIP/PIPViewControllerPrivate.h&gt;
+#else
+
+NS_ASSUME_NONNULL_BEGIN
+
+@protocol PIPViewControllerDelegate;
+
+@interface PIPViewController : NSViewController
+
+@property (nonatomic, weak, nullable) id&lt;PIPViewControllerDelegate&gt; delegate;
+@property (nonatomic, weak, nullable) NSWindow *replacementWindow;
+@property (nonatomic) NSRect replacementRect;
+@property (nonatomic) bool playing;
+@property (nonatomic) bool userCanResize;
+@property (nonatomic) NSSize aspectRatio;
+
+- (void)presentViewControllerAsPictureInPicture:(NSViewController *)viewController;
+
+@end
+
+@protocol PIPViewControllerDelegate &lt;NSObject&gt;
+@optional
+- (BOOL)pipShouldClose:(PIPViewController *)pip;
+- (void)pipDidClose:(PIPViewController *)pip;
+- (void)pipActionPlay:(PIPViewController *)pip;
+- (void)pipActionPause:(PIPViewController *)pip;
+- (void)pipActionStop:(PIPViewController *)pip;
+@end
+
+NS_ASSUME_NONNULL_END
+
+#endif
+
+#endif // PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderingHitTestResultcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/HitTestResult.cpp (202273 => 202274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/HitTestResult.cpp        2016-06-21 11:04:53 UTC (rev 202273)
+++ trunk/Source/WebCore/rendering/HitTestResult.cpp        2016-06-21 13:15:40 UTC (rev 202274)
</span><span class="lines">@@ -786,22 +786,40 @@
</span><span class="cx">     return node-&gt;parentElement();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if USE(APPLE_INTERNAL_SDK)
-#include &lt;WebKitAdditions/HitTestResultAdditions.cpp&gt;
-#else
</del><span class="cx"> bool HitTestResult::mediaSupportsEnhancedFullscreen() const
</span><span class="cx"> {
</span><ins>+#if PLATFORM(MAC) &amp;&amp; ENABLE(VIDEO) &amp;&amp; ENABLE(VIDEO_PRESENTATION_MODE)
+    HTMLMediaElement* mediaElt(mediaElement());
+    return is&lt;HTMLVideoElement&gt;(mediaElt) &amp;&amp; mediaElt-&gt;supportsFullscreen(HTMLMediaElementEnums::VideoFullscreenModePictureInPicture);
+#else
</ins><span class="cx">     return false;
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool HitTestResult::mediaIsInEnhancedFullscreen() const
</span><span class="cx"> {
</span><ins>+#if PLATFORM(MAC) &amp;&amp; ENABLE(VIDEO) &amp;&amp; ENABLE(VIDEO_PRESENTATION_MODE)
+    HTMLMediaElement* mediaElt(mediaElement());
+    return is&lt;HTMLVideoElement&gt;(mediaElt) &amp;&amp; mediaElt-&gt;fullscreenMode() == HTMLMediaElementEnums::VideoFullscreenModePictureInPicture;
+#else
</ins><span class="cx">     return false;
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HitTestResult::toggleEnhancedFullscreenForVideo() const
</span><span class="cx"> {
</span><ins>+#if PLATFORM(MAC) &amp;&amp; ENABLE(VIDEO) &amp;&amp; ENABLE(VIDEO_PRESENTATION_MODE)
+    HTMLMediaElement* mediaElement(this-&gt;mediaElement());
+    if (!is&lt;HTMLVideoElement&gt;(mediaElement) || !mediaElement-&gt;supportsFullscreen(HTMLMediaElementEnums::VideoFullscreenModePictureInPicture))
+        return;
+
+    HTMLVideoElement&amp; videoElement = downcast&lt;HTMLVideoElement&gt;(*mediaElement);
+    UserGestureIndicator indicator(DefinitelyProcessingUserGesture, &amp;mediaElement-&gt;document());
+    if (videoElement.fullscreenMode() == HTMLMediaElementEnums::VideoFullscreenModePictureInPicture)
+        videoElement.exitFullscreen();
+    else
+        videoElement.enterFullscreen(HTMLMediaElementEnums::VideoFullscreenModePictureInPicture);
+#endif
</ins><span class="cx"> }
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (202273 => 202274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeMac.mm        2016-06-21 11:04:53 UTC (rev 202273)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm        2016-06-21 13:15:40 UTC (rev 202274)
</span><span class="lines">@@ -236,11 +236,6 @@
</span><span class="cx">     if (m_mediaControlsStyleSheet.isEmpty()) {
</span><span class="cx">         StringBuilder styleSheetBuilder;
</span><span class="cx">         styleSheetBuilder.append([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@&quot;mediaControlsApple&quot; ofType:@&quot;css&quot;] encoding:NSUTF8StringEncoding error:nil]);
</span><del>-
-#if USE(APPLE_INTERNAL_SDK)
-#import &lt;WebKitAdditions/RenderThemeMacMediaControlsStyleSheetAdditions.mm&gt;
-#endif
-
</del><span class="cx">         m_mediaControlsStyleSheet = styleSheetBuilder.toString();
</span><span class="cx">     }
</span><span class="cx">     return m_mediaControlsStyleSheet;
</span><span class="lines">@@ -256,11 +251,6 @@
</span><span class="cx">         StringBuilder scriptBuilder;
</span><span class="cx">         scriptBuilder.append([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@&quot;mediaControlsLocalizedStrings&quot; ofType:@&quot;js&quot;] encoding:NSUTF8StringEncoding error:nil]);
</span><span class="cx">         scriptBuilder.append([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@&quot;mediaControlsApple&quot; ofType:@&quot;js&quot;] encoding:NSUTF8StringEncoding error:nil]);
</span><del>-
-#if USE(APPLE_INTERNAL_SDK)
-#import &lt;WebKitAdditions/RenderThemeMacMediaControlsScriptAdditions.mm&gt;
-#endif
-        
</del><span class="cx">         m_mediaControlsScript = scriptBuilder.toString();
</span><span class="cx">     }
</span><span class="cx">     return m_mediaControlsScript;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (202273 => 202274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-06-21 11:04:53 UTC (rev 202273)
+++ trunk/Source/WebKit2/ChangeLog        2016-06-21 13:15:40 UTC (rev 202274)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2016-06-21  Dan Bernstein  &lt;mitz@apple.com&gt;
+
+        Inlined some picture-in-picture code.
+        https://bugs.webkit.org/show_bug.cgi?id=158977
+
+        Reviewed by Eric Carlsson.
+
+        This code was written primarily by Ada Chan, and originally reviewed by Alex Christensen,
+        Anders Carlsson, Conrad Shultz, Dan Bernstein, Eric Carlson, Jer Noble, Jeremy Jones,
+        Jon Lee, Remy Demarest, and Zach Li.
+
+        * Shared/WebPreferencesStoreDefaultsAdditions.cpp:
+          Define and use DEFAULT_ALLOWS_PICTURE_IN_PICTURE_MEDIA_PLAYBACK.
+
+        * Shared/WebPreferencesStore.cpp:
+        (WebKit::defaults): Removed include of WebPreferencesStoreDefaultsAdditions.cpp now that the
+          default is defined correctly in WebPreferencesStoreDefaultsAdditions.cpp.
+
+        * UIProcess/API/C/WKPreferences.cpp: Inlined WKPreferencesAdditions.cpp.
+        * UIProcess/API/C/WKPreferencesRefPrivate.h: Ditto.
+
+        * WebProcess/cocoa/WebVideoFullscreenManager.mm: Inlined WebVideoFullscreenManagerSupportsVideoFullscreenMac.mm.
+
</ins><span class="cx"> 2016-06-21  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Web view is not redrawn when reparented in force compositing mode
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebPreferencesDefinitionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (202273 => 202274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h        2016-06-21 11:04:53 UTC (rev 202273)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h        2016-06-21 13:15:40 UTC (rev 202274)
</span><span class="lines">@@ -63,6 +63,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><ins>+#define DEFAULT_ALLOWS_PICTURE_IN_PICTURE_MEDIA_PLAYBACK true
</ins><span class="cx"> #define DEFAULT_BACKSPACE_KEY_NAVIGATION_ENABLED false
</span><span class="cx"> #define DEFAULT_FRAME_FLATTENING_ENABLED true
</span><span class="cx"> #define DEFAULT_SHOULD_PRINT_BACKGROUNDS true
</span><span class="lines">@@ -79,6 +80,7 @@
</span><span class="cx"> #define DEFAULT_TEMPORARY_TILE_COHORT_RETENTION_ENABLED false
</span><span class="cx"> #define DEFAULT_REQUIRES_USER_GESTURE_FOR_AUDIO_PLAYBACK true
</span><span class="cx"> #else
</span><ins>+#define DEFAULT_ALLOWS_PICTURE_IN_PICTURE_MEDIA_PLAYBACK false
</ins><span class="cx"> #define DEFAULT_BACKSPACE_KEY_NAVIGATION_ENABLED true
</span><span class="cx"> #define DEFAULT_FRAME_FLATTENING_ENABLED false
</span><span class="cx"> #define DEFAULT_SHOULD_PRINT_BACKGROUNDS false
</span><span class="lines">@@ -161,7 +163,7 @@
</span><span class="cx">     macro(InlineMediaPlaybackRequiresPlaysInlineAttribute, inlineMediaPlaybackRequiresPlaysInlineAttribute, Bool, bool, DEFAULT_INLINE_MEDIA_PLAYBACK_REQUIRES_PLAYS_INLINE_ATTRIBUTE, &quot;&quot;, &quot;&quot;) \
</span><span class="cx">     macro(InvisibleAutoplayNotPermitted, invisibleAutoplayNotPermitted, Bool, bool, DEFAULT_INVISIBLE_AUTOPLAY_NOT_PERMITTED, &quot;&quot;, &quot;&quot;) \
</span><span class="cx">     macro(MediaDataLoadsAutomatically, mediaDataLoadsAutomatically, Bool, bool, DEFAULT_MEDIA_DATA_LOADS_AUTOMATICALLY, &quot;&quot;, &quot;&quot;) \
</span><del>-    macro(AllowsPictureInPictureMediaPlayback, allowsPictureInPictureMediaPlayback, Bool, bool, true, &quot;&quot;, &quot;&quot;) \
</del><ins>+    macro(AllowsPictureInPictureMediaPlayback, allowsPictureInPictureMediaPlayback, Bool, bool, DEFAULT_ALLOWS_PICTURE_IN_PICTURE_MEDIA_PLAYBACK, &quot;&quot;, &quot;&quot;) \
</ins><span class="cx">     macro(AllowsAirPlayForMediaPlayback, allowsAirPlayForMediaPlayback, Bool, bool, true, &quot;&quot;, &quot;&quot;) \
</span><span class="cx">     macro(MediaControlsScaleWithPageZoom, mediaControlsScaleWithPageZoom, Bool, bool, DEFAULT_MEDIA_CONTROLS_SCALE_WITH_PAGE_ZOOM, &quot;&quot;, &quot;&quot;) \
</span><span class="cx">     macro(InspectorStartsAttached, inspectorStartsAttached, Bool, bool, true, &quot;&quot;, &quot;&quot;) \
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebPreferencesStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebPreferencesStore.cpp (202273 => 202274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebPreferencesStore.cpp        2016-06-21 11:04:53 UTC (rev 202273)
+++ trunk/Source/WebKit2/Shared/WebPreferencesStore.cpp        2016-06-21 13:15:40 UTC (rev 202274)
</span><span class="lines">@@ -165,9 +165,6 @@
</span><span class="cx">         FOR_EACH_WEBKIT_DEBUG_PREFERENCE(DEFINE_DEFAULTS)
</span><span class="cx">         FOR_EACH_WEBKIT_EXPERIMENTAL_FEATURE_PREFERENCE(DEFINE_DEFAULTS)
</span><span class="cx"> #undef DEFINE_DEFAULTS
</span><del>-#if USE(APPLE_INTERNAL_SDK)
-#include &lt;WebKitAdditions/WebPreferencesStoreDefaultsAdditions.cpp&gt;
-#endif
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return defaults;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPreferencescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (202273 => 202274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp        2016-06-21 11:04:53 UTC (rev 202273)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp        2016-06-21 13:15:40 UTC (rev 202274)
</span><span class="lines">@@ -35,10 +35,6 @@
</span><span class="cx"> 
</span><span class="cx"> using namespace WebKit;
</span><span class="cx"> 
</span><del>-#if USE(APPLE_INTERNAL_SDK)
-#include &lt;WebKitAdditions/WKPreferencesAdditions.cpp&gt;
-#endif
-
</del><span class="cx"> WKTypeID WKPreferencesGetTypeID()
</span><span class="cx"> {
</span><span class="cx">     return toAPI(WebPreferences::APIType);
</span><span class="lines">@@ -1525,3 +1521,13 @@
</span><span class="cx"> {
</span><span class="cx">     return toImpl(preferencesRef)-&gt;selectionPaintingWithoutSelectionGapsEnabled();
</span><span class="cx"> }
</span><ins>+
+void WKPreferencesSetAllowsPictureInPictureMediaPlayback(WKPreferencesRef preferencesRef, bool enabled)
+{
+    toImpl(preferencesRef)-&gt;setAllowsPictureInPictureMediaPlayback(enabled);
+}
+
+bool WKPreferencesGetAllowsPictureInPictureMediaPlayback(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)-&gt;allowsPictureInPictureMediaPlayback();
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPreferencesRefPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h (202273 => 202274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h        2016-06-21 11:04:53 UTC (rev 202273)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h        2016-06-21 13:15:40 UTC (rev 202274)
</span><span class="lines">@@ -421,6 +421,10 @@
</span><span class="cx"> WK_EXPORT void WKPreferencesSetSelectionPaintingWithoutSelectionGapsEnabled(WKPreferencesRef, bool flag);
</span><span class="cx"> WK_EXPORT bool WKPreferencesGetSelectionPaintingWithoutSelectionGapsEnabled(WKPreferencesRef);
</span><span class="cx"> 
</span><ins>+// Defaults to false.
+WK_EXPORT void WKPreferencesSetAllowsPictureInPictureMediaPlayback(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetAllowsPictureInPictureMediaPlayback(WKPreferencesRef);
+
</ins><span class="cx"> #ifdef __cplusplus
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcesscocoaWebVideoFullscreenManagermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm (202273 => 202274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm        2016-06-21 11:04:53 UTC (rev 202273)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm        2016-06-21 13:15:40 UTC (rev 202274)
</span><span class="lines">@@ -256,10 +256,8 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     UNUSED_PARAM(mode);
</span><span class="cx">     return Settings::avKitEnabled();
</span><del>-#elif USE(APPLE_INTERNAL_SDK)
-#import &lt;WebKitAdditions/WebVideoFullscreenManagerSupportsVideoFullscreenMac.mm&gt;
</del><span class="cx"> #else
</span><del>-    return false;
</del><ins>+    return mode == HTMLMediaElementEnums::VideoFullscreenModePictureInPicture &amp;&amp; supportsPictureInPicture();
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>