Bug 1643873 [wpt PR 24023] - Implement the media element 'show poster flag' in accordance with spec, a=testonly
authorWill Cassella <cassew@google.com>
Mon, 22 Jun 2020 10:38:30 +0000
changeset 536798 5c0ce0a37205e620c367f5d6477db00a2494050e
parent 536797 6ddaab82e8aec48f193aaca616e396d7aa49827e
child 536799 676cae6112c256c52e9d2b8d1263f82f0e835d74
push id119680
push userwptsync@mozilla.com
push dateTue, 23 Jun 2020 11:08:22 +0000
treeherderautoland@7ca3d4bada73 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1643873, 24023, 1007241, 2222948, 778039
milestone79.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1643873 [wpt PR 24023] - Implement the media element 'show poster flag' in accordance with spec, a=testonly Automatic update from web-platform-tests Implement the media element 'show poster flag' in accordance with spec Previously, HTMLMediaElement had a 'DisplayMode' enum which was one of { 'kUnknown', 'kPoster', 'kVideo' }. This didn't mesh well with the spec, which only mentions the 'show poster flag' as being true or false. Additionally, the points where this mode was changed were inconsistent with the spec, and resulted in us showing video contents when we should be showing the poster, and makes implementing other features dependent on the state of the 'show poster flag' difficult, such as the cue timeline. This CL removes 'DisplayMode' from HTMLMediaElement (though reintroduces it in a limited form in LayoutVideo), and implements the 'show-poster-flag' in accordance with the spec. This makes the behavior of poster rendering (as detailed in the attached bug) consistent with Firefox and Safari. Bug: 1007241 Change-Id: Iaaf3a10581357443b7889578360852e0a674e68c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2222948 Reviewed-by: Mounir Lamouri <mlamouri@chromium.org> Reviewed-by: Stephen Chenney <schenney@chromium.org> Commit-Queue: Mounir Lamouri <mlamouri@chromium.org> Cr-Commit-Position: refs/heads/master@{#778039} -- wpt-commits: 04caec1f4f239a2f1b36b6eaa5017f421b242694 wpt-pr: 24023
testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video-poster-shown-preload-auto-ref.html
testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video-poster-shown-preload-auto.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video-poster-shown-preload-auto-ref.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<html>
+  <title>Verifies that video poster is shown even if video element has 'preload="auto"' attribute</title>
+  <video preload="none" poster="/media/poster.png" src="/media/video.ogv" width="100" height="100"></video>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video-poster-shown-preload-auto.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+  <title>Verifies that video poster is shown even if video element has 'preload="auto"' attribute</title>
+  <link rel="match" href="video-poster-shown-preload-auto-ref.html">
+  <video preload="auto" poster="/media/poster.png" src="/media/video.ogv" width="100" height="100"></video>
+  <script>
+    const video = document.querySelector("video");
+    video.oncanplaythrough = () => document.documentElement.classList.remove("reftest-wait");
+  </script>
+</html>