mirror of
https://github.com/servo/servo.git
synced 2025-06-17 04:44:28 +00:00
feat(script): add Supports()
to htmlscriptelement
(#37313)
Add static method `Supports` to `HTMLScriptElement`. Part of #37262 Testing: relative WPT tests should become `PASS` Signed-off-by: Jason Tsai <git@pews.dev>
This commit is contained in:
parent
352e4bfcf1
commit
47f9fbd8c7
4 changed files with 10 additions and 21 deletions
|
@ -70,6 +70,7 @@ use crate::dom::performanceresourcetiming::InitiatorType;
|
|||
use crate::dom::trustedscript::TrustedScript;
|
||||
use crate::dom::trustedscripturl::TrustedScriptURL;
|
||||
use crate::dom::virtualmethods::VirtualMethods;
|
||||
use crate::dom::window::Window;
|
||||
use crate::fetch::create_a_potential_cors_request;
|
||||
use crate::network_listener::{self, NetworkListener, PreInvoke, ResourceTimingListener};
|
||||
use crate::realms::enter_realm;
|
||||
|
@ -1526,6 +1527,13 @@ impl HTMLScriptElementMethods<crate::DomTypeHolder> for HTMLScriptElement {
|
|||
.SetTextContent(Some(DOMString::from(value)), can_gc);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-script-supports>
|
||||
fn Supports(_window: &Window, type_: DOMString) -> bool {
|
||||
// The type argument has to exactly match these values,
|
||||
// we do not perform an ASCII case-insensitive match.
|
||||
matches!(type_.str(), "classic" | "module" | "importmap")
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue