aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2015-10-14 01:56:15 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2015-10-19 21:05:07 +0200
commit57c423a93142e072a992aa33c3ecca9446c477b0 (patch)
treeeefe41008e917df08620b98050c035cb776ad538 /components/script
parente0c8a88410277843714a20d5fced73a392fad861 (diff)
downloadservo-57c423a93142e072a992aa33c3ecca9446c477b0.tar.gz
servo-57c423a93142e072a992aa33c3ecca9446c477b0.zip
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.
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/location.rs64
-rw-r--r--components/script/dom/url.rs42
-rw-r--r--components/script/dom/urlhelper.rs19
-rw-r--r--components/script/dom/webidls/HTMLAnchorElement.webidl2
-rw-r--r--components/script/dom/webidls/HTMLAreaElement.webidl7
-rw-r--r--components/script/dom/webidls/HTMLHyperlinkElementUtils.webidl20
-rw-r--r--components/script/dom/webidls/Location.webidl22
-rw-r--r--components/script/dom/webidls/URL.webidl20
-rw-r--r--components/script/dom/webidls/URLSearchParams.webidl4
-rw-r--r--components/script/dom/webidls/URLUtils.webidl28
-rw-r--r--components/script/dom/webidls/URLUtilsReadOnly.webidl26
-rw-r--r--components/script/dom/webidls/WorkerLocation.webidl18
-rw-r--r--components/script/dom/workerlocation.rs18
13 files changed, 131 insertions, 159 deletions
diff --git a/components/script/dom/location.rs b/components/script/dom/location.rs
index 230cf2748da..a9e788a7b04 100644
--- a/components/script/dom/location.rs
+++ b/components/script/dom/location.rs
@@ -4,7 +4,6 @@
use dom::bindings::codegen::Bindings::LocationBinding;
use dom::bindings::codegen::Bindings::LocationBinding::LocationMethods;
-use dom::bindings::error::ErrorResult;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JS, Root};
use dom::bindings::str::USVString;
@@ -48,11 +47,11 @@ impl Location {
impl LocationMethods for Location {
// https://html.spec.whatwg.org/multipage/#dom-location-assign
- fn Assign(&self, url: DOMString) {
+ fn Assign(&self, url: USVString) {
// TODO: per spec, we should use the _API base URL_ specified by the
// _entry settings object_.
let base_url = self.window.get_url();
- if let Ok(url) = UrlParser::new().base_url(&base_url).parse(&url) {
+ if let Ok(url) = UrlParser::new().base_url(&base_url).parse(&url.0) {
self.window.load_url(url);
}
}
@@ -62,111 +61,90 @@ impl LocationMethods for Location {
self.window.load_url(self.get_url());
}
- // https://url.spec.whatwg.org/#dom-urlutils-hash
+ // https://html.spec.whatwg.org/multipage/#dom-location-hash
fn Hash(&self) -> USVString {
UrlHelper::Hash(&self.get_url())
}
- // https://url.spec.whatwg.org/#dom-urlutils-hash
+ // https://html.spec.whatwg.org/multipage/#dom-location-hash
fn SetHash(&self, value: USVString) {
self.set_url_component(value, UrlHelper::SetHash);
}
- // https://url.spec.whatwg.org/#dom-urlutils-host
+ // https://html.spec.whatwg.org/multipage/#dom-location-host
fn Host(&self) -> USVString {
UrlHelper::Host(&self.get_url())
}
- // https://url.spec.whatwg.org/#dom-urlutils-host
+ // https://html.spec.whatwg.org/multipage/#dom-location-host
fn SetHost(&self, value: USVString) {
self.set_url_component(value, UrlHelper::SetHost);
}
- // https://url.spec.whatwg.org/#dom-urlutils-hostname
+ // https://html.spec.whatwg.org/multipage/#dom-location-hostname
fn Hostname(&self) -> USVString {
UrlHelper::Hostname(&self.get_url())
}
- // https://url.spec.whatwg.org/#dom-urlutils-hostname
+ // https://html.spec.whatwg.org/multipage/#dom-location-hostname
fn SetHostname(&self, value: USVString) {
self.set_url_component(value, UrlHelper::SetHostname);
}
- // https://url.spec.whatwg.org/#dom-urlutils-href
+ // https://html.spec.whatwg.org/multipage/#dom-location-href
fn Href(&self) -> USVString {
UrlHelper::Href(&self.get_url())
}
- // https://url.spec.whatwg.org/#dom-urlutils-href
- fn SetHref(&self, value: USVString) -> ErrorResult {
+ // https://html.spec.whatwg.org/multipage/#dom-location-href
+ fn SetHref(&self, value: USVString) {
if let Ok(url) = UrlParser::new().base_url(&self.window.get_url()).parse(&value.0) {
self.window.load_url(url);
- };
- Ok(())
- }
-
- // https://url.spec.whatwg.org/#dom-urlutils-password
- fn Password(&self) -> USVString {
- UrlHelper::Password(&self.get_url())
- }
-
- // https://url.spec.whatwg.org/#dom-urlutils-password
- fn SetPassword(&self, value: USVString) {
- self.set_url_component(value, UrlHelper::SetPassword);
+ }
}
- // https://url.spec.whatwg.org/#dom-urlutils-pathname
+ // https://html.spec.whatwg.org/multipage/#dom-location-pathname
fn Pathname(&self) -> USVString {
UrlHelper::Pathname(&self.get_url())
}
- // https://url.spec.whatwg.org/#dom-urlutils-pathname
+ // https://html.spec.whatwg.org/multipage/#dom-location-pathname
fn SetPathname(&self, value: USVString) {
self.set_url_component(value, UrlHelper::SetPathname);
}
- // https://url.spec.whatwg.org/#dom-urlutils-port
+ // https://html.spec.whatwg.org/multipage/#dom-location-port
fn Port(&self) -> USVString {
UrlHelper::Port(&self.get_url())
}
- // https://url.spec.whatwg.org/#dom-urlutils-port
+ // https://html.spec.whatwg.org/multipage/#dom-location-port
fn SetPort(&self, value: USVString) {
self.set_url_component(value, UrlHelper::SetPort);
}
- // https://url.spec.whatwg.org/#dom-urlutils-protocol
+ // https://html.spec.whatwg.org/multipage/#dom-location-protocol
fn Protocol(&self) -> USVString {
UrlHelper::Protocol(&self.get_url())
}
- // https://url.spec.whatwg.org/#dom-urlutils-protocol
+ // https://html.spec.whatwg.org/multipage/#dom-location-protocol
fn SetProtocol(&self, value: USVString) {
self.set_url_component(value, UrlHelper::SetProtocol);
}
- // https://url.spec.whatwg.org/#URLUtils-stringification-behavior
+ // https://html.spec.whatwg.org/multipage/#dom-location-href
fn Stringifier(&self) -> DOMString {
self.Href().0
}
- // https://url.spec.whatwg.org/#dom-urlutils-search
+ // https://html.spec.whatwg.org/multipage/#dom-location-search
fn Search(&self) -> USVString {
UrlHelper::Search(&self.get_url())
}
- // https://url.spec.whatwg.org/#dom-urlutils-search
+ // https://html.spec.whatwg.org/multipage/#dom-location-search
fn SetSearch(&self, value: USVString) {
self.set_url_component(value, UrlHelper::SetSearch);
}
-
- // https://url.spec.whatwg.org/#dom-urlutils-username
- fn Username(&self) -> USVString {
- UrlHelper::Username(&self.get_url())
- }
-
- // https://url.spec.whatwg.org/#dom-urlutils-username
- fn SetUsername(&self, value: USVString) {
- self.set_url_component(value, UrlHelper::SetUsername);
- }
}
diff --git a/components/script/dom/url.rs b/components/script/dom/url.rs
index 4a3bb19a776..9ff22b53597 100644
--- a/components/script/dom/url.rs
+++ b/components/script/dom/url.rs
@@ -88,42 +88,42 @@ impl URL {
}
impl URLMethods for URL {
- // https://url.spec.whatwg.org/#dom-urlutils-hash
+ // https://url.spec.whatwg.org/#dom-url-hash
fn Hash(&self) -> USVString {
UrlHelper::Hash(&self.url.borrow())
}
- // https://url.spec.whatwg.org/#dom-urlutils-hash
+ // https://url.spec.whatwg.org/#dom-url-hash
fn SetHash(&self, value: USVString) {
UrlHelper::SetHash(&mut self.url.borrow_mut(), value);
}
- // https://url.spec.whatwg.org/#dom-urlutils-host
+ // https://url.spec.whatwg.org/#dom-url-host
fn Host(&self) -> USVString {
UrlHelper::Host(&self.url.borrow())
}
- // https://url.spec.whatwg.org/#dom-urlutils-host
+ // https://url.spec.whatwg.org/#dom-url-host
fn SetHost(&self, value: USVString) {
UrlHelper::SetHost(&mut self.url.borrow_mut(), value);
}
- // https://url.spec.whatwg.org/#dom-urlutils-hostname
+ // https://url.spec.whatwg.org/#dom-url-hostname
fn Hostname(&self) -> USVString {
UrlHelper::Hostname(&self.url.borrow())
}
- // https://url.spec.whatwg.org/#dom-urlutils-hostname
+ // https://url.spec.whatwg.org/#dom-url-hostname
fn SetHostname(&self, value: USVString) {
UrlHelper::SetHostname(&mut self.url.borrow_mut(), value);
}
- // https://url.spec.whatwg.org/#dom-urlutils-href
+ // https://url.spec.whatwg.org/#dom-url-href
fn Href(&self) -> USVString {
UrlHelper::Href(&self.url.borrow())
}
- // https://url.spec.whatwg.org/#dom-urlutils-href
+ // https://url.spec.whatwg.org/#dom-url-href
fn SetHref(&self, value: USVString) -> ErrorResult {
match parse_with_base(value, self.base.as_ref()) {
Ok(url) => {
@@ -136,67 +136,67 @@ impl URLMethods for URL {
}
}
- // https://url.spec.whatwg.org/#dom-urlutils-password
+ // https://url.spec.whatwg.org/#dom-url-password
fn Password(&self) -> USVString {
UrlHelper::Password(&self.url.borrow())
}
- // https://url.spec.whatwg.org/#dom-urlutils-password
+ // https://url.spec.whatwg.org/#dom-url-password
fn SetPassword(&self, value: USVString) {
UrlHelper::SetPassword(&mut self.url.borrow_mut(), value);
}
- // https://url.spec.whatwg.org/#dom-urlutils-pathname
+ // https://url.spec.whatwg.org/#dom-url-pathname
fn Pathname(&self) -> USVString {
UrlHelper::Pathname(&self.url.borrow())
}
- // https://url.spec.whatwg.org/#dom-urlutils-pathname
+ // https://url.spec.whatwg.org/#dom-url-pathname
fn SetPathname(&self, value: USVString) {
UrlHelper::SetPathname(&mut self.url.borrow_mut(), value);
}
- // https://url.spec.whatwg.org/#dom-urlutils-port
+ // https://url.spec.whatwg.org/#dom-url-port
fn Port(&self) -> USVString {
UrlHelper::Port(&self.url.borrow())
}
- // https://url.spec.whatwg.org/#dom-urlutils-port
+ // https://url.spec.whatwg.org/#dom-url-port
fn SetPort(&self, value: USVString) {
UrlHelper::SetPort(&mut self.url.borrow_mut(), value);
}
- // https://url.spec.whatwg.org/#dom-urlutils-protocol
+ // https://url.spec.whatwg.org/#dom-url-protocol
fn Protocol(&self) -> USVString {
UrlHelper::Protocol(&self.url.borrow())
}
- // https://url.spec.whatwg.org/#dom-urlutils-protocol
+ // https://url.spec.whatwg.org/#dom-url-protocol
fn SetProtocol(&self, value: USVString) {
UrlHelper::SetProtocol(&mut self.url.borrow_mut(), value);
}
- // https://url.spec.whatwg.org/#dom-urlutils-search
+ // https://url.spec.whatwg.org/#dom-url-search
fn Search(&self) -> USVString {
UrlHelper::Search(&self.url.borrow())
}
- // https://url.spec.whatwg.org/#dom-urlutils-search
+ // https://url.spec.whatwg.org/#dom-url-search
fn SetSearch(&self, value: USVString) {
UrlHelper::SetSearch(&mut self.url.borrow_mut(), value);
}
- // https://url.spec.whatwg.org/#URLUtils-stringification-behavior
+ // https://url.spec.whatwg.org/#dom-url-href
fn Stringifier(&self) -> DOMString {
self.Href().0
}
- // https://url.spec.whatwg.org/#dom-urlutils-username
+ // https://url.spec.whatwg.org/#dom-url-username
fn Username(&self) -> USVString {
UrlHelper::Username(&self.url.borrow())
}
- // https://url.spec.whatwg.org/#dom-urlutils-username
+ // https://url.spec.whatwg.org/#dom-url-username
fn SetUsername(&self, value: USVString) {
UrlHelper::SetUsername(&mut self.url.borrow_mut(), value);
}
diff --git a/components/script/dom/urlhelper.rs b/components/script/dom/urlhelper.rs
index 8d6916c0551..d9e26e84263 100644
--- a/components/script/dom/urlhelper.rs
+++ b/components/script/dom/urlhelper.rs
@@ -12,7 +12,6 @@ use url::{SchemeData, Url, UrlParser};
pub struct UrlHelper;
impl UrlHelper {
- // https://url.spec.whatwg.org/#dom-urlutils-hash
pub fn Hash(url: &Url) -> USVString {
USVString(match url.fragment {
None => "".to_owned(),
@@ -21,13 +20,11 @@ impl UrlHelper {
})
}
- // https://url.spec.whatwg.org/#dom-urlutils-hash
pub fn SetHash(url: &mut Url, value: USVString) {
let mut wrapper = UrlUtilsWrapper { url: url, parser: &UrlParser::new() };
let _ = wrapper.set_fragment(&value.0);
}
- // https://url.spec.whatwg.org/#dom-urlutils-host
pub fn Host(url: &Url) -> USVString {
USVString(match url.scheme_data {
SchemeData::NonRelative(..) => "".to_owned(),
@@ -41,40 +38,33 @@ impl UrlHelper {
})
}
- // https://url.spec.whatwg.org/#dom-urlutils-host
pub fn SetHost(url: &mut Url, value: USVString) {
let mut wrapper = UrlUtilsWrapper { url: url, parser: &UrlParser::new() };
let _ = wrapper.set_host(&value.0);
}
- // https://url.spec.whatwg.org/#dom-urlutils-hostname
pub fn Hostname(url: &Url) -> USVString {
USVString(url.serialize_host().unwrap_or_else(|| "".to_owned()))
}
- // https://url.spec.whatwg.org/#dom-urlutils-hostname
pub fn SetHostname(url: &mut Url, value: USVString) {
let mut wrapper = UrlUtilsWrapper { url: url, parser: &UrlParser::new() };
let _ = wrapper.set_host_and_port(&value.0);
}
- // https://url.spec.whatwg.org/#dom-urlutils-href
pub fn Href(url: &Url) -> USVString {
USVString(url.serialize())
}
- // https://url.spec.whatwg.org/#dom-urlutils-password
pub fn Password(url: &Url) -> USVString {
USVString(url.password().unwrap_or("").to_owned())
}
- // https://url.spec.whatwg.org/#dom-urlutils-password
pub fn SetPassword(url: &mut Url, value: USVString) {
let mut wrapper = UrlUtilsWrapper { url: url, parser: &UrlParser::new() };
let _ = wrapper.set_password(&value.0);
}
- // https://url.spec.whatwg.org/#dom-urlutils-pathname
pub fn Pathname(url: &Url) -> USVString {
USVString(match url.scheme_data {
SchemeData::NonRelative(ref scheme_data) => scheme_data.clone(),
@@ -82,13 +72,11 @@ impl UrlHelper {
})
}
- // https://url.spec.whatwg.org/#dom-urlutils-pathname
pub fn SetPathname(url: &mut Url, value: USVString) {
let mut wrapper = UrlUtilsWrapper { url: url, parser: &UrlParser::new() };
let _ = wrapper.set_path(&value.0);
}
- // https://url.spec.whatwg.org/#dom-urlutils-port
pub fn Port(url: &Url) -> USVString {
USVString(match url.port() {
None => "".to_owned(),
@@ -96,18 +84,15 @@ impl UrlHelper {
})
}
- // https://url.spec.whatwg.org/#dom-urlutils-port
pub fn SetPort(url: &mut Url, value: USVString) {
let mut wrapper = UrlUtilsWrapper { url: url, parser: &UrlParser::new() };
let _ = wrapper.set_port(&value.0);
}
- // https://url.spec.whatwg.org/#dom-urlutils-protocol
pub fn Protocol(url: &Url) -> USVString {
USVString(format!("{}:", url.scheme.clone()))
}
- // https://url.spec.whatwg.org/#dom-urlutils-protocol
pub fn SetProtocol(url: &mut Url, value: USVString) {
let mut wrapper = UrlUtilsWrapper { url: url, parser: &UrlParser::new() };
let _ = wrapper.set_scheme(&value.0);
@@ -127,7 +112,6 @@ impl UrlHelper {
true
}
- // https://url.spec.whatwg.org/#dom-urlutils-search
pub fn Search(url: &Url) -> USVString {
USVString(match url.query {
None => "".to_owned(),
@@ -136,18 +120,15 @@ impl UrlHelper {
})
}
- // https://url.spec.whatwg.org/#dom-urlutils-search
pub fn SetSearch(url: &mut Url, value: USVString) {
let mut wrapper = UrlUtilsWrapper { url: url, parser: &UrlParser::new() };
let _ = wrapper.set_query(&value.0);
}
- // https://url.spec.whatwg.org/#dom-urlutils-username
pub fn Username(url: &Url) -> USVString {
USVString(url.username().unwrap_or("").to_owned())
}
- // https://url.spec.whatwg.org/#dom-urlutils-username
pub fn SetUsername(url: &mut Url, value: USVString) {
let mut wrapper = UrlUtilsWrapper { url: url, parser: &UrlParser::new() };
let _ = wrapper.set_username(&value.0);
diff --git a/components/script/dom/webidls/HTMLAnchorElement.webidl b/components/script/dom/webidls/HTMLAnchorElement.webidl
index f21e3dc6af7..6585e1ccc56 100644
--- a/components/script/dom/webidls/HTMLAnchorElement.webidl
+++ b/components/script/dom/webidls/HTMLAnchorElement.webidl
@@ -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 {
diff --git a/components/script/dom/webidls/HTMLAreaElement.webidl b/components/script/dom/webidls/HTMLAreaElement.webidl
index 860e9af008a..a6568bd0b6b 100644
--- a/components/script/dom/webidls/HTMLAreaElement.webidl
+++ b/components/script/dom/webidls/HTMLAreaElement.webidl
@@ -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 {
diff --git a/components/script/dom/webidls/HTMLHyperlinkElementUtils.webidl b/components/script/dom/webidls/HTMLHyperlinkElementUtils.webidl
new file mode 100644
index 00000000000..c8d7a35493d
--- /dev/null
+++ b/components/script/dom/webidls/HTMLHyperlinkElementUtils.webidl
@@ -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;
+//};
diff --git a/components/script/dom/webidls/Location.webidl b/components/script/dom/webidls/Location.webidl
index 70b496b00ec..f82031ac74b 100644
--- a/components/script/dom/webidls/Location.webidl
+++ b/components/script/dom/webidls/Location.webidl
@@ -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;
diff --git a/components/script/dom/webidls/URL.webidl b/components/script/dom/webidls/URL.webidl
index 2e03ea9b858..57ae34a3eba 100644
--- a/components/script/dom/webidls/URL.webidl
+++ b/components/script/dom/webidls/URL.webidl
@@ -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;
diff --git a/components/script/dom/webidls/URLSearchParams.webidl b/components/script/dom/webidls/URLSearchParams.webidl
index 1afdc30a352..4ab1cd43019 100644
--- a/components/script/dom/webidls/URLSearchParams.webidl
+++ b/components/script/dom/webidls/URLSearchParams.webidl
@@ -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;
};
+
diff --git a/components/script/dom/webidls/URLUtils.webidl b/components/script/dom/webidls/URLUtils.webidl
deleted file mode 100644
index bb32fb82e5e..00000000000
--- a/components/script/dom/webidls/URLUtils.webidl
+++ /dev/null
@@ -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;
-};
diff --git a/components/script/dom/webidls/URLUtilsReadOnly.webidl b/components/script/dom/webidls/URLUtilsReadOnly.webidl
deleted file mode 100644
index a919986bbbe..00000000000
--- a/components/script/dom/webidls/URLUtilsReadOnly.webidl
+++ /dev/null
@@ -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;
-};
diff --git a/components/script/dom/webidls/WorkerLocation.webidl b/components/script/dom/webidls/WorkerLocation.webidl
index 7d624118271..598e210de44 100644
--- a/components/script/dom/webidls/WorkerLocation.webidl
+++ b/components/script/dom/webidls/WorkerLocation.webidl
@@ -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;
+};
diff --git a/components/script/dom/workerlocation.rs b/components/script/dom/workerlocation.rs
index 467d2fef7ee..477c329cf75 100644
--- a/components/script/dom/workerlocation.rs
+++ b/components/script/dom/workerlocation.rs
@@ -36,47 +36,47 @@ impl WorkerLocation {
}
impl WorkerLocationMethods for WorkerLocation {
- // https://url.spec.whatwg.org/#dom-urlutils-hash
+ // https://html.spec.whatwg.org/multipage/#dom-workerlocation-hash
fn Hash(&self) -> USVString {
UrlHelper::Hash(&self.url)
}
- // https://url.spec.whatwg.org/#dom-urlutils-host
+ // https://html.spec.whatwg.org/multipage/#dom-workerlocation-host
fn Host(&self) -> USVString {
UrlHelper::Host(&self.url)
}
- // https://url.spec.whatwg.org/#dom-urlutils-hostname
+ // https://html.spec.whatwg.org/multipage/#dom-workerlocation-hostname
fn Hostname(&self) -> USVString {
UrlHelper::Hostname(&self.url)
}
- // https://url.spec.whatwg.org/#dom-urlutils-href
+ // https://html.spec.whatwg.org/multipage/#dom-workerlocation-href
fn Href(&self) -> USVString {
UrlHelper::Href(&self.url)
}
- // https://url.spec.whatwg.org/#dom-urlutils-pathname
+ // https://html.spec.whatwg.org/multipage/#dom-workerlocation-pathname
fn Pathname(&self) -> USVString {
UrlHelper::Pathname(&self.url)
}
- // https://url.spec.whatwg.org/#dom-urlutils-port
+ // https://html.spec.whatwg.org/multipage/#dom-workerlocation-port
fn Port(&self) -> USVString {
UrlHelper::Port(&self.url)
}
- // https://url.spec.whatwg.org/#dom-urlutils-protocol
+ // https://html.spec.whatwg.org/multipage/#dom-workerlocation-protocol
fn Protocol(&self) -> USVString {
UrlHelper::Protocol(&self.url)
}
- // https://url.spec.whatwg.org/#dom-urlutils-search
+ // https://html.spec.whatwg.org/multipage/#dom-workerlocation-search
fn Search(&self) -> USVString {
UrlHelper::Search(&self.url)
}
- // https://url.spec.whatwg.org/#URLUtils-stringification-behavior
+ // https://html.spec.whatwg.org/multipage/#dom-workerlocation-href
fn Stringifier(&self) -> DOMString {
self.Href().0
}