Bug 1446568: Devirtualize nsIDocument::CreateElem. r=smaug
MozReview-Commit-ID: FO0mMHN6zvi
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -8032,18 +8032,18 @@ nsDocument::RetrieveRelevantHeaders(nsIC
mLastModified.Truncate();
if (modDate != 0) {
GetFormattedTimeString(modDate, mLastModified);
}
}
already_AddRefed<Element>
-nsDocument::CreateElem(const nsAString& aName, nsAtom *aPrefix,
- int32_t aNamespaceID, const nsAString* aIs)
+nsIDocument::CreateElem(const nsAString& aName, nsAtom *aPrefix,
+ int32_t aNamespaceID, const nsAString* aIs)
{
#ifdef DEBUG
nsAutoString qName;
if (aPrefix) {
aPrefix->ToString(qName);
qName.Append(':');
}
qName.Append(aName);
--- a/dom/base/nsDocument.h
+++ b/dom/base/nsDocument.h
@@ -270,22 +270,16 @@ public:
// nsIScriptObjectPrincipal
virtual nsIPrincipal* GetPrincipal() override;
// nsIApplicationCacheContainer
NS_DECL_NSIAPPLICATIONCACHECONTAINER
virtual nsresult Init();
- virtual already_AddRefed<Element> CreateElem(const nsAString& aName,
- nsAtom* aPrefix,
- int32_t aNamespaceID,
- const nsAString* aIs = nullptr) override;
-
-
virtual void Destroy() override;
virtual void RemovedFromDocShell() override;
virtual void BlockOnload() override;
virtual void UnblockOnload(bool aFireSync) override;
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsDocument,
nsIDocument)
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -2197,20 +2197,20 @@ public:
{
mIsContentDocument = aIsContentDocument;
}
/**
* Create an element with the specified name, prefix and namespace ID.
* Returns null if element name parsing failed.
*/
- virtual already_AddRefed<Element> CreateElem(const nsAString& aName,
- nsAtom* aPrefix,
- int32_t aNamespaceID,
- const nsAString* aIs = nullptr) = 0;
+ already_AddRefed<Element> CreateElem(const nsAString& aName,
+ nsAtom* aPrefix,
+ int32_t aNamespaceID,
+ const nsAString* aIs = nullptr);
/**
* Get the security info (i.e. SSL state etc) that the document got
* from the channel/document that created the content of the
* document.
*
* @see nsIChannel
*/