Bug 614724. Quickstub createElementNS. r=peterv a=jst
☠☠ backed out by 2789b87e8cba ☠ ☠
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 30 Nov 2010 11:56:12 +0100
changeset 58366 d1fe7786e33bf4756e5bf46ebcd73b88e3a49f7b
parent 58365 837d7b346a647b21005963738eb49f848141e0d9
child 58367 2789b87e8cba8cc181a34bbfadfd0da5ab6b37c4
push id17266
push usermlamouri@mozilla.com
push dateTue, 30 Nov 2010 10:57:45 +0000
treeherdermozilla-central@d1fe7786e33b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv, jst
bugs614724
milestone2.0b8pre
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 614724. Quickstub createElementNS. r=peterv a=jst
content/base/src/nsDocument.cpp
content/base/src/nsDocument.h
js/src/xpconnect/src/dom_quickstubs.qsconf
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -4346,31 +4346,38 @@ nsDocument::CreateElement(const nsAStrin
 }
 
 NS_IMETHODIMP
 nsDocument::CreateElementNS(const nsAString& aNamespaceURI,
                             const nsAString& aQualifiedName,
                             nsIDOMElement** aReturn)
 {
   *aReturn = nsnull;
-
+  nsCOMPtr<nsIContent> content;
+  nsresult rv = CreateElementNS(aNamespaceURI, aQualifiedName,
+                                getter_AddRefs(content));
+  NS_ENSURE_SUCCESS(rv, rv);
+  return CallQueryInterface(content, aReturn);
+}
+
+nsresult
+nsDocument::CreateElementNS(const nsAString& aNamespaceURI,
+                            const nsAString& aQualifiedName,
+                            nsIContent** aReturn)
+{
   nsCOMPtr<nsINodeInfo> nodeInfo;
   nsresult rv = nsContentUtils::GetNodeInfoFromQName(aNamespaceURI,
                                                      aQualifiedName,
                                                      mNodeInfoManager,
                                                      getter_AddRefs(nodeInfo));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCOMPtr<nsIContent> content;
   PRInt32 ns = nodeInfo->NamespaceID();
-  rv = NS_NewElement(getter_AddRefs(content), ns, nodeInfo.forget(),
-                     NOT_FROM_PARSER);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return CallQueryInterface(content, aReturn);
+  return NS_NewElement(aReturn, nodeInfo->NamespaceID(),
+                       nodeInfo.forget(), NOT_FROM_PARSER);
 }
 
 NS_IMETHODIMP
 nsDocument::CreateTextNode(const nsAString& aData, nsIDOMText** aReturn)
 {
   *aReturn = nsnull;
   nsCOMPtr<nsIContent> content;
   nsresult rv = CreateTextNode(aData, getter_AddRefs(content));
--- a/content/base/src/nsDocument.h
+++ b/content/base/src/nsDocument.h
@@ -854,16 +854,19 @@ public:
 
   virtual nsresult CreateElem(const nsAString& aName, nsIAtom *aPrefix,
                               PRInt32 aNamespaceID,
                               PRBool aDocumentDefaultType,
                               nsIContent **aResult);
 
   nsresult CreateElement(const nsAString& aTagName,
                          nsIContent** aReturn);
+  nsresult CreateElementNS(const nsAString& aNamespaceURI,
+                           const nsAString& aQualifiedName,
+                           nsIContent** aReturn);
 
   nsresult CreateTextNode(const nsAString& aData, nsIContent** aReturn);
 
   virtual NS_HIDDEN_(nsresult) Sanitize();
 
   virtual NS_HIDDEN_(void) EnumerateSubDocuments(nsSubDocEnumFunc aCallback,
                                                  void *aData);
 
--- a/js/src/xpconnect/src/dom_quickstubs.qsconf
+++ b/js/src/xpconnect/src/dom_quickstubs.qsconf
@@ -98,16 +98,17 @@ members = [
     'nsIDOMDocument.documentElement',
     'nsIDOMDocument.implementation',
     'nsIDOMDocument.getElementsByTagName',
     'nsIDOMDocument.doctype',
     'nsIDOMDocument.getElementsByTagNameNS',
     'nsIDOMDocument.getElementById',
     'nsIDOMDocument.createDocumentFragment',
     'nsIDOMDocument.createElement',
+    'nsIDOMDocument.createElementNS',
     'nsIDOMDocument.importNode',
     'nsIDOMDocument.createTextNode',
     'nsIDOMElement.removeAttributeNS',
     'nsIDOMElement.removeAttribute',
     'nsIDOMElement.getAttribute',
     'nsIDOMElement.getElementsByTagName',
     'nsIDOMElement.setAttribute',
     'nsIDOMElement.getElementsByTagNameNS',
@@ -904,16 +905,21 @@ customMethodCalls = {
     'nsIDOMElement_': {
         'thisType': 'nsGenericElement'
         },
     'nsIDOMDocument_CreateElement': {
         'thisType': 'nsDocument',
         'code': '    nsCOMPtr<nsIContent> result;\n'
                 '    rv = self->CreateElement(arg0, getter_AddRefs(result));'
     },
+    'nsIDOMDocument_CreateElementNS': {
+        'thisType': 'nsDocument',
+        'code': '    nsCOMPtr<nsIContent> result;\n'
+                '    rv = self->CreateElementNS(arg0, arg1, getter_AddRefs(result));'
+    },
     'nsIDOMDocument_CreateTextNode': {
         'thisType': 'nsDocument',
         'code': '    nsCOMPtr<nsIContent> result;\n'
                 '    rv = self->CreateTextNode(arg0, getter_AddRefs(result));'
     },
     # WebGL
     'nsIDOMWebGLRenderingContext_BufferData': CUSTOM_QS,
     'nsIDOMWebGLRenderingContext_BufferSubData': CUSTOM_QS,