mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update URL-related interfaces and their tests up to spec
The URL spec recently changed and the variour "mixins" interfaces are gone, this commit updates our code and WPT accordingly. The new expected failures related to HTMLAnchorElement and HTMLAreaElement's attributes are due to their moving to the HTMLHyperLinkElementUtils interface, which is not anymore in a separate <script class=untested> element.
This commit is contained in:
parent
e0c8a88410
commit
57c423a931
19 changed files with 395 additions and 254 deletions
|
@ -26,7 +26,7 @@ interface HTMLAnchorElement : HTMLElement {
|
|||
|
||||
// also has obsolete members
|
||||
};
|
||||
//HTMLAnchorElement implements URLUtils;
|
||||
//HTMLAnchorElement implements HTMLHyperlinkElementUtils;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#HTMLAnchorElement-partial
|
||||
partial interface HTMLAnchorElement {
|
||||
|
|
|
@ -13,12 +13,9 @@ interface HTMLAreaElement : HTMLElement {
|
|||
//[PutForwards=value] attribute DOMSettableTokenList ping;
|
||||
// attribute DOMString rel;
|
||||
readonly attribute DOMTokenList relList;
|
||||
// attribute DOMString hreflang;
|
||||
// attribute DOMString type;
|
||||
|
||||
// also has obsolete members
|
||||
// hreflang and type are not reflected
|
||||
};
|
||||
//HTMLAreaElement implements URLUtils;
|
||||
//HTMLAreaElement implements HTMLHyperlinkElementUtils;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#HTMLAreaElement-partial
|
||||
partial interface HTMLAreaElement {
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#htmlhyperlinkelementutils
|
||||
//[NoInterfaceObject/*, Exposed=Window*/]
|
||||
//interface HTMLHyperlinkElementUtils {
|
||||
// stringifier attribute USVString href;
|
||||
// attribute USVString origin;
|
||||
// attribute USVString protocol;
|
||||
// attribute USVString username;
|
||||
// attribute USVString password;
|
||||
// attribute USVString host;
|
||||
// attribute USVString hostname;
|
||||
// attribute USVString port;
|
||||
// attribute USVString pathname;
|
||||
// attribute USVString search;
|
||||
// attribute USVString hash;
|
||||
//};
|
|
@ -5,8 +5,24 @@
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#location
|
||||
/*[Unforgeable]*/ interface Location {
|
||||
void assign(DOMString url);
|
||||
//void replace(DOMString url);
|
||||
/*stringifier*/ attribute USVString href;
|
||||
// attribute USVString origin;
|
||||
attribute USVString protocol;
|
||||
attribute USVString host;
|
||||
attribute USVString hostname;
|
||||
attribute USVString port;
|
||||
attribute USVString pathname;
|
||||
attribute USVString search;
|
||||
attribute USVString hash;
|
||||
|
||||
void assign(USVString url);
|
||||
//void replace(USVString url);
|
||||
void reload();
|
||||
|
||||
//[SameObject] readonly attribute USVString[] ancestorOrigins;
|
||||
|
||||
// This is only doing as well as gecko right now.
|
||||
// https://github.com/servo/servo/issues/7590 is on file for
|
||||
// adding attribute stringifier support.
|
||||
stringifier;
|
||||
};
|
||||
Location implements URLUtils;
|
||||
|
|
|
@ -8,5 +8,23 @@
|
|||
interface URL {
|
||||
static USVString domainToASCII(USVString domain);
|
||||
// static USVString domainToUnicode(USVString domain);
|
||||
|
||||
[SetterThrows]
|
||||
/*stringifier*/ attribute USVString href;
|
||||
// readonly attribute USVString origin;
|
||||
attribute USVString protocol;
|
||||
attribute USVString username;
|
||||
attribute USVString password;
|
||||
attribute USVString host;
|
||||
attribute USVString hostname;
|
||||
attribute USVString port;
|
||||
attribute USVString pathname;
|
||||
attribute USVString search;
|
||||
// readonly attribute URLSearchParams searchParams;
|
||||
attribute USVString hash;
|
||||
|
||||
// This is only doing as well as gecko right now.
|
||||
// https://github.com/servo/servo/issues/7590 is on file for
|
||||
// adding attribute stringifier support.
|
||||
stringifier;
|
||||
};
|
||||
URL implements URLUtils;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* https://url.spec.whatwg.org/#interface-urlsearchparams
|
||||
*/
|
||||
|
||||
[Constructor(optional (DOMString or URLSearchParams) init)]
|
||||
[Constructor(optional (DOMString or URLSearchParams) init/* = ""*/)]
|
||||
interface URLSearchParams {
|
||||
void append(DOMString name, DOMString value);
|
||||
void delete(DOMString name);
|
||||
|
@ -15,5 +15,7 @@ interface URLSearchParams {
|
|||
// sequence<DOMString> getAll(DOMString name);
|
||||
boolean has(DOMString name);
|
||||
void set(DOMString name, DOMString value);
|
||||
// iterable<USVString, USVString>;
|
||||
stringifier;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// https://url.spec.whatwg.org/#urlutils
|
||||
[NoInterfaceObject]
|
||||
interface URLUtils {
|
||||
//stringifier attribute USVString href;
|
||||
[SetterThrows]
|
||||
attribute USVString href;
|
||||
//readonly attribute USVString origin;
|
||||
attribute USVString protocol;
|
||||
attribute USVString username;
|
||||
attribute USVString password;
|
||||
attribute USVString host;
|
||||
attribute USVString hostname;
|
||||
attribute USVString port;
|
||||
attribute USVString pathname;
|
||||
attribute USVString search;
|
||||
// attribute URLSearchParams searchParams;
|
||||
attribute USVString hash;
|
||||
|
||||
// This is only doing as well as gecko right now.
|
||||
// https://github.com/servo/servo/issues/7590 is on file for
|
||||
// adding attribute stringifier support.
|
||||
stringifier;
|
||||
};
|
|
@ -1,26 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// https://url.spec.whatwg.org/#urlutilsreadonly
|
||||
[NoInterfaceObject/*,
|
||||
Exposed=(Window,Worker)*/]
|
||||
interface URLUtilsReadOnly {
|
||||
//stringifier readonly attribute USVString href;
|
||||
readonly attribute USVString href;
|
||||
//readonly attribute USVString origin;
|
||||
|
||||
readonly attribute USVString protocol;
|
||||
readonly attribute USVString host;
|
||||
readonly attribute USVString hostname;
|
||||
readonly attribute USVString port;
|
||||
readonly attribute USVString pathname;
|
||||
readonly attribute USVString search;
|
||||
readonly attribute USVString hash;
|
||||
|
||||
// This is only doing as well as gecko right now.
|
||||
// https://github.com/servo/servo/issues/7590 is on file for
|
||||
// adding attribute stringifier support.
|
||||
stringifier;
|
||||
};
|
|
@ -5,5 +5,19 @@
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#worker-locations
|
||||
//[Exposed=Worker]
|
||||
interface WorkerLocation { };
|
||||
WorkerLocation implements URLUtilsReadOnly;
|
||||
interface WorkerLocation {
|
||||
/*stringifier*/ readonly attribute USVString href;
|
||||
// readonly attribute USVString origin;
|
||||
readonly attribute USVString protocol;
|
||||
readonly attribute USVString host;
|
||||
readonly attribute USVString hostname;
|
||||
readonly attribute USVString port;
|
||||
readonly attribute USVString pathname;
|
||||
readonly attribute USVString search;
|
||||
readonly attribute USVString hash;
|
||||
|
||||
// This is only doing as well as gecko right now.
|
||||
// https://github.com/servo/servo/issues/7590 is on file for
|
||||
// adding attribute stringifier support.
|
||||
stringifier;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue