From d8dded16af5e418493a6949f22bd5b75f6eaedd3 Mon Sep 17 00:00:00 2001 From: roytam1 Date: Fri, 15 Jan 2021 14:07:12 +0800 Subject: [PATCH] import changes from `dev' branch of rmottola/Arctic-Fox: - Bug 1140131 - When XPConnect loads scripts (JS components or Cu.import), set the MIME type so that we don't load the exthandler service to guess it, r=bholley (0ab34e729) - Bug 1164982 - Record telemetry for GC max pause during animations; r=sfink (aab107db0) - Bug 1171305 - Remove lots of now-unnecessary null-checks involving XPCMaps. r=mrbkap. (7e64f2a60) - Bug 1170934 (part 1) - Remove PLDHashTable::{Init,Fini}(). r=froydnj. (554061e2e) - Bug 1170934 (part 2) - Fix the comment for PL_DHashTableRemove(). r=froydnj. (34ddb176b) - Bug 1171323 - Remove PL_DHashFreeStringKey(), because it's dead. r=froydnj. (4fd00ebe1) - Bug 1138848 - Modify OneCRL blocklist for subject / public key blocking (r=keeler, unfocused) (54b7f3d9d) - Bug 1173212 (part 1) - Remove some can't-fail tests in PLDHashTable. r=froydnj. (4b4642c4a) - Bug 1173212 (part 2) - Make PLDHashTable::Iterator work in chaos mode. r=froydnj. (17b6777fa) - Bug 1173600 (part 1) - Tweak PLDHashTable post-enumeration shrinking. r=froydnj. (a21ba3a63) - Bug 1173600 (part 2) - Move post-enumeration shrinking code into its own function. r=froydnj. (87f64a10f) - Bug 1174046 - Fix PLDHashTable::Iterator in chaos mode again. r=froydnj, a=philor (69ed3b9b1) - Bug 1158366: Remove nsIDOMHTML[BR|Div|Heading|TableCaption|Table|Title]Element.idl. r=ehsan (ccc80f0b1) - Bug 1167189: Add an infallible version of nsContentUtils::GetNodeTextContent. r=jst (5c464322a) - Bug 1169800 - nsContentUtils::ParseLegacyFontSize should check when the input string is just '+' or '-', r=dveditz (c5d5e870e) - Bug 1170328 - Mark nsIDocument::WarnOnceAbout() with const. r=smaug (41b39009c) - Bug 1139640: Change DOM property for -moz-osx-font-smoothing to match standard camel-casing algorithm. r=jdaggett (5f2eb6c59) - Bug 1140148 - Update mochitest manifests for Android 4.3 emulator; r=dminor (04a28ac92) - partial of Bug 1116187 - Disable failing mochitest-chrome tests for B2G (0ca9f0e25) - Bug 1157097 - Don't share a style context that will have its cached style data cleared. r=dbaron (d5adcb047) - Bug 1160724 - Part 1: Resolve a properly parented style context when looking up -moz-binding of a display:none XUL/plugin element. r=dbaron (599665d4d) - Bug 1160724 - Part 2: Test that we resolve a properly parented style context when looking up -moz-binding of a display:none XUL/plugin element. r=heycam (87fe13c8d) --- caps/tests/mochitest/chrome.ini | 1 + docshell/test/chrome/chrome.ini | 1 + docshell/test/navigation/mochitest.ini | 2 +- dom/animation/test/chrome.ini | 1 + dom/apps/tests/chrome.ini | 1 + dom/base/Element.cpp | 10 +- dom/base/FragmentOrElement.cpp | 2 +- dom/base/nsContentUtils.cpp | 19 +- dom/base/nsContentUtils.h | 7 +- dom/base/nsDocument.cpp | 16 +- dom/base/nsIDocument.h | 23 +- dom/base/nsStyleLinkElement.cpp | 2 +- dom/base/nsTreeSanitizer.cpp | 5 +- dom/base/test/chrome.ini | 1 + dom/base/test/chrome/chrome.ini | 1 + dom/base/test/csp/chrome.ini | 1 + dom/bindings/test/chrome.ini | 1 + dom/canvas/test/chrome/chrome.ini | 1 + dom/canvas/test/webgl-mochitest.ini | 2 +- dom/contacts/tests/chrome.ini | 1 + dom/devicestorage/test/chrome.ini | 2 +- dom/encoding/test/chrome.ini | 1 + dom/events/test/chrome.ini | 1 + dom/html/HTMLAnchorElement.cpp | 2 +- dom/html/HTMLBRElement.cpp | 6 - dom/html/HTMLBRElement.h | 14 +- dom/html/HTMLDivElement.cpp | 3 - dom/html/HTMLDivElement.h | 22 +- dom/html/HTMLElement.cpp | 2 +- dom/html/HTMLHeadingElement.cpp | 6 - dom/html/HTMLHeadingElement.h | 20 +- dom/html/HTMLMenuItemElement.cpp | 4 +- dom/html/HTMLOutputElement.cpp | 8 +- dom/html/HTMLScriptElement.cpp | 4 +- dom/html/HTMLStyleElement.cpp | 2 +- dom/html/HTMLTableCaptionElement.cpp | 5 - dom/html/HTMLTableCaptionElement.h | 10 +- dom/html/HTMLTableElement.cpp | 5 +- dom/html/HTMLTableElement.h | 4 +- dom/html/HTMLTextAreaElement.cpp | 2 +- dom/html/HTMLTitleElement.cpp | 18 +- dom/html/HTMLTitleElement.h | 12 +- dom/html/test/chrome.ini | 1 + dom/html/test/forms/chrome.ini | 1 + dom/html/test/forms/mochitest.ini | 6 +- dom/identity/tests/mochitest/chrome.ini | 1 + dom/indexedDB/test/chrome.ini | 1 + dom/interfaces/base/domstubs.idl | 1 - dom/interfaces/html/moz.build | 6 - dom/interfaces/html/nsIDOMHTMLBRElement.idl | 23 -- dom/interfaces/html/nsIDOMHTMLDivElement.idl | 23 -- .../html/nsIDOMHTMLHeadingElement.idl | 23 -- .../html/nsIDOMHTMLTableCaptionElem.idl | 23 -- .../html/nsIDOMHTMLTableElement.idl | 22 -- .../html/nsIDOMHTMLTitleElement.idl | 23 -- dom/ipc/tests/chrome.ini | 1 + dom/media/test/chrome.ini | 1 + dom/media/test/mochitest.ini | 2 +- .../tests/mochitest/identity/mochitest.ini | 2 +- dom/media/tests/mochitest/mochitest.ini | 2 +- dom/media/webaudio/test/chrome.ini | 1 + dom/media/webaudio/test/mochitest.ini | 2 +- dom/phonenumberutils/tests/chrome.ini | 1 + dom/plugins/test/mochitest/chrome.ini | 2 +- dom/promise/tests/chrome.ini | 1 + dom/settings/tests/chrome.ini | 1 + dom/svg/SVGScriptElement.cpp | 4 +- dom/svg/test/mochitest.ini | 1 + dom/system/tests/chrome.ini | 1 + dom/tests/mochitest/chrome/chrome.ini | 1 + dom/tests/mochitest/general/chrome.ini | 1 + dom/tests/mochitest/localstorage/chrome.ini | 1 + dom/tests/mochitest/sessionstorage/chrome.ini | 1 + dom/tests/mochitest/webapps/chrome.ini | 1 + dom/tests/mochitest/whatwg/chrome.ini | 1 + dom/webidl/HTMLHeadingElement.webidl | 1 + dom/webidl/HTMLTitleElement.webidl | 2 +- dom/workers/test/chrome.ini | 1 + dom/xbl/nsXBLPrototypeBinding.cpp | 10 +- dom/xbl/test/chrome.ini | 1 + .../nsXULTemplateQueryProcessorStorage.cpp | 4 +- dom/xul/templates/tests/chrome/chrome.ini | 2 +- dom/xul/test/chrome.ini | 1 + editor/composer/test/chrome.ini | 1 + editor/libeditor/tests/chrome.ini | 1 + editor/libeditor/tests/mochitest.ini | 5 +- extensions/cookie/test/chrome.ini | 1 + .../spellcheck/src/mozInlineSpellWordUtil.cpp | 1 - extensions/spellcheck/tests/chrome/chrome.ini | 1 + extensions/universalchardet/tests/chrome.ini | 1 + image/test/mochitest/chrome.ini | 1 + js/public/SliceBudget.h | 6 +- js/src/gc/GCRuntime.h | 18 +- js/src/gc/Statistics.cpp | 1 - js/src/jsgc.cpp | 2 +- js/xpconnect/src/XPCJSRuntime.cpp | 107 +++---- js/xpconnect/src/XPCMaps.cpp | 74 ++--- js/xpconnect/src/XPCMaps.h | 22 +- js/xpconnect/src/XPCWrappedNativeScope.cpp | 27 +- js/xpconnect/tests/chrome/chrome.ini | 1 + js/xpconnect/wrappers/WrapperFactory.cpp | 1 - layout/base/RestyleManager.cpp | 6 + layout/base/tests/chrome/chrome.ini | 32 +- layout/forms/test/chrome.ini | 1 + layout/generic/nsRubyBaseContainerFrame.cpp | 13 +- layout/generic/test/chrome.ini | 1 + layout/inspector/tests/chrome/chrome.ini | 1 + layout/mathml/nsMathMLTokenFrame.cpp | 4 +- layout/mathml/nsMathMLmoFrame.cpp | 4 +- layout/style/nsCSSPropList.h | 2 +- layout/style/nsComputedDOMStyle.cpp | 2 +- layout/style/nsComputedDOMStyle.h | 2 +- layout/style/nsComputedDOMStylePropertyList.h | 2 +- layout/style/nsRuleNode.cpp | 2 +- layout/style/nsStyleContext.cpp | 25 +- layout/style/nsStyleContext.h | 7 + layout/style/nsStyleStruct.h | 4 +- layout/style/test/chrome/chrome.ini | 3 + layout/style/test/chrome/test_bug1157097.html | 31 ++ layout/style/test/chrome/test_bug1160724.xul | 74 +++++ layout/style/test/mochitest.ini | 3 +- layout/style/test/property_database.js | 2 +- layout/xul/test/chrome.ini | 1 + layout/xul/test/mochitest.ini | 1 + mfbt/ChaosMode.h | 1 + modules/libjar/test/chrome/chrome.ini | 1 + .../test-manifest-keys-extracted/chrome.ini | 1 + .../certverifier/NSSCertDBTrustDomain.cpp | 4 + security/manager/ssl/CertBlocklist.cpp | 287 +++++++++++------- security/manager/ssl/CertBlocklist.h | 23 +- security/manager/ssl/nsICertBlocklist.idl | 19 +- .../ssl/tests/mochitest/bugs/chrome.ini | 1 + .../stricttransportsecurity/chrome.ini | 1 + .../ssl/tests/unit/test_cert_blocklist.js | 28 +- .../fxaccounts/tests/mochitest/chrome.ini | 1 + testing/mochitest/chrome/chrome.ini | 1 + .../components/aboutmemory/tests/chrome.ini | 2 +- toolkit/components/console/tests/chrome.ini | 1 + .../components/ctypes/tests/chrome/chrome.ini | 1 + toolkit/components/feeds/test/chrome.ini | 1 + .../formautofill/test/chrome/chrome.ini | 1 + .../components/osfile/tests/mochi/chrome.ini | 1 + .../components/passwordmgr/test/chrome.ini | 1 + toolkit/components/perf/chrome.ini | 1 + .../components/places/tests/chrome/chrome.ini | 1 + toolkit/components/telemetry/Histograms.json | 16 + toolkit/components/viewsource/test/chrome.ini | 1 + .../components/workerloader/tests/chrome.ini | 1 + .../xulstore/tests/chrome/chrome.ini | 1 + toolkit/content/tests/chrome/chrome.ini | 1 + toolkit/content/tests/widgets/chrome.ini | 1 + toolkit/content/tests/widgets/mochitest.ini | 2 +- .../server/tests/mochitest/chrome.ini | 1 + toolkit/devtools/tests/mochitest/chrome.ini | 5 +- toolkit/identity/tests/chrome/chrome.ini | 1 + toolkit/modules/tests/chrome/chrome.ini | 1 + .../mozapps/downloads/tests/chrome/chrome.ini | 1 + .../mozapps/extensions/nsBlocklistService.js | 27 +- .../mozapps/update/tests/chrome/chrome.ini | 2 +- toolkit/profile/test/chrome.ini | 1 + toolkit/themes/osx/mochitests/chrome.ini | 1 + widget/tests/chrome.ini | 1 + xpcom/glue/pldhash.cpp | 184 ++++++----- xpcom/glue/pldhash.h | 24 +- xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp | 18 -- xpfe/appshell/test/chrome.ini | 1 + 166 files changed, 865 insertions(+), 753 deletions(-) delete mode 100644 dom/interfaces/html/nsIDOMHTMLBRElement.idl delete mode 100644 dom/interfaces/html/nsIDOMHTMLDivElement.idl delete mode 100644 dom/interfaces/html/nsIDOMHTMLHeadingElement.idl delete mode 100644 dom/interfaces/html/nsIDOMHTMLTableCaptionElem.idl delete mode 100644 dom/interfaces/html/nsIDOMHTMLTableElement.idl delete mode 100644 dom/interfaces/html/nsIDOMHTMLTitleElement.idl create mode 100644 layout/style/test/chrome/test_bug1157097.html create mode 100644 layout/style/test/chrome/test_bug1160724.xul diff --git a/caps/tests/mochitest/chrome.ini b/caps/tests/mochitest/chrome.ini index 364d48621f..71b166f659 100644 --- a/caps/tests/mochitest/chrome.ini +++ b/caps/tests/mochitest/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = file_disableScript.html diff --git a/docshell/test/chrome/chrome.ini b/docshell/test/chrome/chrome.ini index ed69e7a7f5..3adcb5eba0 100644 --- a/docshell/test/chrome/chrome.ini +++ b/docshell/test/chrome/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = 662200a.html 662200b.html diff --git a/docshell/test/navigation/mochitest.ini b/docshell/test/navigation/mochitest.ini index 30c3bba6eb..540fc57355 100644 --- a/docshell/test/navigation/mochitest.ini +++ b/docshell/test/navigation/mochitest.ini @@ -45,7 +45,7 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop spec [test_popup-navigates-children.html] skip-if = buildapp == 'b2g' # b2g(Needs multiple window.open support, also uses docshelltreenode) b2g-debug(Needs multiple window.open support, also uses docshelltreenode) b2g-desktop(Needs multiple window.open support, also uses docshelltreenode) [test_reserved.html] -skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) || android_version == '10' #too slow on Android 2.3 aws only; bug 1030403 +skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) || android_version == '10' || android_version == '18' #too slow on Android 2.3 and 4.3 aws only; bug 1030403 [test_sessionhistory.html] skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) || toolkit == 'android' #RANDOM # b2g-debug(Perma-orange on debug emulator builds) b2g-desktop(Bug 931116, b2g desktop specific, initial triage) [test_sibling-matching-parent.html] diff --git a/dom/animation/test/chrome.ini b/dom/animation/test/chrome.ini index 06725d4c3c..aa8b4b0263 100644 --- a/dom/animation/test/chrome.ini +++ b/dom/animation/test/chrome.ini @@ -1,2 +1,3 @@ [chrome/test_animation_observers.html] [chrome/test_running_on_compositor.html] +skip-if = buildapp == 'b2g' \ No newline at end of file diff --git a/dom/apps/tests/chrome.ini b/dom/apps/tests/chrome.ini index 80312505c4..e3aeb5a269 100644 --- a/dom/apps/tests/chrome.ini +++ b/dom/apps/tests/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = asmjs/* file_bug_945152.html diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index 05ca08854c..57ffc4bb5c 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -139,6 +139,7 @@ #include "mozilla/dom/WindowBinding.h" #include "mozilla/dom/ElementBinding.h" #include "mozilla/dom/VRDevice.h" +#include "nsComputedDOMStyle.h" using namespace mozilla; using namespace mozilla::dom; @@ -391,7 +392,7 @@ Element::GetBindingURL(nsIDocument *aDocument, css::URLValue **aResult) IsHTMLElement(nsGkAtoms::object) || IsHTMLElement(nsGkAtoms::embed) || IsHTMLElement(nsGkAtoms::applet)); - nsIPresShell *shell = aDocument->GetShell(); + nsCOMPtr shell = aDocument->GetShell(); if (!shell || GetPrimaryFrame() || !isXULorPluginElement) { *aResult = nullptr; @@ -399,11 +400,8 @@ Element::GetBindingURL(nsIDocument *aDocument, css::URLValue **aResult) } // Get the computed -moz-binding directly from the style context - nsPresContext *pctx = shell->GetPresContext(); - NS_ENSURE_TRUE(pctx, false); - - nsRefPtr sc = pctx->StyleSet()->ResolveStyleFor(this, - nullptr); + nsRefPtr sc = + nsComputedDOMStyle::GetStyleContextForElementNoFlush(this, nullptr, shell); NS_ENSURE_TRUE(sc, false); *aResult = sc->StyleDisplay()->mBinding; diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp index 085caf4f06..3bb3ec6d5b 100644 --- a/dom/base/FragmentOrElement.cpp +++ b/dom/base/FragmentOrElement.cpp @@ -1156,7 +1156,7 @@ void FragmentOrElement::GetTextContentInternal(nsAString& aTextContent, ErrorResult& aError) { - if(!nsContentUtils::GetNodeTextContent(this, true, aTextContent)) { + if(!nsContentUtils::GetNodeTextContent(this, true, aTextContent, fallible)) { aError.Throw(NS_ERROR_OUT_OF_MEMORY); } } diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 045e8140fb..c325693e24 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -1685,7 +1685,7 @@ nsContentUtils::ParseLegacyFontSize(const nsAString& aValue) ++iter; } - if (*iter < char16_t('0') || *iter > char16_t('9')) { + if (iter == end || *iter < char16_t('0') || *iter > char16_t('9')) { return 0; } @@ -3364,7 +3364,7 @@ nsContentUtils::LogSimpleConsoleError(const nsAString& aErrorText, /* static */ nsresult nsContentUtils::ReportToConsole(uint32_t aErrorFlags, const nsACString& aCategory, - nsIDocument* aDocument, + const nsIDocument* aDocument, PropertiesFile aFile, const char *aMessageName, const char16_t **aParams, @@ -3399,7 +3399,7 @@ nsContentUtils::ReportToConsole(uint32_t aErrorFlags, nsContentUtils::ReportToConsoleNonLocalized(const nsAString& aErrorText, uint32_t aErrorFlags, const nsACString& aCategory, - nsIDocument* aDocument, + const nsIDocument* aDocument, nsIURI* aURI, const nsAFlatString& aSourceLine, uint32_t aLineNumber, @@ -7125,10 +7125,19 @@ nsContentUtils::DOMWindowDumpEnabled() } bool -nsContentUtils::GetNodeTextContent(nsINode* aNode, bool aDeep, nsAString& aResult) +nsContentUtils::GetNodeTextContent(nsINode* aNode, bool aDeep, nsAString& aResult, + const fallible_t& aFallible) { aResult.Truncate(); - return AppendNodeTextContent(aNode, aDeep, aResult, fallible); + return AppendNodeTextContent(aNode, aDeep, aResult, aFallible); +} + +void +nsContentUtils::GetNodeTextContent(nsINode* aNode, bool aDeep, nsAString& aResult) +{ + if (!GetNodeTextContent(aNode, aDeep, aResult, fallible)) { + NS_ABORT_OOM(0); // Unfortunately we don't know the allocation size + } } void diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h index 7ac728fcf3..5595e04b38 100644 --- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h @@ -775,7 +775,7 @@ public: static nsresult ReportToConsoleNonLocalized(const nsAString& aErrorText, uint32_t aErrorFlags, const nsACString& aCategory, - nsIDocument* aDocument, + const nsIDocument* aDocument, nsIURI* aURI = nullptr, const nsAFlatString& aSourceLine = EmptyString(), @@ -820,7 +820,7 @@ public: }; static nsresult ReportToConsole(uint32_t aErrorFlags, const nsACString& aCategory, - nsIDocument* aDocument, + const nsIDocument* aDocument, PropertiesFile aFile, const char *aMessageName, const char16_t **aParams = nullptr, @@ -1339,6 +1339,9 @@ public: */ MOZ_WARN_UNUSED_RESULT static bool GetNodeTextContent(nsINode* aNode, bool aDeep, + nsAString& aResult, const mozilla::fallible_t&); + + static void GetNodeTextContent(nsINode* aNode, bool aDeep, nsAString& aResult); /** diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index e35af24ea8..f3244484b9 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -7084,8 +7084,7 @@ nsDocument::GetTitleFromElement(uint32_t aNamespace, nsAString& aTitle) nsIContent* title = GetTitleContent(aNamespace); if (!title) return; - if(!nsContentUtils::GetNodeTextContent(title, false, aTitle)) - NS_RUNTIMEABORT("OOM"); + nsContentUtils::GetNodeTextContent(title, false, aTitle); } NS_IMETHODIMP @@ -7542,9 +7541,8 @@ nsDocument::GetInputEncoding(nsAString& aInputEncoding) } void -nsIDocument::GetInputEncoding(nsAString& aInputEncoding) +nsIDocument::GetInputEncoding(nsAString& aInputEncoding) const { - // Not const function, because WarnOnceAbout is not a const method WarnOnceAbout(eInputEncoding); if (mHaveInputEncoding) { return GetCharacterSet(aInputEncoding); @@ -10403,7 +10401,7 @@ static const char* kDocumentWarnings[] = { #undef DOCUMENT_WARNING bool -nsIDocument::HasWarnedAbout(DeprecatedOperations aOperation) +nsIDocument::HasWarnedAbout(DeprecatedOperations aOperation) const { static_assert(eDeprecatedOperationCount <= 64, "Too many deprecated operations"); @@ -10412,8 +10410,9 @@ nsIDocument::HasWarnedAbout(DeprecatedOperations aOperation) void nsIDocument::WarnOnceAbout(DeprecatedOperations aOperation, - bool asError /* = false */) + bool asError /* = false */) const { + MOZ_ASSERT(NS_IsMainThread()); if (HasWarnedAbout(aOperation)) { return; } @@ -10427,7 +10426,7 @@ nsIDocument::WarnOnceAbout(DeprecatedOperations aOperation, } bool -nsIDocument::HasWarnedAbout(DocumentWarnings aWarning) +nsIDocument::HasWarnedAbout(DocumentWarnings aWarning) const { static_assert(eDocumentWarningCount <= 64, "Too many document warnings"); @@ -10438,8 +10437,9 @@ void nsIDocument::WarnOnceAbout(DocumentWarnings aWarning, bool asError /* = false */, const char16_t **aParams /* = nullptr */, - uint32_t aParamsLength /* = 0 */) + uint32_t aParamsLength /* = 0 */) const { + MOZ_ASSERT(NS_IsMainThread()); if (HasWarnedAbout(aWarning)) { return; } diff --git a/dom/base/nsIDocument.h b/dom/base/nsIDocument.h index ff3056caaa..733fc17276 100644 --- a/dom/base/nsIDocument.h +++ b/dom/base/nsIDocument.h @@ -1065,7 +1065,7 @@ public: /** * Return the inner window ID. */ - uint64_t InnerWindowID() + uint64_t InnerWindowID() const { nsPIDOMWindow *window = GetInnerWindow(); return window ? window->WindowID() : 0; @@ -2216,8 +2216,9 @@ public: eDeprecatedOperationCount }; #undef DEPRECATED_OPERATION - bool HasWarnedAbout(DeprecatedOperations aOperation); - void WarnOnceAbout(DeprecatedOperations aOperation, bool asError = false); + bool HasWarnedAbout(DeprecatedOperations aOperation) const; + void WarnOnceAbout(DeprecatedOperations aOperation, + bool asError = false) const; #define DOCUMENT_WARNING(_op) e##_op, enum DocumentWarnings { @@ -2225,11 +2226,11 @@ public: eDocumentWarningCount }; #undef DOCUMENT_WARNING - bool HasWarnedAbout(DocumentWarnings aWarning); + bool HasWarnedAbout(DocumentWarnings aWarning) const; void WarnOnceAbout(DocumentWarnings aWarning, bool asError = false, const char16_t **aParams = nullptr, - uint32_t aParamsLength = 0); + uint32_t aParamsLength = 0) const; virtual void PostVisibilityUpdateEvent() = 0; @@ -2429,7 +2430,7 @@ public: CreateAttributeNS(const nsAString& aNamespaceURI, const nsAString& aQualifiedName, mozilla::ErrorResult& rv); - void GetInputEncoding(nsAString& aInputEncoding); + void GetInputEncoding(nsAString& aInputEncoding) const; already_AddRefed GetLocation() const; void GetReferrer(nsAString& aReferrer) const; void GetLastModified(nsAString& aLastModified) const; @@ -2474,16 +2475,16 @@ public: { return mVisibilityState != mozilla::dom::VisibilityState::Visible; } - bool MozHidden() // Not const because of WarnOnceAbout + bool MozHidden() const { WarnOnceAbout(ePrefixedVisibilityAPI); return Hidden(); } - mozilla::dom::VisibilityState VisibilityState() + mozilla::dom::VisibilityState VisibilityState() const { return mVisibilityState; } - mozilla::dom::VisibilityState MozVisibilityState() + mozilla::dom::VisibilityState MozVisibilityState() const { WarnOnceAbout(ePrefixedVisibilityAPI); return VisibilityState(); @@ -2615,8 +2616,8 @@ public: bool InlineScriptAllowedByCSP(); private: - uint64_t mDeprecationWarnedAbout; - uint64_t mDocWarningWarnedAbout; + mutable uint64_t mDeprecationWarnedAbout; + mutable uint64_t mDocWarningWarnedAbout; SelectorCache mSelectorCache; protected: diff --git a/dom/base/nsStyleLinkElement.cpp b/dom/base/nsStyleLinkElement.cpp index 773b7ca59f..3cb51e5dac 100644 --- a/dom/base/nsStyleLinkElement.cpp +++ b/dom/base/nsStyleLinkElement.cpp @@ -404,7 +404,7 @@ nsStyleLinkElement::DoUpdateStyleSheet(nsIDocument* aOldDocument, nsresult rv = NS_OK; if (isInline) { nsAutoString text; - if (!nsContentUtils::GetNodeTextContent(thisContent, false, text)) { + if (!nsContentUtils::GetNodeTextContent(thisContent, false, text, fallible)) { return NS_ERROR_OUT_OF_MEMORY; } diff --git a/dom/base/nsTreeSanitizer.cpp b/dom/base/nsTreeSanitizer.cpp index feb8362237..8775f91215 100644 --- a/dom/base/nsTreeSanitizer.cpp +++ b/dom/base/nsTreeSanitizer.cpp @@ -1396,9 +1396,8 @@ nsTreeSanitizer::SanitizeChildren(nsINode* aRoot) NS_ASSERTION(ns == kNameSpaceID_XHTML || ns == kNameSpaceID_SVG, "Should have only HTML or SVG here!"); nsAutoString styleText; - if (!nsContentUtils::GetNodeTextContent(node, false, styleText)) { - NS_RUNTIMEABORT("OOM"); - } + nsContentUtils::GetNodeTextContent(node, false, styleText); + nsAutoString sanitizedStyle; nsCOMPtr baseURI = node->GetBaseURI(); if (SanitizeStyleSheet(styleText, diff --git a/dom/base/test/chrome.ini b/dom/base/test/chrome.ini index b741795993..34f81ead9d 100644 --- a/dom/base/test/chrome.ini +++ b/dom/base/test/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = file_url.jsm file_empty.html diff --git a/dom/base/test/chrome/chrome.ini b/dom/base/test/chrome/chrome.ini index c8087554f1..8b13589ba5 100644 --- a/dom/base/test/chrome/chrome.ini +++ b/dom/base/test/chrome/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = blockNoPlugins.xml blockPluginHard.xml diff --git a/dom/base/test/csp/chrome.ini b/dom/base/test/csp/chrome.ini index fb55f3e127..75359e9464 100644 --- a/dom/base/test/csp/chrome.ini +++ b/dom/base/test/csp/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' [test_csp_bug768029.html] [test_csp_bug773891.html] diff --git a/dom/bindings/test/chrome.ini b/dom/bindings/test/chrome.ini index 0be6e8adb4..e4c8caf75e 100644 --- a/dom/bindings/test/chrome.ini +++ b/dom/bindings/test/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' [test_bug707564-chrome.html] [test_bug775543.html] diff --git a/dom/canvas/test/chrome/chrome.ini b/dom/canvas/test/chrome/chrome.ini index c90274862a..0d6107fae8 100644 --- a/dom/canvas/test/chrome/chrome.ini +++ b/dom/canvas/test/chrome/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = nonchrome_webgl_debug_renderer_info.html [test_webgl_debug_renderer_info.html] diff --git a/dom/canvas/test/webgl-mochitest.ini b/dom/canvas/test/webgl-mochitest.ini index a0e9477c06..becb141854 100644 --- a/dom/canvas/test/webgl-mochitest.ini +++ b/dom/canvas/test/webgl-mochitest.ini @@ -19,7 +19,7 @@ skip-if = (os == 'b2g') || buildapp == 'mulet' # Mulet - bug 1093639 (crashes in [webgl-mochitest/test_implicit_color_buffer_float.html] [webgl-mochitest/test_highp_fs.html] [webgl-mochitest/test_no_arr_points.html] -skip-if = android_version == '10' #Android 2.3 aws only; bug 1030942 +skip-if = android_version == '10' || android_version == '18' #Android 2.3 and 4.3 aws only; bug 1030942 [webgl-mochitest/test_noprog_draw.html] [webgl-mochitest/test_privileged_exts.html] [webgl-mochitest/test_texsubimage_float.html] diff --git a/dom/contacts/tests/chrome.ini b/dom/contacts/tests/chrome.ini index 3ae71ea349..7e43e4279c 100644 --- a/dom/contacts/tests/chrome.ini +++ b/dom/contacts/tests/chrome.ini @@ -1,5 +1,6 @@ [DEFAULT] skip-if = os == "android" +skip-if = buildapp == 'b2g' [test_contacts_shutdown.xul] [test_contacts_upgrade.xul] diff --git a/dom/devicestorage/test/chrome.ini b/dom/devicestorage/test/chrome.ini index d7e88eb147..bedf4638bb 100644 --- a/dom/devicestorage/test/chrome.ini +++ b/dom/devicestorage/test/chrome.ini @@ -1,5 +1,5 @@ [DEFAULT] -skip-if = buildapp == 'mulet' +skip-if = (buildapp == 'b2g' || buildapp == 'mulet') [test_app_permissions.html] [test_fs_app_permissions.html] diff --git a/dom/encoding/test/chrome.ini b/dom/encoding/test/chrome.ini index a6aa662c5c..95ef1467a6 100644 --- a/dom/encoding/test/chrome.ini +++ b/dom/encoding/test/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = file_stringencoding.jsm [test_stringencoding.xul] diff --git a/dom/events/test/chrome.ini b/dom/events/test/chrome.ini index db4d2ba324..e29a393428 100644 --- a/dom/events/test/chrome.ini +++ b/dom/events/test/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = bug415498-doc1.html bug415498-doc2.html diff --git a/dom/html/HTMLAnchorElement.cpp b/dom/html/HTMLAnchorElement.cpp index ea33cc61e7..7115f14e67 100644 --- a/dom/html/HTMLAnchorElement.cpp +++ b/dom/html/HTMLAnchorElement.cpp @@ -351,7 +351,7 @@ IMPL_URI_PART(Hash) NS_IMETHODIMP HTMLAnchorElement::GetText(nsAString& aText) { - if(!nsContentUtils::GetNodeTextContent(this, true, aText)) { + if(!nsContentUtils::GetNodeTextContent(this, true, aText, fallible)) { return NS_ERROR_OUT_OF_MEMORY; } return NS_OK; diff --git a/dom/html/HTMLBRElement.cpp b/dom/html/HTMLBRElement.cpp index 2bd17afa61..d292b0cca4 100644 --- a/dom/html/HTMLBRElement.cpp +++ b/dom/html/HTMLBRElement.cpp @@ -27,14 +27,8 @@ HTMLBRElement::~HTMLBRElement() { } -NS_IMPL_ISUPPORTS_INHERITED(HTMLBRElement, nsGenericHTMLElement, - nsIDOMHTMLBRElement) - NS_IMPL_ELEMENT_CLONE(HTMLBRElement) - -NS_IMPL_STRING_ATTR(HTMLBRElement, Clear, clear) - static const nsAttrValue::EnumTable kClearTable[] = { { "left", NS_STYLE_CLEAR_LEFT }, { "right", NS_STYLE_CLEAR_RIGHT }, diff --git a/dom/html/HTMLBRElement.h b/dom/html/HTMLBRElement.h index 47fd406f5c..cf7aaaedc5 100644 --- a/dom/html/HTMLBRElement.h +++ b/dom/html/HTMLBRElement.h @@ -8,25 +8,17 @@ #define mozilla_dom_HTMLBRElement_h #include "mozilla/Attributes.h" -#include "nsIDOMHTMLBRElement.h" #include "nsGenericHTMLElement.h" #include "nsGkAtoms.h" namespace mozilla { namespace dom { -class HTMLBRElement final : public nsGenericHTMLElement, - public nsIDOMHTMLBRElement +class HTMLBRElement final : public nsGenericHTMLElement { public: explicit HTMLBRElement(already_AddRefed& aNodeInfo); - // nsISupports - NS_DECL_ISUPPORTS_INHERITED - - // nsIDOMHTMLBRElement - NS_DECL_NSIDOMHTMLBRELEMENT - virtual bool ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute, const nsAString& aValue, @@ -43,6 +35,10 @@ public: { return SetHTMLAttr(nsGkAtoms::clear, aClear, aError); } + void GetClear(DOMString& aClear) const + { + return GetHTMLAttr(nsGkAtoms::clear, aClear); + } virtual JSObject* WrapNode(JSContext *aCx, JS::Handle aGivenProto) override; diff --git a/dom/html/HTMLDivElement.cpp b/dom/html/HTMLDivElement.cpp index 29108ef0ae..b56187e299 100644 --- a/dom/html/HTMLDivElement.cpp +++ b/dom/html/HTMLDivElement.cpp @@ -19,9 +19,6 @@ HTMLDivElement::~HTMLDivElement() { } -NS_IMPL_ISUPPORTS_INHERITED(HTMLDivElement, nsGenericHTMLElement, - nsIDOMHTMLDivElement) - NS_IMPL_ELEMENT_CLONE(HTMLDivElement) JSObject* diff --git a/dom/html/HTMLDivElement.h b/dom/html/HTMLDivElement.h index 6c4b09f416..9cd0f84b9a 100644 --- a/dom/html/HTMLDivElement.h +++ b/dom/html/HTMLDivElement.h @@ -8,13 +8,11 @@ #include "mozilla/Attributes.h" #include "nsGenericHTMLElement.h" -#include "nsIDOMHTMLDivElement.h" namespace mozilla { namespace dom { -class HTMLDivElement final : public nsGenericHTMLElement, - public nsIDOMHTMLDivElement +class HTMLDivElement final : public nsGenericHTMLElement { public: explicit HTMLDivElement(already_AddRefed& aNodeInfo) @@ -22,24 +20,6 @@ public: { } - // nsISupports - NS_DECL_ISUPPORTS_INHERITED - - // nsIDOMHTMLDivElement - NS_IMETHOD GetAlign(nsAString& aAlign) override - { - DOMString align; - GetAlign(align); - align.ToString(aAlign); - return NS_OK; - } - NS_IMETHOD SetAlign(const nsAString& aAlign) override - { - mozilla::ErrorResult rv; - SetAlign(aAlign, rv); - return rv.StealNSResult(); - } - void GetAlign(DOMString& aAlign) { GetHTMLAttr(nsGkAtoms::align, aAlign); diff --git a/dom/html/HTMLElement.cpp b/dom/html/HTMLElement.cpp index 968468f7c6..f7e57af944 100644 --- a/dom/html/HTMLElement.cpp +++ b/dom/html/HTMLElement.cpp @@ -49,7 +49,7 @@ HTMLElement::GetInnerHTML(nsAString& aInnerHTML) */ if (mNodeInfo->Equals(nsGkAtoms::xmp) || mNodeInfo->Equals(nsGkAtoms::plaintext)) { - if (!nsContentUtils::GetNodeTextContent(this, false, aInnerHTML)) { + if (!nsContentUtils::GetNodeTextContent(this, false, aInnerHTML, fallible)) { return NS_ERROR_OUT_OF_MEMORY; } return NS_OK; diff --git a/dom/html/HTMLHeadingElement.cpp b/dom/html/HTMLHeadingElement.cpp index d1bfa1eab8..091e60abbf 100644 --- a/dom/html/HTMLHeadingElement.cpp +++ b/dom/html/HTMLHeadingElement.cpp @@ -22,9 +22,6 @@ HTMLHeadingElement::~HTMLHeadingElement() { } -NS_IMPL_ISUPPORTS_INHERITED(HTMLHeadingElement, nsGenericHTMLElement, - nsIDOMHTMLHeadingElement) - NS_IMPL_ELEMENT_CLONE(HTMLHeadingElement) JSObject* @@ -33,9 +30,6 @@ HTMLHeadingElement::WrapNode(JSContext *aCx, JS::Handle aGivenProto) return HTMLHeadingElementBinding::Wrap(aCx, this, aGivenProto); } -NS_IMPL_STRING_ATTR(HTMLHeadingElement, Align, align) - - bool HTMLHeadingElement::ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute, diff --git a/dom/html/HTMLHeadingElement.h b/dom/html/HTMLHeadingElement.h index ff8a98d8d8..2abf5bbb5e 100644 --- a/dom/html/HTMLHeadingElement.h +++ b/dom/html/HTMLHeadingElement.h @@ -8,14 +8,12 @@ #define mozilla_dom_HTMLHeadingElement_h #include "mozilla/Attributes.h" -#include "nsIDOMHTMLHeadingElement.h" #include "nsGenericHTMLElement.h" namespace mozilla { namespace dom { -class HTMLHeadingElement final : public nsGenericHTMLElement, - public nsIDOMHTMLHeadingElement +class HTMLHeadingElement final : public nsGenericHTMLElement { public: explicit HTMLHeadingElement(already_AddRefed& aNodeInfo) @@ -23,12 +21,6 @@ public: { } - // nsISupports - NS_DECL_ISUPPORTS_INHERITED - - // nsIDOMHTMLHeadingElement - NS_DECL_NSIDOMHTMLHEADINGELEMENT - virtual bool ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute, const nsAString& aValue, @@ -37,8 +29,14 @@ public: nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override; - // The XPCOM versions of GetAlign and SetAlign are fine for us for - // use from WebIDL. + void SetAlign(const nsAString& aAlign, ErrorResult& aError) + { + return SetHTMLAttr(nsGkAtoms::align, aAlign, aError); + } + void GetAlign(DOMString& aAlign) const + { + return GetHTMLAttr(nsGkAtoms::align, aAlign); + } protected: virtual ~HTMLHeadingElement(); diff --git a/dom/html/HTMLMenuItemElement.cpp b/dom/html/HTMLMenuItemElement.cpp index 8501819bca..2ac74b0cf0 100644 --- a/dom/html/HTMLMenuItemElement.cpp +++ b/dom/html/HTMLMenuItemElement.cpp @@ -372,9 +372,7 @@ void HTMLMenuItemElement::GetText(nsAString& aText) { nsAutoString text; - if (!nsContentUtils::GetNodeTextContent(this, false, text)) { - NS_RUNTIMEABORT("OOM"); - } + nsContentUtils::GetNodeTextContent(this, false, text); text.CompressWhitespace(true, true); aText = text; diff --git a/dom/html/HTMLOutputElement.cpp b/dom/html/HTMLOutputElement.cpp index 2b16a6d5e9..79c30cc653 100644 --- a/dom/html/HTMLOutputElement.cpp +++ b/dom/html/HTMLOutputElement.cpp @@ -147,9 +147,7 @@ HTMLOutputElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent, void HTMLOutputElement::GetValue(nsAString& aValue) { - if (!nsContentUtils::GetNodeTextContent(this, true, aValue)) { - NS_RUNTIMEABORT("OOM"); - } + nsContentUtils::GetNodeTextContent(this, true, aValue); } void @@ -180,9 +178,7 @@ HTMLOutputElement::HtmlFor() void HTMLOutputElement::DescendantsChanged() { if (mIsDoneAddingChildren && mValueModeFlag == eModeDefault) { - if (!nsContentUtils::GetNodeTextContent(this, true, mDefaultValue)) { - NS_RUNTIMEABORT("OOM"); - } + nsContentUtils::GetNodeTextContent(this, true, mDefaultValue); } } diff --git a/dom/html/HTMLScriptElement.cpp b/dom/html/HTMLScriptElement.cpp index 59aef851c1..aa0837252b 100644 --- a/dom/html/HTMLScriptElement.cpp +++ b/dom/html/HTMLScriptElement.cpp @@ -110,7 +110,7 @@ HTMLScriptElement::Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) c NS_IMETHODIMP HTMLScriptElement::GetText(nsAString& aValue) { - if (!nsContentUtils::GetNodeTextContent(this, false, aValue)) { + if (!nsContentUtils::GetNodeTextContent(this, false, aValue, fallible)) { return NS_ERROR_OUT_OF_MEMORY; } return NS_OK; @@ -222,7 +222,7 @@ HTMLScriptElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName, NS_IMETHODIMP HTMLScriptElement::GetInnerHTML(nsAString& aInnerHTML) { - if (!nsContentUtils::GetNodeTextContent(this, false, aInnerHTML)) { + if (!nsContentUtils::GetNodeTextContent(this, false, aInnerHTML, fallible)) { return NS_ERROR_OUT_OF_MEMORY; } return NS_OK; diff --git a/dom/html/HTMLStyleElement.cpp b/dom/html/HTMLStyleElement.cpp index 8a6f2f2a7f..7f98bdb91c 100644 --- a/dom/html/HTMLStyleElement.cpp +++ b/dom/html/HTMLStyleElement.cpp @@ -194,7 +194,7 @@ HTMLStyleElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, NS_IMETHODIMP HTMLStyleElement::GetInnerHTML(nsAString& aInnerHTML) { - if (!nsContentUtils::GetNodeTextContent(this, false, aInnerHTML)) { + if (!nsContentUtils::GetNodeTextContent(this, false, aInnerHTML, fallible)) { return NS_ERROR_OUT_OF_MEMORY; } return NS_OK; diff --git a/dom/html/HTMLTableCaptionElement.cpp b/dom/html/HTMLTableCaptionElement.cpp index 25635193c3..9389fa01fb 100644 --- a/dom/html/HTMLTableCaptionElement.cpp +++ b/dom/html/HTMLTableCaptionElement.cpp @@ -25,13 +25,8 @@ HTMLTableCaptionElement::WrapNode(JSContext *aCx, JS::Handle aGivenPr return HTMLTableCaptionElementBinding::Wrap(aCx, this, aGivenProto); } -NS_IMPL_ISUPPORTS_INHERITED(HTMLTableCaptionElement, nsGenericHTMLElement, - nsIDOMHTMLTableCaptionElement) - NS_IMPL_ELEMENT_CLONE(HTMLTableCaptionElement) -NS_IMPL_STRING_ATTR(HTMLTableCaptionElement, Align, align) - static const nsAttrValue::EnumTable kCaptionAlignTable[] = { { "left", NS_STYLE_CAPTION_SIDE_LEFT }, { "right", NS_STYLE_CAPTION_SIDE_RIGHT }, diff --git a/dom/html/HTMLTableCaptionElement.h b/dom/html/HTMLTableCaptionElement.h index c42f23f016..1c84118d7c 100644 --- a/dom/html/HTMLTableCaptionElement.h +++ b/dom/html/HTMLTableCaptionElement.h @@ -8,13 +8,11 @@ #include "mozilla/Attributes.h" #include "nsGenericHTMLElement.h" -#include "nsIDOMHTMLTableCaptionElem.h" namespace mozilla { namespace dom { -class HTMLTableCaptionElement final : public nsGenericHTMLElement, - public nsIDOMHTMLTableCaptionElement +class HTMLTableCaptionElement final : public nsGenericHTMLElement { public: explicit HTMLTableCaptionElement(already_AddRefed& aNodeInfo) @@ -23,12 +21,6 @@ public: SetHasWeirdParserInsertionMode(); } - // nsISupports - NS_DECL_ISUPPORTS_INHERITED - - // nsIDOMHTMLTableCaptionElement - NS_DECL_NSIDOMHTMLTABLECAPTIONELEMENT - void GetAlign(DOMString& aAlign) { GetHTMLAttr(nsGkAtoms::align, aAlign); diff --git a/dom/html/HTMLTableElement.cpp b/dom/html/HTMLTableElement.cpp index 805751fd5c..b12903eabe 100644 --- a/dom/html/HTMLTableElement.cpp +++ b/dom/html/HTMLTableElement.cpp @@ -327,9 +327,8 @@ NS_IMPL_ADDREF_INHERITED(HTMLTableElement, Element) NS_IMPL_RELEASE_INHERITED(HTMLTableElement, Element) // QueryInterface implementation for HTMLTableElement -NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLTableElement) - NS_INTERFACE_TABLE_INHERITED(HTMLTableElement, nsIDOMHTMLTableElement) -NS_INTERFACE_TABLE_TAIL_INHERITING(nsGenericHTMLElement) +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(HTMLTableElement) +NS_INTERFACE_MAP_END_INHERITING(nsGenericHTMLElement) NS_IMPL_ELEMENT_CLONE(HTMLTableElement) diff --git a/dom/html/HTMLTableElement.h b/dom/html/HTMLTableElement.h index aed7f7c8f3..0c3b67f323 100644 --- a/dom/html/HTMLTableElement.h +++ b/dom/html/HTMLTableElement.h @@ -8,7 +8,6 @@ #include "mozilla/Attributes.h" #include "nsGenericHTMLElement.h" -#include "nsIDOMHTMLTableElement.h" #include "mozilla/dom/HTMLTableCaptionElement.h" #include "mozilla/dom/HTMLTableSectionElement.h" @@ -19,8 +18,7 @@ namespace dom { class TableRowsCollection; -class HTMLTableElement final : public nsGenericHTMLElement, - public nsIDOMHTMLTableElement +class HTMLTableElement final : public nsGenericHTMLElement { public: explicit HTMLTableElement(already_AddRefed& aNodeInfo); diff --git a/dom/html/HTMLTextAreaElement.cpp b/dom/html/HTMLTextAreaElement.cpp index b9f5914803..c514cd0307 100644 --- a/dom/html/HTMLTextAreaElement.cpp +++ b/dom/html/HTMLTextAreaElement.cpp @@ -362,7 +362,7 @@ HTMLTextAreaElement::SetValueChanged(bool aValueChanged) NS_IMETHODIMP HTMLTextAreaElement::GetDefaultValue(nsAString& aDefaultValue) { - if (!nsContentUtils::GetNodeTextContent(this, false, aDefaultValue)) { + if (!nsContentUtils::GetNodeTextContent(this, false, aDefaultValue, fallible)) { return NS_ERROR_OUT_OF_MEMORY; } return NS_OK; diff --git a/dom/html/HTMLTitleElement.cpp b/dom/html/HTMLTitleElement.cpp index 89fa551275..b005d104a0 100644 --- a/dom/html/HTMLTitleElement.cpp +++ b/dom/html/HTMLTitleElement.cpp @@ -29,7 +29,7 @@ HTMLTitleElement::~HTMLTitleElement() } NS_IMPL_ISUPPORTS_INHERITED(HTMLTitleElement, nsGenericHTMLElement, - nsIDOMHTMLTitleElement, nsIMutationObserver) + nsIMutationObserver) NS_IMPL_ELEMENT_CLONE(HTMLTitleElement) @@ -39,20 +39,18 @@ HTMLTitleElement::WrapNode(JSContext* cx, JS::Handle aGivenProto) return HTMLTitleElementBinding::Wrap(cx, this, aGivenProto); } - -NS_IMETHODIMP -HTMLTitleElement::GetText(nsAString& aTitle) +void +HTMLTitleElement::GetText(DOMString& aText, ErrorResult& aError) { - if (!nsContentUtils::GetNodeTextContent(this, false, aTitle)) { - return NS_ERROR_OUT_OF_MEMORY; + if (!nsContentUtils::GetNodeTextContent(this, false, aText, fallible)) { + aError = NS_ERROR_OUT_OF_MEMORY; } - return NS_OK; } -NS_IMETHODIMP -HTMLTitleElement::SetText(const nsAString& aTitle) +void +HTMLTitleElement::SetText(const nsAString& aText, ErrorResult& aError) { - return nsContentUtils::SetNodeTextContent(this, aTitle, true); + aError = nsContentUtils::SetNodeTextContent(this, aText, true); } void diff --git a/dom/html/HTMLTitleElement.h b/dom/html/HTMLTitleElement.h index cf9cb55eed..430ae0c1a3 100644 --- a/dom/html/HTMLTitleElement.h +++ b/dom/html/HTMLTitleElement.h @@ -8,7 +8,6 @@ #define mozilla_dom_HTMLTITLEElement_h_ #include "mozilla/Attributes.h" -#include "nsIDOMHTMLTitleElement.h" #include "nsGenericHTMLElement.h" #include "nsStubMutationObserver.h" @@ -18,7 +17,6 @@ class ErrorResult; namespace dom { class HTMLTitleElement final : public nsGenericHTMLElement, - public nsIDOMHTMLTitleElement, public nsStubMutationObserver { public: @@ -30,15 +28,9 @@ public: // nsISupports NS_DECL_ISUPPORTS_INHERITED - // nsIDOMHTMLTitleElement - NS_DECL_NSIDOMHTMLTITLEELEMENT - //HTMLTitleElement - //The xpcom GetTextContent() never fails so we just use that. - void SetText(const nsAString& aText, ErrorResult& aError) - { - aError = SetText(aText); - } + void GetText(DOMString& aText, ErrorResult& aError); + void SetText(const nsAString& aText, ErrorResult& aError); // nsIMutationObserver NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED diff --git a/dom/html/test/chrome.ini b/dom/html/test/chrome.ini index 459cc8a9d4..8fc13b0fa5 100644 --- a/dom/html/test/chrome.ini +++ b/dom/html/test/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = file_anchor_ping.html diff --git a/dom/html/test/forms/chrome.ini b/dom/html/test/forms/chrome.ini index 0c8fa82314..b23b1e7c2c 100644 --- a/dom/html/test/forms/chrome.ini +++ b/dom/html/test/forms/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = submit_invalid_file.sjs [test_autocompleteinfo.html] diff --git a/dom/html/test/forms/mochitest.ini b/dom/html/test/forms/mochitest.ini index c167a87d46..0e4a1d8d36 100644 --- a/dom/html/test/forms/mochitest.ini +++ b/dom/html/test/forms/mochitest.ini @@ -28,13 +28,13 @@ skip-if = buildapp == 'mulet' [test_input_color_picker_initial.html] skip-if = buildapp == 'mulet' [test_input_color_picker_popup.html] -skip-if = buildapp == 'mulet' +skip-if = buildapp == 'mulet' || android_version == '18' # Android, bug 1147974 [test_input_color_picker_update.html] -skip-if = buildapp == 'mulet' +skip-if = buildapp == 'mulet' || android_version == '18' # Android, bug 1147974 [test_input_defaultValue.html] [test_input_email.html] [test_input_event.html] -skip-if = buildapp == 'mulet' || (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop and mulet specific, initial triage +skip-if = buildapp == 'mulet' || (buildapp == 'b2g' && toolkit != 'gonk') || android_version == '18' #Bug 931116, b2g desktop and mulet specific, initial triage; on Android, bug 1147974 [test_input_file_picker.html] skip-if = buildapp == 'b2g' # b2g(5 failures out of 139 and timing out, bug 901581) b2g-debug(5 failures out of 139 and timing out, bug 901581) b2g-desktop(5 failures out of 139 and timing out, bug 901581) [test_input_list_attribute.html] diff --git a/dom/identity/tests/mochitest/chrome.ini b/dom/identity/tests/mochitest/chrome.ini index adcf54945f..cd93f6a854 100644 --- a/dom/identity/tests/mochitest/chrome.ini +++ b/dom/identity/tests/mochitest/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files= file_browserid_rp_ok.html diff --git a/dom/indexedDB/test/chrome.ini b/dom/indexedDB/test/chrome.ini index a809b45b5d..155149ec85 100644 --- a/dom/indexedDB/test/chrome.ini +++ b/dom/indexedDB/test/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = chromeHelpers.js [test_globalObjects_chrome.xul] diff --git a/dom/interfaces/base/domstubs.idl b/dom/interfaces/base/domstubs.idl index 8c20f25232..165c19d8da 100644 --- a/dom/interfaces/base/domstubs.idl +++ b/dom/interfaces/base/domstubs.idl @@ -69,7 +69,6 @@ interface nsIDOMCounter; interface nsIDOMRect; interface nsIDOMCSSStyleRule; interface nsIDOMCSSStyleRuleCollection; -interface nsIDOMHTMLTableCaptionElement; // Range interface nsIDOMRange; diff --git a/dom/interfaces/html/moz.build b/dom/interfaces/html/moz.build index 1a77c37ecc..7b40bfb2bd 100644 --- a/dom/interfaces/html/moz.build +++ b/dom/interfaces/html/moz.build @@ -10,12 +10,10 @@ XPIDL_SOURCES += [ 'nsIDOMHTMLAreaElement.idl', 'nsIDOMHTMLBaseElement.idl', 'nsIDOMHTMLBodyElement.idl', - 'nsIDOMHTMLBRElement.idl', 'nsIDOMHTMLButtonElement.idl', 'nsIDOMHTMLCanvasElement.idl', 'nsIDOMHTMLCollection.idl', 'nsIDOMHTMLDirectoryElement.idl', - 'nsIDOMHTMLDivElement.idl', 'nsIDOMHTMLDocument.idl', 'nsIDOMHTMLElement.idl', 'nsIDOMHTMLEmbedElement.idl', @@ -24,7 +22,6 @@ XPIDL_SOURCES += [ 'nsIDOMHTMLFrameElement.idl', 'nsIDOMHTMLFrameSetElement.idl', 'nsIDOMHTMLHeadElement.idl', - 'nsIDOMHTMLHeadingElement.idl', 'nsIDOMHTMLHRElement.idl', 'nsIDOMHTMLHtmlElement.idl', 'nsIDOMHTMLIFrameElement.idl', @@ -51,11 +48,8 @@ XPIDL_SOURCES += [ 'nsIDOMHTMLSelectElement.idl', 'nsIDOMHTMLSourceElement.idl', 'nsIDOMHTMLStyleElement.idl', - 'nsIDOMHTMLTableCaptionElem.idl', 'nsIDOMHTMLTableCellElement.idl', - 'nsIDOMHTMLTableElement.idl', 'nsIDOMHTMLTextAreaElement.idl', - 'nsIDOMHTMLTitleElement.idl', 'nsIDOMHTMLUListElement.idl', 'nsIDOMMediaError.idl', 'nsIDOMMozBrowserFrame.idl', diff --git a/dom/interfaces/html/nsIDOMHTMLBRElement.idl b/dom/interfaces/html/nsIDOMHTMLBRElement.idl deleted file mode 100644 index 0e4037224c..0000000000 --- a/dom/interfaces/html/nsIDOMHTMLBRElement.idl +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "nsIDOMHTMLElement.idl" - -/** - * The nsIDOMHTMLBRElement interface is the interface to a [X]HTML br - * element. - * - * This interface is trying to follow the DOM Level 2 HTML specification: - * http://www.w3.org/TR/DOM-Level-2-HTML/ - * - * with changes from the work-in-progress WHATWG HTML specification: - * http://www.whatwg.org/specs/web-apps/current-work/ - */ - -[uuid(ba8fb51a-e552-4272-b3df-5e63a60b86ee)] -interface nsIDOMHTMLBRElement : nsISupports -{ - attribute DOMString clear; -}; diff --git a/dom/interfaces/html/nsIDOMHTMLDivElement.idl b/dom/interfaces/html/nsIDOMHTMLDivElement.idl deleted file mode 100644 index 5bbeb1b0dd..0000000000 --- a/dom/interfaces/html/nsIDOMHTMLDivElement.idl +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "nsIDOMHTMLElement.idl" - -/** - * The nsIDOMHTMLDivElement interface is the interface to a [X]HTML - * div element. - * - * This interface is trying to follow the DOM Level 2 HTML specification: - * http://www.w3.org/TR/DOM-Level-2-HTML/ - * - * with changes from the work-in-progress WHATWG HTML specification: - * http://www.whatwg.org/specs/web-apps/current-work/ - */ - -[uuid(d1b51f44-38e0-4496-8236-b795e36df0e2)] -interface nsIDOMHTMLDivElement : nsISupports -{ - attribute DOMString align; -}; diff --git a/dom/interfaces/html/nsIDOMHTMLHeadingElement.idl b/dom/interfaces/html/nsIDOMHTMLHeadingElement.idl deleted file mode 100644 index 0772050a86..0000000000 --- a/dom/interfaces/html/nsIDOMHTMLHeadingElement.idl +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "nsIDOMHTMLElement.idl" - -/** - * The nsIDOMHTMLHeadingElement interface is the interface to a - * [X]HTML h1, h2, h3, ... element. - * - * This interface is trying to follow the DOM Level 2 HTML specification: - * http://www.w3.org/TR/DOM-Level-2-HTML/ - * - * with changes from the work-in-progress WHATWG HTML specification: - * http://www.whatwg.org/specs/web-apps/current-work/ - */ - -[uuid(a40b92f7-9da7-4c9f-8a0c-cf5b9e28bb30)] -interface nsIDOMHTMLHeadingElement : nsISupports -{ - attribute DOMString align; -}; diff --git a/dom/interfaces/html/nsIDOMHTMLTableCaptionElem.idl b/dom/interfaces/html/nsIDOMHTMLTableCaptionElem.idl deleted file mode 100644 index c6bd9e5ce5..0000000000 --- a/dom/interfaces/html/nsIDOMHTMLTableCaptionElem.idl +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "nsIDOMHTMLElement.idl" - -/** - * The nsIDOMHTMLTableCaptionElement interface is the interface to a - * [X]HTML caption element. - * - * This interface is trying to follow the DOM Level 2 HTML specification: - * http://www.w3.org/TR/DOM-Level-2-HTML/ - * - * with changes from the work-in-progress WHATWG HTML specification: - * http://www.whatwg.org/specs/web-apps/current-work/ - */ - -[builtinclass, uuid(78f0635b-44d2-4d5c-87de-29d54df6aed6)] -interface nsIDOMHTMLTableCaptionElement : nsISupports -{ - attribute DOMString align; -}; diff --git a/dom/interfaces/html/nsIDOMHTMLTableElement.idl b/dom/interfaces/html/nsIDOMHTMLTableElement.idl deleted file mode 100644 index fa99cba038..0000000000 --- a/dom/interfaces/html/nsIDOMHTMLTableElement.idl +++ /dev/null @@ -1,22 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "nsIDOMHTMLElement.idl" - -/** - * The nsIDOMHTMLTableElement interface is the interface to a [X]HTML - * table element. - * - * This interface is trying to follow the DOM Level 2 HTML specification: - * http://www.w3.org/TR/DOM-Level-2-HTML/ - * - * with changes from the work-in-progress WHATWG HTML specification: - * http://www.whatwg.org/specs/web-apps/current-work/ - */ - -[uuid(135a30ee-0374-4ee7-9d36-91736bff5fb1)] -interface nsIDOMHTMLTableElement : nsISupports -{ -}; diff --git a/dom/interfaces/html/nsIDOMHTMLTitleElement.idl b/dom/interfaces/html/nsIDOMHTMLTitleElement.idl deleted file mode 100644 index 79671f4e9b..0000000000 --- a/dom/interfaces/html/nsIDOMHTMLTitleElement.idl +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "nsIDOMHTMLElement.idl" - -/** - * The nsIDOMHTMLTitleElement interface is the interface to a [X]HTML - * title element. - * - * This interface is trying to follow the DOM Level 2 HTML specification: - * http://www.w3.org/TR/DOM-Level-2-HTML/ - * - * with changes from the work-in-progress WHATWG HTML specification: - * http://www.whatwg.org/specs/web-apps/current-work/ - */ - -[uuid(e8e5168a-e12e-4946-9fa7-5fe0d6932198)] -interface nsIDOMHTMLTitleElement : nsISupports -{ - attribute DOMString text; -}; diff --git a/dom/ipc/tests/chrome.ini b/dom/ipc/tests/chrome.ini index f324e7ae9c..7905860854 100644 --- a/dom/ipc/tests/chrome.ini +++ b/dom/ipc/tests/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = process_error.xul process_error_contentscript.js diff --git a/dom/media/test/chrome.ini b/dom/media/test/chrome.ini index 532aa13437..789bd1d7dd 100644 --- a/dom/media/test/chrome.ini +++ b/dom/media/test/chrome.ini @@ -1,6 +1,7 @@ #Media chrome tests [DEFAULT] +skip-if = buildapp == 'b2g' support-files = basic.vtt seek.webm diff --git a/dom/media/test/mochitest.ini b/dom/media/test/mochitest.ini index cf9e0e817c..e4e49020b6 100644 --- a/dom/media/test/mochitest.ini +++ b/dom/media/test/mochitest.ini @@ -22,7 +22,7 @@ # do ok(true, "Type not supported") and stop the test. [DEFAULT] -skip-if = buildapp == 'mulet' || (os == 'win' && strictContentSandbox) # strictContentSandbox (Bug 1042735) +skip-if = buildapp == 'mulet' || (os == 'win' && strictContentSandbox) || android_version == '18' # strictContentSandbox (Bug 1042735) support-files = 320x240.ogv 320x240.ogv^headers^ diff --git a/dom/media/tests/mochitest/identity/mochitest.ini b/dom/media/tests/mochitest/identity/mochitest.ini index 0269f0f857..f49361e26f 100644 --- a/dom/media/tests/mochitest/identity/mochitest.ini +++ b/dom/media/tests/mochitest/identity/mochitest.ini @@ -2,7 +2,7 @@ # strictContentSandbox - bug 1042735, Android 2.3 - bug 981881 # won't run on b2g desktop tests - bug 1119993 # broken HTTPS on b2g emulator - bug 1135339 -skip-if = (os == 'win' && strictContentSandbox) || android_version == '10' || (buildapp == 'b2g' && toolkit != 'gonk') || (buildapp == 'b2g' && toolkit == 'gonk') +skip-if = (os == 'win' && strictContentSandbox) || android_version == '10' || android_version == '18' || (buildapp == 'b2g' && toolkit != 'gonk') || (buildapp == 'b2g' && toolkit == 'gonk') support-files = /.well-known/idp-proxy/idp.js diff --git a/dom/media/tests/mochitest/mochitest.ini b/dom/media/tests/mochitest/mochitest.ini index d933d53535..0cf1c58297 100644 --- a/dom/media/tests/mochitest/mochitest.ini +++ b/dom/media/tests/mochitest/mochitest.ini @@ -1,6 +1,6 @@ [DEFAULT] # strictContentSandbox - bug 1042735, Android 2.3 - bug 981881 -skip-if = (os == 'win' && strictContentSandbox) || android_version == '10' +skip-if = (os == 'win' && strictContentSandbox) || android_version == '10' || android_version == '18' support-files = head.js dataChannel.js diff --git a/dom/media/webaudio/test/chrome.ini b/dom/media/webaudio/test/chrome.ini index afa72caca6..4de3332be8 100644 --- a/dom/media/webaudio/test/chrome.ini +++ b/dom/media/webaudio/test/chrome.ini @@ -1,3 +1,4 @@ [DEFAULT] +skip-if = buildapp == 'b2g' [test_AudioNodeDevtoolsAPI.html] diff --git a/dom/media/webaudio/test/mochitest.ini b/dom/media/webaudio/test/mochitest.ini index 7dd6f2de91..c73b742718 100644 --- a/dom/media/webaudio/test/mochitest.ini +++ b/dom/media/webaudio/test/mochitest.ini @@ -119,7 +119,7 @@ skip-if = toolkit == 'android' # bug 1056706 [test_mediaStreamAudioSourceNodePassThrough.html] [test_mediaStreamAudioSourceNodeResampling.html] [test_mixingRules.html] -skip-if = android_version == '10' # bug 1091965 +skip-if = android_version == '10' || android_version == '18' # bug 1091965 [test_mozaudiochannel.html] # Android: bug 1061675; OSX 10.6: bug 1097721 skip-if = (toolkit == 'gonk' && !debug) || android_version == '10' || android_version == '18' || (os == 'mac' && os_version == '10.6') diff --git a/dom/phonenumberutils/tests/chrome.ini b/dom/phonenumberutils/tests/chrome.ini index a3cf1810fc..92be51514f 100644 --- a/dom/phonenumberutils/tests/chrome.ini +++ b/dom/phonenumberutils/tests/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' [test_phonenumber.xul] [test_phonenumberservice.xul] diff --git a/dom/plugins/test/mochitest/chrome.ini b/dom/plugins/test/mochitest/chrome.ini index f95ea16e5e..af68f7c8c8 100644 --- a/dom/plugins/test/mochitest/chrome.ini +++ b/dom/plugins/test/mochitest/chrome.ini @@ -1,5 +1,5 @@ [DEFAULT] -skip-if = buildapp == "mulet" +skip-if = (buildapp == 'b2g' || buildapp == 'mulet') support-files = hang_test.js privatemode_perwindowpb.xul diff --git a/dom/promise/tests/chrome.ini b/dom/promise/tests/chrome.ini index 9a83f362f5..52d840cdf0 100644 --- a/dom/promise/tests/chrome.ini +++ b/dom/promise/tests/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' [test_dependentPromises.html] [test_on_new_promise.html] diff --git a/dom/settings/tests/chrome.ini b/dom/settings/tests/chrome.ini index 7595148140..d5e345ddc1 100644 --- a/dom/settings/tests/chrome.ini +++ b/dom/settings/tests/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' [test_settings_service.js] [test_settings_service.xul] diff --git a/dom/svg/SVGScriptElement.cpp b/dom/svg/SVGScriptElement.cpp index d3d3046f3d..49a2518f87 100644 --- a/dom/svg/SVGScriptElement.cpp +++ b/dom/svg/SVGScriptElement.cpp @@ -124,9 +124,7 @@ SVGScriptElement::GetScriptType(nsAString& type) void SVGScriptElement::GetScriptText(nsAString& text) { - if (!nsContentUtils::GetNodeTextContent(this, false, text)) { - NS_RUNTIMEABORT("OOM"); - } + nsContentUtils::GetNodeTextContent(this, false, text); } void diff --git a/dom/svg/test/mochitest.ini b/dom/svg/test/mochitest.ini index 6491e5dd3c..3ecfed0e66 100644 --- a/dom/svg/test/mochitest.ini +++ b/dom/svg/test/mochitest.ini @@ -61,6 +61,7 @@ skip-if = true [test_pointer-events-1b.xhtml] [test_pointer-events-2.xhtml] [test_pointer-events-3.xhtml] +skip-if = android_version == '18' # bug 1147994 [test_pointer-events-4.xhtml] [test_pointer-events-5.xhtml] [test_pointer-events-6.xhtml] diff --git a/dom/system/tests/chrome.ini b/dom/system/tests/chrome.ini index 79441b1571..cfb2eba3ec 100644 --- a/dom/system/tests/chrome.ini +++ b/dom/system/tests/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = worker_constants.js [test_constants.xul] diff --git a/dom/tests/mochitest/chrome/chrome.ini b/dom/tests/mochitest/chrome/chrome.ini index 36d2ac27c2..52950fd53f 100644 --- a/dom/tests/mochitest/chrome/chrome.ini +++ b/dom/tests/mochitest/chrome/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = 489127.html DOMWindowCreated_chrome.xul diff --git a/dom/tests/mochitest/general/chrome.ini b/dom/tests/mochitest/general/chrome.ini index 6a80281ab7..83bdb93f34 100644 --- a/dom/tests/mochitest/general/chrome.ini +++ b/dom/tests/mochitest/general/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' [test_innerScreen.xul] [test_offsets.css] diff --git a/dom/tests/mochitest/localstorage/chrome.ini b/dom/tests/mochitest/localstorage/chrome.ini index 5483aa390b..3c4a3362dc 100644 --- a/dom/tests/mochitest/localstorage/chrome.ini +++ b/dom/tests/mochitest/localstorage/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = frame_clear_browser_data.html page_blank.html diff --git a/dom/tests/mochitest/sessionstorage/chrome.ini b/dom/tests/mochitest/sessionstorage/chrome.ini index 65112f0f82..fbba9af108 100644 --- a/dom/tests/mochitest/sessionstorage/chrome.ini +++ b/dom/tests/mochitest/sessionstorage/chrome.ini @@ -1,3 +1,4 @@ [DEFAULT] +skip-if = buildapp == 'b2g' [test_sessionStorageFromChrome.xhtml] diff --git a/dom/tests/mochitest/webapps/chrome.ini b/dom/tests/mochitest/webapps/chrome.ini index 80295f04aa..21a6b1debf 100644 --- a/dom/tests/mochitest/webapps/chrome.ini +++ b/dom/tests/mochitest/webapps/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = cross_origin.html head.js diff --git a/dom/tests/mochitest/whatwg/chrome.ini b/dom/tests/mochitest/whatwg/chrome.ini index 6d6bfc36c6..34596488bf 100644 --- a/dom/tests/mochitest/whatwg/chrome.ini +++ b/dom/tests/mochitest/whatwg/chrome.ini @@ -1,3 +1,4 @@ [DEFAULT] +skip-if = buildapp == 'b2g' [test_postMessage_chrome.html] diff --git a/dom/webidl/HTMLHeadingElement.webidl b/dom/webidl/HTMLHeadingElement.webidl index 37e7396dfd..c07e5cb99c 100644 --- a/dom/webidl/HTMLHeadingElement.webidl +++ b/dom/webidl/HTMLHeadingElement.webidl @@ -17,5 +17,6 @@ interface HTMLHeadingElement : HTMLElement { // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis partial interface HTMLHeadingElement { + [SetterThrows] attribute DOMString align; }; diff --git a/dom/webidl/HTMLTitleElement.webidl b/dom/webidl/HTMLTitleElement.webidl index e695d8421a..e6c8f2c61f 100644 --- a/dom/webidl/HTMLTitleElement.webidl +++ b/dom/webidl/HTMLTitleElement.webidl @@ -8,6 +8,6 @@ */ interface HTMLTitleElement : HTMLElement { - [SetterThrows] + [Throws] attribute DOMString text; }; diff --git a/dom/workers/test/chrome.ini b/dom/workers/test/chrome.ini index 5f3a05cba9..40209252a8 100644 --- a/dom/workers/test/chrome.ini +++ b/dom/workers/test/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = WorkerDebugger.initialize_childWorker.js WorkerDebugger.initialize_debugger.js diff --git a/dom/xbl/nsXBLPrototypeBinding.cpp b/dom/xbl/nsXBLPrototypeBinding.cpp index 1d70364cff..94244d73dc 100644 --- a/dom/xbl/nsXBLPrototypeBinding.cpp +++ b/dom/xbl/nsXBLPrototypeBinding.cpp @@ -361,9 +361,7 @@ nsXBLPrototypeBinding::AttributeChanged(nsIAtom* aAttribute, // Check to see if the src attribute is xbl:text. If so, then we need to obtain the // children of the real element and get the text nodes' values. if (aAttribute == nsGkAtoms::text && aNameSpaceID == kNameSpaceID_XBL) { - if (!nsContentUtils::GetNodeTextContent(aChangedElement, false, value)) { - NS_RUNTIMEABORT("OOM"); - } + nsContentUtils::GetNodeTextContent(aChangedElement, false, value); value.StripChar(char16_t('\n')); value.StripChar(char16_t('\r')); nsAutoString stripVal(value); @@ -514,10 +512,8 @@ SetAttrs(nsISupports* aKey, nsXBLAttributeEntry* aEntry, void* aClosure) bool attrPresent = true; if (src == nsGkAtoms::text && srcNs == kNameSpaceID_XBL) { - if (!nsContentUtils::GetNodeTextContent(changeData->mBoundElement, false, - value)) { - NS_RUNTIMEABORT("OOM"); - } + nsContentUtils::GetNodeTextContent(changeData->mBoundElement, false, + value); value.StripChar(char16_t('\n')); value.StripChar(char16_t('\r')); nsAutoString stripVal(value); diff --git a/dom/xbl/test/chrome.ini b/dom/xbl/test/chrome.ini index 40606de12c..74188ccd9e 100644 --- a/dom/xbl/test/chrome.ini +++ b/dom/xbl/test/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = file_bug944407.xml file_bug950909.xml diff --git a/dom/xul/templates/nsXULTemplateQueryProcessorStorage.cpp b/dom/xul/templates/nsXULTemplateQueryProcessorStorage.cpp index e02db96c06..52b049690b 100644 --- a/dom/xul/templates/nsXULTemplateQueryProcessorStorage.cpp +++ b/dom/xul/templates/nsXULTemplateQueryProcessorStorage.cpp @@ -290,7 +290,7 @@ nsXULTemplateQueryProcessorStorage::CompileQuery(nsIXULTemplateBuilder* aBuilder nsAutoString sqlQuery; // Let's get all text nodes (which should be the query) - if (!nsContentUtils::GetNodeTextContent(queryContent, false, sqlQuery)) { + if (!nsContentUtils::GetNodeTextContent(queryContent, false, sqlQuery, fallible)) { return NS_ERROR_OUT_OF_MEMORY; } @@ -308,7 +308,7 @@ nsXULTemplateQueryProcessorStorage::CompileQuery(nsIXULTemplateBuilder* aBuilder if (child->NodeInfo()->Equals(nsGkAtoms::param, kNameSpaceID_XUL)) { nsAutoString value; - if (!nsContentUtils::GetNodeTextContent(child, false, value)) { + if (!nsContentUtils::GetNodeTextContent(child, false, value, fallible)) { return NS_ERROR_OUT_OF_MEMORY; } diff --git a/dom/xul/templates/tests/chrome/chrome.ini b/dom/xul/templates/tests/chrome/chrome.ini index 2c1da41317..b557b401a3 100644 --- a/dom/xul/templates/tests/chrome/chrome.ini +++ b/dom/xul/templates/tests/chrome/chrome.ini @@ -1,5 +1,5 @@ [DEFAULT] -skip-if = buildapp == 'mulet' +skip-if = (buildapp == 'b2g' || buildapp == 'mulet') support-files = animals.rdf animals.sqlite diff --git a/dom/xul/test/chrome.ini b/dom/xul/test/chrome.ini index d5dd737c99..f3e071badf 100644 --- a/dom/xul/test/chrome.ini +++ b/dom/xul/test/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = 398289-resource.xul bug497875-iframe.xul diff --git a/editor/composer/test/chrome.ini b/editor/composer/test/chrome.ini index 30d3cc41cc..d07480ba06 100644 --- a/editor/composer/test/chrome.ini +++ b/editor/composer/test/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' [test_async_UpdateCurrentDictionary.html] [test_bug338427.html] diff --git a/editor/libeditor/tests/chrome.ini b/editor/libeditor/tests/chrome.ini index 25562a01b8..ce8ed69bd3 100644 --- a/editor/libeditor/tests/chrome.ini +++ b/editor/libeditor/tests/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = green.png [test_bug46555.html] diff --git a/editor/libeditor/tests/mochitest.ini b/editor/libeditor/tests/mochitest.ini index bce1fb7594..c616609184 100644 --- a/editor/libeditor/tests/mochitest.ini +++ b/editor/libeditor/tests/mochitest.ini @@ -30,6 +30,7 @@ skip-if = toolkit == 'android' skip-if = toolkit == 'android' || e10s [test_bug414526.html] [test_bug417418.html] +skip-if = android_version == '18' # bug 1147989 [test_bug432225.html] skip-if = toolkit == 'android' || e10s [test_bug439808.html] @@ -60,11 +61,13 @@ skip-if = toolkit == 'android' || e10s [test_bug549262.html] skip-if = toolkit == 'android' || e10s [test_bug550434.html] +skip-if = android_version == '18' # bug 1147989 [test_bug551704.html] [test_bug552782.html] [test_bug567213.html] [test_bug570144.html] [test_bug578771.html] +skip-if = android_version == '18' # bug 1147989 [test_bug586662.html] skip-if = toolkit == 'android' || e10s [test_bug587461.html] @@ -101,7 +104,7 @@ skip-if = toolkit == 'android' || e10s [test_bug629845.html] [test_bug638596.html] [test_bug640321.html] -skip-if = e10s +skip-if = android_version == '18' || e10s # bug 1147989 [test_bug641466.html] [test_bug645914.html] [test_bug668599.html] diff --git a/extensions/cookie/test/chrome.ini b/extensions/cookie/test/chrome.ini index a237d63600..76bb729f77 100644 --- a/extensions/cookie/test/chrome.ini +++ b/extensions/cookie/test/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = channel_utils.js [test_app_uninstall_cookies.html] diff --git a/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp b/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp index f63dbed309..6489e53b55 100644 --- a/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp +++ b/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp @@ -12,7 +12,6 @@ #include "nsIDOMRange.h" #include "nsIEditor.h" #include "nsIDOMNode.h" -#include "nsIDOMHTMLBRElement.h" #include "nsUnicharUtilCIID.h" #include "nsUnicodeProperties.h" #include "nsServiceManagerUtils.h" diff --git a/extensions/spellcheck/tests/chrome/chrome.ini b/extensions/spellcheck/tests/chrome/chrome.ini index ee78f75258..430f6a68fc 100644 --- a/extensions/spellcheck/tests/chrome/chrome.ini +++ b/extensions/spellcheck/tests/chrome/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' [test_add_remove_dictionaries.xul] support-files = diff --git a/extensions/universalchardet/tests/chrome.ini b/extensions/universalchardet/tests/chrome.ini index 995ff043fb..2cf61e9f44 100644 --- a/extensions/universalchardet/tests/chrome.ini +++ b/extensions/universalchardet/tests/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = CharsetDetectionTests.js bug306272_text.html diff --git a/image/test/mochitest/chrome.ini b/image/test/mochitest/chrome.ini index 465cec6422..f83953dc6e 100644 --- a/image/test/mochitest/chrome.ini +++ b/image/test/mochitest/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = animated-gif-finalframe.gif animated-gif.gif diff --git a/js/public/SliceBudget.h b/js/public/SliceBudget.h index 316bf9e62c..8ac0def7ac 100644 --- a/js/public/SliceBudget.h +++ b/js/public/SliceBudget.h @@ -70,9 +70,9 @@ struct JS_PUBLIC_API(SliceBudget) return checkOverBudget(); } - bool isUnlimited() const { - return deadline == unlimitedDeadline; - } + bool isWorkBudget() const { return deadline == 0; } + bool isTimeBudget() const { return deadline > 0 && !isUnlimited(); } + bool isUnlimited() const { return deadline == unlimitedDeadline; } int describe(char* buffer, size_t maxlen) const; diff --git a/js/src/gc/GCRuntime.h b/js/src/gc/GCRuntime.h index ca9138840f..17ec432fdf 100644 --- a/js/src/gc/GCRuntime.h +++ b/js/src/gc/GCRuntime.h @@ -771,28 +771,30 @@ class GCRuntime JS::Zone* getCurrentZoneGroup() { return currentZoneGroup; } void setFoundBlackGrayEdges() { foundBlackGrayEdges = true; } - uint64_t gcNumber() { return number; } + uint64_t gcNumber() const { return number; } void incGcNumber() { ++number; } - uint64_t minorGCCount() { return minorGCNumber; } + uint64_t minorGCCount() const { return minorGCNumber; } void incMinorGcNumber() { ++minorGCNumber; } - uint64_t majorGCCount() { return majorGCNumber; } + uint64_t majorGCCount() const { return majorGCNumber; } void incMajorGcNumber() { ++majorGCNumber; } - bool isIncrementalGc() { return isIncremental; } - bool isFullGc() { return isFull; } + int64_t defaultSliceBudget() const { return sliceBudget; } + + bool isIncrementalGc() const { return isIncremental; } + bool isFullGc() const { return isFull; } bool shouldCleanUpEverything() { return cleanUpEverything; } - bool areGrayBitsValid() { return grayBitsValid; } + bool areGrayBitsValid() const { return grayBitsValid; } void setGrayBitsInvalid() { grayBitsValid = false; } bool minorGCRequested() const { return minorGCTriggerReason != JS::gcreason::NO_REASON; } bool majorGCRequested() const { return majorGCTriggerReason != JS::gcreason::NO_REASON; } bool isGcNeeded() { return minorGCRequested() || majorGCRequested(); } - bool fullGCForAtomsRequested() { return fullGCForAtomsRequested_; } + bool fullGCForAtomsRequested() const { return fullGCForAtomsRequested_; } double computeHeapGrowthFactor(size_t lastBytes); size_t computeTriggerBytes(double growthFactor, size_t lastBytes); @@ -1161,7 +1163,7 @@ class GCRuntime */ bool interFrameGC; - /* Default budget for incremental GC slice. See SliceBudget in jsgc.h. */ + /* Default budget for incremental GC slice. See js/SliceBudget.h. */ int64_t sliceBudget; /* diff --git a/js/src/gc/Statistics.cpp b/js/src/gc/Statistics.cpp index aa73ae2e1a..c49440df7b 100644 --- a/js/src/gc/Statistics.cpp +++ b/js/src/gc/Statistics.cpp @@ -1250,7 +1250,6 @@ Statistics::endSlice() if (!aborted) { slices.back().end = PRMJ_Now(); slices.back().endFaults = GetPageFaultCount(); - } bool last = !runtime->gc.isIncrementalGCInProgress(); diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index 75b7e824ad..b07c04550f 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -2999,7 +2999,7 @@ SliceBudget::describe(char* buffer, size_t maxlen) const { if (isUnlimited()) return JS_snprintf(buffer, maxlen, "unlimited"); - else if (deadline == 0) + else if (isWorkBudget()) return JS_snprintf(buffer, maxlen, "work(%lld)", workBudget.budget); else return JS_snprintf(buffer, maxlen, "%lldms", timeBudget.budget); diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index 435c75550d..432e9aabe5 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -1524,9 +1524,8 @@ void XPCJSRuntime::DestroyJSContextStack() void XPCJSRuntime::SystemIsBeingShutDown() { - if (mDetachedWrappedNativeProtoMap) - mDetachedWrappedNativeProtoMap-> - Enumerate(DetachedWrappedNativeProtoShutdownMarker, nullptr); + mDetachedWrappedNativeProtoMap-> + Enumerate(DetachedWrappedNativeProtoShutdownMarker, nullptr); } #define JS_OPTIONS_DOT_STR "javascript.options." @@ -1608,51 +1607,33 @@ XPCJSRuntime::~XPCJSRuntime() JS_SetRuntimePrivate(Runtime(), nullptr); // clean up and destroy maps... - if (mWrappedJSMap) { - mWrappedJSMap->ShutdownMarker(); - delete mWrappedJSMap; - mWrappedJSMap = nullptr; - } + mWrappedJSMap->ShutdownMarker(); + delete mWrappedJSMap; + mWrappedJSMap = nullptr; - if (mWrappedJSClassMap) { - delete mWrappedJSClassMap; - mWrappedJSClassMap = nullptr; - } + delete mWrappedJSClassMap; + mWrappedJSClassMap = nullptr; - if (mIID2NativeInterfaceMap) { - delete mIID2NativeInterfaceMap; - mIID2NativeInterfaceMap = nullptr; - } + delete mIID2NativeInterfaceMap; + mIID2NativeInterfaceMap = nullptr; - if (mClassInfo2NativeSetMap) { - delete mClassInfo2NativeSetMap; - mClassInfo2NativeSetMap = nullptr; - } + delete mClassInfo2NativeSetMap; + mClassInfo2NativeSetMap = nullptr; - if (mNativeSetMap) { - delete mNativeSetMap; - mNativeSetMap = nullptr; - } + delete mNativeSetMap; + mNativeSetMap = nullptr; - if (mThisTranslatorMap) { - delete mThisTranslatorMap; - mThisTranslatorMap = nullptr; - } + delete mThisTranslatorMap; + mThisTranslatorMap = nullptr; - if (mNativeScriptableSharedMap) { - delete mNativeScriptableSharedMap; - mNativeScriptableSharedMap = nullptr; - } + delete mNativeScriptableSharedMap; + mNativeScriptableSharedMap = nullptr; - if (mDyingWrappedNativeProtoMap) { - delete mDyingWrappedNativeProtoMap; - mDyingWrappedNativeProtoMap = nullptr; - } + delete mDyingWrappedNativeProtoMap; + mDyingWrappedNativeProtoMap = nullptr; - if (mDetachedWrappedNativeProtoMap) { - delete mDetachedWrappedNativeProtoMap; - mDetachedWrappedNativeProtoMap = nullptr; - } + delete mDetachedWrappedNativeProtoMap; + mDetachedWrappedNativeProtoMap = nullptr; Preferences::UnregisterCallback(ReloadPrefsCallback, JS_OPTIONS_DOT_STR, this); } @@ -3147,6 +3128,10 @@ ReadSourceFromFilename(JSContext* cx, const char* filename, char16_t** src, size if (!scheme.EqualsLiteral("file") && !scheme.EqualsLiteral("jar")) return NS_OK; + // Explicitly set the content type so that we don't load the + // exthandler to guess it. + scriptChannel->SetContentType(NS_LITERAL_CSTRING("text/plain")); + nsCOMPtr scriptStream; rv = scriptChannel->Open(getter_AddRefs(scriptStream)); NS_ENSURE_SUCCESS(rv, rv); @@ -3575,6 +3560,10 @@ XPCJSRuntime::DebugDump(int16_t depth) XPC_LOG_INDENT(); XPC_LOG_ALWAYS(("mJSRuntime @ %x", Runtime())); + XPC_LOG_ALWAYS(("mWrappedJSToReleaseArray @ %x with %d wrappers(s)", + &mWrappedJSToReleaseArray, + mWrappedJSToReleaseArray.Length())); + int cxCount = 0; JSContext* iter = nullptr; while (JS_ContextIterator(Runtime(), &iter)) @@ -3589,43 +3578,39 @@ XPCJSRuntime::DebugDump(int16_t depth) XPC_LOG_OUTDENT(); } - XPC_LOG_ALWAYS(("mWrappedJSClassMap @ %x with %d wrapperclasses(s)", \ - mWrappedJSClassMap, mWrappedJSClassMap ? \ - mWrappedJSClassMap->Count() : 0)); + XPC_LOG_ALWAYS(("mWrappedJSClassMap @ %x with %d wrapperclasses(s)", + mWrappedJSClassMap, mWrappedJSClassMap->Count())); // iterate wrappersclasses... - if (depth && mWrappedJSClassMap && mWrappedJSClassMap->Count()) { + if (depth && mWrappedJSClassMap->Count()) { XPC_LOG_INDENT(); mWrappedJSClassMap->Enumerate(WrappedJSClassMapDumpEnumerator, &depth); XPC_LOG_OUTDENT(); } - XPC_LOG_ALWAYS(("mWrappedJSMap @ %x with %d wrappers(s)", \ - mWrappedJSMap, mWrappedJSMap ? \ - mWrappedJSMap->Count() : 0)); + XPC_LOG_ALWAYS(("mWrappedJSMap @ %x with %d wrappers(s)", + mWrappedJSMap, mWrappedJSMap->Count())); // iterate wrappers... - if (depth && mWrappedJSMap && mWrappedJSMap->Count()) { + if (depth && mWrappedJSMap->Count()) { XPC_LOG_INDENT(); mWrappedJSMap->Dump(depth); XPC_LOG_OUTDENT(); } - XPC_LOG_ALWAYS(("mIID2NativeInterfaceMap @ %x with %d interface(s)", \ - mIID2NativeInterfaceMap, mIID2NativeInterfaceMap ? \ - mIID2NativeInterfaceMap->Count() : 0)); + XPC_LOG_ALWAYS(("mIID2NativeInterfaceMap @ %x with %d interface(s)", + mIID2NativeInterfaceMap, + mIID2NativeInterfaceMap->Count())); - XPC_LOG_ALWAYS(("mClassInfo2NativeSetMap @ %x with %d sets(s)", \ - mClassInfo2NativeSetMap, mClassInfo2NativeSetMap ? \ - mClassInfo2NativeSetMap->Count() : 0)); + XPC_LOG_ALWAYS(("mClassInfo2NativeSetMap @ %x with %d sets(s)", + mClassInfo2NativeSetMap, + mClassInfo2NativeSetMap->Count())); - XPC_LOG_ALWAYS(("mThisTranslatorMap @ %x with %d translator(s)", \ - mThisTranslatorMap, mThisTranslatorMap ? \ - mThisTranslatorMap->Count() : 0)); + XPC_LOG_ALWAYS(("mThisTranslatorMap @ %x with %d translator(s)", + mThisTranslatorMap, mThisTranslatorMap->Count())); - XPC_LOG_ALWAYS(("mNativeSetMap @ %x with %d sets(s)", \ - mNativeSetMap, mNativeSetMap ? \ - mNativeSetMap->Count() : 0)); + XPC_LOG_ALWAYS(("mNativeSetMap @ %x with %d sets(s)", + mNativeSetMap, mNativeSetMap->Count())); // iterate sets... - if (depth && mNativeSetMap && mNativeSetMap->Count()) { + if (depth && mNativeSetMap->Count()) { XPC_LOG_INDENT(); mNativeSetMap->Enumerate(NativeSetDumpEnumerator, &depth); XPC_LOG_OUTDENT(); diff --git a/js/xpconnect/src/XPCMaps.cpp b/js/xpconnect/src/XPCMaps.cpp index 054de93dc5..03f0b46f27 100644 --- a/js/xpconnect/src/XPCMaps.cpp +++ b/js/xpconnect/src/XPCMaps.cpp @@ -176,8 +176,8 @@ Native2WrappedNativeMap::newMap(int length) } Native2WrappedNativeMap::Native2WrappedNativeMap(int length) + : mTable(new PLDHashTable(PL_DHashGetStubOps(), sizeof(Entry), length)) { - mTable = new PLDHashTable(PL_DHashGetStubOps(), sizeof(Entry), length); } Native2WrappedNativeMap::~Native2WrappedNativeMap() @@ -190,7 +190,7 @@ Native2WrappedNativeMap::SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) { size_t n = 0; n += mallocSizeOf(this); - n += mTable ? PL_DHashTableSizeOfIncludingThis(mTable, SizeOfEntryExcludingThis, mallocSizeOf) : 0; + n += PL_DHashTableSizeOfIncludingThis(mTable, SizeOfEntryExcludingThis, mallocSizeOf); return n; } @@ -216,16 +216,12 @@ const struct PLDHashTableOps IID2WrappedJSClassMap::Entry::sOps = IID2WrappedJSClassMap* IID2WrappedJSClassMap::newMap(int length) { - IID2WrappedJSClassMap* map = new IID2WrappedJSClassMap(length); - if (map && map->mTable) - return map; - delete map; - return nullptr; + return new IID2WrappedJSClassMap(length); } IID2WrappedJSClassMap::IID2WrappedJSClassMap(int length) + : mTable(new PLDHashTable(&Entry::sOps, sizeof(Entry), length)) { - mTable = new PLDHashTable(&Entry::sOps, sizeof(Entry), length); } IID2WrappedJSClassMap::~IID2WrappedJSClassMap() @@ -233,7 +229,6 @@ IID2WrappedJSClassMap::~IID2WrappedJSClassMap() delete mTable; } - /***************************************************************************/ // implement IID2NativeInterfaceMap... @@ -249,16 +244,12 @@ const struct PLDHashTableOps IID2NativeInterfaceMap::Entry::sOps = IID2NativeInterfaceMap* IID2NativeInterfaceMap::newMap(int length) { - IID2NativeInterfaceMap* map = new IID2NativeInterfaceMap(length); - if (map && map->mTable) - return map; - delete map; - return nullptr; + return new IID2NativeInterfaceMap(length); } IID2NativeInterfaceMap::IID2NativeInterfaceMap(int length) + : mTable(new PLDHashTable(&Entry::sOps, sizeof(Entry), length)) { - mTable = new PLDHashTable(&Entry::sOps, sizeof(Entry), length); } IID2NativeInterfaceMap::~IID2NativeInterfaceMap() @@ -271,7 +262,7 @@ IID2NativeInterfaceMap::SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) { size_t n = 0; n += mallocSizeOf(this); - n += mTable ? PL_DHashTableSizeOfIncludingThis(mTable, SizeOfEntryExcludingThis, mallocSizeOf) : 0; + n += PL_DHashTableSizeOfIncludingThis(mTable, SizeOfEntryExcludingThis, mallocSizeOf); return n; } @@ -290,16 +281,12 @@ IID2NativeInterfaceMap::SizeOfEntryExcludingThis(PLDHashEntryHdr* hdr, ClassInfo2NativeSetMap* ClassInfo2NativeSetMap::newMap(int length) { - ClassInfo2NativeSetMap* map = new ClassInfo2NativeSetMap(length); - if (map && map->mTable) - return map; - delete map; - return nullptr; + return new ClassInfo2NativeSetMap(length); } ClassInfo2NativeSetMap::ClassInfo2NativeSetMap(int length) + : mTable(new PLDHashTable(PL_DHashGetStubOps(), sizeof(Entry), length)) { - mTable = new PLDHashTable(PL_DHashGetStubOps(), sizeof(Entry), length); } ClassInfo2NativeSetMap::~ClassInfo2NativeSetMap() @@ -313,7 +300,7 @@ ClassInfo2NativeSetMap::ShallowSizeOfIncludingThis(mozilla::MallocSizeOf mallocS size_t n = 0; n += mallocSizeOf(this); // The second arg is nullptr because this is a "shallow" measurement of the map. - n += mTable ? PL_DHashTableSizeOfIncludingThis(mTable, nullptr, mallocSizeOf) : 0; + n += PL_DHashTableSizeOfIncludingThis(mTable, nullptr, mallocSizeOf); return n; } @@ -336,8 +323,8 @@ ClassInfo2WrappedNativeProtoMap::newMap(int length) } ClassInfo2WrappedNativeProtoMap::ClassInfo2WrappedNativeProtoMap(int length) + : mTable(new PLDHashTable(PL_DHashGetStubOps(), sizeof(Entry), length)) { - mTable = new PLDHashTable(PL_DHashGetStubOps(), sizeof(Entry), length); } ClassInfo2WrappedNativeProtoMap::~ClassInfo2WrappedNativeProtoMap() @@ -350,7 +337,7 @@ ClassInfo2WrappedNativeProtoMap::SizeOfIncludingThis(mozilla::MallocSizeOf mallo { size_t n = 0; n += mallocSizeOf(this); - n += mTable ? PL_DHashTableSizeOfIncludingThis(mTable, SizeOfEntryExcludingThis, mallocSizeOf) : 0; + n += PL_DHashTableSizeOfIncludingThis(mTable, SizeOfEntryExcludingThis, mallocSizeOf); return n; } @@ -448,16 +435,12 @@ const struct PLDHashTableOps NativeSetMap::Entry::sOps = NativeSetMap* NativeSetMap::newMap(int length) { - NativeSetMap* map = new NativeSetMap(length); - if (map && map->mTable) - return map; - delete map; - return nullptr; + return new NativeSetMap(length); } NativeSetMap::NativeSetMap(int length) + : mTable(new PLDHashTable(&Entry::sOps, sizeof(Entry), length)) { - mTable = new PLDHashTable(&Entry::sOps, sizeof(Entry), length); } NativeSetMap::~NativeSetMap() @@ -470,7 +453,7 @@ NativeSetMap::SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) { size_t n = 0; n += mallocSizeOf(this); - n += mTable ? PL_DHashTableSizeOfIncludingThis(mTable, SizeOfEntryExcludingThis, mallocSizeOf) : 0; + n += PL_DHashTableSizeOfIncludingThis(mTable, SizeOfEntryExcludingThis, mallocSizeOf); return n; } @@ -511,16 +494,12 @@ const struct PLDHashTableOps IID2ThisTranslatorMap::Entry::sOps = IID2ThisTranslatorMap* IID2ThisTranslatorMap::newMap(int length) { - IID2ThisTranslatorMap* map = new IID2ThisTranslatorMap(length); - if (map && map->mTable) - return map; - delete map; - return nullptr; + return new IID2ThisTranslatorMap(length); } IID2ThisTranslatorMap::IID2ThisTranslatorMap(int length) + : mTable(new PLDHashTable(&Entry::sOps, sizeof(Entry), length)) { - mTable = new PLDHashTable(&Entry::sOps, sizeof(Entry), length); } IID2ThisTranslatorMap::~IID2ThisTranslatorMap() @@ -586,17 +565,12 @@ const struct PLDHashTableOps XPCNativeScriptableSharedMap::Entry::sOps = XPCNativeScriptableSharedMap* XPCNativeScriptableSharedMap::newMap(int length) { - XPCNativeScriptableSharedMap* map = - new XPCNativeScriptableSharedMap(length); - if (map && map->mTable) - return map; - delete map; - return nullptr; + return new XPCNativeScriptableSharedMap(length); } XPCNativeScriptableSharedMap::XPCNativeScriptableSharedMap(int length) + : mTable(new PLDHashTable(&Entry::sOps, sizeof(Entry), length)) { - mTable = new PLDHashTable(&Entry::sOps, sizeof(Entry), length); } XPCNativeScriptableSharedMap::~XPCNativeScriptableSharedMap() @@ -638,17 +612,13 @@ XPCNativeScriptableSharedMap::GetNewOrUsed(uint32_t flags, XPCWrappedNativeProtoMap* XPCWrappedNativeProtoMap::newMap(int length) { - XPCWrappedNativeProtoMap* map = new XPCWrappedNativeProtoMap(length); - if (map && map->mTable) - return map; - delete map; - return nullptr; + return new XPCWrappedNativeProtoMap(length); } XPCWrappedNativeProtoMap::XPCWrappedNativeProtoMap(int length) + : mTable(new PLDHashTable(PL_DHashGetStubOps(), sizeof(PLDHashEntryStub), + length)) { - mTable = new PLDHashTable(PL_DHashGetStubOps(), - sizeof(PLDHashEntryStub), length); } XPCWrappedNativeProtoMap::~XPCWrappedNativeProtoMap() diff --git a/js/xpconnect/src/XPCMaps.h b/js/xpconnect/src/XPCMaps.h index ca80a8d91c..85b112a9d5 100644 --- a/js/xpconnect/src/XPCMaps.h +++ b/js/xpconnect/src/XPCMaps.h @@ -32,10 +32,13 @@ class JSObject2WrappedJSMap public: static JSObject2WrappedJSMap* newMap(int length) { JSObject2WrappedJSMap* map = new JSObject2WrappedJSMap(); - if (map && map->mTable.init(length)) - return map; - delete map; - return nullptr; + if (!map->mTable.init(length)) { + // This is a decent estimate of the size of the hash table's + // entry storage. The |2| is because on average the capacity is + // twice the requested length. + NS_ABORT_OOM(length * 2 * sizeof(Map::Entry)); + } + return map; } inline nsXPCWrappedJS* Find(JSObject* Obj) { @@ -599,10 +602,13 @@ class JSObject2JSObjectMap public: static JSObject2JSObjectMap* newMap(int length) { JSObject2JSObjectMap* map = new JSObject2JSObjectMap(); - if (map && map->mTable.init(length)) - return map; - delete map; - return nullptr; + if (!map->mTable.init(length)) { + // This is a decent estimate of the size of the hash table's + // entry storage. The |2| is because on average the capacity is + // twice the requested length. + NS_ABORT_OOM(length * 2 * sizeof(Map::Entry)); + } + return map; } inline JSObject* Find(JSObject* key) { diff --git a/js/xpconnect/src/XPCWrappedNativeScope.cpp b/js/xpconnect/src/XPCWrappedNativeScope.cpp index 088ec7f4f8..495e137925 100644 --- a/js/xpconnect/src/XPCWrappedNativeScope.cpp +++ b/js/xpconnect/src/XPCWrappedNativeScope.cpp @@ -434,15 +434,11 @@ XPCWrappedNativeScope::~XPCWrappedNativeScope() // We can do additional cleanup assertions here... - if (mWrappedNativeMap) { - MOZ_ASSERT(0 == mWrappedNativeMap->Count(), "scope has non-empty map"); - delete mWrappedNativeMap; - } + MOZ_ASSERT(0 == mWrappedNativeMap->Count(), "scope has non-empty map"); + delete mWrappedNativeMap; - if (mWrappedNativeProtoMap) { - MOZ_ASSERT(0 == mWrappedNativeProtoMap->Count(), "scope has non-empty map"); - delete mWrappedNativeProtoMap; - } + MOZ_ASSERT(0 == mWrappedNativeProtoMap->Count(), "scope has non-empty map"); + delete mWrappedNativeProtoMap; // This should not be necessary, since the Components object should die // with the scope but just in case. @@ -839,21 +835,20 @@ XPCWrappedNativeScope::DebugDump(int16_t depth) XPC_LOG_ALWAYS(("mComponents @ %x", mComponents.get())); XPC_LOG_ALWAYS(("mGlobalJSObject @ %x", mGlobalJSObject.get())); - XPC_LOG_ALWAYS(("mWrappedNativeMap @ %x with %d wrappers(s)", \ - mWrappedNativeMap, \ - mWrappedNativeMap ? mWrappedNativeMap->Count() : 0)); + XPC_LOG_ALWAYS(("mWrappedNativeMap @ %x with %d wrappers(s)", + mWrappedNativeMap, mWrappedNativeMap->Count())); // iterate contexts... - if (depth && mWrappedNativeMap && mWrappedNativeMap->Count()) { + if (depth && mWrappedNativeMap->Count()) { XPC_LOG_INDENT(); mWrappedNativeMap->Enumerate(WrappedNativeMapDumpEnumerator, &depth); XPC_LOG_OUTDENT(); } - XPC_LOG_ALWAYS(("mWrappedNativeProtoMap @ %x with %d protos(s)", \ - mWrappedNativeProtoMap, \ - mWrappedNativeProtoMap ? mWrappedNativeProtoMap->Count() : 0)); + XPC_LOG_ALWAYS(("mWrappedNativeProtoMap @ %x with %d protos(s)", + mWrappedNativeProtoMap, + mWrappedNativeProtoMap->Count())); // iterate contexts... - if (depth && mWrappedNativeProtoMap && mWrappedNativeProtoMap->Count()) { + if (depth && mWrappedNativeProtoMap->Count()) { XPC_LOG_INDENT(); mWrappedNativeProtoMap->Enumerate(WrappedNativeProtoMapDumpEnumerator, &depth); XPC_LOG_OUTDENT(); diff --git a/js/xpconnect/tests/chrome/chrome.ini b/js/xpconnect/tests/chrome/chrome.ini index b2bbb66a69..1b1189ebad 100644 --- a/js/xpconnect/tests/chrome/chrome.ini +++ b/js/xpconnect/tests/chrome/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = bug503926.xul file_bug618176.xul diff --git a/js/xpconnect/wrappers/WrapperFactory.cpp b/js/xpconnect/wrappers/WrapperFactory.cpp index 661400fd64..9e35ea08c1 100644 --- a/js/xpconnect/wrappers/WrapperFactory.cpp +++ b/js/xpconnect/wrappers/WrapperFactory.cpp @@ -87,7 +87,6 @@ WrapperFactory::CreateXrayWaiver(JSContext* cx, HandleObject obj) if (!scope->mWaiverWrapperMap) { scope->mWaiverWrapperMap = JSObject2JSObjectMap::newMap(XPC_WRAPPER_MAP_LENGTH); - MOZ_ASSERT(scope->mWaiverWrapperMap); } if (!scope->mWaiverWrapperMap->Add(cx, obj, waiver)) return nullptr; diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp index 0a1e5cc3dc..6143099924 100644 --- a/layout/base/RestyleManager.cpp +++ b/layout/base/RestyleManager.cpp @@ -2875,6 +2875,12 @@ ElementRestyler::Restyle(nsRestyleHint aRestyleHint) // to the style context (as is done by nsTransformedTextRun objects, which // can be referenced by a text frame's mTextRun longer than the frame's // mStyleContext). + // + // Also, we don't want this style context to get any more uses by being + // returned from nsStyleContext::FindChildWithRules, so we add the + // NS_STYLE_INELIGIBLE_FOR_SHARING bit to it. + oldContext->SetIneligibleForSharing(); + ContextToClear* toClear = mContextsToClear.AppendElement(); toClear->mStyleContext = Move(oldContext); toClear->mStructs = swappedStructs; diff --git a/layout/base/tests/chrome/chrome.ini b/layout/base/tests/chrome/chrome.ini index 99bc0e21d1..afe7db848d 100644 --- a/layout/base/tests/chrome/chrome.ini +++ b/layout/base/tests/chrome/chrome.ini @@ -22,39 +22,63 @@ support-files = [test_bug396367-1.html] [test_bug396367-2.html] [test_bug420499.xul] +skip-if = buildapp == 'b2g' [test_bug458898.html] +skip-if = buildapp == 'b2g' [test_bug495648.xul] +skip-if = buildapp == 'b2g' [test_bug504311.xul] +skip-if = buildapp == 'b2g' [test_bug514660.xul] +skip-if = buildapp == 'b2g' [test_bug533845.xul] -skip-if = buildapp == 'mulet' +skip-if = buildapp == 'mulet' || buildapp == 'b2g' [test_bug551434.html] [test_bug708062.html] [test_bug812817.xul] +skip-if = buildapp == 'b2g' [test_bug847890_paintFlashing.html] [test_bug1018265.xul] -skip-if = buildapp == 'mulet' +skip-if = buildapp == 'mulet' || buildapp == 'b2g' [test_bug1041200.xul] +skip-if = buildapp == 'b2g' support-files=bug1041200_window.html [test_chrome_content_integration.xul] +skip-if = buildapp == 'b2g' [test_chrome_over_plugin.xul] -skip-if = buildapp == 'mulet' +skip-if = buildapp == 'mulet' || buildapp == 'b2g' [test_default_background.xul] +skip-if = buildapp == 'b2g' [test_dialog_with_positioning.html] +skip-if = buildapp == 'b2g' [test_fixed_bg_scrolling_repaints.html] +skip-if = buildapp == 'b2g' [test_leaf_layers_partition_browser_window.xul] -skip-if = (!debug) || (toolkit == "cocoa") # Disabled on Mac because of Bug 748219 +skip-if = (!debug) || (toolkit == "cocoa") || (buildapp == 'b2g') # Disabled on Mac because of Bug 748219 [test_no_clip_iframe.xul] +skip-if = buildapp == 'b2g' [test_passpointerevents.html] +skip-if = buildapp == 'b2g' [test_passpointerevents_dynamic.html] +skip-if = buildapp == 'b2g' [test_prerendered_transforms.html] +skip-if = buildapp == 'b2g' [test_printpreview.xul] +skip-if = buildapp == 'b2g' [test_printpreview_bug396024.xul] +skip-if = buildapp == 'b2g' [test_printpreview_bug482976.xul] +skip-if = buildapp == 'b2g' [test_scroll_selection_into_view.html] +skip-if = buildapp == 'b2g' support-files=scroll_selection_into_view_window.html [test_scrolling_repaints.html] +skip-if = buildapp == 'b2g' [test_transformed_scrolling_repaints.html] +skip-if = buildapp == 'b2g' [test_transformed_scrolling_repaints_2.html] +skip-if = buildapp == 'b2g' [test_transformed_scrolling_repaints_3.html] +skip-if = buildapp == 'b2g' [test_will_change.html] +skip-if = buildapp == 'b2g' diff --git a/layout/forms/test/chrome.ini b/layout/forms/test/chrome.ini index 7a6075c126..1a9bac3ac0 100644 --- a/layout/forms/test/chrome.ini +++ b/layout/forms/test/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = bug536567_iframe.html bug536567_subframe.html diff --git a/layout/generic/nsRubyBaseContainerFrame.cpp b/layout/generic/nsRubyBaseContainerFrame.cpp index 309440015d..e69090d519 100644 --- a/layout/generic/nsRubyBaseContainerFrame.cpp +++ b/layout/generic/nsRubyBaseContainerFrame.cpp @@ -585,10 +585,8 @@ nsRubyBaseContainerFrame::ReflowOneColumn(const ReflowState& aReflowState, nsAutoString baseText; if (aColumn.mBaseFrame) { - if (!nsContentUtils::GetNodeTextContent(aColumn.mBaseFrame->GetContent(), - true, baseText)) { - NS_RUNTIMEABORT("OOM"); - } + nsContentUtils::GetNodeTextContent(aColumn.mBaseFrame->GetContent(), + true, baseText); } // Reflow text frames @@ -596,10 +594,9 @@ nsRubyBaseContainerFrame::ReflowOneColumn(const ReflowState& aReflowState, nsRubyTextFrame* textFrame = aColumn.mTextFrames[i]; if (textFrame) { nsAutoString annotationText; - if (!nsContentUtils::GetNodeTextContent(textFrame->GetContent(), - true, annotationText)) { - NS_RUNTIMEABORT("OOM"); - } + nsContentUtils::GetNodeTextContent(textFrame->GetContent(), + true, annotationText); + // Per CSS Ruby spec, the content comparison for auto-hiding // takes place prior to white spaces collapsing (white-space) // and text transformation (text-transform), and ignores elements diff --git a/layout/generic/test/chrome.ini b/layout/generic/test/chrome.ini index 5b8d699416..2494d1d288 100644 --- a/layout/generic/test/chrome.ini +++ b/layout/generic/test/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = file_bug514732_window.xul frame_selection_underline-ref.xhtml diff --git a/layout/inspector/tests/chrome/chrome.ini b/layout/inspector/tests/chrome/chrome.ini index d6f57343f0..ce80f45923 100644 --- a/layout/inspector/tests/chrome/chrome.ini +++ b/layout/inspector/tests/chrome/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = GentiumPlus-R.woff [test_bug467669.css] diff --git a/layout/mathml/nsMathMLTokenFrame.cpp b/layout/mathml/nsMathMLTokenFrame.cpp index 740d204a90..a87e5aaaa8 100644 --- a/layout/mathml/nsMathMLTokenFrame.cpp +++ b/layout/mathml/nsMathMLTokenFrame.cpp @@ -77,9 +77,7 @@ nsMathMLTokenFrame::MarkTextFramesAsTokenMathML() } if (mContent->IsMathMLElement(nsGkAtoms::mi_) && childCount == 1) { nsAutoString data; - if (!nsContentUtils::GetNodeTextContent(mContent, false, data)) { - NS_RUNTIMEABORT("OOM"); - } + nsContentUtils::GetNodeTextContent(mContent, false, data); data.CompressWhitespace(); int32_t length = data.Length(); diff --git a/layout/mathml/nsMathMLmoFrame.cpp b/layout/mathml/nsMathMLmoFrame.cpp index df0f443cb5..675e649baa 100644 --- a/layout/mathml/nsMathMLmoFrame.cpp +++ b/layout/mathml/nsMathMLmoFrame.cpp @@ -115,9 +115,7 @@ nsMathMLmoFrame::ProcessTextData() mFlags = 0; nsAutoString data; - if (!nsContentUtils::GetNodeTextContent(mContent, false, data)) { - NS_RUNTIMEABORT("OOM"); - } + nsContentUtils::GetNodeTextContent(mContent, false, data); data.CompressWhitespace(); int32_t length = data.Length(); diff --git a/layout/style/nsCSSPropList.h b/layout/style/nsCSSPropList.h index 98a2761bd6..23fb541f37 100644 --- a/layout/style/nsCSSPropList.h +++ b/layout/style/nsCSSPropList.h @@ -1823,7 +1823,7 @@ CSS_PROP_FONT( CSS_PROP_FONT( -moz-osx-font-smoothing, osx_font_smoothing, - CSS_PROP_DOMPROP_PREFIXED(OSXFontSmoothing), + CSS_PROP_DOMPROP_PREFIXED(OsxFontSmoothing), CSS_PROPERTY_PARSE_VALUE | CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE | CSS_PROPERTY_APPLIES_TO_PLACEHOLDER, diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index 4757e38c0a..a5d68dcdc2 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -1445,7 +1445,7 @@ nsComputedDOMStyle::DoGetFontSizeAdjust() } CSSValue* -nsComputedDOMStyle::DoGetOSXFontSmoothing() +nsComputedDOMStyle::DoGetOsxFontSmoothing() { nsROCSSPrimitiveValue* val = new nsROCSSPrimitiveValue; val->SetIdent(nsCSSProps::ValueToKeywordEnum(StyleFont()->mFont.smoothing, diff --git a/layout/style/nsComputedDOMStyle.h b/layout/style/nsComputedDOMStyle.h index d0e387b0f3..46f1d334a6 100644 --- a/layout/style/nsComputedDOMStyle.h +++ b/layout/style/nsComputedDOMStyle.h @@ -232,7 +232,7 @@ private: mozilla::dom::CSSValue* DoGetFontLanguageOverride(); mozilla::dom::CSSValue* DoGetFontSize(); mozilla::dom::CSSValue* DoGetFontSizeAdjust(); - mozilla::dom::CSSValue* DoGetOSXFontSmoothing(); + mozilla::dom::CSSValue* DoGetOsxFontSmoothing(); mozilla::dom::CSSValue* DoGetFontStretch(); mozilla::dom::CSSValue* DoGetFontStyle(); mozilla::dom::CSSValue* DoGetFontSynthesis(); diff --git a/layout/style/nsComputedDOMStylePropertyList.h b/layout/style/nsComputedDOMStylePropertyList.h index 5f78b5117d..96308f04e2 100644 --- a/layout/style/nsComputedDOMStylePropertyList.h +++ b/layout/style/nsComputedDOMStylePropertyList.h @@ -272,7 +272,7 @@ COMPUTED_STYLE_PROP(force_broken_image_icon, ForceBrokenImageIcon) COMPUTED_STYLE_PROP(hyphens, Hyphens) COMPUTED_STYLE_PROP(image_region, ImageRegion) COMPUTED_STYLE_PROP(orient, Orient) -COMPUTED_STYLE_PROP(osx_font_smoothing, OSXFontSmoothing) +COMPUTED_STYLE_PROP(osx_font_smoothing, OsxFontSmoothing) COMPUTED_STYLE_PROP(_moz_outline_radius_bottomLeft, OutlineRadiusBottomLeft) COMPUTED_STYLE_PROP(_moz_outline_radius_bottomRight,OutlineRadiusBottomRight) COMPUTED_STYLE_PROP(_moz_outline_radius_topLeft, OutlineRadiusTopLeft) diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index f7d3bc5b5e..42db99a88d 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -3460,7 +3460,7 @@ nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext, 0, 0, 0, 0); // font-smoothing: enum, inherit, initial - SetDiscrete(*aRuleData->ValueForOSXFontSmoothing(), + SetDiscrete(*aRuleData->ValueForOsxFontSmoothing(), aFont->mFont.smoothing, aCanStoreInRuleTree, SETDSC_ENUMERATED | SETDSC_UNSET_INHERIT, aParentFont->mFont.smoothing, diff --git a/layout/style/nsStyleContext.cpp b/layout/style/nsStyleContext.cpp index 70a7f5e0f4..6aa7a16e40 100644 --- a/layout/style/nsStyleContext.cpp +++ b/layout/style/nsStyleContext.cpp @@ -345,7 +345,7 @@ nsStyleContext::FindChildWithRules(const nsIAtom* aPseudoTag, } else { match = !child->GetStyleIfVisited(); } - if (match) { + if (match && !(child->mBits & NS_STYLE_INELIGIBLE_FOR_SHARING)) { result = child; break; } @@ -1370,6 +1370,29 @@ nsStyleContext::DoClearCachedInheritedStyleDataOnDescendants(uint32_t aStructs) ClearCachedInheritedStyleDataOnDescendants(aStructs); } +void +nsStyleContext::SetIneligibleForSharing() +{ + if (mBits & NS_STYLE_INELIGIBLE_FOR_SHARING) { + return; + } + mBits |= NS_STYLE_INELIGIBLE_FOR_SHARING; + if (mChild) { + nsStyleContext* child = mChild; + do { + child->SetIneligibleForSharing(); + child = child->mNextSibling; + } while (mChild != child); + } + if (mEmptyChild) { + nsStyleContext* child = mEmptyChild; + do { + child->SetIneligibleForSharing(); + child = child->mNextSibling; + } while (mEmptyChild != child); + } +} + #ifdef RESTYLE_LOGGING nsCString nsStyleContext::GetCachedStyleDataAsString(uint32_t aStructs) diff --git a/layout/style/nsStyleContext.h b/layout/style/nsStyleContext.h index 9d097d6450..9c4f4d8afa 100644 --- a/layout/style/nsStyleContext.h +++ b/layout/style/nsStyleContext.h @@ -419,6 +419,13 @@ public: */ void ClearCachedInheritedStyleDataOnDescendants(uint32_t aStructs); + /** + * Sets the NS_STYLE_INELIGIBLE_FOR_SHARING bit on this style context + * and its descendants. If it finds a descendant that has the bit + * already set, assumes that it can skip that subtree. + */ + void SetIneligibleForSharing(); + #ifdef DEBUG void List(FILE* out, int32_t aIndent, bool aListDescendants = true); static void AssertStyleStructMaxDifferenceValid(); diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index 10968bc446..f6669bcc0c 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -61,8 +61,10 @@ class imgIContainer; #define NS_STYLE_SUPPRESS_LINEBREAK 0x080000000 // See nsStyleContext::IsInDisplayNoneSubtree #define NS_STYLE_IN_DISPLAY_NONE_SUBTREE 0x100000000 +// See nsStyleContext::FindChildWithRules +#define NS_STYLE_INELIGIBLE_FOR_SHARING 0x200000000 // See nsStyleContext::GetPseudoEnum -#define NS_STYLE_CONTEXT_TYPE_SHIFT 33 +#define NS_STYLE_CONTEXT_TYPE_SHIFT 34 // Additional bits for nsRuleNode's mDependentBits: #define NS_RULE_NODE_GC_MARK 0x02000000 diff --git a/layout/style/test/chrome/chrome.ini b/layout/style/test/chrome/chrome.ini index 09d04e4a32..46796ab13e 100644 --- a/layout/style/test/chrome/chrome.ini +++ b/layout/style/test/chrome/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = bug535806-css.css bug535806-html.html @@ -8,6 +9,8 @@ support-files = [test_addSheet.html] [test_additional_sheets.html] [test_author_specified_style.html] +[test_bug1157097.html] +[test_bug1160724.xul] [test_bug535806.xul] [test_hover.html] skip-if = buildapp == 'mulet' diff --git a/layout/style/test/chrome/test_bug1157097.html b/layout/style/test/chrome/test_bug1157097.html new file mode 100644 index 0000000000..748a9eed2d --- /dev/null +++ b/layout/style/test/chrome/test_bug1157097.html @@ -0,0 +1,31 @@ + +Test for bug 1157097 + + + + +

+ diff --git a/layout/style/test/chrome/test_bug1160724.xul b/layout/style/test/chrome/test_bug1160724.xul new file mode 100644 index 0000000000..decf2b162d --- /dev/null +++ b/layout/style/test/chrome/test_bug1160724.xul @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + this.firstChild + + + + + + + diff --git a/layout/style/test/mochitest.ini b/layout/style/test/mochitest.ini index bcedc8bf2e..742c2dcf57 100644 --- a/layout/style/test/mochitest.ini +++ b/layout/style/test/mochitest.ini @@ -72,6 +72,7 @@ skip-if = toolkit == 'android' skip-if = true # Bug 701060 [test_bug405818.html] [test_bug412901.html] +skip-if = android_version == '18' # bug 1147986 [test_bug413958.html] [test_bug437915.html] [test_bug450191.html] @@ -164,7 +165,7 @@ skip-if = toolkit == 'android' [test_initial_storage.html] [test_keyframes_rules.html] [test_media_queries.html] -skip-if = (toolkit == 'gonk' && debug) || android_version == '10' #debug-only failure; timed out #Android 2.3 aws only; bug 1030419 +skip-if = (toolkit == 'gonk' && debug) || android_version == '10' || android_version == '18' #debug-only failure; timed out #Android 2.3 and 4.3 aws only; bug 1030419 [test_media_queries_dynamic.html] [test_media_queries_dynamic_xbl.html] [test_media_query_list.html] diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index 16e7422caa..ec7b051eac 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -6291,7 +6291,7 @@ if (SpecialPowers.getBoolPref("layout.css.image-orientation.enabled")) { if (SpecialPowers.getBoolPref("layout.css.osx-font-smoothing.enabled")) { gCSSProperties["-moz-osx-font-smoothing"] = { - domProp: "MozOSXFontSmoothing", + domProp: "MozOsxFontSmoothing", inherited: true, type: CSS_TYPE_LONGHAND, initial_values: [ "auto" ], diff --git a/layout/xul/test/chrome.ini b/layout/xul/test/chrome.ini index 2102550634..90bb78cf7a 100644 --- a/layout/xul/test/chrome.ini +++ b/layout/xul/test/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = window_resizer.xul window_resizer_element.xul diff --git a/layout/xul/test/mochitest.ini b/layout/xul/test/mochitest.ini index f52c2ad5cb..cabb243e1d 100644 --- a/layout/xul/test/mochitest.ini +++ b/layout/xul/test/mochitest.ini @@ -8,3 +8,4 @@ skip-if = toolkit == 'android' #bug 798806 [test_bug563416.html] [test_resizer_incontent.xul] [test_splitter.xul] +skip-if = android_version == '18' # bug 1147982 diff --git a/mfbt/ChaosMode.h b/mfbt/ChaosMode.h index 9378f66515..ca943a1e76 100644 --- a/mfbt/ChaosMode.h +++ b/mfbt/ChaosMode.h @@ -81,6 +81,7 @@ public: */ static uint32_t randomUint32LessThan(uint32_t aBound) { + MOZ_ASSERT(aBound != 0); return uint32_t(rand()) % aBound; } }; diff --git a/modules/libjar/test/chrome/chrome.ini b/modules/libjar/test/chrome/chrome.ini index b130cbc337..9b0838bc0f 100644 --- a/modules/libjar/test/chrome/chrome.ini +++ b/modules/libjar/test/chrome/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = signed-added.zip signed-badca.zip diff --git a/python/mozbuild/mozbuild/test/frontend/data/test-manifest-keys-extracted/chrome.ini b/python/mozbuild/mozbuild/test/frontend/data/test-manifest-keys-extracted/chrome.ini index 1db07cfac9..1070c7853b 100644 --- a/python/mozbuild/mozbuild/test/frontend/data/test-manifest-keys-extracted/chrome.ini +++ b/python/mozbuild/mozbuild/test/frontend/data/test-manifest-keys-extracted/chrome.ini @@ -1,3 +1,4 @@ [DEFAULT] +skip-if = buildapp == 'b2g' [test_chrome.js] diff --git a/security/certverifier/NSSCertDBTrustDomain.cpp b/security/certverifier/NSSCertDBTrustDomain.cpp index 546d968dc4..ec12abd485 100644 --- a/security/certverifier/NSSCertDBTrustDomain.cpp +++ b/security/certverifier/NSSCertDBTrustDomain.cpp @@ -209,6 +209,10 @@ NSSCertDBTrustDomain::GetCertTrust(EndEntityOrCA endEntityOrCA, candidateCert->derIssuer.len, candidateCert->serialNumber.data, candidateCert->serialNumber.len, + candidateCert->derSubject.data, + candidateCert->derSubject.len, + candidateCert->derPublicKey.data, + candidateCert->derPublicKey.len, &isCertRevoked); if (NS_FAILED(nsrv)) { return Result::FATAL_ERROR_LIBRARY_FAILURE; diff --git a/security/manager/ssl/CertBlocklist.cpp b/security/manager/ssl/CertBlocklist.cpp index 6c564c5eb3..f52c641eae 100644 --- a/security/manager/ssl/CertBlocklist.cpp +++ b/security/manager/ssl/CertBlocklist.cpp @@ -9,6 +9,7 @@ #include "nsAppDirectoryServiceDefs.h" #include "nsCRTGlue.h" #include "nsDirectoryServiceUtils.h" +#include "nsICryptoHash.h" #include "nsIFileStreams.h" #include "nsILineInputStream.h" #include "nsIX509Cert.h" @@ -23,74 +24,85 @@ NS_IMPL_ISUPPORTS(CertBlocklist, nsICertBlocklist) static PRLogModuleInfo* gCertBlockPRLog; -CertBlocklistItem::CertBlocklistItem(mozilla::pkix::Input aIssuer, - mozilla::pkix::Input aSerial) +CertBlocklistItem::CertBlocklistItem(const uint8_t* DNData, + size_t DNLength, + const uint8_t* otherData, + size_t otherLength, + CertBlocklistItemMechanism itemMechanism) : mIsCurrent(false) + , mItemMechanism(itemMechanism) { - mIssuerData = new uint8_t[aIssuer.GetLength()]; - memcpy(mIssuerData, aIssuer.UnsafeGetData(), aIssuer.GetLength()); - mozilla::unused << mIssuer.Init(mIssuerData, aIssuer.GetLength()); + mDNData = new uint8_t[DNLength]; + memcpy(mDNData, DNData, DNLength); + mDNLength = DNLength; - mSerialData = new uint8_t[aSerial.GetLength()]; - memcpy(mSerialData, aSerial.UnsafeGetData(), aSerial.GetLength()); - mozilla::unused << mSerial.Init(mSerialData, aSerial.GetLength()); + mOtherData = new uint8_t[otherLength]; + memcpy(mOtherData, otherData, otherLength); + mOtherLength = otherLength; } CertBlocklistItem::CertBlocklistItem(const CertBlocklistItem& aItem) { - uint32_t issuerLength = aItem.mIssuer.GetLength(); - mIssuerData = new uint8_t[issuerLength]; - memcpy(mIssuerData, aItem.mIssuerData, issuerLength); - mozilla::unused << mIssuer.Init(mIssuerData, issuerLength); + mDNLength = aItem.mDNLength; + mDNData = new uint8_t[mDNLength]; + memcpy(mDNData, aItem.mDNData, mDNLength); + + mOtherLength = aItem.mOtherLength; + mOtherData = new uint8_t[mOtherLength]; + memcpy(mOtherData, aItem.mOtherData, mOtherLength); + + mItemMechanism = aItem.mItemMechanism; - uint32_t serialLength = aItem.mSerial.GetLength(); - mSerialData = new uint8_t[serialLength]; - memcpy(mSerialData, aItem.mSerialData, serialLength); - mozilla::unused << mSerial.Init(mSerialData, serialLength); mIsCurrent = aItem.mIsCurrent; } CertBlocklistItem::~CertBlocklistItem() { - delete[] mIssuerData; - delete[] mSerialData; + delete[] mDNData; + delete[] mOtherData; } nsresult -CertBlocklistItem::ToBase64(nsACString& b64IssuerOut, nsACString& b64SerialOut) +CertBlocklistItem::ToBase64(nsACString& b64DNOut, nsACString& b64OtherOut) { - nsDependentCSubstring issuerString(reinterpret_cast(mIssuerData), - mIssuer.GetLength()); - nsDependentCSubstring serialString(reinterpret_cast(mSerialData), - mSerial.GetLength()); - nsresult rv = mozilla::Base64Encode(issuerString, b64IssuerOut); + nsDependentCSubstring DNString(reinterpret_cast(mDNData), + mDNLength); + nsDependentCSubstring otherString(reinterpret_cast(mOtherData), + mOtherLength); + nsresult rv = mozilla::Base64Encode(DNString, b64DNOut); if (NS_FAILED(rv)) { return rv; } - rv = mozilla::Base64Encode(serialString, b64SerialOut); + rv = mozilla::Base64Encode(otherString, b64OtherOut); return rv; } bool CertBlocklistItem::operator==(const CertBlocklistItem& aItem) const { - bool retval = InputsAreEqual(aItem.mIssuer, mIssuer) && - InputsAreEqual(aItem.mSerial, mSerial); - return retval; + if (aItem.mItemMechanism != mItemMechanism) { + return false; + } + if (aItem.mDNLength != mDNLength || + aItem.mOtherLength != mOtherLength) { + return false; + } + return memcmp(aItem.mDNData, mDNData, mDNLength) == 0 && + memcmp(aItem.mOtherData, mOtherData, mOtherLength) == 0; } uint32_t CertBlocklistItem::Hash() const { uint32_t hash; - uint32_t serialLength = mSerial.GetLength(); // there's no requirement for a serial to be as large as the size of the hash // key; if it's smaller, fall back to the first octet (otherwise, the last // four) - if (serialLength >= sizeof(hash)) { - memcpy(&hash, mSerialData + serialLength - sizeof(hash), sizeof(hash)); + if (mItemMechanism == BlockByIssuerAndSerial && + mOtherLength >= sizeof(hash)) { + memcpy(&hash, mOtherData + mOtherLength - sizeof(hash), sizeof(hash)); } else { - hash = *mSerialData; + hash = *mOtherData; } return hash; } @@ -186,12 +198,14 @@ CertBlocklist::EnsureBackingFileInitialized(mozilla::MutexAutoLock& lock) nsCOMPtr lineStream(do_QueryInterface(fileStream, &rv)); nsAutoCString line; - nsAutoCString issuer; - nsAutoCString serial; + nsAutoCString DN; + nsAutoCString other; + CertBlocklistItemMechanism mechanism; // read in the revocations file. The file format is as follows: each line - // contains a comment, base64 encoded DER for an issuer or base64 encoded DER - // for a serial number. Comment lines start with '#', serial number lines, ' ' - // (a space) and anything else is assumed to be an issuer. + // contains a comment, base64 encoded DER for a DN, base64 encoded DER for a + // serial number or a Base64 encoded SHA256 hash of a public key. Comment + // lines start with '#', serial number lines, ' ' (a space), public key hashes + // with '\t' (a tab) and anything else is assumed to be a DN. bool more = true; do { rv = lineStream->ReadLine(line, &more); @@ -202,24 +216,32 @@ CertBlocklist::EnsureBackingFileInitialized(mozilla::MutexAutoLock& lock) if (line.IsEmpty() || line.First() == '#') { continue; } - if (line.First() != ' ') { - issuer = line; + if (line.First() != ' ' && line.First() != '\t') { + DN = line; continue; } - serial = line; - serial.Trim(" ", true, false, false); - // serial numbers 'belong' to the last issuer line seen; if no issuer has - // been seen, the serial number is ignored - if (issuer.IsEmpty() || serial.IsEmpty()) { + other = line; + if (line.First() == ' ') { + mechanism = BlockByIssuerAndSerial; + } else { + mechanism = BlockBySubjectAndPubKey; + } + other.Trim(" \t", true, false, false); + // Serial numbers and public key hashes 'belong' to the last DN line seen; + // if no DN has been seen, the serial number or public key hash is ignored. + if (DN.IsEmpty() || other.IsEmpty()) { continue; } PR_LOG(gCertBlockPRLog, PR_LOG_DEBUG, ("CertBlocklist::EnsureBackingFileInitialized adding: %s %s", - issuer.get(), serial.get())); - rv = AddRevokedCertInternal(issuer.get(), - serial.get(), - CertOldFromLocalCache, + DN.get(), other.get())); + + PR_LOG(gCertBlockPRLog, PR_LOG_DEBUG, + ("CertBlocklist::EnsureBackingFileInitialized - pre-decode")); + + rv = AddRevokedCertInternal(DN, other, mechanism, CertOldFromLocalCache, lock); + if (NS_FAILED(rv)) { // we warn here, rather than abandoning, since we need to // ensure that as many items as possible are read @@ -232,56 +254,64 @@ CertBlocklist::EnsureBackingFileInitialized(mozilla::MutexAutoLock& lock) return NS_OK; } -// void addRevokedCert (in string issuer, in string serialNumber); +// void revokeCertBySubjectAndPubKey(in string subject, in string pubKeyHash); NS_IMETHODIMP -CertBlocklist::AddRevokedCert(const char* aIssuer, - const char* aSerialNumber) +CertBlocklist::RevokeCertBySubjectAndPubKey(const char* aSubject, + const char* aPubKeyHash) { PR_LOG(gCertBlockPRLog, PR_LOG_DEBUG, - ("CertBlocklist::AddRevokedCert - issuer is: %s and serial: %s", + ("CertBlocklist::RevokeCertBySubjectAndPubKey - subject is: %s and pubKeyHash: %s", + aSubject, aPubKeyHash)); + mozilla::MutexAutoLock lock(mMutex); + + return AddRevokedCertInternal(nsDependentCString(aSubject), + nsDependentCString(aPubKeyHash), + BlockBySubjectAndPubKey, + CertNewFromBlocklist, lock); +} + +// void revokeCertByIssuerAndSerial(in string issuer, in string serialNumber); +NS_IMETHODIMP +CertBlocklist::RevokeCertByIssuerAndSerial(const char* aIssuer, + const char* aSerialNumber) +{ + PR_LOG(gCertBlockPRLog, PR_LOG_DEBUG, + ("CertBlocklist::RevokeCertByIssuerAndSerial - issuer is: %s and serial: %s", aIssuer, aSerialNumber)); mozilla::MutexAutoLock lock(mMutex); - return AddRevokedCertInternal(aIssuer, - aSerialNumber, - CertNewFromBlocklist, - lock); + + return AddRevokedCertInternal(nsDependentCString(aIssuer), + nsDependentCString(aSerialNumber), + BlockByIssuerAndSerial, + CertNewFromBlocklist, lock); } nsresult -CertBlocklist::AddRevokedCertInternal(const char* aIssuer, - const char* aSerialNumber, +CertBlocklist::AddRevokedCertInternal(const nsACString& aEncodedDN, + const nsACString& aEncodedOther, + CertBlocklistItemMechanism aMechanism, CertBlocklistItemState aItemState, mozilla::MutexAutoLock& /*proofOfLock*/) { - nsCString decodedIssuer; - nsCString decodedSerial; + nsCString decodedDN; + nsCString decodedOther; - nsresult rv; - rv = mozilla::Base64Decode(nsDependentCString(aIssuer), decodedIssuer); - if (NS_FAILED(rv)) { - return rv; - } - rv = mozilla::Base64Decode(nsDependentCString(aSerialNumber), decodedSerial); - if (NS_FAILED(rv)) { - return rv; - } + nsresult rv = mozilla::Base64Decode(aEncodedDN, decodedDN); + if (NS_FAILED(rv)) { + return rv; + } + rv = mozilla::Base64Decode(aEncodedOther, decodedOther); + if (NS_FAILED(rv)) { + return rv; + } - mozilla::pkix::Input issuer; - mozilla::pkix::Input serial; + CertBlocklistItem item(reinterpret_cast(decodedDN.get()), + decodedDN.Length(), + reinterpret_cast(decodedOther.get()), + decodedOther.Length(), + aMechanism); - mozilla::pkix::Result pkrv; - pkrv = issuer.Init(reinterpret_cast(decodedIssuer.get()), - decodedIssuer.Length()); - if (pkrv != mozilla::pkix::Success) { - return NS_ERROR_FAILURE; - } - pkrv = serial.Init(reinterpret_cast(decodedSerial.get()), - decodedSerial.Length()); - if (pkrv != mozilla::pkix::Success) { - return NS_ERROR_FAILURE; - } - CertBlocklistItem item(issuer, serial); if (aItemState == CertNewFromBlocklist) { // we want SaveEntries to be a no-op if no new entries are added @@ -345,22 +375,30 @@ ProcessBlocklistEntry(BlocklistItemKey* aHashKey, void* aUserArg) return PL_DHASH_NEXT; } - nsAutoCString encIssuer; - nsAutoCString encSerial; + nsAutoCString encDN; + nsAutoCString encOther; - nsresult rv = item.ToBase64(encIssuer, encSerial); + nsresult rv = item.ToBase64(encDN, encOther); if (NS_FAILED(rv)) { saveInfo->success = false; return PL_DHASH_STOP; } - saveInfo->issuers.PutEntry(encIssuer); - BlocklistStringSet* issuerSet = saveInfo->issuerTable.Get(encIssuer); + // If it's a subject / public key block, write it straight out + if (item.mItemMechanism == BlockBySubjectAndPubKey) { + WriteLine(saveInfo->outputStream, encDN); + WriteLine(saveInfo->outputStream, NS_LITERAL_CSTRING("\t") + encOther); + return PL_DHASH_NEXT; + } + + // Otherwise, we have to group entries by issuer + saveInfo->issuers.PutEntry(encDN); + BlocklistStringSet* issuerSet = saveInfo->issuerTable.Get(encDN); if (!issuerSet) { issuerSet = new BlocklistStringSet(); - saveInfo->issuerTable.Put(encIssuer, issuerSet); + saveInfo->issuerTable.Put(encDN, issuerSet); } - issuerSet->PutEntry(encSerial); + issuerSet->PutEntry(encOther); return PL_DHASH_NEXT; } @@ -438,6 +476,12 @@ CertBlocklist::SaveEntries() if (NS_FAILED(rv)) { return rv; } + rv = WriteLine(saveInfo.outputStream, + NS_LITERAL_CSTRING("# Auto generated contents. Do not edit.")); + if (NS_FAILED(rv)) { + return rv; + } + mBlocklist.EnumerateEntries(ProcessBlocklistEntry, &saveInfo); if (!saveInfo.success) { PR_LOG(gCertBlockPRLog, PR_LOG_WARN, @@ -445,12 +489,6 @@ CertBlocklist::SaveEntries() return NS_ERROR_FAILURE; } - rv = WriteLine(saveInfo.outputStream, - NS_LITERAL_CSTRING("# Auto generated contents. Do not edit.")); - if (NS_FAILED(rv)) { - return rv; - } - saveInfo.issuers.EnumerateEntries(WriteIssuer, &saveInfo); if (!saveInfo.success) { PR_LOG(gCertBlockPRLog, PR_LOG_WARN, @@ -477,12 +515,21 @@ CertBlocklist::SaveEntries() // boolean isCertRevoked([const, array, size_is(issuerLength)] in octet issuer, // in unsigned long issuerLength, // [const, array, size_is(serialLength)] in octet serial, -// in unsigned long serialLength); -NS_IMETHODIMP CertBlocklist::IsCertRevoked(const uint8_t* aIssuer, - uint32_t aIssuerLength, - const uint8_t* aSerial, - uint32_t aSerialLength, - bool* _retval) +// in unsigned long serialLength), +// [const, array, size_is(subject_length)] in octet subject, +// in unsigned long subject_length, +// [const, array, size_is(pubkey_length)] in octet pubkey, +// in unsigned long pubkey_length); +NS_IMETHODIMP +CertBlocklist::IsCertRevoked(const uint8_t* aIssuer, + uint32_t aIssuerLength, + const uint8_t* aSerial, + uint32_t aSerialLength, + const uint8_t* aSubject, + uint32_t aSubjectLength, + const uint8_t* aPubKey, + uint32_t aPubKeyLength, + bool* _retval) { mozilla::MutexAutoLock lock(mMutex); @@ -500,8 +547,40 @@ NS_IMETHODIMP CertBlocklist::IsCertRevoked(const uint8_t* aIssuer, return NS_ERROR_FAILURE; } - CertBlocklistItem item(issuer, serial); - *_retval = mBlocklist.Contains(item); + CertBlocklistItem issuerSerial(aIssuer, aIssuerLength, aSerial, aSerialLength, + BlockByIssuerAndSerial); + *_retval = mBlocklist.Contains(issuerSerial); + + if (*_retval) { + return NS_OK; + } + + nsCOMPtr crypto; + crypto = do_CreateInstance(NS_CRYPTO_HASH_CONTRACTID, &rv); + + rv = crypto->Init(nsICryptoHash::SHA256); + if (NS_FAILED(rv)) { + return rv; + } + + rv = crypto->Update(reinterpret_cast(aPubKey), + aPubKeyLength); + if (NS_FAILED(rv)) { + return rv; + } + + nsCString hashString; + rv = crypto->Finish(false, hashString); + if (NS_FAILED(rv)) { + return rv; + } + + CertBlocklistItem subjectPubKey(aSubject, + static_cast(aSubjectLength), + reinterpret_cast(hashString.get()), + hashString.Length(), + BlockBySubjectAndPubKey); + *_retval = mBlocklist.Contains(subjectPubKey); return NS_OK; } diff --git a/security/manager/ssl/CertBlocklist.h b/security/manager/ssl/CertBlocklist.h index fccf9b6a95..b0f8506b4b 100644 --- a/security/manager/ssl/CertBlocklist.h +++ b/security/manager/ssl/CertBlocklist.h @@ -18,6 +18,11 @@ #define NS_CERT_BLOCKLIST_CID \ {0x11aefd53, 0x2fbb, 0x4c92, {0xa0, 0xc1, 0x05, 0x32, 0x12, 0xae, 0x42, 0xd0} } +enum CertBlocklistItemMechanism { + BlockByIssuerAndSerial, + BlockBySubjectAndPubKey +}; + enum CertBlocklistItemState { CertNewFromBlocklist, CertOldFromLocalCache @@ -26,19 +31,22 @@ enum CertBlocklistItemState { class CertBlocklistItem { public: - CertBlocklistItem(mozilla::pkix::Input aIssuer, mozilla::pkix::Input aSerial); + CertBlocklistItem(const uint8_t* DNData, size_t DNLength, + const uint8_t* otherData, size_t otherLength, + CertBlocklistItemMechanism itemMechanism); CertBlocklistItem(const CertBlocklistItem& aItem); ~CertBlocklistItem(); nsresult ToBase64(nsACString& b64IssuerOut, nsACString& b64SerialOut); bool operator==(const CertBlocklistItem& aItem) const; uint32_t Hash() const; bool mIsCurrent; + CertBlocklistItemMechanism mItemMechanism; private: - mozilla::pkix::Input mIssuer; - uint8_t* mIssuerData; - mozilla::pkix::Input mSerial; - uint8_t* mSerialData; + size_t mDNLength; + uint8_t* mDNData; + size_t mOtherLength; + uint8_t* mOtherData; }; typedef nsGenericHashKey BlocklistItemKey; @@ -56,8 +64,9 @@ public: private: BlocklistTable mBlocklist; - nsresult AddRevokedCertInternal(const char* aIssuer, - const char* aSerial, + nsresult AddRevokedCertInternal(const nsACString& aEncodedDN, + const nsACString& aEncodedOther, + CertBlocklistItemMechanism aMechanism, CertBlocklistItemState aItemState, mozilla::MutexAutoLock& /*proofOfLock*/); mozilla::Mutex mMutex; diff --git a/security/manager/ssl/nsICertBlocklist.idl b/security/manager/ssl/nsICertBlocklist.idl index 2152940207..e90663988f 100644 --- a/security/manager/ssl/nsICertBlocklist.idl +++ b/security/manager/ssl/nsICertBlocklist.idl @@ -14,13 +14,20 @@ interface nsIX509Cert; /** * Represents a service to add certificates as explicitly blocked/distrusted. */ -[scriptable, uuid(44b0ee42-1af3-45e7-b601-7f17bd67c5cc)] +[scriptable, uuid(fed30090-c190-11e4-8830-0800200c9a66)] interface nsICertBlocklist : nsISupports { /** * Add details of a revoked certificate : * issuer name (base-64 encoded DER) and serial number (base-64 encoded DER). */ - void addRevokedCert(in string issuer, in string serialNumber); + void revokeCertByIssuerAndSerial(in string issuer, in string serialNumber); + + /** + * Add details of a revoked certificate : + * subject name (base-64 encoded DER) and hash of public key (base-64 encoded + * sha-256 hash of the public key). + */ + void revokeCertBySubjectAndPubKey(in string subject, in string pubKeyHash); /** * Persist (fresh) blocklist entries to the profile (if a profile directory is @@ -32,9 +39,15 @@ interface nsICertBlocklist : nsISupports { * Check if a certificate is blocked. * isser - issuer name, DER encoded * serial - serial number, DER encoded + * subject - subject name, DER encoded + * pubkey - public key, DER encoded */ boolean isCertRevoked([const, array, size_is(issuer_length)] in octet issuer, in unsigned long issuer_length, [const, array, size_is(serial_length)] in octet serial, - in unsigned long serial_length); + in unsigned long serial_length, + [const, array, size_is(subject_length)] in octet subject, + in unsigned long subject_length, + [const, array, size_is(pubkey_length)] in octet pubkey, + in unsigned long pubkey_length); }; diff --git a/security/manager/ssl/tests/mochitest/bugs/chrome.ini b/security/manager/ssl/tests/mochitest/bugs/chrome.ini index d56b449806..ca91054f58 100644 --- a/security/manager/ssl/tests/mochitest/bugs/chrome.ini +++ b/security/manager/ssl/tests/mochitest/bugs/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' [test_bug234856.html] [test_bug413909.html] diff --git a/security/manager/ssl/tests/mochitest/stricttransportsecurity/chrome.ini b/security/manager/ssl/tests/mochitest/stricttransportsecurity/chrome.ini index 4ac7e93af8..2b15acda0a 100644 --- a/security/manager/ssl/tests/mochitest/stricttransportsecurity/chrome.ini +++ b/security/manager/ssl/tests/mochitest/stricttransportsecurity/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = page_blank.html [test_sts_privatebrowsing_perwindowpb.html] diff --git a/security/manager/ssl/tests/unit/test_cert_blocklist.js b/security/manager/ssl/tests/unit/test_cert_blocklist.js index f9cb1f434b..a393a18d70 100644 --- a/security/manager/ssl/tests/unit/test_cert_blocklist.js +++ b/security/manager/ssl/tests/unit/test_cert_blocklist.js @@ -162,13 +162,28 @@ function load_cert(cert, trust) { addCertFromFile(certDB, file, trust); } -function test_is_revoked(certList, issuerString, serialString) { - let issuer = converter.convertToByteArray(issuerString, {}); - let serial = converter.convertToByteArray(serialString, {}); +function test_is_revoked(certList, issuerString, serialString, subjectString, + pubKeyString) { + let issuer = converter.convertToByteArray(issuerString ? issuerString : '', + {}); + + let serial = converter.convertToByteArray(serialString ? serialString : '', + {}); + + let subject = converter.convertToByteArray(subjectString ? subjectString : '', + {}); + + let pubKey = converter.convertToByteArray(pubKeyString ? pubKeyString : '', + {}); + return certList.isCertRevoked(issuer, - issuerString.length, + issuerString ? issuerString.length : 0, serial, - serialString.length); + serialString ? serialString.length : 0, + subject, + subjectString ? subjectString.length : 0, + pubKey, + pubKeyString ? pubKeyString.length : 0); } function run_test() { @@ -290,7 +305,8 @@ function run_test() { // check that save with no further update is a no-op let lastModified = revocations.lastModifiedTime; // add an already existing entry - certList.addRevokedCert("YW5vdGhlciBpbWFnaW5hcnkgaXNzdWVy","c2VyaWFsMi4="); + certList.revokeCertByIssuerAndSerial("YW5vdGhlciBpbWFnaW5hcnkgaXNzdWVy", + "c2VyaWFsMi4="); certList.saveEntries(); let newModified = revocations.lastModifiedTime; equal(lastModified, newModified, diff --git a/services/fxaccounts/tests/mochitest/chrome.ini b/services/fxaccounts/tests/mochitest/chrome.ini index 5dcacd4ab1..a099bf9d12 100644 --- a/services/fxaccounts/tests/mochitest/chrome.ini +++ b/services/fxaccounts/tests/mochitest/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files= file_invalidEmailCase.sjs diff --git a/testing/mochitest/chrome/chrome.ini b/testing/mochitest/chrome/chrome.ini index ecd391111d..6e06dadb2e 100644 --- a/testing/mochitest/chrome/chrome.ini +++ b/testing/mochitest/chrome/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = test-dir/test-file [test_sample.xul] diff --git a/toolkit/components/aboutmemory/tests/chrome.ini b/toolkit/components/aboutmemory/tests/chrome.ini index ef528d5e2b..f920a9bfd0 100644 --- a/toolkit/components/aboutmemory/tests/chrome.ini +++ b/toolkit/components/aboutmemory/tests/chrome.ini @@ -1,5 +1,5 @@ [DEFAULT] -skip-if = buildapp == 'mulet' +skip-if = (buildapp == 'b2g' || buildapp == 'mulet') support-files = crash-dump-diff1.json crash-dump-diff2.json diff --git a/toolkit/components/console/tests/chrome.ini b/toolkit/components/console/tests/chrome.ini index 0480c3533e..995dc38bef 100644 --- a/toolkit/components/console/tests/chrome.ini +++ b/toolkit/components/console/tests/chrome.ini @@ -1,3 +1,4 @@ [DEFAULT] +skip-if = buildapp == 'b2g' [test_hugeURIs.xul] diff --git a/toolkit/components/ctypes/tests/chrome/chrome.ini b/toolkit/components/ctypes/tests/chrome/chrome.ini index 47e0422bc4..9a67fc1dca 100644 --- a/toolkit/components/ctypes/tests/chrome/chrome.ini +++ b/toolkit/components/ctypes/tests/chrome/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = xpcshellTestHarnessAdaptor.js ctypes_worker.js diff --git a/toolkit/components/feeds/test/chrome.ini b/toolkit/components/feeds/test/chrome.ini index 6745fa9a5e..90349ca780 100644 --- a/toolkit/components/feeds/test/chrome.ini +++ b/toolkit/components/feeds/test/chrome.ini @@ -1,3 +1,4 @@ [DEFAULT] +skip-if = buildapp == 'b2g' [test_bug675492.xul] diff --git a/toolkit/components/formautofill/test/chrome/chrome.ini b/toolkit/components/formautofill/test/chrome/chrome.ini index 67b7869afe..a8be6b1919 100644 --- a/toolkit/components/formautofill/test/chrome/chrome.ini +++ b/toolkit/components/formautofill/test/chrome/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' # The following files starting with ".." are installed in the current folder. support-files = ../head_common.js diff --git a/toolkit/components/osfile/tests/mochi/chrome.ini b/toolkit/components/osfile/tests/mochi/chrome.ini index 082e68c8cf..8fdab988c3 100644 --- a/toolkit/components/osfile/tests/mochi/chrome.ini +++ b/toolkit/components/osfile/tests/mochi/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = main_test_osfile_async.js worker_handler.js diff --git a/toolkit/components/passwordmgr/test/chrome.ini b/toolkit/components/passwordmgr/test/chrome.ini index ce2c426563..19668f514c 100644 --- a/toolkit/components/passwordmgr/test/chrome.ini +++ b/toolkit/components/passwordmgr/test/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = formsubmit.sjs notification_common.js diff --git a/toolkit/components/perf/chrome.ini b/toolkit/components/perf/chrome.ini index eaa3c2401d..0d6690d999 100644 --- a/toolkit/components/perf/chrome.ini +++ b/toolkit/components/perf/chrome.ini @@ -1,3 +1,4 @@ [DEFAULT] +skip-if = buildapp == 'b2g' [test_pm.xul] diff --git a/toolkit/components/places/tests/chrome/chrome.ini b/toolkit/components/places/tests/chrome/chrome.ini index 76029339ef..2ca7d73651 100644 --- a/toolkit/components/places/tests/chrome/chrome.ini +++ b/toolkit/components/places/tests/chrome/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = history_post.sjs [test_303567.xul] diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index bf6881ec15..6747168808 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -246,6 +246,22 @@ "n_buckets": 50, "description": "Time spent running JS GC (ms)" }, + "GC_BUDGET_MS": { + "alert_emails": ["dev-telemetry-gc-alerts@mozilla.org"], + "expires_in_version": "never", + "kind": "linear", + "high": "100", + "n_buckets": 10, + "description": "Requested GC slice budget (ms)" + }, + "GC_ANIMATION_MS": { + "alert_emails": ["dev-telemetry-gc-alerts@mozilla.org"], + "expires_in_version": "never", + "kind": "exponential", + "high": "10000", + "n_buckets": 50, + "description": "Time spent running JS GC when animating (ms)" + }, "GC_MAX_PAUSE_MS": { "expires_in_version": "never", "kind": "linear", diff --git a/toolkit/components/viewsource/test/chrome.ini b/toolkit/components/viewsource/test/chrome.ini index a1c83abdcb..f54c1543c5 100644 --- a/toolkit/components/viewsource/test/chrome.ini +++ b/toolkit/components/viewsource/test/chrome.ini @@ -1,3 +1,4 @@ [DEFAULT] +skip-if = buildapp == 'b2g' [test_428653.xul] diff --git a/toolkit/components/workerloader/tests/chrome.ini b/toolkit/components/workerloader/tests/chrome.ini index c83a0b0813..6e79171de7 100644 --- a/toolkit/components/workerloader/tests/chrome.ini +++ b/toolkit/components/workerloader/tests/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = moduleA-depends.js moduleB-dependency.js diff --git a/toolkit/components/xulstore/tests/chrome/chrome.ini b/toolkit/components/xulstore/tests/chrome/chrome.ini index 91efd5455a..236a931732 100644 --- a/toolkit/components/xulstore/tests/chrome/chrome.ini +++ b/toolkit/components/xulstore/tests/chrome/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = window_persistence.xul animals.rdf diff --git a/toolkit/content/tests/chrome/chrome.ini b/toolkit/content/tests/chrome/chrome.ini index 875efedde8..4de31c8d07 100644 --- a/toolkit/content/tests/chrome/chrome.ini +++ b/toolkit/content/tests/chrome/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = ../widgets/popup_shared.js ../widgets/tree_shared.js diff --git a/toolkit/content/tests/widgets/chrome.ini b/toolkit/content/tests/widgets/chrome.ini index e4934a7a1c..8792a342cf 100644 --- a/toolkit/content/tests/widgets/chrome.ini +++ b/toolkit/content/tests/widgets/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = tree_shared.js popup_shared.js diff --git a/toolkit/content/tests/widgets/mochitest.ini b/toolkit/content/tests/widgets/mochitest.ini index eb8214b86e..96d63eb6fd 100644 --- a/toolkit/content/tests/widgets/mochitest.ini +++ b/toolkit/content/tests/widgets/mochitest.ini @@ -28,6 +28,6 @@ skip-if = toolkit == 'android' #TIMED_OUT [test_videocontrols_audio.html] [test_videocontrols_audio_direction.html] [test_videocontrols_standalone.html] -skip-if = android_version == '10' # bug 1075573 +skip-if = android_version == '10' || android_version == '18' # bug 1075573 [test_videocontrols_video_direction.html] [test_bug898940.html] diff --git a/toolkit/devtools/server/tests/mochitest/chrome.ini b/toolkit/devtools/server/tests/mochitest/chrome.ini index bf7c2c9b8d..8d35c35331 100644 --- a/toolkit/devtools/server/tests/mochitest/chrome.ini +++ b/toolkit/devtools/server/tests/mochitest/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = Debugger.Source.prototype.element.js Debugger.Source.prototype.element-2.js diff --git a/toolkit/devtools/tests/mochitest/chrome.ini b/toolkit/devtools/tests/mochitest/chrome.ini index 81e6dfbde5..a85747f73b 100644 --- a/toolkit/devtools/tests/mochitest/chrome.ini +++ b/toolkit/devtools/tests/mochitest/chrome.ini @@ -1,3 +1,6 @@ +[DEFAULT] +skip-if = buildapp == 'b2g' + [test_eventemitter_basic.html] [test_devtools_extensions.html] -[test_loader_paths.html] +[test_loader_paths.html] \ No newline at end of file diff --git a/toolkit/identity/tests/chrome/chrome.ini b/toolkit/identity/tests/chrome/chrome.ini index 1beacb3d21..ff3759c21e 100644 --- a/toolkit/identity/tests/chrome/chrome.ini +++ b/toolkit/identity/tests/chrome/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = sandbox_content.html sandbox_content.sjs diff --git a/toolkit/modules/tests/chrome/chrome.ini b/toolkit/modules/tests/chrome/chrome.ini index a272309190..26bd2854c2 100644 --- a/toolkit/modules/tests/chrome/chrome.ini +++ b/toolkit/modules/tests/chrome/chrome.ini @@ -1,3 +1,4 @@ [DEFAULT] +skip-if = buildapp == 'b2g' [test_bug544442_checkCert.xul] diff --git a/toolkit/mozapps/downloads/tests/chrome/chrome.ini b/toolkit/mozapps/downloads/tests/chrome/chrome.ini index 66dc6a1fce..a675451fb3 100644 --- a/toolkit/mozapps/downloads/tests/chrome/chrome.ini +++ b/toolkit/mozapps/downloads/tests/chrome/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = unknownContentType_dialog_layout_data.pif unknownContentType_dialog_layout_data.pif^headers^ diff --git a/toolkit/mozapps/extensions/nsBlocklistService.js b/toolkit/mozapps/extensions/nsBlocklistService.js index 5f6d761475..837409edbd 100644 --- a/toolkit/mozapps/extensions/nsBlocklistService.js +++ b/toolkit/mozapps/extensions/nsBlocklistService.js @@ -754,6 +754,9 @@ Blocklist.prototype = { # # AkHVNA== # +# +# +# # # */ @@ -927,13 +930,27 @@ Blocklist.prototype = { _handleCertItemNode: function Blocklist_handleCertItemNode(blocklistElement, result) { let issuer = blocklistElement.getAttribute("issuerName"); - for (let snElement of blocklistElement.children) { + if (issuer) { + for (let snElement of blocklistElement.children) { + try { + gCertBlocklistService.revokeCertByIssuerAndSerial(issuer, snElement.textContent); + } catch (e) { + // we want to keep trying other elements since missing all items + // is worse than missing one + LOG("Blocklist::_handleCertItemNode: Error adding revoked cert by Issuer and Serial" + e); + } + } + return; + } + + let pubKeyHash = blocklistElement.getAttribute("pubKeyHash"); + let subject = blocklistElement.getAttribute("subject"); + + if (pubKeyHash && subject) { try { - gCertBlocklistService.addRevokedCert(issuer, snElement.textContent); + gCertBlocklistService.revokeCertBySubjectAndPubKey(subject, pubKeyHash); } catch (e) { - // we want to keep trying other elements since missing all items - // is worse than missing one - LOG("Blocklist::_handleCertItemNode: Error adding revoked cert " + e); + LOG("Blocklist::_handleCertItemNode: Error adding revoked cert by Subject and PubKey" + e); } } }, diff --git a/toolkit/mozapps/update/tests/chrome/chrome.ini b/toolkit/mozapps/update/tests/chrome/chrome.ini index f22f9ce5f2..2b1acb2411 100644 --- a/toolkit/mozapps/update/tests/chrome/chrome.ini +++ b/toolkit/mozapps/update/tests/chrome/chrome.ini @@ -3,7 +3,7 @@ ; file, You can obtain one at http://mozilla.org/MPL/2.0/. [DEFAULT] -skip-if = buildapp == 'mulet' +skip-if = (buildapp == 'b2g' || buildapp == 'mulet') support-files = utils.js update.sjs diff --git a/toolkit/profile/test/chrome.ini b/toolkit/profile/test/chrome.ini index e21c1022e8..666d80a880 100644 --- a/toolkit/profile/test/chrome.ini +++ b/toolkit/profile/test/chrome.ini @@ -1,3 +1,4 @@ [DEFAULT] +skip-if = buildapp == 'b2g' [test_create_profile.xul] diff --git a/toolkit/themes/osx/mochitests/chrome.ini b/toolkit/themes/osx/mochitests/chrome.ini index b7c425bc70..9c6ce58ced 100644 --- a/toolkit/themes/osx/mochitests/chrome.ini +++ b/toolkit/themes/osx/mochitests/chrome.ini @@ -1,3 +1,4 @@ [DEFAULT] +skip-if = buildapp == 'b2g' [test_bug510426.xul] diff --git a/widget/tests/chrome.ini b/widget/tests/chrome.ini index b9dd9c4c83..e65aa291c0 100644 --- a/widget/tests/chrome.ini +++ b/widget/tests/chrome.ini @@ -1,4 +1,5 @@ [DEFAULT] +skip-if = buildapp == 'b2g' support-files = empty_window.xul utils.js diff --git a/xpcom/glue/pldhash.cpp b/xpcom/glue/pldhash.cpp index 6c217096fc..376511584e 100644 --- a/xpcom/glue/pldhash.cpp +++ b/xpcom/glue/pldhash.cpp @@ -7,6 +7,7 @@ /* * Double hashing implementation. */ +#include #include #include #include @@ -38,7 +39,7 @@ * allowed (and therefore the level is 0 or 1, depending on whether they * incremented it). * - * Only Finish() needs to allow this special value. + * Only the destructor needs to allow this special value. */ #define IMMUTABLE_RECURSION_LEVEL UINT32_MAX @@ -132,21 +133,6 @@ PL_DHashClearEntryStub(PLDHashTable* aTable, PLDHashEntryHdr* aEntry) aTable->ClearEntryStub(aEntry); } -MOZ_ALWAYS_INLINE void -PLDHashTable::FreeStringKey(PLDHashEntryHdr* aEntry) -{ - const PLDHashEntryStub* stub = (const PLDHashEntryStub*)aEntry; - - free((void*)stub->key); - memset(aEntry, 0, mEntrySize); -} - -void -PL_DHashFreeStringKey(PLDHashTable* aTable, PLDHashEntryHdr* aEntry) -{ - aTable->FreeStringKey(aEntry); -} - static const PLDHashTableOps stub_ops = { PL_DHashVoidPtrKeyStub, PL_DHashMatchEntryStub, @@ -192,54 +178,64 @@ MinLoad(uint32_t aCapacity) return aCapacity >> 2; // == aCapacity * 0.25 } -static inline uint32_t -MinCapacity(uint32_t aLength) +// Compute the minimum capacity (and the Log2 of that capacity) for a table +// containing |aLength| elements while respecting the following contraints: +// - table must be at most 75% full; +// - capacity must be a power of two; +// - capacity cannot be too small. +static inline void +BestCapacity(uint32_t aLength, uint32_t* aCapacityOut, + uint32_t* aLog2CapacityOut) { - return (aLength * 4 + (3 - 1)) / 3; // == ceil(aLength * 4 / 3) + // Compute the smallest capacity allowing |aLength| elements to be inserted + // without rehashing. + uint32_t capacity = (aLength * 4 + (3 - 1)) / 3; // == ceil(aLength * 4 / 3) + if (capacity < PL_DHASH_MIN_CAPACITY) { + capacity = PL_DHASH_MIN_CAPACITY; + } + + // Round up capacity to next power-of-two. + uint32_t log2 = CeilingLog2(capacity); + capacity = 1u << log2; + MOZ_ASSERT(capacity <= PL_DHASH_MAX_CAPACITY); + + *aCapacityOut = capacity; + *aLog2CapacityOut = log2; } -MOZ_ALWAYS_INLINE void -PLDHashTable::Init(const PLDHashTableOps* aOps, - uint32_t aEntrySize, uint32_t aLength) +static MOZ_ALWAYS_INLINE uint32_t +HashShift(uint32_t aEntrySize, uint32_t aLength) { if (aLength > PL_DHASH_MAX_INITIAL_LENGTH) { MOZ_CRASH("Initial length is too large"); } - // Compute the smallest capacity allowing |aLength| elements to be inserted - // without rehashing. - uint32_t capacity = MinCapacity(aLength); - if (capacity < PL_DHASH_MIN_CAPACITY) { - capacity = PL_DHASH_MIN_CAPACITY; - } + uint32_t capacity, log2; + BestCapacity(aLength, &capacity, &log2); - int log2 = CeilingLog2(capacity); - - capacity = 1u << log2; - MOZ_ASSERT(capacity <= PL_DHASH_MAX_CAPACITY); - mOps = aOps; - mHashShift = PL_DHASH_BITS - log2; - mEntrySize = aEntrySize; - mEntryCount = mRemovedCount = 0; - mGeneration = 0; uint32_t nbytes; if (!SizeOfEntryStore(capacity, aEntrySize, &nbytes)) { MOZ_CRASH("Initial entry store size is too large"); } - mEntryStore = nullptr; - - METER(memset(&mStats, 0, sizeof(mStats))); - -#ifdef DEBUG - mRecursionLevel = 0; -#endif + // Compute the hashShift value. + return PL_DHASH_BITS - log2; } PLDHashTable::PLDHashTable(const PLDHashTableOps* aOps, uint32_t aEntrySize, uint32_t aLength) + : mOps(aOps) + , mHashShift(HashShift(aEntrySize, aLength)) + , mEntrySize(aEntrySize) + , mEntryCount(0) + , mRemovedCount(0) + , mGeneration(0) + , mEntryStore(nullptr) +#ifdef DEBUG + , mRecursionLevel(0) +#endif { - Init(aOps, aEntrySize, aLength); + METER(memset(&mStats, 0, sizeof(mStats))); } PLDHashTable& @@ -250,12 +246,18 @@ PLDHashTable::operator=(PLDHashTable&& aOther) } // Destruct |this|. - Finish(); + this->~PLDHashTable(); - // Move pieces over. - mOps = Move(aOther.mOps); + // |mOps| and |mEntrySize| are const so we can't assign them. Instead, we + // require that they are equal. The justification for this is that they're + // conceptually part of the type -- indeed, if PLDHashTable was a templated + // type like nsTHashtable, they *would* be part of the type -- so it only + // makes sense to assign in cases where they match. + MOZ_RELEASE_ASSERT(mOps == aOther.mOps); + MOZ_RELEASE_ASSERT(mEntrySize == aOther.mEntrySize); + + // Move non-const pieces over. mHashShift = Move(aOther.mHashShift); - mEntrySize = Move(aOther.mEntrySize); mEntryCount = Move(aOther.mEntryCount); mRemovedCount = Move(aOther.mRemovedCount); mGeneration = Move(aOther.mGeneration); @@ -313,8 +315,7 @@ PLDHashTable::EntryIsFree(PLDHashEntryHdr* aEntry) return aEntry->mKeyHash == 0; } -MOZ_ALWAYS_INLINE void -PLDHashTable::Finish() +PLDHashTable::~PLDHashTable() { if (!mEntryStore) { return; @@ -342,20 +343,15 @@ PLDHashTable::Finish() mEntryStore = nullptr; } -PLDHashTable::~PLDHashTable() -{ - Finish(); -} - void PLDHashTable::ClearAndPrepareForLength(uint32_t aLength) { - // Get these values before the call to Finish() clobbers them. + // Get these values before the destructor clobbers them. const PLDHashTableOps* ops = mOps; uint32_t entrySize = mEntrySize; - Finish(); - Init(ops, entrySize, aLength); + this->~PLDHashTable(); + new (this) PLDHashTable(ops, entrySize, aLength); } void @@ -494,13 +490,13 @@ PLDHashTable::FindFreeEntry(PLDHashNumber aKeyHash) } bool -PLDHashTable::ChangeTable(int aDeltaLog2) +PLDHashTable::ChangeTable(int32_t aDeltaLog2) { MOZ_ASSERT(mEntryStore); /* Look, but don't touch, until we succeed in getting new entry store. */ - int oldLog2 = PL_DHASH_BITS - mHashShift; - int newLog2 = oldLog2 + aDeltaLog2; + int32_t oldLog2 = PL_DHASH_BITS - mHashShift; + int32_t newLog2 = oldLog2 + aDeltaLog2; uint32_t newCapacity = 1u << newLog2; if (newCapacity > PL_DHASH_MAX_CAPACITY) { return false; @@ -591,7 +587,7 @@ PLDHashTable::Add(const void* aKey, const mozilla::fallible_t&) // Allocate the entry storage if it hasn't already been allocated. if (!mEntryStore) { uint32_t nbytes; - // We already checked this in Init(), so it must still be true. + // We already checked this in the constructor, so it must still be true. MOZ_RELEASE_ASSERT(SizeOfEntryStore(CapacityFromHashShift(), mEntrySize, &nbytes)); mEntryStore = (char*)malloc(nbytes); @@ -765,6 +761,27 @@ PL_DHashTableRawRemove(PLDHashTable* aTable, PLDHashEntryHdr* aEntry) aTable->RawRemove(aEntry); } +// Shrink or compress if a quarter or more of all entries are removed, or if the +// table is underloaded according to the minimum alpha, and is not minimal-size +// already. +void +PLDHashTable::ShrinkIfAppropriate() +{ + uint32_t capacity = Capacity(); + if (mRemovedCount >= capacity >> 2 || + (capacity > PL_DHASH_MIN_CAPACITY && mEntryCount <= MinLoad(capacity))) { + METER(mStats.mEnumShrinks++); + + uint32_t log2; + BestCapacity(mEntryCount, &capacity, &log2); + + int32_t deltaLog2 = log2 - (PL_DHASH_BITS - mHashShift); + MOZ_ASSERT(deltaLog2 <= 0); + + (void) ChangeTable(deltaLog2); + } +} + MOZ_ALWAYS_INLINE uint32_t PLDHashTable::Enumerate(PLDHashEnumerator aEtor, void* aArg) { @@ -779,7 +796,7 @@ PLDHashTable::Enumerate(PLDHashEnumerator aEtor, void* aArg) char* entryAddr = mEntryStore; uint32_t capacity = Capacity(); uint32_t tableSize = capacity * mEntrySize; - char* entryLimit = entryAddr + tableSize; + char* entryLimit = mEntryStore + tableSize; uint32_t i = 0; bool didRemove = false; @@ -788,9 +805,6 @@ PLDHashTable::Enumerate(PLDHashEnumerator aEtor, void* aArg) // even more chaotic to iterate in fully random order, but that's a lot // more work. entryAddr += ChaosMode::randomUint32LessThan(capacity) * mEntrySize; - if (entryAddr >= entryLimit) { - entryAddr -= tableSize; - } } for (uint32_t e = 0; e < capacity; ++e) { @@ -814,28 +828,11 @@ PLDHashTable::Enumerate(PLDHashEnumerator aEtor, void* aArg) MOZ_ASSERT(!didRemove || mRecursionLevel == 1); - /* - * Shrink or compress if a quarter or more of all entries are removed, or - * if the table is underloaded according to the minimum alpha, and is not - * minimal-size already. Do this only if we removed above, so non-removing - * enumerations can count on stable |mEntryStore| until the next - * Add, Remove, or removing-Enumerate. - */ - if (didRemove && - (mRemovedCount >= capacity >> 2 || - (capacity > PL_DHASH_MIN_CAPACITY && - mEntryCount <= MinLoad(capacity)))) { - METER(mStats.mEnumShrinks++); - capacity = mEntryCount; - capacity += capacity >> 1; - if (capacity < PL_DHASH_MIN_CAPACITY) { - capacity = PL_DHASH_MIN_CAPACITY; - } - - uint32_t ceiling = CeilingLog2(capacity); - ceiling -= PL_DHASH_BITS - mHashShift; - - (void) ChangeTable(ceiling); + // Shrink the table if appropriate. Do this only if we removed above, so + // non-removing enumerations can count on stable |mEntryStore| until the next + // Add, Remove, or removing-Enumerate. + if (didRemove) { + ShrinkIfAppropriate(); } DECREMENT_RECURSION_LEVEL(this); @@ -936,17 +933,12 @@ PLDHashTable::Iterator::Iterator(const PLDHashTable* aTable) // vary over the course of the for loop) are converted into mEntryOffset and // mEntryAddr, respectively. uint32_t capacity = mTable->Capacity(); - uint32_t tableSize = capacity * mTable->EntrySize(); - char* entryLimit = mEntryAddr + tableSize; - if (ChaosMode::isActive(ChaosMode::HashTableIteration)) { + if (ChaosMode::isActive(ChaosMode::HashTableIteration) && capacity > 0) { // Start iterating at a random point in the hashtable. It would be // even more chaotic to iterate in fully random order, but that's a lot // more work. mEntryAddr += ChaosMode::randomUint32LessThan(capacity) * mTable->mEntrySize; - if (mEntryAddr >= entryLimit) { - mEntryAddr -= tableSize; - } } } @@ -986,7 +978,7 @@ PLDHashTable::Iterator::NextEntry() // mEntryAddr, respectively. uint32_t capacity = mTable->Capacity(); uint32_t tableSize = capacity * mTable->mEntrySize; - char* entryLimit = mEntryAddr + tableSize; + char* entryLimit = mTable->mEntryStore + tableSize; // Strictly speaking, we don't need to iterate over the full capacity each // time. However, it is simpler to do so rather than unnecessarily track the diff --git a/xpcom/glue/pldhash.h b/xpcom/glue/pldhash.h index bacabacda2..ad51f92673 100644 --- a/xpcom/glue/pldhash.h +++ b/xpcom/glue/pldhash.h @@ -162,9 +162,9 @@ typedef size_t (*PLDHashSizeOfEntryExcludingThisFun)( class PLDHashTable { private: - const PLDHashTableOps* mOps; /* Virtual operations; see below. */ + const PLDHashTableOps* const mOps; /* Virtual operations; see below. */ int16_t mHashShift; /* multiplicative hash shift */ - uint32_t mEntrySize; /* number of bytes in an entry */ + const uint32_t mEntrySize; /* number of bytes in an entry */ uint32_t mEntryCount; /* number of entries in table */ uint32_t mRemovedCount; /* removed entry sentinels in table */ uint32_t mGeneration; /* entry storage generation number */ @@ -214,7 +214,12 @@ public: uint32_t aLength = PL_DHASH_DEFAULT_INITIAL_LENGTH); PLDHashTable(PLDHashTable&& aOther) - : mOps(nullptr) + // These two fields are |const|. Initialize them here because the + // move assignment operator cannot modify them. + : mOps(aOther.mOps) + , mEntrySize(aOther.mEntrySize) + // Initialize these two fields because they are required for a safe call + // to the destructor, which the move assignment operator does. , mEntryStore(nullptr) #ifdef DEBUG , mRecursionLevel(0) @@ -283,8 +288,6 @@ public: void ClearEntryStub(PLDHashEntryHdr* aEntry); - void FreeStringKey(PLDHashEntryHdr* aEntry); - #ifdef PL_DHASHMETER void DumpMeter(PLDHashEnumerator aDump, FILE* aFp); #endif @@ -322,9 +325,6 @@ private: PLDHashNumber ComputeKeyHash(const void* aKey); - void Init(const PLDHashTableOps* aOps, uint32_t aEntrySize, uint32_t aLength); - void Finish(); - enum SearchReason { ForSearchOrRemove, ForAdd }; template @@ -335,6 +335,8 @@ private: bool ChangeTable(int aDeltaLog2); + void ShrinkIfAppropriate(); + PLDHashTable(const PLDHashTable& aOther) = delete; PLDHashTable& operator=(const PLDHashTable& aOther) = delete; }; @@ -443,8 +445,6 @@ PL_DHashMoveEntryStub(PLDHashTable* aTable, void PL_DHashClearEntryStub(PLDHashTable* aTable, PLDHashEntryHdr* aEntry); -void PL_DHashFreeStringKey(PLDHashTable* aTable, PLDHashEntryHdr* aEntry); - /* * If you use PLDHashEntryStub or a subclass of it as your entry struct, and * if your entries move via memcpy and clear via memset(0), you can use these @@ -493,9 +493,7 @@ PL_DHashTableAdd(PLDHashTable* aTable, const void* aKey); * * PL_DHashTableRemove(table, key); * - * If key's entry is found, it is cleared (via table->mOps->clearEntry) and - * the entry is marked so that PL_DHASH_ENTRY_IS_FREE(entry). This operation - * returns null unconditionally; you should ignore its return value. + * If key's entry is found, it is cleared (via table->mOps->clearEntry). */ void PL_DHASH_FASTCALL PL_DHashTableRemove(PLDHashTable* aTable, const void* aKey); diff --git a/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp b/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp index 97640fd1dc..9536790bae 100644 --- a/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp +++ b/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp @@ -53,14 +53,12 @@ #include "nsIDOMHTMLAnchorElement.h" #include "nsIDOMHTMLAppletElement.h" #include "nsIDOMHTMLAreaElement.h" -#include "nsIDOMHTMLBRElement.h" #include "nsIDOMHTMLBaseElement.h" #include "nsIDOMHTMLBodyElement.h" #include "nsIDOMHTMLButtonElement.h" #include "nsIDOMHTMLCanvasElement.h" #include "nsIDOMHTMLCollection.h" #include "nsIDOMHTMLDirectoryElement.h" -#include "nsIDOMHTMLDivElement.h" #include "nsIDOMHTMLDocument.h" #include "nsIDOMHTMLElement.h" #include "nsIDOMHTMLEmbedElement.h" @@ -70,7 +68,6 @@ #include "nsIDOMHTMLFrameSetElement.h" #include "nsIDOMHTMLHRElement.h" #include "nsIDOMHTMLHeadElement.h" -#include "nsIDOMHTMLHeadingElement.h" #include "nsIDOMHTMLHtmlElement.h" #include "nsIDOMHTMLIFrameElement.h" #include "nsIDOMHTMLImageElement.h" @@ -95,11 +92,8 @@ #include "nsIDOMHTMLSelectElement.h" #include "nsIDOMHTMLSourceElement.h" #include "nsIDOMHTMLStyleElement.h" -#include "nsIDOMHTMLTableCaptionElem.h" #include "nsIDOMHTMLTableCellElement.h" -#include "nsIDOMHTMLTableElement.h" #include "nsIDOMHTMLTextAreaElement.h" -#include "nsIDOMHTMLTitleElement.h" #include "nsIDOMHTMLUListElement.h" #include "nsIDOMKeyEvent.h" #include "nsIDOMMediaError.h" @@ -193,14 +187,12 @@ #include "mozilla/dom/HTMLAnchorElementBinding.h" #include "mozilla/dom/HTMLAppletElementBinding.h" #include "mozilla/dom/HTMLAreaElementBinding.h" -#include "mozilla/dom/HTMLBRElementBinding.h" #include "mozilla/dom/HTMLBaseElementBinding.h" #include "mozilla/dom/HTMLBodyElementBinding.h" #include "mozilla/dom/HTMLButtonElementBinding.h" #include "mozilla/dom/HTMLCanvasElementBinding.h" #include "mozilla/dom/HTMLCollectionBinding.h" #include "mozilla/dom/HTMLDirectoryElementBinding.h" -#include "mozilla/dom/HTMLDivElementBinding.h" #include "mozilla/dom/HTMLDocumentBinding.h" #include "mozilla/dom/HTMLElementBinding.h" #include "mozilla/dom/HTMLEmbedElementBinding.h" @@ -210,7 +202,6 @@ #include "mozilla/dom/HTMLFrameSetElementBinding.h" #include "mozilla/dom/HTMLHRElementBinding.h" #include "mozilla/dom/HTMLHeadElementBinding.h" -#include "mozilla/dom/HTMLHeadingElementBinding.h" #include "mozilla/dom/HTMLHtmlElementBinding.h" #include "mozilla/dom/HTMLIFrameElementBinding.h" #include "mozilla/dom/HTMLImageElementBinding.h" @@ -235,11 +226,8 @@ #include "mozilla/dom/HTMLSelectElementBinding.h" #include "mozilla/dom/HTMLSourceElementBinding.h" #include "mozilla/dom/HTMLStyleElementBinding.h" -#include "mozilla/dom/HTMLTableCaptionElementBinding.h" #include "mozilla/dom/HTMLTableCellElementBinding.h" -#include "mozilla/dom/HTMLTableElementBinding.h" #include "mozilla/dom/HTMLTextAreaElementBinding.h" -#include "mozilla/dom/HTMLTitleElementBinding.h" #include "mozilla/dom/HTMLUListElementBinding.h" #include "mozilla/dom/KeyEventBinding.h" #include "mozilla/dom/ListBoxObjectBinding.h" @@ -386,14 +374,12 @@ const ComponentsInterfaceShimEntry kComponentsInterfaceShimMap[] = DEFINE_SHIM(HTMLAnchorElement), DEFINE_SHIM(HTMLAppletElement), DEFINE_SHIM(HTMLAreaElement), - DEFINE_SHIM(HTMLBRElement), DEFINE_SHIM(HTMLBaseElement), DEFINE_SHIM(HTMLBodyElement), DEFINE_SHIM(HTMLButtonElement), DEFINE_SHIM(HTMLCanvasElement), DEFINE_SHIM(HTMLCollection), DEFINE_SHIM(HTMLDirectoryElement), - DEFINE_SHIM(HTMLDivElement), DEFINE_SHIM(HTMLDocument), DEFINE_SHIM(HTMLElement), DEFINE_SHIM(HTMLEmbedElement), @@ -403,7 +389,6 @@ const ComponentsInterfaceShimEntry kComponentsInterfaceShimMap[] = DEFINE_SHIM(HTMLFrameSetElement), DEFINE_SHIM(HTMLHRElement), DEFINE_SHIM(HTMLHeadElement), - DEFINE_SHIM(HTMLHeadingElement), DEFINE_SHIM(HTMLHtmlElement), DEFINE_SHIM(HTMLIFrameElement), DEFINE_SHIM(HTMLImageElement), @@ -428,11 +413,8 @@ const ComponentsInterfaceShimEntry kComponentsInterfaceShimMap[] = DEFINE_SHIM(HTMLSelectElement), DEFINE_SHIM(HTMLSourceElement), DEFINE_SHIM(HTMLStyleElement), - DEFINE_SHIM(HTMLTableCaptionElement), DEFINE_SHIM(HTMLTableCellElement), - DEFINE_SHIM(HTMLTableElement), DEFINE_SHIM(HTMLTextAreaElement), - DEFINE_SHIM(HTMLTitleElement), DEFINE_SHIM(HTMLUListElement), DEFINE_SHIM(KeyEvent), DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIListBoxObject, ListBoxObject), diff --git a/xpfe/appshell/test/chrome.ini b/xpfe/appshell/test/chrome.ini index 049e527add..7b8193fe82 100644 --- a/xpfe/appshell/test/chrome.ini +++ b/xpfe/appshell/test/chrome.ini @@ -1,3 +1,4 @@ [DEFAULT] +skip-if = buildapp == 'b2g' [test_hiddenPrivateWindow.xul]