mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
Merge m-c to f-t
This commit is contained in:
commit
6b520eb10f
@ -5,8 +5,6 @@
|
||||
{
|
||||
// bug 826335, globo.com
|
||||
"globo.com": "\\(Mobile#(Android; Mobile",
|
||||
// bug 826342, mercadolivre.com.br
|
||||
"mercadolivre.com.br": "\\(Mobile#(Android; Mobile",
|
||||
// bug 826344, abril.com.br
|
||||
"abril.com.br": "\\(Mobile#(Android; Mobile",
|
||||
// bug 826347, msn.com
|
||||
@ -25,10 +23,6 @@
|
||||
"bb.com.br": "\\(Mobile#(Android; Mobile",
|
||||
// bug 826712, orkut.com
|
||||
"orkut.com": "Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19",
|
||||
// bug 826715, noticias.uol.com.br
|
||||
"noticias.uol.com.br": "\\(Mobile#(Android; Mobile",
|
||||
// bug 826845, techtudo.com.br
|
||||
"techtudo.com.br": "\\(Mobile#(Android; Mobile",
|
||||
// bug 826958, ebay.com
|
||||
"ebay.com": "\\(Mobile#(Android; Mobile",
|
||||
// bug 827622, bing.com
|
||||
@ -37,16 +31,12 @@
|
||||
"magazineluiza.com.br": "\\(Mobile#(Android; Mobile",
|
||||
// bug 827628, groupon.com.br
|
||||
"groupon.com.br": "\\(Mobile#(Android; Mobile",
|
||||
// bug 827630, vagalume.com.br
|
||||
"vagalume.com.br": "\\(Mobile#(Android; Mobile",
|
||||
// bug 827632, tecmundo.com.br
|
||||
"tecmundo.com.br": "\\(Mobile#(Android; Mobile",
|
||||
// bug 827633, hao123.com
|
||||
"hao123.com": "\\(Mobile#(Android; Mobile",
|
||||
// bug 827573, webmotors.com.br
|
||||
"webmotors.com.br": "\\(Mobile#(Android; Mobile",
|
||||
// bug 827661, mercadolibre.com.co
|
||||
"mercadolibre.com.co": "\\(Mobile#(Android; Mobile",
|
||||
// bug 827670, elpais.com.co
|
||||
"elpais.com.co": "Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19",
|
||||
// bug 827674, avianca.com
|
||||
@ -57,10 +47,6 @@
|
||||
"gazeta.pl": "\\(Mobile#(Android; Mobile",
|
||||
// bug 828360, sport.pl
|
||||
"sport.pl": "\\(Mobile#(Android; Mobile",
|
||||
// bug 828364, nk.pl
|
||||
"nk.pl": "\\(Mobile#(Android; Mobile",
|
||||
// bug 828369, money.pl
|
||||
"money.pl": "\\(Mobile#(Android; Mobile",
|
||||
// bug 828371, ingbank.pl
|
||||
"ingbank.pl": "\\(Mobile#(Android; Mobile",
|
||||
// bug 828378, wyborcza.pl
|
||||
@ -73,16 +59,12 @@
|
||||
"infojobs.net": "\\(Mobile#(Android; Mobile",
|
||||
// bug 828399, antena3.com
|
||||
"antena3.com": "\\(Mobile#(Android; Mobile",
|
||||
// bug 828406, orange.es
|
||||
"orange.es": "\\(Mobile#(Android; Mobile",
|
||||
// bug 828416, loteriasyapuestas.es
|
||||
"loteriasyapuestas.es": "\\(Mobile#(Android; Mobile",
|
||||
// bug 828418, bbva.es
|
||||
"bbva.es": "\\(Mobile#(Android; Mobile",
|
||||
// bug 828422, publico.es
|
||||
"publico.es": "\\(Mobile#(Android; Mobile",
|
||||
// bug 828425, mercadolibre.com.ve
|
||||
"mercadolibre.com.ve": "\\(Mobile#(Android; Mobile",
|
||||
// bug 828439, movistar.com.ve
|
||||
"movistar.com.ve": "\\(Mobile#(Android; Mobile",
|
||||
// bug 843126, es.playstation.com
|
||||
@ -97,14 +79,10 @@
|
||||
"games.com": "\\(Mobile#(Android; Mobile",
|
||||
// bug 843160, ehow.com
|
||||
"ehow.com": "\\(Mobile#(Android; Mobile",
|
||||
// bug 843186, chevrolet.com
|
||||
"chevrolet.com": "\\(Mobile#(Android; Mobile",
|
||||
// bug 866577, 3g.qq.com
|
||||
"3g.qq.com": "\\(Mobile#(Android; Mobile",
|
||||
// bug 878228, blikk.hu
|
||||
"blikk.hu": "\\(Mobile#(Android; Mobile",
|
||||
// bug 878230, citromail.hu
|
||||
"citromail.hu": "\\(Mobile#(Android; Mobile",
|
||||
// bug 878232, hazipatika.com
|
||||
"hazipatika.com": "\\(Mobile#(Android; Mobile",
|
||||
// bug 878238, koponyeg.hu
|
||||
@ -131,18 +109,12 @@
|
||||
"kurir-info.rs": "\\(Mobile#(Android; Mobile",
|
||||
// bug 878273, livescore.com
|
||||
"livescore.com": "\\(Mobile#(Android; Mobile",
|
||||
// bug 878275, mondo.rs
|
||||
"mondo.rs": "\\(Mobile#(Android; Mobile",
|
||||
// bug 878277, naslovi.net
|
||||
"naslovi.net": "\\(Mobile#(Android; Mobile",
|
||||
// bug 878630, ask.com
|
||||
"ask.com": "\\(Mobile#(Android; Mobile",
|
||||
// bug 878632, banorte.com
|
||||
"banorte.com": "\\(Mobile#(Android; Mobile",
|
||||
// bug 878637, eluniversal.com.mx
|
||||
"eluniversal.com.mx": "\\(Mobile#(Android; Mobile",
|
||||
// bug 878642, mercadolibre.com.mx
|
||||
"mercadolibre.com.mx": "\\(Mobile#(Android; Mobile",
|
||||
// bug 878649, univision.com
|
||||
"univision.com": "\\(Mobile#(Android; Mobile",
|
||||
// bug 878653, redstarbelgrade.info
|
||||
|
@ -874,12 +874,6 @@ WebContentConverterRegistrar.prototype = {
|
||||
},
|
||||
|
||||
classID: WCCR_CLASSID,
|
||||
classInfo: XPCOMUtils.generateCI({classID: WCCR_CLASSID,
|
||||
contractID: WCCR_CONTRACTID,
|
||||
interfaces: [Ci.nsIWebContentConverterService,
|
||||
Ci.nsIWebContentHandlerRegistrar,
|
||||
Ci.nsIObserver, Ci.nsIFactory],
|
||||
flags: Ci.nsIClassInfo.DOM_OBJECT}),
|
||||
|
||||
/**
|
||||
* See nsISupports
|
||||
|
@ -38,8 +38,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "BookmarkHTMLUtils",
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "BookmarkJSONUtils",
|
||||
"resource://gre/modules/BookmarkJSONUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "webappsUI",
|
||||
"resource:///modules/webappsUI.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "WebappManager",
|
||||
"resource:///modules/WebappManager.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PageThumbs",
|
||||
"resource://gre/modules/PageThumbs.jsm");
|
||||
@ -468,7 +468,7 @@ BrowserGlue.prototype = {
|
||||
|
||||
this._syncSearchEngines();
|
||||
|
||||
webappsUI.init();
|
||||
WebappManager.init();
|
||||
PageThumbs.init();
|
||||
NewTabUtils.init();
|
||||
BrowserNewTabPreloader.init();
|
||||
@ -654,7 +654,7 @@ BrowserGlue.prototype = {
|
||||
|
||||
BrowserNewTabPreloader.uninit();
|
||||
CustomizationTabPreloader.uninit();
|
||||
webappsUI.uninit();
|
||||
WebappManager.uninit();
|
||||
SignInToWebsiteUX.uninit();
|
||||
webrtcUI.uninit();
|
||||
},
|
||||
|
@ -798,7 +798,7 @@ bin/libfreebl_32int64_3.so
|
||||
@BINPATH@/webapprt/defaults/preferences/prefs.js
|
||||
@BINPATH@/webapprt/modules/Startup.jsm
|
||||
@BINPATH@/webapprt/modules/WebappRT.jsm
|
||||
@BINPATH@/webapprt/modules/WebappsHandler.jsm
|
||||
@BINPATH@/webapprt/modules/WebappManager.jsm
|
||||
@BINPATH@/webapprt/modules/RemoteDebugger.jsm
|
||||
@BINPATH@/webapprt/modules/WebRTCHandler.jsm
|
||||
#endif
|
||||
|
@ -2,7 +2,7 @@
|
||||
* 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/. */
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["webappsUI"];
|
||||
this.EXPORTED_SYMBOLS = ["WebappManager"];
|
||||
|
||||
let Ci = Components.interfaces;
|
||||
let Cc = Components.classes;
|
||||
@ -12,7 +12,7 @@ Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Webapps.jsm");
|
||||
Cu.import("resource://gre/modules/AppsUtils.jsm");
|
||||
Cu.import("resource://gre/modules/WebappsInstaller.jsm");
|
||||
Cu.import("resource://gre/modules/NativeApp.jsm");
|
||||
Cu.import("resource://gre/modules/WebappOSUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
Cu.import("resource://gre/modules/Promise.jsm");
|
||||
@ -21,11 +21,11 @@ XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
|
||||
"@mozilla.org/childprocessmessagemanager;1",
|
||||
"nsIMessageSender");
|
||||
|
||||
this.webappsUI = {
|
||||
this.WebappManager = {
|
||||
// List of promises for in-progress installations
|
||||
installations: {},
|
||||
|
||||
init: function webappsUI_init() {
|
||||
init: function() {
|
||||
Services.obs.addObserver(this, "webapps-ask-install", false);
|
||||
Services.obs.addObserver(this, "webapps-launch", false);
|
||||
Services.obs.addObserver(this, "webapps-uninstall", false);
|
||||
@ -34,7 +34,7 @@ this.webappsUI = {
|
||||
cpmm.addMessageListener("Webapps:UpdateState", this);
|
||||
},
|
||||
|
||||
uninit: function webappsUI_uninit() {
|
||||
uninit: function() {
|
||||
Services.obs.removeObserver(this, "webapps-ask-install");
|
||||
Services.obs.removeObserver(this, "webapps-launch");
|
||||
Services.obs.removeObserver(this, "webapps-uninstall");
|
||||
@ -71,7 +71,7 @@ this.webappsUI = {
|
||||
}
|
||||
},
|
||||
|
||||
observe: function webappsUI_observe(aSubject, aTopic, aData) {
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
let data = JSON.parse(aData);
|
||||
data.mm = aSubject;
|
||||
|
||||
@ -108,6 +108,8 @@ this.webappsUI = {
|
||||
|
||||
let bundle = chromeWin.gNavigatorBundle;
|
||||
|
||||
let jsonManifest = aData.isPackage ? aData.app.updateManifest : aData.app.manifest;
|
||||
|
||||
let notification;
|
||||
|
||||
let mainAction = {
|
||||
@ -128,7 +130,7 @@ this.webappsUI = {
|
||||
|
||||
let manifestURL = aData.app.manifestURL;
|
||||
|
||||
let cleanup = (ex) => {
|
||||
let cleanup = () => {
|
||||
popupProgressContent.removeChild(progressMeter);
|
||||
delete this.installations[manifestURL];
|
||||
if (Object.getOwnPropertyNames(this.installations).length == 0) {
|
||||
@ -142,38 +144,36 @@ this.webappsUI = {
|
||||
cleanup();
|
||||
});
|
||||
|
||||
let app = WebappsInstaller.init(aData);
|
||||
|
||||
if (app) {
|
||||
let localDir = null;
|
||||
if (app.appProfile) {
|
||||
localDir = app.appProfile.localDir;
|
||||
}
|
||||
|
||||
DOMApplicationRegistry.confirmInstall(aData, localDir,
|
||||
(aManifest, aZipPath) => {
|
||||
Task.spawn(function() {
|
||||
try {
|
||||
yield WebappsInstaller.install(aData, aManifest, aZipPath);
|
||||
yield this.installations[manifestURL].promise;
|
||||
installationSuccessNotification(aData, app, bundle);
|
||||
} catch (ex) {
|
||||
Cu.reportError("Error installing webapp: " + ex);
|
||||
// TODO: Notify user that the installation has failed
|
||||
} finally {
|
||||
cleanup();
|
||||
}
|
||||
}.bind(this));
|
||||
});
|
||||
} else {
|
||||
let nativeApp = new NativeApp(aData.app, jsonManifest,
|
||||
aData.app.categories);
|
||||
let localDir;
|
||||
try {
|
||||
localDir = nativeApp.createProfile();
|
||||
} catch (ex) {
|
||||
Cu.reportError("Error installing webapp: " + ex);
|
||||
DOMApplicationRegistry.denyInstall(aData);
|
||||
cleanup();
|
||||
return;
|
||||
}
|
||||
|
||||
DOMApplicationRegistry.confirmInstall(aData, localDir,
|
||||
(aManifest, aZipPath) => Task.spawn((function*() {
|
||||
try {
|
||||
yield nativeApp.install(aManifest, aZipPath);
|
||||
yield this.installations[manifestURL].promise;
|
||||
notifyInstallSuccess(aData.app, nativeApp, bundle);
|
||||
} catch (ex) {
|
||||
Cu.reportError("Error installing webapp: " + ex);
|
||||
// TODO: Notify user that the installation has failed
|
||||
} finally {
|
||||
cleanup();
|
||||
}
|
||||
}).bind(this))
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
let requestingURI = chromeWin.makeURI(aData.from);
|
||||
let jsonManifest = aData.isPackage ? aData.app.updateManifest : aData.app.manifest;
|
||||
let manifest = new ManifestHelper(jsonManifest, aData.app.origin);
|
||||
|
||||
let host;
|
||||
@ -195,11 +195,11 @@ this.webappsUI = {
|
||||
}
|
||||
}
|
||||
|
||||
function installationSuccessNotification(aData, app, aBundle) {
|
||||
function notifyInstallSuccess(aApp, aNativeApp, aBundle) {
|
||||
let launcher = {
|
||||
observe: function(aSubject, aTopic) {
|
||||
if (aTopic == "alertclickcallback") {
|
||||
WebappOSUtils.launch(aData.app);
|
||||
WebappOSUtils.launch(aApp);
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -208,9 +208,9 @@ function installationSuccessNotification(aData, app, aBundle) {
|
||||
let notifier = Cc["@mozilla.org/alerts-service;1"].
|
||||
getService(Ci.nsIAlertsService);
|
||||
|
||||
notifier.showAlertNotification(app.iconURI.spec,
|
||||
notifier.showAlertNotification(aNativeApp.iconURI.spec,
|
||||
aBundle.getString("webapps.install.success"),
|
||||
app.appNameAsFilename,
|
||||
aNativeApp.appNameAsFilename,
|
||||
true, null, launcher);
|
||||
} catch (ex) {}
|
||||
}
|
@ -20,7 +20,7 @@ EXTRA_JS_MODULES += [
|
||||
'SitePermissions.jsm',
|
||||
'Social.jsm',
|
||||
'TabCrashReporter.jsm',
|
||||
'webappsUI.jsm',
|
||||
'WebappManager.jsm',
|
||||
'webrtcUI.jsm',
|
||||
]
|
||||
|
||||
|
@ -493,18 +493,23 @@ nsPrincipal::GetBaseDomain(nsACString& aBaseDomain)
|
||||
NS_IMETHODIMP
|
||||
nsPrincipal::Read(nsIObjectInputStream* aStream)
|
||||
{
|
||||
nsCOMPtr<nsISupports> supports;
|
||||
nsCOMPtr<nsIURI> codebase;
|
||||
nsresult rv = NS_ReadOptionalObject(aStream, true, getter_AddRefs(codebase));
|
||||
nsresult rv = NS_ReadOptionalObject(aStream, true, getter_AddRefs(supports));
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
codebase = do_QueryInterface(supports);
|
||||
|
||||
nsCOMPtr<nsIURI> domain;
|
||||
rv = NS_ReadOptionalObject(aStream, true, getter_AddRefs(domain));
|
||||
rv = NS_ReadOptionalObject(aStream, true, getter_AddRefs(supports));
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
domain = do_QueryInterface(supports);
|
||||
|
||||
uint32_t appId;
|
||||
rv = aStream->Read32(&appId);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
@ -513,10 +518,12 @@ nsPrincipal::Read(nsIObjectInputStream* aStream)
|
||||
rv = aStream->ReadBoolean(&inMozBrowser);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIContentSecurityPolicy> csp;
|
||||
rv = NS_ReadOptionalObject(aStream, true, getter_AddRefs(csp));
|
||||
rv = NS_ReadOptionalObject(aStream, true, getter_AddRefs(supports));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// This may be null.
|
||||
nsCOMPtr<nsIContentSecurityPolicy> csp = do_QueryInterface(supports, &rv);
|
||||
|
||||
rv = Init(codebase, appId, inMozBrowser);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
@ -119,7 +119,7 @@ class Element : public FragmentOrElement
|
||||
{
|
||||
public:
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
Element(already_AddRefed<nsINodeInfo> aNodeInfo) :
|
||||
Element(already_AddRefed<nsINodeInfo>& aNodeInfo) :
|
||||
FragmentOrElement(aNodeInfo),
|
||||
mState(NS_EVENT_STATE_MOZ_READONLY)
|
||||
{
|
||||
@ -1210,9 +1210,10 @@ inline bool nsINode::HasAttributes() const
|
||||
nsresult \
|
||||
_elementName::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const \
|
||||
{ \
|
||||
*aResult = nullptr; \
|
||||
nsCOMPtr<nsINodeInfo> ni = aNodeInfo; \
|
||||
_elementName *it = new _elementName(ni.forget()); \
|
||||
*aResult = nullptr; \
|
||||
already_AddRefed<nsINodeInfo> ni = \
|
||||
nsCOMPtr<nsINodeInfo>(aNodeInfo).forget(); \
|
||||
_elementName *it = new _elementName(ni); \
|
||||
if (!it) { \
|
||||
return NS_ERROR_OUT_OF_MEMORY; \
|
||||
} \
|
||||
@ -1230,9 +1231,10 @@ _elementName::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const \
|
||||
nsresult \
|
||||
_elementName::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const \
|
||||
{ \
|
||||
*aResult = nullptr; \
|
||||
nsCOMPtr<nsINodeInfo> ni = aNodeInfo; \
|
||||
_elementName *it = new _elementName(ni.forget()); \
|
||||
*aResult = nullptr; \
|
||||
already_AddRefed<nsINodeInfo> ni = \
|
||||
nsCOMPtr<nsINodeInfo>(aNodeInfo).forget(); \
|
||||
_elementName *it = new _elementName(ni); \
|
||||
if (!it) { \
|
||||
return NS_ERROR_OUT_OF_MEMORY; \
|
||||
} \
|
||||
@ -1377,7 +1379,7 @@ NS_IMETHOD SetAttributeNode(nsIDOMAttr* newAttr, \
|
||||
} \
|
||||
mozilla::ErrorResult rv; \
|
||||
mozilla::dom::Attr* attr = static_cast<mozilla::dom::Attr*>(newAttr); \
|
||||
*_retval = Element::SetAttributeNode(*attr, rv).get(); \
|
||||
*_retval = Element::SetAttributeNode(*attr, rv).take(); \
|
||||
return rv.ErrorCode(); \
|
||||
} \
|
||||
NS_IMETHOD RemoveAttributeNode(nsIDOMAttr* oldAttr, \
|
||||
@ -1388,7 +1390,7 @@ NS_IMETHOD RemoveAttributeNode(nsIDOMAttr* oldAttr, \
|
||||
} \
|
||||
mozilla::ErrorResult rv; \
|
||||
mozilla::dom::Attr* attr = static_cast<mozilla::dom::Attr*>(oldAttr); \
|
||||
*_retval = Element::RemoveAttributeNode(*attr, rv).get(); \
|
||||
*_retval = Element::RemoveAttributeNode(*attr, rv).take(); \
|
||||
return rv.ErrorCode(); \
|
||||
} \
|
||||
NS_IMETHOD GetAttributeNodeNS(const nsAString& namespaceURI, \
|
||||
@ -1404,7 +1406,7 @@ NS_IMETHOD SetAttributeNodeNS(nsIDOMAttr* newAttr, \
|
||||
{ \
|
||||
mozilla::ErrorResult rv; \
|
||||
mozilla::dom::Attr* attr = static_cast<mozilla::dom::Attr*>(newAttr); \
|
||||
*_retval = Element::SetAttributeNodeNS(*attr, rv).get(); \
|
||||
*_retval = Element::SetAttributeNodeNS(*attr, rv).take(); \
|
||||
return rv.ErrorCode(); \
|
||||
} \
|
||||
NS_IMETHOD GetElementsByTagName(const nsAString& name, \
|
||||
@ -1480,12 +1482,12 @@ NS_IMETHOD MozRemove() MOZ_FINAL \
|
||||
} \
|
||||
NS_IMETHOD GetClientRects(nsIDOMClientRectList** _retval) MOZ_FINAL \
|
||||
{ \
|
||||
*_retval = Element::GetClientRects().get(); \
|
||||
*_retval = Element::GetClientRects().take(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
NS_IMETHOD GetBoundingClientRect(nsIDOMClientRect** _retval) MOZ_FINAL \
|
||||
{ \
|
||||
*_retval = Element::GetBoundingClientRect().get(); \
|
||||
*_retval = Element::GetBoundingClientRect().take(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
NS_IMETHOD GetScrollTop(int32_t* aScrollTop) MOZ_FINAL \
|
||||
|
@ -166,7 +166,8 @@ class UndoManager;
|
||||
class FragmentOrElement : public nsIContent
|
||||
{
|
||||
public:
|
||||
FragmentOrElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
FragmentOrElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
|
||||
FragmentOrElement(already_AddRefed<nsINodeInfo>&& aNodeInfo);
|
||||
virtual ~FragmentOrElement();
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
|
@ -30,45 +30,47 @@ class Element;
|
||||
|
||||
nsresult
|
||||
NS_NewElement(mozilla::dom::Element** aResult,
|
||||
already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
already_AddRefed<nsINodeInfo>&& aNodeInfo,
|
||||
mozilla::dom::FromParser aFromParser);
|
||||
|
||||
nsresult
|
||||
NS_NewXMLElement(mozilla::dom::Element** aResult,
|
||||
already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
already_AddRefed<nsINodeInfo>&& aNodeInfo);
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLElement(mozilla::dom::Element** aResult,
|
||||
already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
already_AddRefed<nsINodeInfo>&& aNodeInfo,
|
||||
mozilla::dom::FromParser aFromParser);
|
||||
|
||||
// First argument should be nsHTMLTag, but that adds dependency to parser
|
||||
// for a bunch of files.
|
||||
already_AddRefed<nsGenericHTMLElement>
|
||||
CreateHTMLElement(uint32_t aNodeType, already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
CreateHTMLElement(uint32_t aNodeType,
|
||||
already_AddRefed<nsINodeInfo>&& aNodeInfo,
|
||||
mozilla::dom::FromParser aFromParser);
|
||||
|
||||
nsresult
|
||||
NS_NewMathMLElement(mozilla::dom::Element** aResult,
|
||||
already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
already_AddRefed<nsINodeInfo>&& aNodeInfo);
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
nsresult
|
||||
NS_NewXULElement(mozilla::dom::Element** aResult,
|
||||
already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
already_AddRefed<nsINodeInfo>&& aNodeInfo);
|
||||
|
||||
void
|
||||
NS_TrustedNewXULElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
NS_TrustedNewXULElement(nsIContent** aResult,
|
||||
already_AddRefed<nsINodeInfo>&& aNodeInfo);
|
||||
#endif
|
||||
|
||||
nsresult
|
||||
NS_NewSVGElement(mozilla::dom::Element** aResult,
|
||||
already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
already_AddRefed<nsINodeInfo>&& aNodeInfo,
|
||||
mozilla::dom::FromParser aFromParser);
|
||||
|
||||
nsresult
|
||||
NS_NewGenConImageContent(nsIContent** aResult,
|
||||
already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
already_AddRefed<nsINodeInfo>&& aNodeInfo,
|
||||
imgRequestProxy* aImageRequest);
|
||||
|
||||
#endif // nsContentCreatorFunctions_h__
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "nsContentListDeclarations.h"
|
||||
#include "nsMathUtils.h"
|
||||
#include "nsTArrayForwardDeclare.h"
|
||||
#include "Units.h"
|
||||
|
||||
#if defined(XP_WIN)
|
||||
@ -102,7 +103,6 @@ struct JSRuntime;
|
||||
struct nsIntMargin;
|
||||
|
||||
template<class E> class nsCOMArray;
|
||||
template<class E> class nsTArray;
|
||||
template<class K, class V> class nsDataHashtable;
|
||||
template<class K, class V> class nsRefPtrHashtable;
|
||||
template<class T> class nsReadingIterator;
|
||||
|
@ -40,7 +40,8 @@ public:
|
||||
|
||||
protected:
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
nsIAttribute(nsDOMAttributeMap *aAttrMap, already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
nsIAttribute(nsDOMAttributeMap *aAttrMap,
|
||||
already_AddRefed<nsINodeInfo>& aNodeInfo,
|
||||
bool aNsAware);
|
||||
#endif //MOZILLA_INTERNAL_API
|
||||
virtual ~nsIAttribute();
|
||||
|
@ -53,11 +53,10 @@ public:
|
||||
// If you're using the external API, the only thing you can know about
|
||||
// nsIContent is that it exists with an IID
|
||||
|
||||
nsIContent(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
nsIContent(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsINode(aNodeInfo)
|
||||
{
|
||||
NS_ASSERTION(mNodeInfo,
|
||||
"No nsINodeInfo passed to nsIContent, PREPARE TO CRASH!!!");
|
||||
MOZ_ASSERT(mNodeInfo);
|
||||
SetNodeIsContent();
|
||||
}
|
||||
#endif // MOZILLA_INTERNAL_API
|
||||
|
@ -319,7 +319,7 @@ public:
|
||||
friend class nsAttrAndChildArray;
|
||||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
nsINode(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
nsINode(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: mNodeInfo(aNodeInfo),
|
||||
mParent(nullptr),
|
||||
mBoolFlags(0),
|
||||
@ -1882,7 +1882,7 @@ ToCanonicalSupports(nsINode* aPointer)
|
||||
if (rv.Failed()) { \
|
||||
return rv.ErrorCode(); \
|
||||
} \
|
||||
*aResult = clone.forget().get()->AsDOMNode(); \
|
||||
*aResult = clone.forget().take()->AsDOMNode(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
NS_IMETHOD Normalize() __VA_ARGS__ \
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "nsWrapperCacheInlines.h"
|
||||
|
||||
nsIAttribute::nsIAttribute(nsDOMAttributeMap* aAttrMap,
|
||||
already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
already_AddRefed<nsINodeInfo>& aNodeInfo,
|
||||
bool aNsAware)
|
||||
: nsINode(aNodeInfo), mAttrMap(aAttrMap), mNsAware(aNsAware)
|
||||
{
|
||||
@ -47,7 +47,7 @@ namespace dom {
|
||||
bool Attr::sInitialized;
|
||||
|
||||
Attr::Attr(nsDOMAttributeMap *aAttrMap,
|
||||
already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
already_AddRefed<nsINodeInfo>&& aNodeInfo,
|
||||
const nsAString &aValue, bool aNsAware)
|
||||
: nsIAttribute(aAttrMap, aNodeInfo, aNsAware), mValue(aValue)
|
||||
{
|
||||
|
@ -32,7 +32,7 @@ class Attr MOZ_FINAL : public nsIAttribute,
|
||||
{
|
||||
public:
|
||||
Attr(nsDOMAttributeMap* aAttrMap,
|
||||
already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
already_AddRefed<nsINodeInfo>&& aNodeInfo,
|
||||
const nsAString& aValue,
|
||||
bool aNsAware);
|
||||
virtual ~Attr() {}
|
||||
|
@ -24,7 +24,7 @@ private:
|
||||
}
|
||||
|
||||
public:
|
||||
Comment(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
Comment(already_AddRefed<nsINodeInfo>&& aNodeInfo)
|
||||
: nsGenericDOMDataNode(aNodeInfo)
|
||||
{
|
||||
Init();
|
||||
|
@ -88,7 +88,8 @@ DOMImplementation::CreateDocumentType(const nsAString& aQualifiedName,
|
||||
nsIDOMDocumentType** aReturn)
|
||||
{
|
||||
ErrorResult rv;
|
||||
*aReturn = CreateDocumentType(aQualifiedName, aPublicId, aSystemId, rv).get();
|
||||
*aReturn =
|
||||
CreateDocumentType(aQualifiedName, aPublicId, aSystemId, rv).take();
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ public:
|
||||
// interface nsIDOMDocumentFragment
|
||||
NS_DECL_NSIDOMDOCUMENTFRAGMENT
|
||||
|
||||
DocumentFragment(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
DocumentFragment(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: FragmentOrElement(aNodeInfo), mHost(nullptr)
|
||||
{
|
||||
Init();
|
||||
|
@ -28,7 +28,7 @@ NS_NewDOMDocumentType(nsIDOMDocumentType** aDocType,
|
||||
NS_ENSURE_ARG_POINTER(aDocType);
|
||||
mozilla::ErrorResult rv;
|
||||
*aDocType = NS_NewDOMDocumentType(aNodeInfoManager, aName, aPublicId,
|
||||
aSystemId, aInternalSubset, rv).get();
|
||||
aSystemId, aInternalSubset, rv).take();
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
@ -45,14 +45,14 @@ NS_NewDOMDocumentType(nsNodeInfoManager* aNodeInfoManager,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsINodeInfo> ni =
|
||||
already_AddRefed<nsINodeInfo> ni =
|
||||
aNodeInfoManager->GetNodeInfo(nsGkAtoms::documentTypeNodeName, nullptr,
|
||||
kNameSpaceID_None,
|
||||
nsIDOMNode::DOCUMENT_TYPE_NODE,
|
||||
aName);
|
||||
|
||||
nsRefPtr<mozilla::dom::DocumentType> docType =
|
||||
new mozilla::dom::DocumentType(ni.forget(), aPublicId, aSystemId, aInternalSubset);
|
||||
new mozilla::dom::DocumentType(ni, aPublicId, aSystemId, aInternalSubset);
|
||||
return docType.forget();
|
||||
}
|
||||
|
||||
@ -65,7 +65,7 @@ DocumentType::WrapNode(JSContext *cx, JS::Handle<JSObject*> scope)
|
||||
return DocumentTypeBinding::Wrap(cx, scope, this);
|
||||
}
|
||||
|
||||
DocumentType::DocumentType(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
DocumentType::DocumentType(already_AddRefed<nsINodeInfo>& aNodeInfo,
|
||||
const nsAString& aPublicId,
|
||||
const nsAString& aSystemId,
|
||||
const nsAString& aInternalSubset) :
|
||||
@ -141,9 +141,8 @@ DocumentType::MozRemove()
|
||||
nsGenericDOMDataNode*
|
||||
DocumentType::CloneDataNode(nsINodeInfo *aNodeInfo, bool aCloneText) const
|
||||
{
|
||||
nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
|
||||
return new DocumentType(ni.forget(), mPublicId, mSystemId,
|
||||
mInternalSubset);
|
||||
already_AddRefed<nsINodeInfo> ni = nsCOMPtr<nsINodeInfo>(aNodeInfo).forget();
|
||||
return new DocumentType(ni, mPublicId, mSystemId, mInternalSubset);
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
|
@ -29,7 +29,7 @@ class DocumentTypeForward : public nsGenericDOMDataNode,
|
||||
public nsIDOMDocumentType
|
||||
{
|
||||
public:
|
||||
DocumentTypeForward(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
DocumentTypeForward(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsGenericDOMDataNode(aNodeInfo)
|
||||
{
|
||||
}
|
||||
@ -41,7 +41,7 @@ public:
|
||||
class DocumentType MOZ_FINAL : public DocumentTypeForward
|
||||
{
|
||||
public:
|
||||
DocumentType(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
DocumentType(already_AddRefed<nsINodeInfo>& aNodeInfo,
|
||||
const nsAString& aPublicId,
|
||||
const nsAString& aSystemId,
|
||||
const nsAString& aInternalSubset);
|
||||
|
@ -478,7 +478,7 @@ void
|
||||
Element::GetElementsByTagName(const nsAString& aLocalName,
|
||||
nsIDOMHTMLCollection** aResult)
|
||||
{
|
||||
*aResult = GetElementsByTagName(aLocalName).get();
|
||||
*aResult = GetElementsByTagName(aLocalName).take();
|
||||
}
|
||||
|
||||
nsIFrame*
|
||||
@ -1052,7 +1052,8 @@ nsresult
|
||||
Element::GetElementsByClassName(const nsAString& aClassNames,
|
||||
nsIDOMHTMLCollection** aResult)
|
||||
{
|
||||
*aResult = nsContentUtils::GetElementsByClassName(this, aClassNames).get();
|
||||
*aResult =
|
||||
nsContentUtils::GetElementsByClassName(this, aClassNames).take();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -619,7 +619,12 @@ FragmentOrElement::nsDOMSlots::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) c
|
||||
return n;
|
||||
}
|
||||
|
||||
FragmentOrElement::FragmentOrElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
FragmentOrElement::FragmentOrElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsIContent(aNodeInfo)
|
||||
{
|
||||
}
|
||||
|
||||
FragmentOrElement::FragmentOrElement(already_AddRefed<nsINodeInfo>&& aNodeInfo)
|
||||
: nsIContent(aNodeInfo)
|
||||
{
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ NS_IMETHODIMP NodeIterator::GetFilter(nsIDOMNodeFilter **aFilter)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aFilter);
|
||||
|
||||
*aFilter = mFilter.ToXPCOMCallback().get();
|
||||
*aFilter = mFilter.ToXPCOMCallback().take();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ private:
|
||||
if (rv.Failed()) {
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
*aRetval = node ? node.forget().get()->AsDOMNode() : nullptr;
|
||||
*aRetval = node ? node.forget().take()->AsDOMNode() : nullptr;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ NS_IMPL_ADDREF_INHERITED(ShadowRoot, DocumentFragment)
|
||||
NS_IMPL_RELEASE_INHERITED(ShadowRoot, DocumentFragment)
|
||||
|
||||
ShadowRoot::ShadowRoot(nsIContent* aContent,
|
||||
already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
already_AddRefed<nsINodeInfo>&& aNodeInfo,
|
||||
nsXBLPrototypeBinding* aProtoBinding)
|
||||
: DocumentFragment(aNodeInfo), mPoolHost(aContent),
|
||||
mProtoBinding(aProtoBinding), mShadowElement(nullptr),
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
|
||||
NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
|
||||
|
||||
ShadowRoot(nsIContent* aContent, already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
ShadowRoot(nsIContent* aContent, already_AddRefed<nsINodeInfo>&& aNodeInfo,
|
||||
nsXBLPrototypeBinding* aProtoBinding);
|
||||
virtual ~ShadowRoot();
|
||||
|
||||
|
@ -15,7 +15,11 @@ namespace dom {
|
||||
class Text : public nsGenericDOMDataNode
|
||||
{
|
||||
public:
|
||||
Text(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
Text(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsGenericDOMDataNode(aNodeInfo)
|
||||
{}
|
||||
|
||||
Text(already_AddRefed<nsINodeInfo>&& aNodeInfo)
|
||||
: nsGenericDOMDataNode(aNodeInfo)
|
||||
{}
|
||||
|
||||
|
@ -80,7 +80,7 @@ NS_IMETHODIMP TreeWalker::GetFilter(nsIDOMNodeFilter * *aFilter)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aFilter);
|
||||
|
||||
*aFilter = mFilter.ToXPCOMCallback().get();
|
||||
*aFilter = mFilter.ToXPCOMCallback().take();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ private:
|
||||
if (rv.Failed()) {
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
*aRetval = node ? node.forget().get()->AsDOMNode() : nullptr;
|
||||
*aRetval = node ? node.forget().take()->AsDOMNode() : nullptr;
|
||||
return NS_OK;
|
||||
}
|
||||
};
|
||||
|
@ -1412,7 +1412,7 @@ WebSocket::GetLoadGroup(nsILoadGroup** aLoadGroup)
|
||||
nsContentUtils::GetDocumentFromScriptContext(sc);
|
||||
|
||||
if (doc) {
|
||||
*aLoadGroup = doc->GetDocumentLoadGroup().get(); // already_AddRefed
|
||||
*aLoadGroup = doc->GetDocumentLoadGroup().take();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -375,7 +375,7 @@ void
|
||||
nsAttrValue::SetTo(const nsAString& aValue)
|
||||
{
|
||||
ResetIfSet();
|
||||
nsStringBuffer* buf = GetStringBuffer(aValue).get();
|
||||
nsStringBuffer* buf = GetStringBuffer(aValue).take();
|
||||
if (buf) {
|
||||
SetPtrValueAndType(buf, eStringBase);
|
||||
}
|
||||
@ -1232,7 +1232,7 @@ nsAttrValue::ParseAtom(const nsAString& aValue)
|
||||
|
||||
nsCOMPtr<nsIAtom> atom = NS_NewAtom(aValue);
|
||||
if (atom) {
|
||||
SetPtrValueAndType(atom.forget().get(), eAtomBase);
|
||||
SetPtrValueAndType(atom.forget().take(), eAtomBase);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1528,7 +1528,7 @@ nsAttrValue::ParsePositiveIntValue(const nsAString& aString)
|
||||
void
|
||||
nsAttrValue::SetColorValue(nscolor aColor, const nsAString& aString)
|
||||
{
|
||||
nsStringBuffer* buf = GetStringBuffer(aString).get();
|
||||
nsStringBuffer* buf = GetStringBuffer(aString).take();
|
||||
if (!buf) {
|
||||
return;
|
||||
}
|
||||
@ -1716,10 +1716,10 @@ nsAttrValue::SetMiscAtomOrString(const nsAString* aValue)
|
||||
nsCOMPtr<nsIAtom> atom = NS_NewAtom(*aValue);
|
||||
if (atom) {
|
||||
cont->mStringBits =
|
||||
reinterpret_cast<uintptr_t>(atom.forget().get()) | eAtomBase;
|
||||
reinterpret_cast<uintptr_t>(atom.forget().take()) | eAtomBase;
|
||||
}
|
||||
} else {
|
||||
nsStringBuffer* buf = GetStringBuffer(*aValue).get();
|
||||
nsStringBuffer* buf = GetStringBuffer(*aValue).take();
|
||||
if (buf) {
|
||||
cont->mStringBits = reinterpret_cast<uintptr_t>(buf) | eStringBase;
|
||||
}
|
||||
|
@ -293,8 +293,10 @@ CSPService::AsyncOnChannelRedirect(nsIChannel *oldChannel,
|
||||
if (!channelPolicy)
|
||||
return NS_OK;
|
||||
|
||||
nsCOMPtr<nsISupports> supports;
|
||||
nsCOMPtr<nsIContentSecurityPolicy> csp;
|
||||
channelPolicy->GetContentSecurityPolicy(getter_AddRefs(csp));
|
||||
channelPolicy->GetContentSecurityPolicy(getter_AddRefs(supports));
|
||||
csp = do_QueryInterface(supports);
|
||||
uint32_t loadType;
|
||||
channelPolicy->GetLoadType(&loadType);
|
||||
|
||||
|
@ -664,21 +664,30 @@ DragDataProducer::Produce(DataTransfer* aDataTransfer,
|
||||
}
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsISupports> supports;
|
||||
nsCOMPtr<nsISupportsString> data;
|
||||
uint32_t dataSize;
|
||||
rv = transferable->GetTransferData(kHTMLMime, getter_AddRefs(data), &dataSize);
|
||||
rv = transferable->GetTransferData(kHTMLMime, getter_AddRefs(supports),
|
||||
&dataSize);
|
||||
data = do_QueryInterface(supports);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
data->GetData(mHtmlString);
|
||||
}
|
||||
rv = transferable->GetTransferData(kHTMLContext, getter_AddRefs(data), &dataSize);
|
||||
rv = transferable->GetTransferData(kHTMLContext, getter_AddRefs(supports),
|
||||
&dataSize);
|
||||
data = do_QueryInterface(supports);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
data->GetData(mContextString);
|
||||
}
|
||||
rv = transferable->GetTransferData(kHTMLInfo, getter_AddRefs(data), &dataSize);
|
||||
rv = transferable->GetTransferData(kHTMLInfo, getter_AddRefs(supports),
|
||||
&dataSize);
|
||||
data = do_QueryInterface(supports);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
data->GetData(mInfoString);
|
||||
}
|
||||
rv = transferable->GetTransferData(kUnicodeMime, getter_AddRefs(data), &dataSize);
|
||||
rv = transferable->GetTransferData(kUnicodeMime, getter_AddRefs(supports),
|
||||
&dataSize);
|
||||
data = do_QueryInterface(supports);
|
||||
NS_ENSURE_SUCCESS(rv, rv); // require plain text at a minimum
|
||||
data->GetData(mTitleString);
|
||||
}
|
||||
|
@ -2502,11 +2502,11 @@ nsContentUtils::SplitQName(const nsIContent* aNamespaceResolver,
|
||||
if (*aNamespace == kNameSpaceID_Unknown)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
*aLocalName = NS_NewAtom(Substring(colon + 1, end)).get();
|
||||
*aLocalName = NS_NewAtom(Substring(colon + 1, end)).take();
|
||||
}
|
||||
else {
|
||||
*aNamespace = kNameSpaceID_None;
|
||||
*aLocalName = NS_NewAtom(aQName).get();
|
||||
*aLocalName = NS_NewAtom(aQName).take();
|
||||
}
|
||||
NS_ENSURE_TRUE(aLocalName, NS_ERROR_OUT_OF_MEMORY);
|
||||
return NS_OK;
|
||||
@ -2591,7 +2591,7 @@ nsContentUtils::SplitExpatName(const char16_t *aExpatName, nsIAtom **aPrefix,
|
||||
nameStart = (uriEnd + 1);
|
||||
if (nameEnd) {
|
||||
const char16_t *prefixStart = nameEnd + 1;
|
||||
*aPrefix = NS_NewAtom(Substring(prefixStart, pos)).get();
|
||||
*aPrefix = NS_NewAtom(Substring(prefixStart, pos)).take();
|
||||
}
|
||||
else {
|
||||
nameEnd = pos;
|
||||
@ -2604,7 +2604,7 @@ nsContentUtils::SplitExpatName(const char16_t *aExpatName, nsIAtom **aPrefix,
|
||||
nameEnd = pos;
|
||||
*aPrefix = nullptr;
|
||||
}
|
||||
*aLocalName = NS_NewAtom(Substring(nameStart, nameEnd)).get();
|
||||
*aLocalName = NS_NewAtom(Substring(nameStart, nameEnd)).take();
|
||||
}
|
||||
|
||||
// static
|
||||
@ -2895,7 +2895,7 @@ nsContentUtils::NameChanged(nsINodeInfo* aNodeInfo, nsIAtom* aName,
|
||||
*aResult = niMgr->GetNodeInfo(aName, aNodeInfo->GetPrefixAtom(),
|
||||
aNodeInfo->NamespaceID(),
|
||||
aNodeInfo->NodeType(),
|
||||
aNodeInfo->GetExtraName()).get();
|
||||
aNodeInfo->GetExtraName()).take();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -3829,7 +3829,7 @@ nsContentUtils::CreateContextualFragment(nsINode* aContextNode,
|
||||
{
|
||||
ErrorResult rv;
|
||||
*aReturn = CreateContextualFragment(aContextNode, aFragment,
|
||||
aPreventScriptExecution, rv).get();
|
||||
aPreventScriptExecution, rv).take();
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
|
@ -242,7 +242,7 @@ nsDOMAttributeMap::SetNamedItem(nsIDOMAttr* aAttr, nsIDOMAttr** aReturn)
|
||||
NS_ENSURE_ARG(attribute);
|
||||
|
||||
ErrorResult rv;
|
||||
*aReturn = SetNamedItem(*attribute, rv).get();
|
||||
*aReturn = SetNamedItem(*attribute, rv).take();
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
@ -253,7 +253,7 @@ nsDOMAttributeMap::SetNamedItemNS(nsIDOMAttr* aAttr, nsIDOMAttr** aReturn)
|
||||
NS_ENSURE_ARG(attribute);
|
||||
|
||||
ErrorResult rv;
|
||||
*aReturn = SetNamedItemNS(*attribute, rv).get();
|
||||
*aReturn = SetNamedItemNS(*attribute, rv).take();
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
@ -356,7 +356,7 @@ nsDOMAttributeMap::RemoveNamedItem(const nsAString& aName,
|
||||
NS_ENSURE_ARG_POINTER(aReturn);
|
||||
|
||||
ErrorResult rv;
|
||||
*aReturn = RemoveNamedItem(aName, rv).get();
|
||||
*aReturn = RemoveNamedItem(aName, rv).take();
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
@ -497,7 +497,7 @@ nsDOMAttributeMap::RemoveNamedItemNS(const nsAString& aNamespaceURI,
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aReturn);
|
||||
ErrorResult rv;
|
||||
*aReturn = RemoveNamedItemNS(aNamespaceURI, aLocalName, rv).get();
|
||||
*aReturn = RemoveNamedItemNS(aNamespaceURI, aLocalName, rv).take();
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMDataChannel)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMDataChannel)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
|
||||
|
||||
nsDOMDataChannel::nsDOMDataChannel(already_AddRefed<mozilla::DataChannel> aDataChannel,
|
||||
nsDOMDataChannel::nsDOMDataChannel(already_AddRefed<mozilla::DataChannel>& aDataChannel,
|
||||
nsPIDOMWindow* aWindow)
|
||||
: nsDOMEventTargetHelper(aWindow && aWindow->IsOuterWindow() ?
|
||||
aWindow->GetCurrentInnerWindow() : aWindow)
|
||||
@ -490,7 +490,7 @@ nsDOMDataChannel::AppReady()
|
||||
|
||||
/* static */
|
||||
nsresult
|
||||
NS_NewDOMDataChannel(already_AddRefed<mozilla::DataChannel> aDataChannel,
|
||||
NS_NewDOMDataChannel(already_AddRefed<mozilla::DataChannel>&& aDataChannel,
|
||||
nsPIDOMWindow* aWindow,
|
||||
nsIDOMDataChannel** aDomDataChannel)
|
||||
{
|
||||
|
@ -25,7 +25,7 @@ class nsDOMDataChannel : public nsDOMEventTargetHelper,
|
||||
public mozilla::DataChannelListener
|
||||
{
|
||||
public:
|
||||
nsDOMDataChannel(already_AddRefed<mozilla::DataChannel> aDataChannel,
|
||||
nsDOMDataChannel(already_AddRefed<mozilla::DataChannel>& aDataChannel,
|
||||
nsPIDOMWindow* aWindow);
|
||||
~nsDOMDataChannel();
|
||||
|
||||
|
@ -20,7 +20,7 @@ namespace mozilla {
|
||||
class nsPIDOMWindow;
|
||||
|
||||
nsresult
|
||||
NS_NewDOMDataChannel(already_AddRefed<mozilla::DataChannel> dataChannel,
|
||||
NS_NewDOMDataChannel(already_AddRefed<mozilla::DataChannel>&& dataChannel,
|
||||
nsPIDOMWindow* aWindow,
|
||||
nsIDOMDataChannel** domDataChannel);
|
||||
|
||||
|
@ -256,7 +256,7 @@ nsDOMFileBase::Slice(int64_t aStart, int64_t aEnd,
|
||||
|
||||
// Create the new file
|
||||
*aBlob = CreateSlice((uint64_t)aStart, (uint64_t)(aEnd - aStart),
|
||||
aContentType).get();
|
||||
aContentType).take();
|
||||
|
||||
return *aBlob ? NS_OK : NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
@ -607,7 +607,7 @@ nsDOMMutationObserver::HandleMutation()
|
||||
for (uint32_t i = 0; i < mPendingMutationCount; ++i) {
|
||||
nsRefPtr<nsDOMMutationRecord> next;
|
||||
current->mNext.swap(next);
|
||||
*mutations.AppendElement() = current.forget();
|
||||
*mutations.AppendElement() = current;
|
||||
current.swap(next);
|
||||
}
|
||||
}
|
||||
|
@ -343,7 +343,7 @@ class nsDOMMutationObserver : public nsISupports,
|
||||
public nsWrapperCache
|
||||
{
|
||||
public:
|
||||
nsDOMMutationObserver(already_AddRefed<nsPIDOMWindow> aOwner,
|
||||
nsDOMMutationObserver(already_AddRefed<nsPIDOMWindow>&& aOwner,
|
||||
mozilla::dom::MutationCallback& aCb)
|
||||
: mOwner(aOwner), mLastPendingMutation(nullptr), mPendingMutationCount(0),
|
||||
mCallback(&aCb), mWaitingForRun(false), mId(++sCount)
|
||||
@ -387,14 +387,15 @@ public:
|
||||
|
||||
void AppendMutationRecord(already_AddRefed<nsDOMMutationRecord> aRecord)
|
||||
{
|
||||
MOZ_ASSERT(aRecord.get());
|
||||
nsRefPtr<nsDOMMutationRecord> record = aRecord;
|
||||
MOZ_ASSERT(record);
|
||||
if (!mLastPendingMutation) {
|
||||
MOZ_ASSERT(!mFirstPendingMutation);
|
||||
mFirstPendingMutation = aRecord;
|
||||
mFirstPendingMutation = record.forget();
|
||||
mLastPendingMutation = mFirstPendingMutation;
|
||||
} else {
|
||||
MOZ_ASSERT(mFirstPendingMutation);
|
||||
mLastPendingMutation->mNext = aRecord;
|
||||
mLastPendingMutation->mNext = record.forget();
|
||||
mLastPendingMutation = mLastPendingMutation->mNext;
|
||||
}
|
||||
++mPendingMutationCount;
|
||||
|
@ -1265,7 +1265,7 @@ IMPL_SHIM(nsIApplicationCacheContainer)
|
||||
if (!shim) { \
|
||||
return NS_ERROR_OUT_OF_MEMORY; \
|
||||
} \
|
||||
*aSink = shim.forget().get(); \
|
||||
shim.forget(aSink); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
PR_END_MACRO
|
||||
@ -1426,11 +1426,13 @@ struct nsIDocument::FrameRequest
|
||||
int32_t mHandle;
|
||||
};
|
||||
|
||||
static already_AddRefed<nsINodeInfo> nullNodeInfo(nullptr);
|
||||
|
||||
// ==================================================================
|
||||
// =
|
||||
// ==================================================================
|
||||
nsIDocument::nsIDocument()
|
||||
: nsINode(nullptr),
|
||||
: nsINode(nullNodeInfo),
|
||||
mCharacterSet(NS_LITERAL_CSTRING("ISO-8859-1")),
|
||||
mNodeInfoManager(nullptr),
|
||||
mCompatMode(eCompatibility_FullStandards),
|
||||
@ -3368,7 +3370,7 @@ NS_IMETHODIMP
|
||||
nsDocument::GetElementsByClassName(const nsAString& aClasses,
|
||||
nsIDOMNodeList** aReturn)
|
||||
{
|
||||
*aReturn = nsIDocument::GetElementsByClassName(aClasses).get();
|
||||
*aReturn = nsIDocument::GetElementsByClassName(aClasses).take();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -5106,7 +5108,7 @@ nsIDocument::CreateElement(const nsAString& aTagName, ErrorResult& rv)
|
||||
if (rv.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
return dont_AddRef(content.forget().get()->AsElement());
|
||||
return dont_AddRef(content.forget().take()->AsElement());
|
||||
}
|
||||
|
||||
void
|
||||
@ -5237,7 +5239,7 @@ nsDocument::CreateElementNS(const nsAString& aNamespaceURI,
|
||||
NS_IMETHODIMP
|
||||
nsDocument::CreateTextNode(const nsAString& aData, nsIDOMText** aReturn)
|
||||
{
|
||||
*aReturn = nsIDocument::CreateTextNode(aData).get();
|
||||
*aReturn = nsIDocument::CreateTextNode(aData).take();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -5253,7 +5255,7 @@ nsIDocument::CreateTextNode(const nsAString& aData) const
|
||||
NS_IMETHODIMP
|
||||
nsDocument::CreateDocumentFragment(nsIDOMDocumentFragment** aReturn)
|
||||
{
|
||||
*aReturn = nsIDocument::CreateDocumentFragment().get();
|
||||
*aReturn = nsIDocument::CreateDocumentFragment().take();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -5267,7 +5269,7 @@ nsIDocument::CreateDocumentFragment() const
|
||||
NS_IMETHODIMP
|
||||
nsDocument::CreateComment(const nsAString& aData, nsIDOMComment** aReturn)
|
||||
{
|
||||
*aReturn = nsIDocument::CreateComment(aData).get();
|
||||
*aReturn = nsIDocument::CreateComment(aData).take();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -5288,7 +5290,7 @@ nsDocument::CreateCDATASection(const nsAString& aData,
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aReturn);
|
||||
ErrorResult rv;
|
||||
*aReturn = nsIDocument::CreateCDATASection(aData, rv).get();
|
||||
*aReturn = nsIDocument::CreateCDATASection(aData, rv).take();
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
@ -5320,7 +5322,8 @@ nsDocument::CreateProcessingInstruction(const nsAString& aTarget,
|
||||
nsIDOMProcessingInstruction** aReturn)
|
||||
{
|
||||
ErrorResult rv;
|
||||
*aReturn = nsIDocument::CreateProcessingInstruction(aTarget, aData, rv).get();
|
||||
*aReturn =
|
||||
nsIDocument::CreateProcessingInstruction(aTarget, aData, rv).take();
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
@ -5351,7 +5354,7 @@ nsDocument::CreateAttribute(const nsAString& aName,
|
||||
nsIDOMAttr** aReturn)
|
||||
{
|
||||
ErrorResult rv;
|
||||
*aReturn = nsIDocument::CreateAttribute(aName, rv).get();
|
||||
*aReturn = nsIDocument::CreateAttribute(aName, rv).take();
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
@ -5392,7 +5395,7 @@ nsDocument::CreateAttributeNS(const nsAString & aNamespaceURI,
|
||||
{
|
||||
ErrorResult rv;
|
||||
*aResult =
|
||||
nsIDocument::CreateAttributeNS(aNamespaceURI, aQualifiedName, rv).get();
|
||||
nsIDocument::CreateAttributeNS(aNamespaceURI, aQualifiedName, rv).take();
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
@ -5956,7 +5959,7 @@ nsDocument::GetElementsByTagName(const nsAString& aTagname,
|
||||
NS_ENSURE_TRUE(list, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
// transfer ref to aReturn
|
||||
*aReturn = list.forget().get();
|
||||
list.forget(aReturn);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -5994,7 +5997,7 @@ nsDocument::GetElementsByTagNameNS(const nsAString& aNamespaceURI,
|
||||
}
|
||||
|
||||
// transfer ref to aReturn
|
||||
*aReturn = list.forget().get();
|
||||
list.forget(aReturn);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -6422,7 +6425,7 @@ NS_IMETHODIMP
|
||||
nsDocument::CreateRange(nsIDOMRange** aReturn)
|
||||
{
|
||||
ErrorResult rv;
|
||||
*aReturn = nsIDocument::CreateRange(rv).get();
|
||||
*aReturn = nsIDocument::CreateRange(rv).take();
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
@ -6462,7 +6465,7 @@ nsDocument::CreateNodeIterator(nsIDOMNode *aRoot,
|
||||
ErrorResult rv;
|
||||
NodeFilterHolder holder(aFilter);
|
||||
*_retval = nsIDocument::CreateNodeIterator(*root, aWhatToShow, holder,
|
||||
rv).get();
|
||||
rv).take();
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
@ -6505,7 +6508,7 @@ nsDocument::CreateTreeWalker(nsIDOMNode *aRoot,
|
||||
ErrorResult rv;
|
||||
NodeFilterHolder holder(aFilter);
|
||||
*_retval = nsIDocument::CreateTreeWalker(*root, aWhatToShow, holder,
|
||||
rv).get();
|
||||
rv).take();
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
@ -6541,7 +6544,7 @@ nsDocument::GetDefaultView(nsIDOMWindow** aDefaultView)
|
||||
NS_IMETHODIMP
|
||||
nsDocument::GetLocation(nsIDOMLocation **_retval)
|
||||
{
|
||||
*_retval = nsIDocument::GetLocation().get();
|
||||
*_retval = nsIDocument::GetLocation().take();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -7652,7 +7655,7 @@ nsDocument::CreateEvent(const nsAString& aEventType, nsIDOMEvent** aReturn)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aReturn);
|
||||
ErrorResult rv;
|
||||
*aReturn = nsIDocument::CreateEvent(aEventType, rv).get();
|
||||
*aReturn = nsIDocument::CreateEvent(aEventType, rv).take();
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
@ -7674,7 +7677,7 @@ nsIDocument::CreateEvent(const nsAString& aEventType, ErrorResult& rv) const
|
||||
nsEventDispatcher::CreateEvent(const_cast<nsIDocument*>(this),
|
||||
presContext, nullptr, aEventType,
|
||||
getter_AddRefs(ev));
|
||||
return ev ? dont_AddRef(ev.forget().get()->InternalDOMEvent()) : nullptr;
|
||||
return ev ? dont_AddRef(ev.forget().take()->InternalDOMEvent()) : nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
@ -10134,7 +10137,7 @@ NS_IMETHODIMP
|
||||
nsDocument::CaretPositionFromPoint(float aX, float aY, nsISupports** aCaretPos)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aCaretPos);
|
||||
*aCaretPos = nsIDocument::CaretPositionFromPoint(aX, aY).get();
|
||||
*aCaretPos = nsIDocument::CaretPositionFromPoint(aX, aY).take();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -10270,7 +10273,8 @@ FullscreenRoots::Add(nsIDocument* aRoot)
|
||||
if (!sInstance) {
|
||||
sInstance = new FullscreenRoots();
|
||||
}
|
||||
sInstance->mRoots.AppendElement(do_GetWeakReference(aRoot));
|
||||
nsWeakPtr weakRoot = do_GetWeakReference(aRoot);
|
||||
sInstance->mRoots.AppendElement(weakRoot);
|
||||
}
|
||||
}
|
||||
|
||||
@ -10837,7 +10841,8 @@ nsDocument::FullScreenStackPush(Element* aElement)
|
||||
nsEventStateManager::SetFullScreenState(top, false);
|
||||
}
|
||||
nsEventStateManager::SetFullScreenState(aElement, true);
|
||||
mFullScreenStack.AppendElement(do_GetWeakReference(aElement));
|
||||
nsWeakPtr weakElement = do_GetWeakReference(aElement);
|
||||
mFullScreenStack.AppendElement(weakElement);
|
||||
NS_ASSERTION(GetFullScreenElement() == aElement, "Should match");
|
||||
return true;
|
||||
}
|
||||
|
@ -1025,7 +1025,7 @@ nsDocumentEncoder::EncodeToString(nsAString& aOutputString)
|
||||
nsString output;
|
||||
static const size_t bufferSize = 2048;
|
||||
if (!mCachedBuffer) {
|
||||
mCachedBuffer = nsStringBuffer::Alloc(bufferSize).get();
|
||||
mCachedBuffer = nsStringBuffer::Alloc(bufferSize).take();
|
||||
}
|
||||
NS_ASSERTION(!mCachedBuffer->IsReadonly(),
|
||||
"DocumentEncoder shouldn't keep reference to non-readonly buffer!");
|
||||
|
@ -22,7 +22,7 @@ class nsGenConImageContent MOZ_FINAL : public nsXMLElement,
|
||||
public nsImageLoadingContent
|
||||
{
|
||||
public:
|
||||
nsGenConImageContent(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
nsGenConImageContent(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsXMLElement(aNodeInfo)
|
||||
{
|
||||
// nsImageLoadingContent starts out broken, so we start out
|
||||
@ -68,7 +68,7 @@ NS_IMPL_ISUPPORTS_INHERITED3(nsGenConImageContent,
|
||||
imgIOnloadBlocker)
|
||||
|
||||
nsresult
|
||||
NS_NewGenConImageContent(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
NS_NewGenConImageContent(nsIContent** aResult, already_AddRefed<nsINodeInfo>&& aNodeInfo,
|
||||
imgRequestProxy* aImageRequest)
|
||||
{
|
||||
NS_PRECONDITION(aImageRequest, "Must have request!");
|
||||
|
@ -42,7 +42,19 @@
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
nsGenericDOMDataNode::nsGenericDOMDataNode(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
nsGenericDOMDataNode::nsGenericDOMDataNode(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsIContent(aNodeInfo)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::TEXT_NODE ||
|
||||
mNodeInfo->NodeType() == nsIDOMNode::CDATA_SECTION_NODE ||
|
||||
mNodeInfo->NodeType() == nsIDOMNode::COMMENT_NODE ||
|
||||
mNodeInfo->NodeType() ==
|
||||
nsIDOMNode::PROCESSING_INSTRUCTION_NODE ||
|
||||
mNodeInfo->NodeType() == nsIDOMNode::DOCUMENT_TYPE_NODE,
|
||||
"Bad NodeType in aNodeInfo");
|
||||
}
|
||||
|
||||
nsGenericDOMDataNode::nsGenericDOMDataNode(already_AddRefed<nsINodeInfo>&& aNodeInfo)
|
||||
: nsIContent(aNodeInfo)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::TEXT_NODE ||
|
||||
|
@ -70,7 +70,8 @@ public:
|
||||
|
||||
NS_DECL_SIZEOF_EXCLUDING_THIS
|
||||
|
||||
nsGenericDOMDataNode(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
nsGenericDOMDataNode(already_AddRefed<nsINodeInfo>& aNodeInfo);
|
||||
nsGenericDOMDataNode(already_AddRefed<nsINodeInfo>&& aNodeInfo);
|
||||
virtual ~nsGenericDOMDataNode();
|
||||
|
||||
virtual void GetNodeValueInternal(nsAString& aNodeValue) MOZ_OVERRIDE;
|
||||
|
@ -62,7 +62,12 @@ nsHostObjectURI::Read(nsIObjectInputStream* aStream)
|
||||
nsresult rv = nsSimpleURI::Read(aStream);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return NS_ReadOptionalObject(aStream, true, getter_AddRefs(mPrincipal));
|
||||
nsCOMPtr<nsISupports> supports;
|
||||
rv = NS_ReadOptionalObject(aStream, true, getter_AddRefs(supports));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mPrincipal = do_QueryInterface(supports, &rv);
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -2192,7 +2192,7 @@ nsINode::GetBoundMutationObservers(nsTArray<nsRefPtr<nsDOMMutationObserver> >& a
|
||||
nsCOMPtr<nsDOMMutationObserver> mo = do_QueryInterface(objects->ObjectAt(i));
|
||||
if (mo) {
|
||||
MOZ_ASSERT(!aResult.Contains(mo));
|
||||
aResult.AppendElement(mo.forget());
|
||||
aResult.AppendElement(mo);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2545,7 +2545,7 @@ nsresult
|
||||
nsINode::QuerySelectorAll(const nsAString& aSelector, nsIDOMNodeList **aReturn)
|
||||
{
|
||||
ErrorResult rv;
|
||||
*aReturn = nsINode::QuerySelectorAll(aSelector, rv).get();
|
||||
*aReturn = nsINode::QuerySelectorAll(aSelector, rv).take();
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
|
@ -425,7 +425,7 @@ nsImageLoadingContent::GetRequest(int32_t aRequestType,
|
||||
NS_ENSURE_ARG_POINTER(aRequest);
|
||||
|
||||
ErrorResult result;
|
||||
*aRequest = GetRequest(aRequestType, result).get();
|
||||
*aRequest = GetRequest(aRequestType, result).take();
|
||||
|
||||
return result.ErrorCode();
|
||||
}
|
||||
@ -539,7 +539,7 @@ nsImageLoadingContent::GetCurrentURI(nsIURI** aURI)
|
||||
NS_ENSURE_ARG_POINTER(aURI);
|
||||
|
||||
ErrorResult result;
|
||||
*aURI = GetCurrentURI(result).get();
|
||||
*aURI = GetCurrentURI(result).take();
|
||||
return result.ErrorCode();
|
||||
}
|
||||
|
||||
@ -594,7 +594,7 @@ nsImageLoadingContent::LoadImageWithChannel(nsIChannel* aChannel,
|
||||
NS_ENSURE_ARG_POINTER(aListener);
|
||||
|
||||
ErrorResult result;
|
||||
*aListener = LoadImageWithChannel(aChannel, result).get();
|
||||
*aListener = LoadImageWithChannel(aChannel, result).take();
|
||||
return result.ErrorCode();
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ class nsMappedAttributeElement : public nsMappedAttributeElementBase
|
||||
|
||||
protected:
|
||||
|
||||
nsMappedAttributeElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
nsMappedAttributeElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsMappedAttributeElementBase(aNodeInfo)
|
||||
{}
|
||||
|
||||
|
@ -137,29 +137,31 @@ nsNameSpaceManager::GetNameSpaceID(const nsAString& aURI)
|
||||
|
||||
nsresult
|
||||
NS_NewElement(Element** aResult,
|
||||
already_AddRefed<nsINodeInfo> aNodeInfo, FromParser aFromParser)
|
||||
already_AddRefed<nsINodeInfo>&& aNodeInfo,
|
||||
FromParser aFromParser)
|
||||
{
|
||||
int32_t ns = aNodeInfo.get()->NamespaceID();
|
||||
nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
|
||||
int32_t ns = ni->NamespaceID();
|
||||
if (ns == kNameSpaceID_XHTML) {
|
||||
return NS_NewHTMLElement(aResult, aNodeInfo, aFromParser);
|
||||
return NS_NewHTMLElement(aResult, ni.forget(), aFromParser);
|
||||
}
|
||||
#ifdef MOZ_XUL
|
||||
if (ns == kNameSpaceID_XUL) {
|
||||
return NS_NewXULElement(aResult, aNodeInfo);
|
||||
return NS_NewXULElement(aResult, ni.forget());
|
||||
}
|
||||
#endif
|
||||
if (ns == kNameSpaceID_MathML) {
|
||||
return NS_NewMathMLElement(aResult, aNodeInfo);
|
||||
return NS_NewMathMLElement(aResult, ni.forget());
|
||||
}
|
||||
if (ns == kNameSpaceID_SVG) {
|
||||
return NS_NewSVGElement(aResult, aNodeInfo, aFromParser);
|
||||
return NS_NewSVGElement(aResult, ni.forget(), aFromParser);
|
||||
}
|
||||
if (ns == kNameSpaceID_XBL && aNodeInfo.get()->Equals(nsGkAtoms::children)) {
|
||||
NS_ADDREF(*aResult = new XBLChildrenElement(aNodeInfo));
|
||||
if (ns == kNameSpaceID_XBL && ni->Equals(nsGkAtoms::children)) {
|
||||
NS_ADDREF(*aResult = new XBLChildrenElement(ni.forget()));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_NewXMLElement(aResult, aNodeInfo);
|
||||
return NS_NewXMLElement(aResult, ni.forget());
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -2177,7 +2177,7 @@ NS_IMETHODIMP
|
||||
nsRange::CloneContents(nsIDOMDocumentFragment** aReturn)
|
||||
{
|
||||
ErrorResult rv;
|
||||
*aReturn = CloneContents(rv).get();
|
||||
*aReturn = CloneContents(rv).take();
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
@ -2400,7 +2400,7 @@ nsRange::CloneRange() const
|
||||
NS_IMETHODIMP
|
||||
nsRange::CloneRange(nsIDOMRange** aReturn)
|
||||
{
|
||||
*aReturn = CloneRange().get();
|
||||
*aReturn = CloneRange().take();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -2877,7 +2877,7 @@ static void CollectClientRects(nsLayoutUtils::RectCallback* aCollector,
|
||||
NS_IMETHODIMP
|
||||
nsRange::GetBoundingClientRect(nsIDOMClientRect** aResult)
|
||||
{
|
||||
*aResult = GetBoundingClientRect().get();
|
||||
*aResult = GetBoundingClientRect().take();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -2902,7 +2902,7 @@ nsRange::GetBoundingClientRect()
|
||||
NS_IMETHODIMP
|
||||
nsRange::GetClientRects(nsIDOMClientRectList** aResult)
|
||||
{
|
||||
*aResult = GetClientRects().get();
|
||||
*aResult = GetClientRects().take();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ class nsStyledElementNotElementCSSInlineStyle : public nsStyledElementBase
|
||||
|
||||
protected:
|
||||
|
||||
inline nsStyledElementNotElementCSSInlineStyle(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
inline nsStyledElementNotElementCSSInlineStyle(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsStyledElementBase(aNodeInfo)
|
||||
{}
|
||||
|
||||
@ -82,7 +82,7 @@ protected:
|
||||
|
||||
class nsStyledElement : public nsStyledElementNotElementCSSInlineStyle {
|
||||
protected:
|
||||
inline nsStyledElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
inline nsStyledElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsStyledElementNotElementCSSInlineStyle(aNodeInfo)
|
||||
{}
|
||||
};
|
||||
|
@ -32,7 +32,7 @@ class nsAttributeTextNode MOZ_FINAL : public nsTextNode,
|
||||
public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
nsAttributeTextNode(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
nsAttributeTextNode(already_AddRefed<nsINodeInfo>& aNodeInfo,
|
||||
int32_t aNameSpaceID,
|
||||
nsIAtom* aAttrName) :
|
||||
nsTextNode(aNodeInfo),
|
||||
@ -60,8 +60,9 @@ public:
|
||||
virtual nsGenericDOMDataNode *CloneDataNode(nsINodeInfo *aNodeInfo,
|
||||
bool aCloneText) const
|
||||
{
|
||||
nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
|
||||
nsAttributeTextNode *it = new nsAttributeTextNode(ni.forget(),
|
||||
already_AddRefed<nsINodeInfo> ni =
|
||||
nsCOMPtr<nsINodeInfo>(aNodeInfo).forget();
|
||||
nsAttributeTextNode *it = new nsAttributeTextNode(ni,
|
||||
mNameSpaceID,
|
||||
mAttrName);
|
||||
if (it && aCloneText) {
|
||||
@ -112,9 +113,9 @@ nsTextNode::IsNodeOfType(uint32_t aFlags) const
|
||||
nsGenericDOMDataNode*
|
||||
nsTextNode::CloneDataNode(nsINodeInfo *aNodeInfo, bool aCloneText) const
|
||||
{
|
||||
nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
|
||||
nsTextNode *it = new nsTextNode(ni.forget());
|
||||
if (it && aCloneText) {
|
||||
already_AddRefed<nsINodeInfo> ni = nsCOMPtr<nsINodeInfo>(aNodeInfo).forget();
|
||||
nsTextNode *it = new nsTextNode(ni);
|
||||
if (aCloneText) {
|
||||
it->mText = mText;
|
||||
}
|
||||
|
||||
@ -206,12 +207,9 @@ NS_NewAttributeContent(nsNodeInfoManager *aNodeInfoManager,
|
||||
|
||||
*aResult = nullptr;
|
||||
|
||||
nsCOMPtr<nsINodeInfo> ni = aNodeInfoManager->GetTextNodeInfo();
|
||||
if (!ni) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
already_AddRefed<nsINodeInfo> ni = aNodeInfoManager->GetTextNodeInfo();
|
||||
|
||||
nsAttributeTextNode* textNode = new nsAttributeTextNode(ni.forget(),
|
||||
nsAttributeTextNode* textNode = new nsAttributeTextNode(ni,
|
||||
aNameSpaceID,
|
||||
aAttrName);
|
||||
if (!textNode) {
|
||||
|
@ -31,7 +31,7 @@ private:
|
||||
}
|
||||
|
||||
public:
|
||||
nsTextNode(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
nsTextNode(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: mozilla::dom::Text(aNodeInfo)
|
||||
{
|
||||
Init();
|
||||
|
@ -3516,11 +3516,11 @@ nsXMLHttpRequest::GetInterface(const nsIID & aIID, void **aResult)
|
||||
// need to see these notifications for proper functioning.
|
||||
if (aIID.Equals(NS_GET_IID(nsIChannelEventSink))) {
|
||||
mChannelEventSink = do_GetInterface(mNotificationCallbacks);
|
||||
*aResult = static_cast<nsIChannelEventSink*>(EnsureXPCOMifier().get());
|
||||
*aResult = static_cast<nsIChannelEventSink*>(EnsureXPCOMifier().take());
|
||||
return NS_OK;
|
||||
} else if (aIID.Equals(NS_GET_IID(nsIProgressEventSink))) {
|
||||
mProgressEventSink = do_GetInterface(mNotificationCallbacks);
|
||||
*aResult = static_cast<nsIProgressEventSink*>(EnsureXPCOMifier().get());
|
||||
*aResult = static_cast<nsIProgressEventSink*>(EnsureXPCOMifier().take());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -3619,15 +3619,15 @@ nsXMLHttpRequest::GetInterface(const nsIID & aIID, void **aResult)
|
||||
// nsIProgressEventSink and nsIChannelEventSink which we already
|
||||
// handled above.
|
||||
else if (aIID.Equals(NS_GET_IID(nsIStreamListener))) {
|
||||
*aResult = static_cast<nsIStreamListener*>(EnsureXPCOMifier().get());
|
||||
*aResult = static_cast<nsIStreamListener*>(EnsureXPCOMifier().take());
|
||||
return NS_OK;
|
||||
}
|
||||
else if (aIID.Equals(NS_GET_IID(nsIRequestObserver))) {
|
||||
*aResult = static_cast<nsIRequestObserver*>(EnsureXPCOMifier().get());
|
||||
*aResult = static_cast<nsIRequestObserver*>(EnsureXPCOMifier().take());
|
||||
return NS_OK;
|
||||
}
|
||||
else if (aIID.Equals(NS_GET_IID(nsITimerCallback))) {
|
||||
*aResult = static_cast<nsITimerCallback*>(EnsureXPCOMifier().get());
|
||||
*aResult = static_cast<nsITimerCallback*>(EnsureXPCOMifier().take());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,8 @@ void main(void) {
|
||||
elemTestFunc = ok;
|
||||
checkGLTestFunc = ok;
|
||||
}
|
||||
if (DriverInfo.getDriver() == DriverInfo.DRIVER.ANDROID_X86_EMULATOR)
|
||||
if (DriverInfo.getDriver() == DriverInfo.DRIVER.ANDROID_X86_EMULATOR ||
|
||||
DriverInfo.getOS() == DriverInfo.OS.B2G)
|
||||
{
|
||||
// ...but the Android 4.2 x86 emulator environment is different
|
||||
elemTestFunc = todo;
|
||||
|
@ -27,12 +27,6 @@ function test() {
|
||||
shouldFail = false;
|
||||
}
|
||||
|
||||
if (DriverInfo.getOS() == DriverInfo.OS.B2G) {
|
||||
// We don't run these mochitests on hardware with WebGL-capable hardware yet.
|
||||
shouldSucceed = false;
|
||||
shouldFail = true;
|
||||
}
|
||||
|
||||
var gl = WebGLUtil.getWebGL('c');
|
||||
if (shouldSucceed) {
|
||||
ok(gl, 'Expected WebGL creation to succeed.');
|
||||
|
@ -11,9 +11,6 @@
|
||||
<script>
|
||||
|
||||
var testFunc = ok;
|
||||
if (DriverInfo.getOS() == DriverInfo.OS.B2G) {
|
||||
testFunc = todo;
|
||||
}
|
||||
|
||||
function testContextRetrieval(canvasId, creationId, shouldSucceed) {
|
||||
var canvas = document.getElementById(canvasId);
|
||||
|
@ -24,7 +24,7 @@ class HTMLAudioElement MOZ_FINAL : public HTMLMediaElement,
|
||||
public nsIDOMHTMLAudioElement
|
||||
{
|
||||
public:
|
||||
HTMLAudioElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
HTMLAudioElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
|
||||
virtual ~HTMLAudioElement();
|
||||
|
||||
// nsISupports
|
||||
|
@ -46,7 +46,7 @@ class HTMLCanvasElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||
typedef layers::LayerManager LayerManager;
|
||||
|
||||
public:
|
||||
HTMLCanvasElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
HTMLCanvasElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
|
||||
virtual ~HTMLCanvasElement();
|
||||
|
||||
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLCanvasElement, canvas)
|
||||
|
@ -72,7 +72,7 @@ public:
|
||||
return mCORSMode;
|
||||
}
|
||||
|
||||
HTMLMediaElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
HTMLMediaElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
|
||||
virtual ~HTMLMediaElement();
|
||||
|
||||
/**
|
||||
|
@ -21,7 +21,7 @@ class HTMLVideoElement MOZ_FINAL : public HTMLMediaElement,
|
||||
public nsIDOMHTMLVideoElement
|
||||
{
|
||||
public:
|
||||
HTMLVideoElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
HTMLVideoElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
|
||||
virtual ~HTMLVideoElement();
|
||||
|
||||
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLVideoElement, video)
|
||||
|
@ -7,12 +7,12 @@
|
||||
#define nsIHTMLCollection_h___
|
||||
|
||||
#include "nsIDOMHTMLCollection.h"
|
||||
#include "nsTArrayForwardDeclare.h"
|
||||
#include "nsWrapperCache.h"
|
||||
#include "js/TypeDecls.h"
|
||||
|
||||
class nsINode;
|
||||
class nsString;
|
||||
template<class> class nsTArray;
|
||||
|
||||
namespace mozilla {
|
||||
class ErrorResult;
|
||||
|
@ -24,7 +24,7 @@ public:
|
||||
using Element::GetText;
|
||||
using Element::SetText;
|
||||
|
||||
HTMLAnchorElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
HTMLAnchorElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo)
|
||||
, Link(MOZ_THIS_IN_INITIALIZER_LIST())
|
||||
{
|
||||
|
@ -15,7 +15,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Area)
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
HTMLAreaElement::HTMLAreaElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
HTMLAreaElement::HTMLAreaElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo)
|
||||
, Link(MOZ_THIS_IN_INITIALIZER_LIST())
|
||||
{
|
||||
|
@ -25,7 +25,7 @@ class HTMLAreaElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||
public Link
|
||||
{
|
||||
public:
|
||||
HTMLAreaElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
HTMLAreaElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
|
||||
virtual ~HTMLAreaElement();
|
||||
|
||||
// nsISupports
|
||||
|
@ -36,7 +36,7 @@ NS_IMPL_ISUPPORTS_INHERITED4(HTMLAudioElement, HTMLMediaElement,
|
||||
NS_IMPL_ELEMENT_CLONE(HTMLAudioElement)
|
||||
|
||||
|
||||
HTMLAudioElement::HTMLAudioElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
HTMLAudioElement::HTMLAudioElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: HTMLMediaElement(aNodeInfo),
|
||||
mTimerActivated(false)
|
||||
{
|
||||
@ -59,12 +59,12 @@ HTMLAudioElement::Audio(const GlobalObject& aGlobal,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsINodeInfo> nodeInfo =
|
||||
already_AddRefed<nsINodeInfo> nodeInfo =
|
||||
doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::audio, nullptr,
|
||||
kNameSpaceID_XHTML,
|
||||
nsIDOMNode::ELEMENT_NODE);
|
||||
|
||||
nsRefPtr<HTMLAudioElement> audio = new HTMLAudioElement(nodeInfo.forget());
|
||||
nsRefPtr<HTMLAudioElement> audio = new HTMLAudioElement(nodeInfo);
|
||||
audio->SetHTMLAttr(nsGkAtoms::preload, NS_LITERAL_STRING("auto"), aRv);
|
||||
if (aRv.Failed()) {
|
||||
return nullptr;
|
||||
|
@ -17,7 +17,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(BR)
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
HTMLBRElement::HTMLBRElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
HTMLBRElement::HTMLBRElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo)
|
||||
{
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ class HTMLBRElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLBRElement
|
||||
{
|
||||
public:
|
||||
HTMLBRElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
HTMLBRElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
|
||||
virtual ~HTMLBRElement();
|
||||
|
||||
// nsISupports
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
using Element::GetText;
|
||||
using Element::SetText;
|
||||
|
||||
HTMLBodyElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
HTMLBodyElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo)
|
||||
{
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ static const nsAttrValue::EnumTable* kButtonDefaultType = &kButtonTypeTable[2];
|
||||
|
||||
|
||||
// Construction, destruction
|
||||
HTMLButtonElement::HTMLButtonElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
HTMLButtonElement::HTMLButtonElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
|
||||
FromParser aFromParser)
|
||||
: nsGenericHTMLFormElementWithState(aNodeInfo),
|
||||
mType(kButtonDefaultType->value),
|
||||
|
@ -21,7 +21,7 @@ class HTMLButtonElement MOZ_FINAL : public nsGenericHTMLFormElementWithState,
|
||||
public:
|
||||
using nsIConstraintValidation::GetValidationMessage;
|
||||
|
||||
HTMLButtonElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
HTMLButtonElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
|
||||
FromParser aFromParser = NOT_FROM_PARSER);
|
||||
virtual ~HTMLButtonElement();
|
||||
|
||||
|
@ -113,7 +113,7 @@ HTMLCanvasPrintState::NotifyDone()
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
HTMLCanvasElement::HTMLCanvasElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
HTMLCanvasElement::HTMLCanvasElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo),
|
||||
mWriteOnly(false)
|
||||
{
|
||||
@ -673,7 +673,8 @@ HTMLCanvasElement::GetContext(const nsAString& aContextId,
|
||||
nsISupports** aContext)
|
||||
{
|
||||
ErrorResult rv;
|
||||
*aContext = GetContext(nullptr, aContextId, JS::NullHandleValue, rv).get();
|
||||
*aContext =
|
||||
GetContext(nullptr, aContextId, JS::NullHandleValue, rv).take();
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Content)
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
HTMLContentElement::HTMLContentElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
HTMLContentElement::HTMLContentElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo), mValidSelector(true), mIsInsertionPoint(false)
|
||||
{
|
||||
SetIsDOMBinding();
|
||||
|
@ -19,7 +19,7 @@ class DistributedContentList;
|
||||
class HTMLContentElement MOZ_FINAL : public nsGenericHTMLElement
|
||||
{
|
||||
public:
|
||||
HTMLContentElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
HTMLContentElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
|
||||
virtual ~HTMLContentElement();
|
||||
|
||||
// nsISupports
|
||||
|
@ -12,7 +12,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Data)
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
HTMLDataElement::HTMLDataElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
HTMLDataElement::HTMLDataElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo)
|
||||
{
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ namespace dom {
|
||||
class HTMLDataElement MOZ_FINAL : public nsGenericHTMLElement
|
||||
{
|
||||
public:
|
||||
HTMLDataElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
HTMLDataElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
|
||||
virtual ~HTMLDataElement();
|
||||
|
||||
// HTMLDataElement WebIDL
|
||||
|
@ -15,7 +15,7 @@ namespace dom {
|
||||
class HTMLDataListElement MOZ_FINAL : public nsGenericHTMLElement
|
||||
{
|
||||
public:
|
||||
HTMLDataListElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
HTMLDataListElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo)
|
||||
{
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ class HTMLDivElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLDivElement
|
||||
{
|
||||
public:
|
||||
HTMLDivElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
HTMLDivElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo)
|
||||
{
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ namespace dom {
|
||||
class HTMLElement MOZ_FINAL : public nsGenericHTMLElement
|
||||
{
|
||||
public:
|
||||
HTMLElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
HTMLElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
|
||||
virtual ~HTMLElement();
|
||||
|
||||
NS_IMETHOD GetInnerHTML(nsAString& aInnerHTML) MOZ_OVERRIDE;
|
||||
@ -26,7 +26,7 @@ protected:
|
||||
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
|
||||
};
|
||||
|
||||
HTMLElement::HTMLElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
HTMLElement::HTMLElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo)
|
||||
{
|
||||
}
|
||||
@ -68,7 +68,7 @@ HTMLElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aScope)
|
||||
// Here, we expand 'NS_IMPL_NS_NEW_HTML_ELEMENT()' by hand.
|
||||
// (Calling the macro directly (with no args) produces compiler warnings.)
|
||||
nsGenericHTMLElement*
|
||||
NS_NewHTMLElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
NS_NewHTMLElement(already_AddRefed<nsINodeInfo>&& aNodeInfo,
|
||||
mozilla::dom::FromParser aFromParser)
|
||||
{
|
||||
return new mozilla::dom::HTMLElement(aNodeInfo);
|
||||
|
@ -14,7 +14,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(FieldSet)
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
HTMLFieldSetElement::HTMLFieldSetElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
HTMLFieldSetElement::HTMLFieldSetElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsGenericHTMLFormElement(aNodeInfo)
|
||||
, mElements(nullptr)
|
||||
, mFirstLegend(nullptr)
|
||||
|
@ -26,7 +26,7 @@ public:
|
||||
using nsIConstraintValidation::CheckValidity;
|
||||
using nsIConstraintValidation::GetValidationMessage;
|
||||
|
||||
HTMLFieldSetElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
HTMLFieldSetElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
|
||||
virtual ~HTMLFieldSetElement();
|
||||
|
||||
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLFieldSetElement, fieldset)
|
||||
|
@ -14,7 +14,7 @@ namespace dom {
|
||||
class HTMLFontElement MOZ_FINAL : public nsGenericHTMLElement
|
||||
{
|
||||
public:
|
||||
HTMLFontElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
HTMLFontElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo)
|
||||
{
|
||||
}
|
||||
|
@ -62,7 +62,7 @@
|
||||
|
||||
// construction, destruction
|
||||
nsGenericHTMLElement*
|
||||
NS_NewHTMLFormElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
NS_NewHTMLFormElement(already_AddRefed<nsINodeInfo>&& aNodeInfo,
|
||||
mozilla::dom::FromParser aFromParser)
|
||||
{
|
||||
mozilla::dom::HTMLFormElement* it = new mozilla::dom::HTMLFormElement(aNodeInfo);
|
||||
@ -94,7 +94,7 @@ static const nsAttrValue::EnumTable* kFormDefaultAutocomplete = &kFormAutocomple
|
||||
bool HTMLFormElement::gFirstFormSubmitted = false;
|
||||
bool HTMLFormElement::gPasswordManagerInitialized = false;
|
||||
|
||||
HTMLFormElement::HTMLFormElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
HTMLFormElement::HTMLFormElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo),
|
||||
mSelectedRadioButtons(4),
|
||||
mRequiredRadioButtonCounts(4),
|
||||
|
@ -40,7 +40,7 @@ class HTMLFormElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||
friend class HTMLFormControlsCollection;
|
||||
|
||||
public:
|
||||
HTMLFormElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
HTMLFormElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
|
||||
virtual ~HTMLFormElement();
|
||||
|
||||
nsresult Init();
|
||||
|
@ -13,7 +13,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Frame)
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
HTMLFrameElement::HTMLFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
HTMLFrameElement::HTMLFrameElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
|
||||
FromParser aFromParser)
|
||||
: nsGenericHTMLFrameElement(aNodeInfo, aFromParser)
|
||||
{
|
||||
|
@ -22,7 +22,7 @@ class HTMLFrameElement MOZ_FINAL : public nsGenericHTMLFrameElement,
|
||||
public:
|
||||
using nsGenericHTMLFrameElement::SwapFrameLoaders;
|
||||
|
||||
HTMLFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
HTMLFrameElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
|
||||
FromParser aFromParser = NOT_FROM_PARSER);
|
||||
virtual ~HTMLFrameElement();
|
||||
|
||||
|
@ -46,7 +46,7 @@ class HTMLFrameSetElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLFrameSetElement
|
||||
{
|
||||
public:
|
||||
HTMLFrameSetElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
HTMLFrameSetElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo),
|
||||
mNumRows(0),
|
||||
mNumCols(0),
|
||||
|
@ -11,7 +11,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(HR)
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
HTMLHRElement::HTMLHRElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
HTMLHRElement::HTMLHRElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo)
|
||||
{
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ class HTMLHRElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLHRElement
|
||||
{
|
||||
public:
|
||||
HTMLHRElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
HTMLHRElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
|
||||
virtual ~HTMLHRElement();
|
||||
|
||||
// nsISupports
|
||||
|
@ -17,7 +17,7 @@ class HTMLHeadingElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLHeadingElement
|
||||
{
|
||||
public:
|
||||
HTMLHeadingElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
HTMLHeadingElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo)
|
||||
{
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(IFrame)
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
HTMLIFrameElement::HTMLIFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
HTMLIFrameElement::HTMLIFrameElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
|
||||
FromParser aFromParser)
|
||||
: nsGenericHTMLFrameElement(aNodeInfo, aFromParser)
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ class HTMLIFrameElement MOZ_FINAL : public nsGenericHTMLFrameElement
|
||||
, public nsIDOMHTMLIFrameElement
|
||||
{
|
||||
public:
|
||||
HTMLIFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
HTMLIFrameElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
|
||||
FromParser aFromParser = NOT_FROM_PARSER);
|
||||
virtual ~HTMLIFrameElement();
|
||||
|
||||
|
@ -45,7 +45,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Image)
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
HTMLImageElement::HTMLImageElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
HTMLImageElement::HTMLImageElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo)
|
||||
, mForm(nullptr)
|
||||
{
|
||||
@ -547,12 +547,12 @@ HTMLImageElement::Image(const GlobalObject& aGlobal,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsINodeInfo> nodeInfo =
|
||||
already_AddRefed<nsINodeInfo> nodeInfo =
|
||||
doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::img, nullptr,
|
||||
kNameSpaceID_XHTML,
|
||||
nsIDOMNode::ELEMENT_NODE);
|
||||
|
||||
nsRefPtr<HTMLImageElement> img = new HTMLImageElement(nodeInfo.forget());
|
||||
nsRefPtr<HTMLImageElement> img = new HTMLImageElement(nodeInfo);
|
||||
|
||||
if (aWidth.WasPassed()) {
|
||||
img->SetWidth(aWidth.Value(), aError);
|
||||
|
@ -21,7 +21,7 @@ class HTMLImageElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLImageElement
|
||||
{
|
||||
public:
|
||||
explicit HTMLImageElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
explicit HTMLImageElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
|
||||
virtual ~HTMLImageElement();
|
||||
|
||||
static already_AddRefed<HTMLImageElement>
|
||||
|
@ -399,7 +399,7 @@ public:
|
||||
// Note that we leave the trailing "/" on the path.
|
||||
domFile->SetPath(Substring(path, 0, uint32_t(length)));
|
||||
}
|
||||
*aResult = static_cast<nsIDOMFile*>(domFile.forget().get());
|
||||
*aResult = domFile.forget().downcast<nsIDOMFile>().take();
|
||||
LookupAndCacheNext();
|
||||
return NS_OK;
|
||||
}
|
||||
@ -1109,7 +1109,7 @@ static nsresult FireEventForAccessibility(nsIDOMHTMLInputElement* aTarget,
|
||||
// construction, destruction
|
||||
//
|
||||
|
||||
HTMLInputElement::HTMLInputElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
HTMLInputElement::HTMLInputElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
|
||||
FromParser aFromParser)
|
||||
: nsGenericHTMLFormElementWithState(aNodeInfo)
|
||||
, mType(kInputDefaultType->value)
|
||||
@ -1245,9 +1245,8 @@ HTMLInputElement::Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const
|
||||
{
|
||||
*aResult = nullptr;
|
||||
|
||||
nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
|
||||
nsRefPtr<HTMLInputElement> it =
|
||||
new HTMLInputElement(ni.forget(), NOT_FROM_PARSER);
|
||||
already_AddRefed<nsINodeInfo> ni = nsCOMPtr<nsINodeInfo>(aNodeInfo).forget();
|
||||
nsRefPtr<HTMLInputElement> it = new HTMLInputElement(ni, NOT_FROM_PARSER);
|
||||
|
||||
nsresult rv = const_cast<HTMLInputElement*>(this)->CopyInnerTo(it);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -97,7 +97,7 @@ public:
|
||||
using nsIConstraintValidation::Validity;
|
||||
using nsGenericHTMLFormElementWithState::GetForm;
|
||||
|
||||
HTMLInputElement(already_AddRefed<nsINodeInfo> aNodeInfo,
|
||||
HTMLInputElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
|
||||
mozilla::dom::FromParser aFromParser);
|
||||
virtual ~HTMLInputElement();
|
||||
|
||||
|
@ -18,7 +18,7 @@ class HTMLLIElement MOZ_FINAL : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLLIElement
|
||||
{
|
||||
public:
|
||||
HTMLLIElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
HTMLLIElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo)
|
||||
{
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user