Title: [209494] trunk/Source/WebCore
Revision
209494
Author
d...@apple.com
Date
2016-12-07 16:27:35 -0800 (Wed, 07 Dec 2016)

Log Message

Expose internal API to detect media documents
https://bugs.webkit.org/show_bug.cgi?id=165559
<rdar://problems/29564054>

Reviewed by Antoine Quint.

Expose via MediaControlsHost whether or not we're in
a MediaDocument.

Since MediaControlsHost is only exposed to our
internal controls, it's not possible to test this
directly. However, a subsequent test for media documents
with audio-only content will cover this change.

* Modules/mediacontrols/MediaControlsHost.cpp: Add isInMediaDocument and put const on
various methods that should have it.
(WebCore::MediaControlsHost::captionDisplayMode):
(WebCore::MediaControlsHost::supportsFullscreen):
(WebCore::MediaControlsHost::isVideoLayerInline):
(WebCore::MediaControlsHost::isInMediaDocument):
* Modules/mediacontrols/MediaControlsHost.h:
* Modules/mediacontrols/MediaControlsHost.idl: Add isInMediaDocument.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (209493 => 209494)


--- trunk/Source/WebCore/ChangeLog	2016-12-08 00:17:26 UTC (rev 209493)
+++ trunk/Source/WebCore/ChangeLog	2016-12-08 00:27:35 UTC (rev 209494)
@@ -1,3 +1,28 @@
+2016-12-07  Dean Jackson  <d...@apple.com>
+
+        Expose internal API to detect media documents
+        https://bugs.webkit.org/show_bug.cgi?id=165559
+        <rdar://problems/29564054>
+
+        Reviewed by Antoine Quint.
+
+        Expose via MediaControlsHost whether or not we're in
+        a MediaDocument.
+
+        Since MediaControlsHost is only exposed to our
+        internal controls, it's not possible to test this
+        directly. However, a subsequent test for media documents
+        with audio-only content will cover this change.
+
+        * Modules/mediacontrols/MediaControlsHost.cpp: Add isInMediaDocument and put const on
+        various methods that should have it.
+        (WebCore::MediaControlsHost::captionDisplayMode):
+        (WebCore::MediaControlsHost::supportsFullscreen):
+        (WebCore::MediaControlsHost::isVideoLayerInline):
+        (WebCore::MediaControlsHost::isInMediaDocument):
+        * Modules/mediacontrols/MediaControlsHost.h:
+        * Modules/mediacontrols/MediaControlsHost.idl: Add isInMediaDocument.
+
 2016-12-07  Zalan Bujtas  <za...@apple.com>
 
         ASSERTION FAILED: count >= 1 in WebCore::RenderMultiColumnSet::columnCount

Modified: trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp (209493 => 209494)


--- trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp	2016-12-08 00:17:26 UTC (rev 209493)
+++ trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp	2016-12-08 00:27:35 UTC (rev 209494)
@@ -126,7 +126,7 @@
     return TextTrack::captionMenuAutomaticItem();
 }
 
-AtomicString MediaControlsHost::captionDisplayMode()
+AtomicString MediaControlsHost::captionDisplayMode() const
 {
     Page* page = m_mediaElement->document().page();
     if (!page)
@@ -190,16 +190,21 @@
     return !m_mediaElement->mediaSession().requiresFullscreenForVideoPlayback(*m_mediaElement);
 }
 
-bool MediaControlsHost::supportsFullscreen()
+bool MediaControlsHost::supportsFullscreen() const
 {
     return m_mediaElement->supportsFullscreen(HTMLMediaElementEnums::VideoFullscreenModeStandard);
 }
 
-bool MediaControlsHost::isVideoLayerInline()
+bool MediaControlsHost::isVideoLayerInline() const
 {
     return m_mediaElement->isVideoLayerInline();
 }
 
+bool MediaControlsHost::isInMediaDocument() const
+{
+    return m_mediaElement->document().isMediaDocument();
+}
+
 void MediaControlsHost::setPreparedToReturnVideoLayerToInline(bool value)
 {
     m_mediaElement->setPreparedToReturnVideoLayerToInline(value);

Modified: trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h (209493 => 209494)


--- trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h	2016-12-08 00:17:26 UTC (rev 209493)
+++ trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h	2016-12-08 00:27:35 UTC (rev 209494)
@@ -61,13 +61,14 @@
 
     TextTrack* captionMenuOffItem();
     TextTrack* captionMenuAutomaticItem();
-    AtomicString captionDisplayMode();
+    AtomicString captionDisplayMode() const;
     void setSelectedTextTrack(TextTrack*);
     Element* textTrackContainer();
     void updateTextTrackContainer();
     bool allowsInlineMediaPlayback() const;
-    bool supportsFullscreen();
-    bool isVideoLayerInline();
+    bool supportsFullscreen() const;
+    bool isVideoLayerInline() const;
+    bool isInMediaDocument() const;
     bool userGestureRequired() const;
     void setPreparedToReturnVideoLayerToInline(bool);
 

Modified: trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl (209493 => 209494)


--- trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl	2016-12-08 00:17:26 UTC (rev 209493)
+++ trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl	2016-12-08 00:27:35 UTC (rev 209494)
@@ -47,6 +47,7 @@
     readonly attribute boolean supportsFullscreen;
     readonly attribute boolean isVideoLayerInline;
     readonly attribute boolean userGestureRequired;
+    readonly attribute boolean isInMediaDocument;
 
     readonly attribute DOMString externalDeviceDisplayName;
     readonly attribute DeviceType externalDeviceType;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to