Delete MetadataPreloadingNotPermitted, it is unused
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Mar 2019 20:43:47 +0000 (20:43 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Mar 2019 20:43:47 +0000 (20:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196202
<rdar://problem/49213611>

Reviewed by Jer Noble.

Source/WebCore:

No new tests, the flat was unused except in an existing test that was removed.

* html/MediaElementSession.cpp:
(WebCore::restrictionNames):
(WebCore::MediaElementSession::effectivePreloadForElement const):
* html/MediaElementSession.h:
* platform/graphics/cg/UTIRegistry.cpp:
(WebCore::defaultSupportedImageTypes):
* testing/Internals.cpp:
(WebCore::Internals::setMediaElementRestrictions):

LayoutTests:

* media/video-restricted-no-preload-metadata-expected.txt: Removed.
* media/video-restricted-no-preload-metadata.html: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243451 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/media/video-restricted-no-preload-metadata-expected.txt [deleted file]
LayoutTests/media/video-restricted-no-preload-metadata.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/html/MediaElementSession.cpp
Source/WebCore/html/MediaElementSession.h
Source/WebCore/testing/Internals.cpp

index 6e019f7..ca73505 100644 (file)
@@ -1,3 +1,14 @@
+2019-03-25  Eric Carlson  <eric.carlson@apple.com>
+
+        Delete MetadataPreloadingNotPermitted, it is unused
+        https://bugs.webkit.org/show_bug.cgi?id=196202
+        <rdar://problem/49213611>
+
+        Reviewed by Jer Noble.
+
+        * media/video-restricted-no-preload-metadata-expected.txt: Removed.
+        * media/video-restricted-no-preload-metadata.html: Removed.
+
 2019-03-25  Jer Noble  <jer.noble@apple.com>
 
         Add test for fix of #196095
diff --git a/LayoutTests/media/video-restricted-no-preload-metadata-expected.txt b/LayoutTests/media/video-restricted-no-preload-metadata-expected.txt
deleted file mode 100644 (file)
index fe5ac21..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-
-Test that "no preloading restriction" disables preloading in spite of preload='auto'.
-
-** setting video.src
-EXPECTED (video.preload == 'auto') OK
-RUN(internals.setMediaElementRestrictions(video, 'MetadataPreloadingNotPermitted'))
-** Pausing...
-
-** 250ms timer fired
-EXPECTED (video.readyState == '0') OK
-EXPECTED (video.buffered.length == '0') OK
-RUN(video.load())
-
-EVENT(loadedmetadata)
-
-END OF TEST
-
diff --git a/LayoutTests/media/video-restricted-no-preload-metadata.html b/LayoutTests/media/video-restricted-no-preload-metadata.html
deleted file mode 100644 (file)
index 7f44590..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<html>
-    <head>
-        <script src="media-file.js"></script>
-        <script src="video-test.js"></script>
-        <script>
-            var loadCalled = false;
-
-            function loadedmetadata()
-            {
-                consoleWrite("");
-                if (!loadCalled)
-                    consoleWrite("*** FAIL: media data loaded before load() was called ***<br>");
-
-                endTest();
-            }
-
-            function load()
-            {
-                consoleWrite("** 250ms timer fired");
-                testExpected("video.readyState", HTMLMediaElement.HAVE_NOTHING);
-                testExpected("video.buffered.length", 0, "==");
-                loadCalled = true;
-                run("video.load()");
-                consoleWrite("");
-            }
-
-            function start()
-            {
-                if (!window.internals) {
-                    failTest('This test requires window.internals.');
-                    return;
-                }
-
-                findMediaElement();
-                consoleWrite("** setting video.src");
-                video.src = findMediaFile("video", "content/test");
-
-                testExpected("video.preload", "auto");
-                waitForEvent('loadedmetadata', loadedmetadata);
-                run("internals.setMediaElementRestrictions(video, 'MetadataPreloadingNotPermitted')");
-
-                // Wait 250ms before load()ing to make sure setting src did not kick off the load.
-                consoleWrite("** Pausing...<br>");
-                setTimeout(load, 250);
-                failTestIn(2000);
-            }
-        </script>
-    </head>
-
-    <body onload="start()">
-        <video controls preload=auto></video>
-        <p>Test that "no preloading restriction" disables preloading in spite of preload='auto'.</p>
-    </body>
-</html>
index c343d61..1a7f090 100644 (file)
@@ -1,3 +1,22 @@
+2019-03-25  Eric Carlson  <eric.carlson@apple.com>
+
+        Delete MetadataPreloadingNotPermitted, it is unused
+        https://bugs.webkit.org/show_bug.cgi?id=196202
+        <rdar://problem/49213611>
+
+        Reviewed by Jer Noble.
+
+        No new tests, the flat was unused except in an existing test that was removed.
+
+        * html/MediaElementSession.cpp:
+        (WebCore::restrictionNames):
+        (WebCore::MediaElementSession::effectivePreloadForElement const):
+        * html/MediaElementSession.h:
+        * platform/graphics/cg/UTIRegistry.cpp:
+        (WebCore::defaultSupportedImageTypes):
+        * testing/Internals.cpp:
+        (WebCore::Internals::setMediaElementRestrictions):
+
 2019-03-25  Jer Noble  <jer.noble@apple.com>
 
         Test for: 196095 Inband Text Track cues interspersed with Data cues can display out of order.
index d330248..24cab0e 100644 (file)
@@ -85,7 +85,6 @@ static String restrictionNames(MediaElementSession::BehaviorRestrictions restric
     CASE(RequireUserGestureToShowPlaybackTargetPicker)
     CASE(WirelessVideoPlaybackDisabled)
     CASE(RequireUserGestureToAutoplayToExternalDevice)
-    CASE(MetadataPreloadingNotPermitted)
     CASE(AutoPreloadingNotPermitted)
     CASE(InvisibleAutoplayNotPermitted)
     CASE(OverrideUserGestureRequirementForMainContent)
@@ -690,9 +689,6 @@ MediaPlayer::Preload MediaElementSession::effectivePreloadForElement() const
     if (pageExplicitlyAllowsElementToAutoplayInline(m_element))
         return preload;
 
-    if (m_restrictions & MetadataPreloadingNotPermitted)
-        return MediaPlayer::None;
-
     if (m_restrictions & AutoPreloadingNotPermitted) {
         if (preload > MediaPlayer::MetaData)
             return MediaPlayer::MetaData;
index 1c07ac0..0fa0760 100644 (file)
@@ -117,7 +117,6 @@ public:
         RequireUserGestureToShowPlaybackTargetPicker = 1 << 6,
         WirelessVideoPlaybackDisabled =  1 << 7,
         RequireUserGestureToAutoplayToExternalDevice = 1 << 8,
-        MetadataPreloadingNotPermitted = 1 << 9,
         AutoPreloadingNotPermitted = 1 << 10,
         InvisibleAutoplayNotPermitted = 1 << 11,
         OverrideUserGestureRequirementForMainContent = 1 << 12,
index c2c5306..d1379ab 100644 (file)
@@ -3850,8 +3850,6 @@ void Internals::setMediaElementRestrictions(HTMLMediaElement& element, StringVie
 #endif
         if (equalLettersIgnoringASCIICase(restrictionString, "requireusergestureforaudioratechange"))
             restrictions |= MediaElementSession::RequireUserGestureForAudioRateChange;
-        if (equalLettersIgnoringASCIICase(restrictionString, "metadatapreloadingnotpermitted"))
-            restrictions |= MediaElementSession::MetadataPreloadingNotPermitted;
         if (equalLettersIgnoringASCIICase(restrictionString, "autopreloadingnotpermitted"))
             restrictions |= MediaElementSession::AutoPreloadingNotPermitted;
         if (equalLettersIgnoringASCIICase(restrictionString, "invisibleautoplaynotpermitted"))