Title: [220027] branches/safari-604-branch/Source/WebCore

Diff

Modified: branches/safari-604-branch/Source/WebCore/ChangeLog (220026 => 220027)


--- branches/safari-604-branch/Source/WebCore/ChangeLog	2017-07-28 22:19:59 UTC (rev 220026)
+++ branches/safari-604-branch/Source/WebCore/ChangeLog	2017-07-28 22:20:02 UTC (rev 220027)
@@ -1,5 +1,32 @@
 2017-07-28  Jason Marcell  <[email protected]>
 
+        Cherry-pick r219992. rdar://problem/33595621
+
+    2017-07-27  Jeremy Jones  <[email protected]>
+
+            Don't override _allowsMediaDocumentInlinePlayback in MediaDocument with playsinlineAttr.
+            https://bugs.webkit.org/show_bug.cgi?id=174850
+            rdar://problem/33449903
+
+            Reviewed by Jon Lee.
+
+            This change removes playsinlineAttr from MediaDocument so that it doesn't override the setting
+            from _allowsMediaDocumentInlinePlayback. In its place is an update to requiresFullscreenForVideoPlayback
+            that implements the details of exactly which media documents are still allowed to play inlne.
+
+            Media documents always use a video element; but when there are no video tracks, it has behavior like
+            an audio element. See media-controller.js isAudio().
+
+            This change preserves this behavior with respect to fullscreen requirements for media document by
+            mirroring the isAudio() check in requiresFullscreenForVideoPlayback.
+
+            * html/MediaDocument.cpp:
+            (WebCore::MediaDocumentParser::createDocumentStructure):
+            * html/MediaElementSession.cpp:
+            (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
+
+2017-07-28  Jason Marcell  <[email protected]>
+
         Cherry-pick r219991. rdar://problem/33595570
 
     2017-07-27  Jeremy Jones  <[email protected]>

Modified: branches/safari-604-branch/Source/WebCore/html/MediaDocument.cpp (220026 => 220027)


--- branches/safari-604-branch/Source/WebCore/html/MediaDocument.cpp	2017-07-28 22:19:59 UTC (rev 220026)
+++ branches/safari-604-branch/Source/WebCore/html/MediaDocument.cpp	2017-07-28 22:20:02 UTC (rev 220027)
@@ -108,7 +108,6 @@
     m_mediaElement = videoElement.ptr();
     videoElement->setAttributeWithoutSynchronization(controlsAttr, emptyAtom());
     videoElement->setAttributeWithoutSynchronization(autoplayAttr, emptyAtom());
-    videoElement->setAttributeWithoutSynchronization(playsinlineAttr, emptyAtom());
     videoElement->setAttributeWithoutSynchronization(srcAttr, document.url().string());
     if (auto* loader = document.loader())
         videoElement->setAttributeWithoutSynchronization(typeAttr, loader->responseMIMEType());

Modified: branches/safari-604-branch/Source/WebCore/html/MediaElementSession.cpp (220026 => 220027)


--- branches/safari-604-branch/Source/WebCore/html/MediaElementSession.cpp	2017-07-28 22:19:59 UTC (rev 220026)
+++ branches/safari-604-branch/Source/WebCore/html/MediaElementSession.cpp	2017-07-28 22:20:02 UTC (rev 220027)
@@ -560,6 +560,13 @@
     if (is<HTMLAudioElement>(element))
         return false;
 
+    if (element.document().isMediaDocument()) {
+        ASSERT(is<HTMLVideoElement>(element));
+        const HTMLVideoElement& videoElement = *downcast<const HTMLVideoElement>(&element);
+        if (element.readyState() < HTMLVideoElement::HAVE_METADATA || !videoElement.hasEverHadVideo())
+            return false;
+    }
+
     if (element.isTemporarilyAllowingInlinePlaybackAfterFullscreen())
         return false;
 
@@ -575,6 +582,10 @@
     if (dyld_get_program_sdk_version() < DYLD_IOS_VERSION_10_0)
         return !element.hasAttributeWithoutSynchronization(HTMLNames::webkit_playsinlineAttr);
 #endif
+
+    if (element.document().isMediaDocument() && element.document().ownerElement())
+        return false;
+
     return !element.hasAttributeWithoutSynchronization(HTMLNames::playsinlineAttr);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to