mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibWeb: Include a comment for media src attribute and match spec
We're apparently not supposed to load anything when the attribute is removed.
This commit is contained in:
committed by
Gregory Bertilson
parent
978ca691c8
commit
a41e1ad080
Notes:
github-actions[bot]
2026-04-01 07:56:38 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/a41e1ad0807 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8655 Reviewed-by: https://github.com/tcl3
@@ -159,6 +159,12 @@ void HTMLMediaElement::attribute_changed(FlyString const& name, Optional<String>
|
||||
Base::attribute_changed(name, old_value, value, namespace_);
|
||||
|
||||
if (name == HTML::AttributeNames::src) {
|
||||
// https://html.spec.whatwg.org/multipage/media.html#attr-media-src
|
||||
// If a src attribute of a media element is set or changed, the user agent must invoke the
|
||||
// media element's media element load algorithm. (Removing the src attribute does not do
|
||||
// this, even if there are source elements present.)
|
||||
if (!value.has_value())
|
||||
return;
|
||||
load_element().release_value_but_fixme_should_propagate_errors();
|
||||
} else if (name == HTML::AttributeNames::crossorigin) {
|
||||
m_crossorigin = cors_setting_attribute_from_keyword(value);
|
||||
|
||||
Reference in New Issue
Block a user