Bug 839912 - Implement the URLUtils interface; r=Ms2ger
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 19 Feb 2013 01:07:44 -0500
changeset 123103 eea25ab998eb086dc6e9091b270da839c80c307d
parent 123102 0db8acdceffa857532b5782839238d53d8753b50
child 123104 7731263e33fe39665f59687974c9d8f82b757b2f
push id2452
push userlsblakk@mozilla.com
push dateMon, 13 May 2013 16:59:38 +0000
treeherdermozilla-esr52@1c070ab0f9db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMs2ger
bugs839912
milestone22.0a1
Bug 839912 - Implement the URLUtils interface; r=Ms2ger
dom/webidl/HTMLAnchorElement.webidl
dom/webidl/HTMLAreaElement.webidl
dom/webidl/Location.webidl
dom/webidl/URLUtils.webidl
dom/webidl/WebIDL.mk
--- a/dom/webidl/HTMLAnchorElement.webidl
+++ b/dom/webidl/HTMLAnchorElement.webidl
@@ -31,26 +31,18 @@ interface HTMLAnchorElement : HTMLElemen
   //readonly attribute DOMTokenList relList;
            [SetterThrows]
            attribute DOMString hreflang;
            [SetterThrows]
            attribute DOMString type;
 
            [SetterThrows]
            attribute DOMString text;
-
-  // URL decomposition IDL attributes
-           attribute DOMString protocol;
-           attribute DOMString host;
-           attribute DOMString hostname;
-           attribute DOMString port;
-           attribute DOMString pathname;
-           attribute DOMString search;
-           attribute DOMString hash;
 };
+HTMLAnchorElement implements URLUtils;
 
 // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
 partial interface HTMLAnchorElement {
            [SetterThrows]
            attribute DOMString coords;
            [SetterThrows]
            attribute DOMString charset;
            [SetterThrows]
--- a/dom/webidl/HTMLAreaElement.webidl
+++ b/dom/webidl/HTMLAreaElement.webidl
@@ -33,24 +33,16 @@ interface HTMLAreaElement : HTMLElement 
   //        [SetterThrows]
   //       attribute DOMString rel;
   //readonly attribute DOMTokenList relList;
   //
   //       [SetterThrows]
   //       attribute DOMString hreflang;
   //       [SetterThrows]
   //       attribute DOMString type;
-
-  // URL decomposition IDL attributes
-           attribute DOMString protocol;
-           attribute DOMString host;
-           attribute DOMString hostname;
-           attribute DOMString port;
-           attribute DOMString pathname;
-           attribute DOMString search;
-           attribute DOMString hash;
 };
+HTMLAreaElement implements URLUtils;
 
 // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
 partial interface HTMLAreaElement {
            [SetterThrows]
            attribute boolean noHref;
 };
--- a/dom/webidl/Location.webidl
+++ b/dom/webidl/Location.webidl
@@ -11,18 +11,10 @@
  * and create derivative works of this document.
  */
 
 [Unforgeable] interface Location {
   stringifier attribute DOMString href;
   void assign(DOMString url);
   void replace(DOMString url);
   void reload();
-
-  // URL decomposition IDL attributes 
-           attribute DOMString protocol;
-           attribute DOMString host;
-           attribute DOMString hostname;
-           attribute DOMString port;
-           attribute DOMString pathname;
-           attribute DOMString search;
-           attribute DOMString hash;
 };
+Location implements URLUtils;
new file mode 100644
--- /dev/null
+++ b/dom/webidl/URLUtils.webidl
@@ -0,0 +1,33 @@
+/* -*- 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/.
+ *
+ * The origin of this IDL file is
+ * http://url.spec.whatwg.org/#urlutils
+ *
+ * To the extent possible under law, the editors have waived all copyright
+ * and related or neighboring rights to this work. In addition, as of 17
+ * February 2013, the editors have made this specification available under
+ * the Open Web Foundation Agreement Version 1.0, which is available at
+ * http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
+ */
+
+[NoInterfaceObject]
+interface URLUtils {
+  // [SetterThrows]
+  // stringifier attribute DOMString href;
+  // readonly attribute DOMString origin;
+
+           attribute DOMString protocol;
+           // attribute DOMString username;
+           // attribute DOMString password;
+           attribute DOMString host;
+           attribute DOMString hostname;
+           attribute DOMString port;
+           attribute DOMString pathname;
+           attribute DOMString search;
+           // attribute URLQuery? query;
+           attribute DOMString hash;
+};
+
--- a/dom/webidl/WebIDL.mk
+++ b/dom/webidl/WebIDL.mk
@@ -210,16 +210,17 @@ webidl_files = \
   SVGZoomAndPan.webidl \
   Text.webidl \
   TextDecoder.webidl \
   TextEncoder.webidl \
   URL.webidl \
   ValidityState.webidl \
   WebSocket.webidl \
   UndoManager.webidl \
+  URLUtils.webidl \
   USSDReceivedEvent.webidl \
   XMLHttpRequest.webidl \
   XMLHttpRequestEventTarget.webidl \
   XMLHttpRequestUpload.webidl \
   XMLSerializer.webidl \
   XMLStylesheetProcessingInstruction.webidl \
   XPathEvaluator.webidl \
   XULElement.webidl \