diff --git a/accessible/mac/mozHTMLAccessible.mm b/accessible/mac/mozHTMLAccessible.mm index c17231f45c5..ca80cc1088c 100644 --- a/accessible/mac/mozHTMLAccessible.mm +++ b/accessible/mac/mozHTMLAccessible.mm @@ -17,9 +17,10 @@ - (NSString*)title { nsAutoString title; + ErrorResult rv; // XXX use the flattening API when there are available // see bug 768298 - mGeckoAccessible->GetContent()->GetTextContent(title); + mGeckoAccessible->GetContent()->GetTextContent(title, rv); return nsCocoaUtils::ToNSString(title); } diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index 9e46b6dcc3e..0080a4bf21d 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -886,6 +886,10 @@ pref("network.sntp.timeout", 30); // In seconds. // Enable dataStore pref("dom.datastore.enabled", true); +// When an entry is changed, use two timers to fire system messages in a more +// moderate pattern. +pref("dom.datastore.sysMsgOnChangeShortTimeoutSec", 10); +pref("dom.datastore.sysMsgOnChangeLongTimeoutSec", 60); // DOM Inter-App Communication API. pref("dom.inter-app-communication-api.enabled", true); diff --git a/browser/base/content/aboutaccounts/aboutaccounts.js b/browser/base/content/aboutaccounts/aboutaccounts.js index 5cceae154ac..af31be92e5b 100644 --- a/browser/base/content/aboutaccounts/aboutaccounts.js +++ b/browser/base/content/aboutaccounts/aboutaccounts.js @@ -12,6 +12,9 @@ Cu.import("resource://gre/modules/FxAccounts.jsm"); let fxAccountsCommon = {}; Cu.import("resource://gre/modules/FxAccountsCommon.js", fxAccountsCommon); +// for master-password utilities +Cu.import("resource://services-sync/util.js"); + const PREF_LAST_FXA_USER = "identity.fxaccounts.lastSignedInUserHash"; const PREF_SYNC_SHOW_CUSTOMIZATION = "services.sync.ui.showCustomizationDialog"; @@ -104,6 +107,12 @@ let wrapper = { return; } + // If a master-password is enabled, we want to encourage the user to + // unlock it. Things still work if not, but the user will probably need + // to re-auth next startup (in which case we will get here again and + // re-prompt) + Utils.ensureMPUnlocked(); + let iframe = document.getElementById("remote"); this.iframe = iframe; iframe.addEventListener("load", this); diff --git a/browser/base/content/aboutneterror/netError.css b/browser/base/content/aboutneterror/netError.css index 69fbd10f3bd..bf83610ec3d 100644 --- a/browser/base/content/aboutneterror/netError.css +++ b/browser/base/content/aboutneterror/netError.css @@ -52,7 +52,7 @@ ul { } @media (max-width: 675px) { - #errorTitle { + #errorTitleText { padding-top: 0; background-image: none; -moz-padding-start: 0; diff --git a/browser/base/content/sync/customize.js b/browser/base/content/sync/customize.js index 8da91db7c8a..b3178036d3c 100644 --- a/browser/base/content/sync/customize.js +++ b/browser/base/content/sync/customize.js @@ -4,20 +4,6 @@ "use strict"; -const {classes: Cc, interfaces: Ci, utils: Cu} = Components; - -Cu.import("resource://gre/modules/Services.jsm"); - -let service = Cc["@mozilla.org/weave/service;1"] - .getService(Ci.nsISupports) - .wrappedJSObject; - -if (!service.allowPasswordsEngine) { - let checkbox = document.getElementById("fxa-pweng-chk"); - checkbox.checked = false; - checkbox.disabled = true; -} - addEventListener("dialogaccept", function () { let pane = document.getElementById("sync-customize-pane"); pane.writePreferences(true); diff --git a/browser/base/content/sync/customize.xul b/browser/base/content/sync/customize.xul index e1fd95107b1..d95536d9ac9 100644 --- a/browser/base/content/sync/customize.xul +++ b/browser/base/content/sync/customize.xul @@ -45,8 +45,7 @@ - - - - - - - - - - - - + diff --git a/browser/components/preferences/sync.js b/browser/components/preferences/sync.js index 8c627ccb0b8..ea861ed671b 100644 --- a/browser/components/preferences/sync.js +++ b/browser/components/preferences/sync.js @@ -154,17 +154,6 @@ let gSyncPane = { for (let checkbox of engines.querySelectorAll("checkbox")) { checkbox.disabled = enginesListDisabled; } - - let checkbox = document.getElementById("fxa-pweng-chk"); - let help = document.getElementById("fxa-pweng-help"); - let allowPasswordsEngine = service.allowPasswordsEngine; - - if (!allowPasswordsEngine) { - checkbox.checked = false; - } - - checkbox.disabled = !allowPasswordsEngine || enginesListDisabled; - help.hidden = allowPasswordsEngine || enginesListDisabled; }); // If fxAccountEnabled is false and we are in a "not configured" state, // then fxAccounts is probably fully disabled rather than just unconfigured, diff --git a/browser/components/preferences/sync.xul b/browser/components/preferences/sync.xul index a88618794d4..aef18dedc86 100644 --- a/browser/components/preferences/sync.xul +++ b/browser/components/preferences/sync.xul @@ -265,20 +265,9 @@ - - - - - - - - - - - + diff --git a/browser/themes/linux/preferences/preferences.css b/browser/themes/linux/preferences/preferences.css index 20d8a312b01..2d2dffb3303 100644 --- a/browser/themes/linux/preferences/preferences.css +++ b/browser/themes/linux/preferences/preferences.css @@ -171,12 +171,4 @@ label.small { margin-bottom: 0.6em; } -#fxa-pweng-help-link > label { - margin: 0; -} - -#fxa-pweng-help-link > image { - list-style-image: url("chrome://global/skin/icons/question-16.png"); -} - %endif diff --git a/browser/themes/osx/preferences/preferences.css b/browser/themes/osx/preferences/preferences.css index 50371d853a8..52ae7110bfa 100644 --- a/browser/themes/osx/preferences/preferences.css +++ b/browser/themes/osx/preferences/preferences.css @@ -233,20 +233,4 @@ html|a.inline-link:-moz-focusring { margin-bottom: 0.6em; } -#fxa-pweng-help-link > label { - margin: 0; -} - -#fxa-pweng-help-link > image { - width: 16px; - height: 16px; - list-style-image: url("chrome://global/skin/icons/question-16.png"); -} - -@media (min-resolution: 2dppx) { - #fxa-pweng-help-link > image { - list-style-image: url("chrome://global/skin/icons/question-32.png"); - } -} - %endif diff --git a/browser/themes/windows/preferences/preferences.css b/browser/themes/windows/preferences/preferences.css index 63537da6992..13d5281f90b 100644 --- a/browser/themes/windows/preferences/preferences.css +++ b/browser/themes/windows/preferences/preferences.css @@ -161,12 +161,4 @@ label.small { margin-bottom: 0.6em; } -#fxa-pweng-help-link > label { - margin: 0; -} - -#fxa-pweng-help-link > image { - list-style-image: url("chrome://global/skin/icons/question-16.png"); -} - %endif diff --git a/content/base/public/Element.h b/content/base/public/Element.h index bd8c19ddab3..1718232193d 100644 --- a/content/base/public/Element.h +++ b/content/base/public/Element.h @@ -139,7 +139,7 @@ class Element : public FragmentOrElement { public: #ifdef MOZILLA_INTERNAL_API - Element(already_AddRefed& aNodeInfo) : + explicit Element(already_AddRefed& aNodeInfo) : FragmentOrElement(aNodeInfo), mState(NS_EVENT_STATE_MOZ_READONLY) { @@ -1213,7 +1213,7 @@ private: class DestinationInsertionPointList : public nsINodeList { public: - DestinationInsertionPointList(Element* aElement); + explicit DestinationInsertionPointList(Element* aElement); NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_CLASS(DestinationInsertionPointList) diff --git a/content/base/public/FragmentOrElement.h b/content/base/public/FragmentOrElement.h index 5353ea1e521..17fc512a7fc 100644 --- a/content/base/public/FragmentOrElement.h +++ b/content/base/public/FragmentOrElement.h @@ -48,7 +48,7 @@ class Element; class nsChildContentList MOZ_FINAL : public nsINodeList { public: - nsChildContentList(nsINode* aNode) + explicit nsChildContentList(nsINode* aNode) : mNode(aNode) { SetIsDOMBinding(); @@ -96,7 +96,7 @@ public: NS_DECL_NSIDOMXPATHNSRESOLVER - nsNode3Tearoff(nsINode *aNode) : mNode(aNode) + explicit nsNode3Tearoff(nsINode *aNode) : mNode(aNode) { } @@ -114,7 +114,7 @@ private: class nsNodeWeakReference MOZ_FINAL : public nsIWeakReference { public: - nsNodeWeakReference(nsINode* aNode) + explicit nsNodeWeakReference(nsINode* aNode) : mNode(aNode) { } @@ -143,7 +143,7 @@ private: class nsNodeSupportsWeakRefTearoff MOZ_FINAL : public nsISupportsWeakReference { public: - nsNodeSupportsWeakRefTearoff(nsINode* aNode) + explicit nsNodeSupportsWeakRefTearoff(nsINode* aNode) : mNode(aNode) { } @@ -175,8 +175,8 @@ class UndoManager; class FragmentOrElement : public nsIContent { public: - FragmentOrElement(already_AddRefed& aNodeInfo); - FragmentOrElement(already_AddRefed&& aNodeInfo); + explicit FragmentOrElement(already_AddRefed& aNodeInfo); + explicit FragmentOrElement(already_AddRefed&& aNodeInfo); NS_DECL_CYCLE_COLLECTING_ISUPPORTS @@ -190,7 +190,8 @@ public: virtual nsresult InsertChildAt(nsIContent* aKid, uint32_t aIndex, bool aNotify) MOZ_OVERRIDE; virtual void RemoveChildAt(uint32_t aIndex, bool aNotify) MOZ_OVERRIDE; - virtual void GetTextContentInternal(nsAString& aTextContent) MOZ_OVERRIDE; + virtual void GetTextContentInternal(nsAString& aTextContent, + mozilla::ErrorResult& aError) MOZ_OVERRIDE; virtual void SetTextContentInternal(const nsAString& aTextContent, mozilla::ErrorResult& aError) MOZ_OVERRIDE; diff --git a/content/base/public/nsDOMFile.h b/content/base/public/nsDOMFile.h index f73bc1cee65..1cbcb78e347 100644 --- a/content/base/public/nsDOMFile.h +++ b/content/base/public/nsDOMFile.h @@ -754,7 +754,7 @@ class nsDOMFileList MOZ_FINAL : public nsIDOMFileList, ~nsDOMFileList() {} public: - nsDOMFileList(nsISupports *aParent) : mParent(aParent) + explicit nsDOMFileList(nsISupports *aParent) : mParent(aParent) { SetIsDOMBinding(); } diff --git a/content/base/public/nsIContent.h b/content/base/public/nsIContent.h index 7ba6a654dad..fa4b2003356 100644 --- a/content/base/public/nsIContent.h +++ b/content/base/public/nsIContent.h @@ -54,7 +54,7 @@ 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& aNodeInfo) + explicit nsIContent(already_AddRefed& aNodeInfo) : nsINode(aNodeInfo) { MOZ_ASSERT(mNodeInfo); diff --git a/content/base/public/nsIDocument.h b/content/base/public/nsIDocument.h index 7875ffc5ef9..610b47f7910 100644 --- a/content/base/public/nsIDocument.h +++ b/content/base/public/nsIDocument.h @@ -688,7 +688,7 @@ private: class SelectorCacheKey { public: - SelectorCacheKey(const nsAString& aString) : mKey(aString) + explicit SelectorCacheKey(const nsAString& aString) : mKey(aString) { MOZ_COUNT_CTOR(SelectorCacheKey); } @@ -2728,7 +2728,7 @@ private: class MOZ_STACK_CLASS nsAutoSyncOperation { public: - nsAutoSyncOperation(nsIDocument* aDocument); + explicit nsAutoSyncOperation(nsIDocument* aDocument); ~nsAutoSyncOperation(); private: nsCOMArray mDocuments; diff --git a/content/base/public/nsINode.h b/content/base/public/nsINode.h index 86e29ed18cc..c2558ab43e4 100644 --- a/content/base/public/nsINode.h +++ b/content/base/public/nsINode.h @@ -337,7 +337,7 @@ public: friend class nsAttrAndChildArray; #ifdef MOZILLA_INTERNAL_API - nsINode(already_AddRefed& aNodeInfo) + explicit nsINode(already_AddRefed& aNodeInfo) : mNodeInfo(aNodeInfo), mParent(nullptr), mBoolFlags(0), @@ -1136,9 +1136,10 @@ protected: } public: - void GetTextContent(nsAString& aTextContent) + void GetTextContent(nsAString& aTextContent, + mozilla::ErrorResult& aError) { - GetTextContentInternal(aTextContent); + GetTextContentInternal(aTextContent, aError); } void SetTextContent(const nsAString& aTextContent, mozilla::ErrorResult& aError) @@ -1749,7 +1750,8 @@ protected: return IsEditableInternal(); } - virtual void GetTextContentInternal(nsAString& aTextContent); + virtual void GetTextContentInternal(nsAString& aTextContent, + mozilla::ErrorResult& aError); virtual void SetTextContentInternal(const nsAString& aTextContent, mozilla::ErrorResult& aError) { @@ -2032,8 +2034,9 @@ ToCanonicalSupports(nsINode* aPointer) } \ NS_IMETHOD GetTextContent(nsAString& aTextContent) __VA_ARGS__ \ { \ - nsINode::GetTextContent(aTextContent); \ - return NS_OK; \ + mozilla::ErrorResult rv; \ + nsINode::GetTextContent(aTextContent, rv); \ + return rv.ErrorCode(); \ } \ NS_IMETHOD SetTextContent(const nsAString& aTextContent) __VA_ARGS__ \ { \ diff --git a/content/base/public/nsNameSpaceManager.h b/content/base/public/nsNameSpaceManager.h index 8b9f63738bc..889943e97ec 100644 --- a/content/base/public/nsNameSpaceManager.h +++ b/content/base/public/nsNameSpaceManager.h @@ -20,7 +20,7 @@ public: typedef const nsAString* KeyType; typedef const nsAString* KeyTypePointer; - nsNameSpaceKey(KeyTypePointer aKey) : mKey(aKey) + explicit nsNameSpaceKey(KeyTypePointer aKey) : mKey(aKey) { } nsNameSpaceKey(const nsNameSpaceKey& toCopy) : mKey(toCopy.mKey) diff --git a/content/base/src/Attr.cpp b/content/base/src/Attr.cpp index 48baf7c9d74..3059c9e2846 100644 --- a/content/base/src/Attr.cpp +++ b/content/base/src/Attr.cpp @@ -302,7 +302,8 @@ Attr::GetBaseURI(bool aTryUseXHRDocBaseURI) const } void -Attr::GetTextContentInternal(nsAString& aTextContent) +Attr::GetTextContentInternal(nsAString& aTextContent, + ErrorResult& aError) { OwnerDoc()->WarnOnceAbout(nsIDocument::eTextContent); diff --git a/content/base/src/Attr.h b/content/base/src/Attr.h index 16a118c8ed7..42e02b26bc1 100644 --- a/content/base/src/Attr.h +++ b/content/base/src/Attr.h @@ -42,7 +42,8 @@ public: // nsIDOMNode interface NS_FORWARD_NSIDOMNODE_TO_NSINODE - virtual void GetTextContentInternal(nsAString& aTextContent) MOZ_OVERRIDE; + virtual void GetTextContentInternal(nsAString& aTextContent, + ErrorResult& aError) MOZ_OVERRIDE; virtual void SetTextContentInternal(const nsAString& aTextContent, ErrorResult& aError) MOZ_OVERRIDE; virtual void GetNodeValueInternal(nsAString& aNodeValue) MOZ_OVERRIDE; diff --git a/content/base/src/DOMRect.h b/content/base/src/DOMRect.h index f4c2d3d4470..ce36815395b 100644 --- a/content/base/src/DOMRect.h +++ b/content/base/src/DOMRect.h @@ -33,7 +33,7 @@ public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMRectReadOnly) - DOMRectReadOnly(nsISupports* aParent) + explicit DOMRectReadOnly(nsISupports* aParent) : mParent(aParent) { SetIsDOMBinding(); @@ -80,8 +80,8 @@ class DOMRect MOZ_FINAL : public DOMRectReadOnly , public nsIDOMClientRect { public: - DOMRect(nsISupports* aParent, double aX = 0, double aY = 0, - double aWidth = 0, double aHeight = 0) + explicit DOMRect(nsISupports* aParent, double aX = 0, double aY = 0, + double aWidth = 0, double aHeight = 0) : DOMRectReadOnly(aParent) , mX(aX) , mY(aY) @@ -150,7 +150,7 @@ class DOMRectList MOZ_FINAL : public nsIDOMClientRectList, ~DOMRectList() {} public: - DOMRectList(nsISupports *aParent) : mParent(aParent) + explicit DOMRectList(nsISupports *aParent) : mParent(aParent) { SetIsDOMBinding(); } diff --git a/content/base/src/FragmentOrElement.cpp b/content/base/src/FragmentOrElement.cpp index e2be514e15b..b41caeed96a 100644 --- a/content/base/src/FragmentOrElement.cpp +++ b/content/base/src/FragmentOrElement.cpp @@ -1102,10 +1102,12 @@ FragmentOrElement::RemoveChildAt(uint32_t aIndex, bool aNotify) } void -FragmentOrElement::GetTextContentInternal(nsAString& aTextContent) +FragmentOrElement::GetTextContentInternal(nsAString& aTextContent, + ErrorResult& aError) { - if(!nsContentUtils::GetNodeTextContent(this, true, aTextContent)) - NS_RUNTIMEABORT("OOM"); + if(!nsContentUtils::GetNodeTextContent(this, true, aTextContent)) { + aError.Throw(NS_ERROR_OUT_OF_MEMORY); + } } void diff --git a/content/base/src/nsAttrValue.h b/content/base/src/nsAttrValue.h index d4c19ab71a8..3bf1151bafd 100644 --- a/content/base/src/nsAttrValue.h +++ b/content/base/src/nsAttrValue.h @@ -67,7 +67,7 @@ struct ImageValue; */ class nsCheapString : public nsString { public: - nsCheapString(nsStringBuffer* aBuf) + explicit nsCheapString(nsStringBuffer* aBuf) { if (aBuf) aBuf->ToString(aBuf->StorageSize()/sizeof(char16_t) - 1, *this); diff --git a/content/base/src/nsDOMAttributeMap.h b/content/base/src/nsDOMAttributeMap.h index e9d853d2639..477dc858acc 100644 --- a/content/base/src/nsDOMAttributeMap.h +++ b/content/base/src/nsDOMAttributeMap.h @@ -55,7 +55,7 @@ public: typedef const nsAttrKey& KeyType; typedef const nsAttrKey* KeyTypePointer; - nsAttrHashKey(KeyTypePointer aKey) : mKey(*aKey) {} + explicit nsAttrHashKey(KeyTypePointer aKey) : mKey(*aKey) {} nsAttrHashKey(const nsAttrHashKey& aCopy) : mKey(aCopy.mKey) {} ~nsAttrHashKey() {} @@ -89,7 +89,7 @@ public: typedef mozilla::dom::Element Element; typedef mozilla::ErrorResult ErrorResult; - nsDOMAttributeMap(Element *aContent); + explicit nsDOMAttributeMap(Element *aContent); NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsDOMAttributeMap) diff --git a/content/base/src/nsFrameLoader.cpp b/content/base/src/nsFrameLoader.cpp index f93c00dfbd1..1f358025eec 100644 --- a/content/base/src/nsFrameLoader.cpp +++ b/content/base/src/nsFrameLoader.cpp @@ -2326,7 +2326,7 @@ nsFrameLoader::DoSendAsyncMessage(JSContext* aCx, return false; } return tabParent->SendAsyncMessage(nsString(aMessage), data, cpows, - aPrincipal); + IPC::Principal(aPrincipal)); } if (mChildMessageManager) { diff --git a/content/base/src/nsFrameMessageManager.cpp b/content/base/src/nsFrameMessageManager.cpp index f9990ffb6d1..31ec577f780 100644 --- a/content/base/src/nsFrameMessageManager.cpp +++ b/content/base/src/nsFrameMessageManager.cpp @@ -1729,10 +1729,10 @@ public: } if (aIsSync) { return cc->SendSyncMessage(PromiseFlatString(aMessage), data, cpows, - aPrincipal, aJSONRetVal); + IPC::Principal(aPrincipal), aJSONRetVal); } return cc->CallRpcMessage(PromiseFlatString(aMessage), data, cpows, - aPrincipal, aJSONRetVal); + IPC::Principal(aPrincipal), aJSONRetVal); } virtual bool DoSendAsyncMessage(JSContext* aCx, @@ -1755,7 +1755,7 @@ public: return false; } return cc->SendAsyncMessage(PromiseFlatString(aMessage), data, cpows, - aPrincipal); + IPC::Principal(aPrincipal)); } }; diff --git a/content/base/src/nsGenericDOMDataNode.h b/content/base/src/nsGenericDOMDataNode.h index 19e1977cb54..b66bdd5f0bb 100644 --- a/content/base/src/nsGenericDOMDataNode.h +++ b/content/base/src/nsGenericDOMDataNode.h @@ -93,7 +93,8 @@ public: virtual nsresult InsertChildAt(nsIContent* aKid, uint32_t aIndex, bool aNotify) MOZ_OVERRIDE; virtual void RemoveChildAt(uint32_t aIndex, bool aNotify) MOZ_OVERRIDE; - virtual void GetTextContentInternal(nsAString& aTextContent) MOZ_OVERRIDE + virtual void GetTextContentInternal(nsAString& aTextContent, + mozilla::ErrorResult& aError) MOZ_OVERRIDE { GetNodeValue(aTextContent); } diff --git a/content/base/src/nsINode.cpp b/content/base/src/nsINode.cpp index 10d3514b8b0..ed89554af6b 100644 --- a/content/base/src/nsINode.cpp +++ b/content/base/src/nsINode.cpp @@ -380,7 +380,7 @@ nsINode::ChildNodes() } void -nsINode::GetTextContentInternal(nsAString& aTextContent) +nsINode::GetTextContentInternal(nsAString& aTextContent, ErrorResult& aError) { SetDOMStringToNull(aTextContent); } diff --git a/content/base/src/nsMappedAttributeElement.h b/content/base/src/nsMappedAttributeElement.h index 61460e15742..301b0682d13 100644 --- a/content/base/src/nsMappedAttributeElement.h +++ b/content/base/src/nsMappedAttributeElement.h @@ -28,7 +28,7 @@ class nsMappedAttributeElement : public nsMappedAttributeElementBase protected: - nsMappedAttributeElement(already_AddRefed& aNodeInfo) + explicit nsMappedAttributeElement(already_AddRefed& aNodeInfo) : nsMappedAttributeElementBase(aNodeInfo) {} diff --git a/content/base/src/nsPropertyTable.h b/content/base/src/nsPropertyTable.h index 510fd1bc796..ec5d26de2e8 100644 --- a/content/base/src/nsPropertyTable.h +++ b/content/base/src/nsPropertyTable.h @@ -52,8 +52,8 @@ public: // These are the types of objects that can own properties. No object should // inherit more then one of these classes. // To add support for more types just add to this list. - nsPropertyOwner(const nsINode* aObject) : mObject(aObject) {} - nsPropertyOwner(const nsIFrame* aObject) : mObject(aObject) {} + MOZ_IMPLICIT nsPropertyOwner(const nsINode* aObject) : mObject(aObject) {} + MOZ_IMPLICIT nsPropertyOwner(const nsIFrame* aObject) : mObject(aObject) {} operator const void*() { return mObject; } const void* get() { return mObject; } diff --git a/content/base/src/nsRange.h b/content/base/src/nsRange.h index a7bab97ef66..5e4c9f92f1e 100644 --- a/content/base/src/nsRange.h +++ b/content/base/src/nsRange.h @@ -41,7 +41,7 @@ class nsRange MOZ_FINAL : public nsIDOMRange, virtual ~nsRange(); public: - nsRange(nsINode* aNode) + explicit nsRange(nsINode* aNode) : mRoot(nullptr) , mStartOffset(0) , mEndOffset(0) @@ -290,7 +290,7 @@ protected: struct MOZ_STACK_CLASS AutoInvalidateSelection { - AutoInvalidateSelection(nsRange* aRange) : mRange(aRange) + explicit AutoInvalidateSelection(nsRange* aRange) : mRange(aRange) { #ifdef DEBUG mWasInSelection = mRange->IsInSelection(); diff --git a/content/base/src/nsStyledElement.h b/content/base/src/nsStyledElement.h index 469d3b1707c..8e746d2bba6 100644 --- a/content/base/src/nsStyledElement.h +++ b/content/base/src/nsStyledElement.h @@ -30,7 +30,7 @@ class nsStyledElementNotElementCSSInlineStyle : public nsStyledElementBase protected: - inline nsStyledElementNotElementCSSInlineStyle(already_AddRefed& aNodeInfo) + inline explicit nsStyledElementNotElementCSSInlineStyle(already_AddRefed& aNodeInfo) : nsStyledElementBase(aNodeInfo) {} @@ -72,7 +72,7 @@ protected: class nsStyledElement : public nsStyledElementNotElementCSSInlineStyle { protected: - inline nsStyledElement(already_AddRefed& aNodeInfo) + inline explicit nsStyledElement(already_AddRefed& aNodeInfo) : nsStyledElementNotElementCSSInlineStyle(aNodeInfo) {} }; diff --git a/content/base/src/nsXMLHttpRequest.h b/content/base/src/nsXMLHttpRequest.h index 595044c12e8..0d53a3a97c4 100644 --- a/content/base/src/nsXMLHttpRequest.h +++ b/content/base/src/nsXMLHttpRequest.h @@ -113,7 +113,7 @@ class nsXHREventTarget : public mozilla::DOMEventTargetHelper, public nsIXMLHttpRequestEventTarget { protected: - nsXHREventTarget(mozilla::DOMEventTargetHelper* aOwner) + explicit nsXHREventTarget(mozilla::DOMEventTargetHelper* aOwner) : mozilla::DOMEventTargetHelper(aOwner) { } @@ -151,7 +151,7 @@ class nsXMLHttpRequestUpload MOZ_FINAL : public nsXHREventTarget, public nsIXMLHttpRequestUpload { public: - nsXMLHttpRequestUpload(mozilla::DOMEventTargetHelper* aOwner) + explicit nsXMLHttpRequestUpload(mozilla::DOMEventTargetHelper* aOwner) : nsXHREventTarget(aOwner) { } @@ -343,31 +343,31 @@ private: RequestBody() : mType(Uninitialized) { } - RequestBody(const mozilla::dom::ArrayBuffer* aArrayBuffer) : mType(ArrayBuffer) + explicit RequestBody(const mozilla::dom::ArrayBuffer* aArrayBuffer) : mType(ArrayBuffer) { mValue.mArrayBuffer = aArrayBuffer; } - RequestBody(const mozilla::dom::ArrayBufferView* aArrayBufferView) : mType(ArrayBufferView) + explicit RequestBody(const mozilla::dom::ArrayBufferView* aArrayBufferView) : mType(ArrayBufferView) { mValue.mArrayBufferView = aArrayBufferView; } - RequestBody(nsIDOMBlob* aBlob) : mType(Blob) + explicit RequestBody(nsIDOMBlob* aBlob) : mType(Blob) { mValue.mBlob = aBlob; } - RequestBody(nsIDocument* aDocument) : mType(Document) + explicit RequestBody(nsIDocument* aDocument) : mType(Document) { mValue.mDocument = aDocument; } - RequestBody(const nsAString& aString) : mType(DOMString) + explicit RequestBody(const nsAString& aString) : mType(DOMString) { mValue.mString = &aString; } - RequestBody(nsFormData& aFormData) : mType(FormData) + explicit RequestBody(nsFormData& aFormData) : mType(FormData) { mValue.mFormData = &aFormData; } - RequestBody(nsIInputStream* aStream) : mType(InputStream) + explicit RequestBody(nsIInputStream* aStream) : mType(InputStream) { mValue.mStream = aStream; } @@ -809,7 +809,7 @@ class nsXMLHttpRequestXPCOMifier MOZ_FINAL : public nsIStreamListener, NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXMLHttpRequestXPCOMifier, nsIStreamListener) - nsXMLHttpRequestXPCOMifier(nsXMLHttpRequest* aXHR) : + explicit nsXMLHttpRequestXPCOMifier(nsXMLHttpRequest* aXHR) : mXHR(aXHR) { } @@ -847,7 +847,7 @@ public: mXHR = nullptr; return NS_OK; } - nsXHRParseEndListener(nsIXMLHttpRequest* aXHR) + explicit nsXHRParseEndListener(nsIXMLHttpRequest* aXHR) : mXHR(do_GetWeakReference(aXHR)) {} private: virtual ~nsXHRParseEndListener() {} diff --git a/content/html/content/public/HTMLCanvasElement.h b/content/html/content/public/HTMLCanvasElement.h index ac4c6c8bcd7..575a41ff60c 100644 --- a/content/html/content/public/HTMLCanvasElement.h +++ b/content/html/content/public/HTMLCanvasElement.h @@ -47,7 +47,7 @@ class HTMLCanvasElement MOZ_FINAL : public nsGenericHTMLElement, typedef layers::LayerManager LayerManager; public: - HTMLCanvasElement(already_AddRefed& aNodeInfo); + explicit HTMLCanvasElement(already_AddRefed& aNodeInfo); NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLCanvasElement, canvas) diff --git a/content/html/content/src/HTMLMediaElement.cpp b/content/html/content/src/HTMLMediaElement.cpp index 466d1c0d1ee..230e0c6431f 100644 --- a/content/html/content/src/HTMLMediaElement.cpp +++ b/content/html/content/src/HTMLMediaElement.cpp @@ -3895,6 +3895,11 @@ void HTMLMediaElement::UpdateAudioChannelPlayingState() if (playingThroughTheAudioChannel != mPlayingThroughTheAudioChannel) { mPlayingThroughTheAudioChannel = playingThroughTheAudioChannel; + // If we are not playing, we don't need to create a new audioChannelAgent. + if (!mAudioChannelAgent && !mPlayingThroughTheAudioChannel) { + return; + } + if (!mAudioChannelAgent) { nsresult rv; mAudioChannelAgent = do_CreateInstance("@mozilla.org/audiochannelagent;1", &rv); diff --git a/content/html/content/src/HTMLTimeElement.cpp b/content/html/content/src/HTMLTimeElement.cpp index f7ea0d1b51c..bb9367047c3 100644 --- a/content/html/content/src/HTMLTimeElement.cpp +++ b/content/html/content/src/HTMLTimeElement.cpp @@ -37,7 +37,8 @@ HTMLTimeElement::GetItemValueText(nsAString& text) if (HasAttr(kNameSpaceID_None, nsGkAtoms::datetime)) { GetDateTime(text); } else { - GetTextContentInternal(text); + ErrorResult rv; + GetTextContentInternal(text, rv); } } diff --git a/content/html/content/src/ValidityState.h b/content/html/content/src/ValidityState.h index a74e8fb04e4..33fb447a1c5 100644 --- a/content/html/content/src/ValidityState.h +++ b/content/html/content/src/ValidityState.h @@ -75,7 +75,7 @@ public: } protected: - ValidityState(nsIConstraintValidation* aConstraintValidation); + explicit ValidityState(nsIConstraintValidation* aConstraintValidation); /** * Helper function to get a validity state from constraint validation instance. diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp index b6af4398434..67b521eb713 100644 --- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -3126,7 +3126,8 @@ nsGenericHTMLElement::SetItemValue(nsIVariant* aValue) void nsGenericHTMLElement::GetItemValueText(nsAString& text) { - GetTextContentInternal(text); + ErrorResult rv; + GetTextContentInternal(text, rv); } void diff --git a/content/html/content/src/nsGenericHTMLElement.h b/content/html/content/src/nsGenericHTMLElement.h index 630dcaa6bee..038b167a47f 100644 --- a/content/html/content/src/nsGenericHTMLElement.h +++ b/content/html/content/src/nsGenericHTMLElement.h @@ -51,7 +51,7 @@ class nsGenericHTMLElement : public nsGenericHTMLElementBase, public nsIDOMHTMLElement { public: - nsGenericHTMLElement(already_AddRefed& aNodeInfo) + explicit nsGenericHTMLElement(already_AddRefed& aNodeInfo) : nsGenericHTMLElementBase(aNodeInfo), mScrollgrab(false) { @@ -1263,7 +1263,7 @@ class nsGenericHTMLFormElement : public nsGenericHTMLElement, public nsIFormControl { public: - nsGenericHTMLFormElement(already_AddRefed& aNodeInfo); + explicit nsGenericHTMLFormElement(already_AddRefed& aNodeInfo); NS_DECL_ISUPPORTS_INHERITED @@ -1421,7 +1421,7 @@ protected: class nsGenericHTMLFormElementWithState : public nsGenericHTMLFormElement { public: - nsGenericHTMLFormElementWithState(already_AddRefed& aNodeInfo); + explicit nsGenericHTMLFormElementWithState(already_AddRefed& aNodeInfo); /** * Get the presentation state for a piece of content, or create it if it does diff --git a/content/html/content/test/file_fullscreen-plugins.html b/content/html/content/test/file_fullscreen-plugins.html index 9d3c0dd3bf7..b1a99df2be3 100644 --- a/content/html/content/test/file_fullscreen-plugins.html +++ b/content/html/content/test/file_fullscreen-plugins.html @@ -15,6 +15,8 @@ Test plugins with DOM full-screen API: Test for Bug 545812 + +