summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2023-04-07 10:45:17 -0400
committerLinus Groh <mail@linusgroh.de>2023-04-08 22:04:14 +0200
commite130525c24cf0b7cac7fb1f3b39bd406acb6715e (patch)
treeb3b8aa8eeb44cb69510da6ca3e55d2f6394cba26
parent9ad4c9e6b0b35af794068ba8d9efa34a105f2525 (diff)
downloadserenity-e130525c24cf0b7cac7fb1f3b39bd406acb6715e.zip
LibWeb: Implement HTMLMediaElement.load
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp7
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h3
2 files changed, 7 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp
index a61b895f25..8038c1791e 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2020, the SerenityOS developers.
+ * Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -91,9 +92,11 @@ WebIDL::ExceptionOr<Bindings::CanPlayTypeResult> HTMLMediaElement::can_play_type
}
// https://html.spec.whatwg.org/multipage/media.html#dom-media-load
-void HTMLMediaElement::load() const
+WebIDL::ExceptionOr<void> HTMLMediaElement::load()
{
- dbgln("(STUBBED) HTMLMediaElement::load()");
+ // When the load() method on a media element is invoked, the user agent must run the media element load algorithm.
+ TRY(load_element());
+ return {};
}
// https://html.spec.whatwg.org/multipage/media.html#dom-media-duration
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h
index ab95962ace..041989a5e3 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h
+++ b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2020, the SerenityOS developers.
+ * Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -42,7 +43,7 @@ public:
};
ReadyState ready_state() const { return m_ready_state; }
- void load() const;
+ WebIDL::ExceptionOr<void> load();
double duration() const;
void pause() const;