Bug 824823 part 2. WebIDL binding for HTMLAnchorElement. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 04 Jan 2013 12:02:13 -0500
changeset 126728 3a73a1fa423b415204a325624a9228cd923b0561
parent 126727 ce3ac746bfca1bd3d018d4a2e1346185d706a86a
child 126729 f79cb09fd2cb2715fb3f8cca4d315a984224c75d
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs824823
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 824823 part 2. WebIDL binding for HTMLAnchorElement. r=peterv
content/base/src/Link.cpp
content/base/src/Link.h
content/html/content/src/HTMLAnchorElement.cpp
content/html/content/src/HTMLAnchorElement.h
content/html/content/src/nsHTMLAreaElement.cpp
content/html/content/src/nsHTMLDNSPrefetch.cpp
dom/bindings/Bindings.conf
dom/webidl/HTMLAnchorElement.webidl
dom/webidl/WebIDL.mk
js/xpconnect/src/dom_quickstubs.qsconf
--- a/content/base/src/Link.cpp
+++ b/content/base/src/Link.cpp
@@ -136,43 +136,42 @@ Link::GetURI() const
   // We want to cache the URI if we have it
   if (uri) {
     mCachedURI = uri;
   }
 
   return uri.forget();
 }
 
-nsresult
+void
 Link::SetProtocol(const nsAString &aProtocol)
 {
   nsCOMPtr<nsIURI> uri(GetURIToMutate());
   if (!uri) {
     // Ignore failures to be compatible with NS4.
-    return NS_OK;
+    return;
   }
 
   nsAString::const_iterator start, end;
   aProtocol.BeginReading(start);
   aProtocol.EndReading(end);
   nsAString::const_iterator iter(start);
   (void)FindCharInReadable(':', iter, end);
   (void)uri->SetScheme(NS_ConvertUTF16toUTF8(Substring(start, iter)));
 
   SetHrefAttribute(uri);
-  return NS_OK;
 }
 
-nsresult
+void
 Link::SetHost(const nsAString &aHost)
 {
   nsCOMPtr<nsIURI> uri(GetURIToMutate());
   if (!uri) {
     // Ignore failures to be compatible with NS4.
-    return NS_OK;
+    return;
   }
 
   // We cannot simply call nsIURI::SetHost because that would treat the name as
   // an IPv6 address (like http:://[server:443]/).  We also cannot call
   // nsIURI::SetHostPort because that isn't implemented.  Sadfaces.
 
   // First set the hostname.
   nsAString::const_iterator start, end;
@@ -192,238 +191,228 @@ Link::SetHost(const nsAString &aHost)
       int32_t port = portStr.ToInteger(&rv);
       if (NS_SUCCEEDED(rv)) {
         (void)uri->SetPort(port);
       }
     }
   };
 
   SetHrefAttribute(uri);
-  return NS_OK;
+  return;
 }
 
-nsresult
+void
 Link::SetHostname(const nsAString &aHostname)
 {
   nsCOMPtr<nsIURI> uri(GetURIToMutate());
   if (!uri) {
     // Ignore failures to be compatible with NS4.
-    return NS_OK;
+    return;
   }
 
   (void)uri->SetHost(NS_ConvertUTF16toUTF8(aHostname));
   SetHrefAttribute(uri);
-  return NS_OK;
 }
 
-nsresult
+void
 Link::SetPathname(const nsAString &aPathname)
 {
   nsCOMPtr<nsIURI> uri(GetURIToMutate());
   nsCOMPtr<nsIURL> url(do_QueryInterface(uri));
   if (!url) {
     // Ignore failures to be compatible with NS4.
-    return NS_OK;
+    return;
   }
 
   (void)url->SetFilePath(NS_ConvertUTF16toUTF8(aPathname));
   SetHrefAttribute(uri);
-  return NS_OK;
 }
 
-nsresult
+void
 Link::SetSearch(const nsAString &aSearch)
 {
   nsCOMPtr<nsIURI> uri(GetURIToMutate());
   nsCOMPtr<nsIURL> url(do_QueryInterface(uri));
   if (!url) {
     // Ignore failures to be compatible with NS4.
-    return NS_OK;
+    return;
   }
 
   (void)url->SetQuery(NS_ConvertUTF16toUTF8(aSearch));
   SetHrefAttribute(uri);
-  return NS_OK;
 }
 
-nsresult
+void
 Link::SetPort(const nsAString &aPort)
 {
   nsCOMPtr<nsIURI> uri(GetURIToMutate());
   if (!uri) {
     // Ignore failures to be compatible with NS4.
-    return NS_OK;
+    return;
   }
 
   nsresult rv;
   nsAutoString portStr(aPort);
   int32_t port = portStr.ToInteger(&rv);
   if (NS_FAILED(rv)) {
-    return NS_OK;
+    return;
   }
 
   (void)uri->SetPort(port);
   SetHrefAttribute(uri);
-  return NS_OK;
 }
 
-nsresult
+void
 Link::SetHash(const nsAString &aHash)
 {
   nsCOMPtr<nsIURI> uri(GetURIToMutate());
   if (!uri) {
     // Ignore failures to be compatible with NS4.
-    return NS_OK;
+    return;
   }
 
   (void)uri->SetRef(NS_ConvertUTF16toUTF8(aHash));
   SetHrefAttribute(uri);
-  return NS_OK;
 }
 
-nsresult
+void
 Link::GetProtocol(nsAString &_protocol)
 {
   nsCOMPtr<nsIURI> uri(GetURI());
   if (!uri) {
     _protocol.AssignLiteral("http");
   }
   else {
     nsAutoCString scheme;
     (void)uri->GetScheme(scheme);
     CopyASCIItoUTF16(scheme, _protocol);
   }
   _protocol.Append(PRUnichar(':'));
-  return NS_OK;
+  return;
 }
 
-nsresult
+void
 Link::GetHost(nsAString &_host)
 {
   _host.Truncate();
 
   nsCOMPtr<nsIURI> uri(GetURI());
   if (!uri) {
     // Do not throw!  Not having a valid URI should result in an empty string.
-    return NS_OK;
+    return;
   }
 
   nsAutoCString hostport;
   nsresult rv = uri->GetHostPort(hostport);
   if (NS_SUCCEEDED(rv)) {
     CopyUTF8toUTF16(hostport, _host);
   }
-  return NS_OK;
 }
 
-nsresult
+void
 Link::GetHostname(nsAString &_hostname)
 {
   _hostname.Truncate();
 
   nsCOMPtr<nsIURI> uri(GetURI());
   if (!uri) {
     // Do not throw!  Not having a valid URI should result in an empty string.
-    return NS_OK;
+    return;
   }
 
   nsAutoCString host;
   nsresult rv = uri->GetHost(host);
   // Note that failure to get the host from the URI is not necessarily a bad
   // thing.  Some URIs do not have a host.
   if (NS_SUCCEEDED(rv)) {
     CopyUTF8toUTF16(host, _hostname);
   }
-  return NS_OK;
 }
 
-nsresult
+void
 Link::GetPathname(nsAString &_pathname)
 {
   _pathname.Truncate();
 
   nsCOMPtr<nsIURI> uri(GetURI());
   nsCOMPtr<nsIURL> url(do_QueryInterface(uri));
   if (!url) {
     // Do not throw!  Not having a valid URI or URL should result in an empty
     // string.
-    return NS_OK;
+    return;
   }
 
   nsAutoCString file;
   nsresult rv = url->GetFilePath(file);
-  NS_ENSURE_SUCCESS(rv, rv);
-  CopyUTF8toUTF16(file, _pathname);
-  return NS_OK;
+  if (NS_SUCCEEDED(rv)) {
+    CopyUTF8toUTF16(file, _pathname);
+  }
 }
 
-nsresult
+void
 Link::GetSearch(nsAString &_search)
 {
   _search.Truncate();
 
   nsCOMPtr<nsIURI> uri(GetURI());
   nsCOMPtr<nsIURL> url(do_QueryInterface(uri));
   if (!url) {
     // Do not throw!  Not having a valid URI or URL should result in an empty
     // string.
-    return NS_OK;
+    return;
   }
 
   nsAutoCString search;
   nsresult rv = url->GetQuery(search);
   if (NS_SUCCEEDED(rv) && !search.IsEmpty()) {
     CopyUTF8toUTF16(NS_LITERAL_CSTRING("?") + search, _search);
   }
-  return NS_OK;
 }
 
-nsresult
+void
 Link::GetPort(nsAString &_port)
 {
   _port.Truncate();
 
   nsCOMPtr<nsIURI> uri(GetURI());
   if (!uri) {
     // Do not throw!  Not having a valid URI should result in an empty string.
-    return NS_OK;
+    return;
   }
 
   int32_t port;
   nsresult rv = uri->GetPort(&port);
   // Note that failure to get the port from the URI is not necessarily a bad
   // thing.  Some URIs do not have a port.
   if (NS_SUCCEEDED(rv) && port != -1) {
     nsAutoString portStr;
     portStr.AppendInt(port, 10);
     _port.Assign(portStr);
   }
-  return NS_OK;
 }
 
-nsresult
+void
 Link::GetHash(nsAString &_hash)
 {
   _hash.Truncate();
 
   nsCOMPtr<nsIURI> uri(GetURI());
   if (!uri) {
     // Do not throw!  Not having a valid URI should result in an empty
     // string.
-    return NS_OK;
+    return;
   }
 
   nsAutoCString ref;
   nsresult rv = uri->GetRef(ref);
   if (NS_SUCCEEDED(rv) && !ref.IsEmpty()) {
     NS_UnescapeURL(ref); // XXX may result in random non-ASCII bytes!
     _hash.Assign(PRUnichar('#'));
     AppendUTF8toUTF16(ref, _hash);
   }
-  return NS_OK;
 }
 
 void
 Link::ResetLinkState(bool aNotify, bool aHasHref)
 {
   nsLinkState defaultState;
 
   // The default state for links with an href is unvisited.
--- a/content/base/src/Link.h
+++ b/content/base/src/Link.h
@@ -48,30 +48,30 @@ public:
   already_AddRefed<nsIURI> GetURI() const;
   virtual already_AddRefed<nsIURI> GetURIExternal() const {
     return GetURI();
   }
 
   /**
    * Helper methods for modifying and obtaining parts of the URI of the Link.
    */
-  nsresult SetProtocol(const nsAString &aProtocol);
-  nsresult SetHost(const nsAString &aHost);
-  nsresult SetHostname(const nsAString &aHostname);
-  nsresult SetPathname(const nsAString &aPathname);
-  nsresult SetSearch(const nsAString &aSearch);
-  nsresult SetPort(const nsAString &aPort);
-  nsresult SetHash(const nsAString &aHash);
-  nsresult GetProtocol(nsAString &_protocol);
-  nsresult GetHost(nsAString &_host);
-  nsresult GetHostname(nsAString &_hostname);
-  nsresult GetPathname(nsAString &_pathname);
-  nsresult GetSearch(nsAString &_search);
-  nsresult GetPort(nsAString &_port);
-  nsresult GetHash(nsAString &_hash);
+  void SetProtocol(const nsAString &aProtocol);
+  void SetHost(const nsAString &aHost);
+  void SetHostname(const nsAString &aHostname);
+  void SetPathname(const nsAString &aPathname);
+  void SetSearch(const nsAString &aSearch);
+  void SetPort(const nsAString &aPort);
+  void SetHash(const nsAString &aHash);
+  void GetProtocol(nsAString &_protocol);
+  void GetHost(nsAString &_host);
+  void GetHostname(nsAString &_hostname);
+  void GetPathname(nsAString &_pathname);
+  void GetSearch(nsAString &_search);
+  void GetPort(nsAString &_port);
+  void GetHash(nsAString &_hash);
 
   /**
    * Invalidates any link caching, and resets the state to the default.
    *
    * @param aNotify
    *        true if ResetLinkState should notify the owning document about style
    *        changes or false if it should not.
    */
--- a/content/html/content/src/HTMLAnchorElement.cpp
+++ b/content/html/content/src/HTMLAnchorElement.cpp
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set tw=80 expandtab softtabstop=2 ts=2 sw=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/. */
 
 #include "mozilla/dom/HTMLAnchorElement.h"
+#include "mozilla/dom/HTMLAnchorElementBinding.h"
 
 #include "nsCOMPtr.h"
 #include "nsContentUtils.h"
 #include "nsGkAtoms.h"
 #include "nsIPresShell.h"
 #include "nsIDocument.h"
 #include "nsPresContext.h"
 #include "nsHTMLDNSPrefetch.h"
@@ -51,16 +52,21 @@ NS_INTERFACE_TABLE_HEAD(HTMLAnchorElemen
                                    Link)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLAnchorElement,
                                                nsGenericHTMLElement)
 NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLAnchorElement)
 
 
 NS_IMPL_ELEMENT_CLONE(HTMLAnchorElement)
 
+JSObject*
+HTMLAnchorElement::WrapNode(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap)
+{
+  return HTMLAnchorElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
+}
 
 NS_IMPL_STRING_ATTR(HTMLAnchorElement, Charset, charset)
 NS_IMPL_STRING_ATTR(HTMLAnchorElement, Coords, coords)
 NS_IMPL_URI_ATTR(HTMLAnchorElement, Href, href)
 NS_IMPL_STRING_ATTR(HTMLAnchorElement, Hreflang, hreflang)
 NS_IMPL_STRING_ATTR(HTMLAnchorElement, Name, name)
 NS_IMPL_STRING_ATTR(HTMLAnchorElement, Rel, rel)
 NS_IMPL_STRING_ATTR(HTMLAnchorElement, Rev, rev)
@@ -269,22 +275,24 @@ HTMLAnchorElement::SetTarget(const nsASt
 {
   return SetAttr(kNameSpaceID_None, nsGkAtoms::target, aValue, true);
 }
 
 #define IMPL_URI_PART(_part)                                 \
   NS_IMETHODIMP                                              \
   HTMLAnchorElement::Get##_part(nsAString& a##_part)         \
   {                                                          \
-    return Link::Get##_part(a##_part);                       \
+    Link::Get##_part(a##_part);                              \
+    return NS_OK;                                            \
   }                                                          \
   NS_IMETHODIMP                                              \
   HTMLAnchorElement::Set##_part(const nsAString& a##_part)   \
   {                                                          \
-    return Link::Set##_part(a##_part);                       \
+    Link::Set##_part(a##_part);                              \
+    return NS_OK;                                            \
   }
 
 IMPL_URI_PART(Protocol)
 IMPL_URI_PART(Host)
 IMPL_URI_PART(Hostname)
 IMPL_URI_PART(Pathname)
 IMPL_URI_PART(Search)
 IMPL_URI_PART(Port)
--- a/content/html/content/src/HTMLAnchorElement.h
+++ b/content/html/content/src/HTMLAnchorElement.h
@@ -23,16 +23,17 @@ class HTMLAnchorElement : public nsGener
 public:
   using Element::GetText;
   using Element::SetText;
 
   HTMLAnchorElement(already_AddRefed<nsINodeInfo> aNodeInfo)
     : nsGenericHTMLElement(aNodeInfo)
     , Link(this)
   {
+    SetIsDOMBinding();
   }
   virtual ~HTMLAnchorElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
@@ -92,17 +93,121 @@ public:
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 
   virtual void OnDNSPrefetchDeferred();
   virtual void OnDNSPrefetchRequested();
   virtual bool HasDeferredDNSPrefetchRequest();
 
+  // WebIDL API
+  void GetHref(nsString& aValue)
+  {
+    GetHTMLURIAttr(nsGkAtoms::href, aValue);
+  }
+  void SetHref(const nsAString& aValue, mozilla::ErrorResult& rv)
+  {
+    SetHTMLAttr(nsGkAtoms::href, aValue, rv);
+  }
+  // The XPCOM GetTarget is OK for us
+  void SetTarget(const nsAString& aValue, mozilla::ErrorResult& rv)
+  {
+    SetHTMLAttr(nsGkAtoms::target, aValue, rv);
+  }
+  void GetDownload(nsString& aValue)
+  {
+    GetHTMLAttr(nsGkAtoms::download, aValue);
+  }
+  void SetDownload(const nsAString& aValue, mozilla::ErrorResult& rv)
+  {
+    SetHTMLAttr(nsGkAtoms::download, aValue, rv);
+  }
+  // The XPCOM GetPing is OK for us
+  void SetPing(const nsAString& aValue, mozilla::ErrorResult& rv)
+  {
+    SetHTMLAttr(nsGkAtoms::ping, aValue, rv);
+  }
+  void GetRel(nsString& aValue)
+  {
+    GetHTMLAttr(nsGkAtoms::rel, aValue);
+  }
+  void SetRel(const nsAString& aValue, mozilla::ErrorResult& rv)
+  {
+    SetHTMLAttr(nsGkAtoms::rel, aValue, rv);
+  }
+  void GetHreflang(nsString& aValue)
+  {
+    GetHTMLAttr(nsGkAtoms::hreflang, aValue);
+  }
+  void SetHreflang(const nsAString& aValue, mozilla::ErrorResult& rv)
+  {
+    SetHTMLAttr(nsGkAtoms::hreflang, aValue, rv);
+  }
+  void GetType(nsString& aValue)
+  {
+    GetHTMLAttr(nsGkAtoms::type, aValue);
+  }
+  void SetType(const nsAString& aValue, mozilla::ErrorResult& rv)
+  {
+    SetHTMLAttr(nsGkAtoms::type, aValue, rv);
+  }
+  // The XPCOM GetText is OK for us
+  void SetText(const nsAString& aValue, mozilla::ErrorResult& rv)
+  {
+    rv = SetText(aValue);
+  }
+  // The XPCOM URI decomposition attributes are fine for us
+  void GetCoords(nsString& aValue)
+  {
+    GetHTMLAttr(nsGkAtoms::coords, aValue);
+  }
+  void SetCoords(const nsAString& aValue, mozilla::ErrorResult& rv)
+  {
+    SetHTMLAttr(nsGkAtoms::coords, aValue, rv);
+  }
+  void GetCharset(nsString& aValue)
+  {
+    GetHTMLAttr(nsGkAtoms::charset, aValue);
+  }
+  void SetCharset(const nsAString& aValue, mozilla::ErrorResult& rv)
+  {
+    SetHTMLAttr(nsGkAtoms::charset, aValue, rv);
+  }
+  void GetName(nsString& aValue)
+  {
+    GetHTMLAttr(nsGkAtoms::name, aValue);
+  }
+  void SetName(const nsAString& aValue, mozilla::ErrorResult& rv)
+  {
+    SetHTMLAttr(nsGkAtoms::name, aValue, rv);
+  }
+  void GetRev(nsString& aValue)
+  {
+    GetHTMLAttr(nsGkAtoms::rev, aValue);
+  }
+  void SetRev(const nsAString& aValue, mozilla::ErrorResult& rv)
+  {
+    SetHTMLAttr(nsGkAtoms::rev, aValue, rv);
+  }
+  void GetShape(nsString& aValue)
+  {
+    GetHTMLAttr(nsGkAtoms::shape, aValue);
+  }
+  void SetShape(const nsAString& aValue, mozilla::ErrorResult& rv)
+  {
+    SetHTMLAttr(nsGkAtoms::shape, aValue, rv);
+  }
+  void Stringify(nsAString& aResult)
+  {
+    GetHref(aResult);
+  }
+
 protected:
   virtual void GetItemValueText(nsAString& text);
   virtual void SetItemValueText(const nsAString& text);
+  virtual JSObject* WrapNode(JSContext *aCx, JSObject *aScope,
+                             bool *aTriedToWrap) MOZ_OVERRIDE;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_HTMLAnchorElement_h
--- a/content/html/content/src/nsHTMLAreaElement.cpp
+++ b/content/html/content/src/nsHTMLAreaElement.cpp
@@ -250,22 +250,24 @@ nsHTMLAreaElement::UnsetAttr(int32_t aNa
 
   return rv;
 }
 
 #define IMPL_URI_PART(_part)                                 \
   NS_IMETHODIMP                                              \
   nsHTMLAreaElement::Get##_part(nsAString& a##_part)         \
   {                                                          \
-    return Link::Get##_part(a##_part);                       \
+    Link::Get##_part(a##_part);                              \
+    return NS_OK;                                            \
   }                                                          \
   NS_IMETHODIMP                                              \
   nsHTMLAreaElement::Set##_part(const nsAString& a##_part)   \
   {                                                          \
-    return Link::Set##_part(a##_part);                       \
+    Link::Set##_part(a##_part);                              \
+    return NS_OK;                                            \
   }
 
 IMPL_URI_PART(Protocol)
 IMPL_URI_PART(Host)
 IMPL_URI_PART(Hostname)
 IMPL_URI_PART(Pathname)
 IMPL_URI_PART(Search)
 IMPL_URI_PART(Port)
--- a/content/html/content/src/nsHTMLDNSPrefetch.cpp
+++ b/content/html/content/src/nsHTMLDNSPrefetch.cpp
@@ -176,18 +176,17 @@ nsresult
 nsHTMLDNSPrefetch::CancelPrefetch(Link *aElement,
                                   uint16_t flags,
                                   nsresult aReason)
 {
   if (!(sInitialized && sPrefetches && sDNSService && sDNSListener))
     return NS_ERROR_NOT_AVAILABLE;
 
   nsAutoString hostname;
-  nsresult rv = aElement->GetHostname(hostname);
-  NS_ENSURE_SUCCESS(rv, rv);
+  aElement->GetHostname(hostname);
   return CancelPrefetch(hostname, flags, aReason);
 }
 
 nsresult
 nsHTMLDNSPrefetch::CancelPrefetch(const nsAString &hostname,
                                   uint16_t flags,
                                   nsresult aReason)
 {
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -292,16 +292,23 @@ DOMInterfaces = {
     'nativeType': 'JSObject'
 }],
 
 'GainNode': [
 {
     'resultNotAddRefed': [ 'gain' ],
 }],
 
+'HTMLAnchorElement': {
+    'binaryNames': {
+        '__stringifier': 'Stringify'
+    },
+    'hasInstanceInterface': 'nsIDOMHTMLAnchorElement',
+},
+
 'HTMLBodyElement': {
   'hasInstanceInterface': 'nsIDOMHTMLBodyElement',
 },
 
 'HTMLCollection': {
     'nativeType': 'nsIHTMLCollection',
     'resultNotAddRefed': [ 'item' ]
 },
new file mode 100644
--- /dev/null
+++ b/dom/webidl/HTMLAnchorElement.webidl
@@ -0,0 +1,63 @@
+/* -*- 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://www.whatwg.org/specs/web-apps/current-work/#the-a-element
+ * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
+ * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
+ * Opera Software ASA. You are granted a license to use, reproduce
+ * and create derivative works of this document.
+ */
+
+// http://www.whatwg.org/specs/web-apps/current-work/#the-a-element
+interface HTMLAnchorElement : HTMLElement {
+  // No support for stringifier attributes yet
+  //[SetterThrows]
+  //stringifier attribute DOMString href;
+  stringifier;
+           [SetterThrows]
+           attribute DOMString href;
+           [SetterThrows]
+           attribute DOMString target;
+           [SetterThrows]
+           attribute DOMString download;
+           [SetterThrows]
+           attribute DOMString ping;
+           [SetterThrows]
+           attribute DOMString rel;
+  // relList not supported yet
+  //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;
+/*};
+
+// 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]
+           attribute DOMString name;
+           [SetterThrows]
+           attribute DOMString rev;
+           [SetterThrows]
+           attribute DOMString shape;
+};
--- a/dom/webidl/WebIDL.mk
+++ b/dom/webidl/WebIDL.mk
@@ -44,16 +44,17 @@ webidl_files = \
   EventTarget.webidl \
   File.webidl \
   FileHandle.webidl \
   FileList.webidl \
   FileReaderSync.webidl \
   FormData.webidl \
   Function.webidl \
   GainNode.webidl \
+  HTMLAnchorElement.webidl \
   HTMLBodyElement.webidl \
   HTMLCollection.webidl \
   HTMLDataListElement.webidl \
   HTMLDivElement.webidl \
   HTMLDocument.webidl \
   HTMLElement.webidl \
   HTMLFontElement.webidl \
   HTMLFrameSetElement.webidl \
--- a/js/xpconnect/src/dom_quickstubs.qsconf
+++ b/js/xpconnect/src/dom_quickstubs.qsconf
@@ -114,23 +114,16 @@ members = [
 
     'nsIDOMTouch.*',
     'nsIDOMTouchList.*',
     'nsIDOMTouchEvent.*',
 
     # dom/interfaces/geolocation - None.
 
     # dom/interfaces/html
-    'nsIDOMHTMLAnchorElement.href',
-    'nsIDOMHTMLAnchorElement.rel',
-    'nsIDOMHTMLAnchorElement.target',
-    'nsIDOMHTMLAnchorElement.name',
-    'nsIDOMHTMLAnchorElement.text',
-    'nsIDOMHTMLAnchorElement.search',
-    'nsIDOMHTMLAnchorElement.hash',
     'nsIDOMHTMLBaseElement.href',
     'nsIDOMHTMLBaseElement.target',
     'nsIDOMHTMLButtonElement.name',
     'nsIDOMHTMLButtonElement.form',
     'nsIDOMHTMLButtonElement.value',
     'nsIDOMHTMLButtonElement.disabled',
     'nsIDOMHTMLCommandElement.*',
     'nsIDOMHTMLFormElement.elements',
@@ -138,18 +131,16 @@ members = [
     'nsIDOMHTMLFormElement.submit',
     'nsIDOMHTMLFormElement.length',
     'nsIDOMHTMLFormElement.target',
     'nsIDOMHTMLFormElement.action',
     'nsIDOMHTMLFrameElement.src',
     'nsIDOMHTMLFrameElement.contentDocument',
     'nsIDOMHTMLFrameElement.contentWindow',
     'nsIDOMHTMLFrameElement.name',
-    'nsIDOMHTMLFrameSetElement.rows',
-    'nsIDOMHTMLFrameSetElement.cols',
     'nsIDOMHTMLIFrameElement.src',
     'nsIDOMHTMLIFrameElement.contentDocument',
     'nsIDOMHTMLIFrameElement.contentWindow',
     'nsIDOMHTMLInputElement.defaultChecked',
     'nsIDOMHTMLInputElement.disabled',
     'nsIDOMHTMLInputElement.select',
     'nsIDOMHTMLInputElement.checked',
     'nsIDOMHTMLInputElement.type',