Implement URL.canParse

Add an implementation of `URL.canParse` as a static method. See
[here][1] for the specification.

[1]: https://url.spec.whatwg.org/#dom-url-canparse

Signed-off-by: Yutaro Ohno <yutaro.ono.418@gmail.com>
This commit is contained in:
Yutaro Ohno 2023-04-02 19:23:45 +09:00
parent 6b33738006
commit 239776a270
3 changed files with 24 additions and 44 deletions

View file

@ -7,6 +7,9 @@
LegacyWindowAlias=webkitURL]
interface URL {
[Throws] constructor(USVString url, optional USVString base);
static boolean canParse(USVString url, optional USVString base);
[SetterThrows]
stringifier attribute USVString href;
readonly attribute USVString origin;