☠☠ backed out by c6e6de08c7cd ☠ ☠ | |
author | Ehsan Akhgari <ehsan@mozilla.com> |
Mon, 08 Jul 2019 18:49:45 +0000 | |
changeset 542400 | 4bacb947e99138de31dafa9dc27e20a045d7f2cc |
parent 542399 | 598f42e27dfcb42785e3a269f2a9284c18c24195 |
child 542401 | aa07814cd7c4058bb500189dc4eb945512910a52 |
push id | 11848 |
push user | ffxbld-merge |
push date | Mon, 26 Aug 2019 19:26:25 +0000 |
treeherder | mozilla-beta@9b31bfdfac10 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | farre |
bugs | 1558571 |
milestone | 70.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp @@ -86,16 +86,17 @@ #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/ContentChild.h" #include "mozilla/dom/CSPDictionariesBinding.h" #include "mozilla/dom/Element.h" #include "mozilla/dom/Event.h" #include "mozilla/dom/FeaturePolicy.h" #include "mozilla/dom/FeaturePolicyUtils.h" #include "mozilla/dom/FramingChecker.h" +#include "mozilla/dom/HTMLAllCollection.h" #include "mozilla/dom/HTMLSharedElement.h" #include "mozilla/dom/Navigator.h" #include "mozilla/dom/Performance.h" #include "mozilla/dom/TreeOrderedArrayInlines.h" #include "mozilla/dom/ResizeObserver.h" #include "mozilla/dom/ResizeObserverController.h" #include "mozilla/dom/ServiceWorkerContainer.h" #include "mozilla/dom/ScriptLoader.h" @@ -1998,16 +1999,17 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_ NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mApplets); NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAnchors); NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAnonymousContents) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCommandDispatcher) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mFeaturePolicy) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSuppressedEventListener) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPrototypeDocument) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMidasCommandManager) + NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAll) // Traverse all our nsCOMArrays. NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPreloadingImages) for (uint32_t i = 0; i < tmp->mFrameRequestCallbacks.Length(); ++i) { NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mFrameRequestCallbacks[i]"); cb.NoteXPCOMChild(tmp->mFrameRequestCallbacks[i].mCallback); } @@ -5626,16 +5628,23 @@ void Document::SetFgColor(const nsAStrin body->SetText(aFgColor); } } void Document::CaptureEvents() { WarnOnceAbout(Document::eUseOfCaptureEvents); } void Document::ReleaseEvents() { WarnOnceAbout(Document::eUseOfReleaseEvents); } +HTMLAllCollection* Document::All() { + if (!mAll) { + mAll = new HTMLAllCollection(this); + } + return mAll; +} + nsresult Document::GetSrcdocData(nsAString& aSrcdocData) { if (mIsSrcdocDocument) { nsCOMPtr<nsIInputStreamChannel> inStrmChan = do_QueryInterface(mChannel); if (inStrmChan) { return inStrmChan->GetSrcdocData(aSrcdocData); } } aSrcdocData = VoidString();
--- a/dom/base/Document.h +++ b/dom/base/Document.h @@ -180,16 +180,17 @@ class DOMStringList; class Element; struct ElementCreationOptions; class Event; class EventTarget; class FeaturePolicy; class FontFaceSet; class FrameRequestCallback; class ImageTracker; +class HTMLAllCollection; class HTMLBodyElement; class HTMLSharedElement; class HTMLImageElement; struct LifecycleCallbackArgs; class Link; class Location; class MediaQueryList; class GlobalObject; @@ -3574,16 +3575,18 @@ class Document : public nsINode, void GetBgColor(nsAString& aBgColor); void SetBgColor(const nsAString& aBgColor); void Clear() const { // Deprecated } void CaptureEvents(); void ReleaseEvents(); + mozilla::dom::HTMLAllCollection* All(); + static bool IsUnprefixedFullscreenEnabled(JSContext* aCx, JSObject* aObject); static bool DocumentSupportsL10n(JSContext* aCx, JSObject* aObject); static bool IsWebAnimationsEnabled(JSContext* aCx, JSObject* aObject); static bool IsWebAnimationsEnabled(CallerType aCallerType); static bool IsWebAnimationsGetAnimationsEnabled(JSContext* aCx, JSObject* aObject); static bool AreWebAnimationsImplicitKeyframesEnabled(JSContext* aCx, JSObject* aObject); @@ -5203,16 +5206,18 @@ class Document : public nsINode, uint32_t mIgnoreOpensDuringUnloadCounter; nsCOMPtr<nsIDOMXULCommandDispatcher> mCommandDispatcher; // [OWNER] of the focus tracker RefPtr<XULBroadcastManager> mXULBroadcastManager; RefPtr<XULPersist> mXULPersist; + RefPtr<mozilla::dom::HTMLAllCollection> mAll; + // document lightweight theme for use with :-moz-lwtheme, // :-moz-lwtheme-brighttext and :-moz-lwtheme-darktext DocumentTheme mDocLWTheme; // Pres shell resolution saved before entering fullscreen mode. float mSavedResolution; bool mPendingInitialTranslation;
--- a/dom/html/HTMLAllCollection.cpp +++ b/dom/html/HTMLAllCollection.cpp @@ -3,23 +3,25 @@ /* 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 "mozilla/dom/HTMLAllCollection.h" #include "mozilla/dom/HTMLAllCollectionBinding.h" #include "mozilla/dom/Nullable.h" +#include "mozilla/dom/Document.h" #include "mozilla/dom/Element.h" -#include "nsHTMLDocument.h" +#include "nsContentList.h" +#include "nsGenericHTMLElement.h" namespace mozilla { namespace dom { -HTMLAllCollection::HTMLAllCollection(nsHTMLDocument* aDocument) +HTMLAllCollection::HTMLAllCollection(mozilla::dom::Document* aDocument) : mDocument(aDocument) { MOZ_ASSERT(mDocument); } HTMLAllCollection::~HTMLAllCollection() {} NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(HTMLAllCollection, mDocument, mCollection, mNamedMap)
--- a/dom/html/HTMLAllCollection.h +++ b/dom/html/HTMLAllCollection.h @@ -10,34 +10,34 @@ #include "nsCycleCollectionParticipant.h" #include "nsISupportsImpl.h" #include "nsRefPtrHashtable.h" #include "nsWrapperCache.h" #include <stdint.h> class nsContentList; -class nsHTMLDocument; class nsINode; namespace mozilla { namespace dom { +class Document; class Element; class OwningHTMLCollectionOrElement; template <typename> struct Nullable; template <typename> class Optional; class HTMLAllCollection final : public nsISupports, public nsWrapperCache { ~HTMLAllCollection(); public: - explicit HTMLAllCollection(nsHTMLDocument* aDocument); + explicit HTMLAllCollection(mozilla::dom::Document* aDocument); NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(HTMLAllCollection) virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; nsINode* GetParentObject() const; @@ -75,17 +75,17 @@ class HTMLAllCollection final : public n */ nsContentList* GetDocumentAllList(const nsAString& aID); /** * Helper for indexed getter and spec Item() method. */ Element* Item(uint32_t aIndex); - RefPtr<nsHTMLDocument> mDocument; + RefPtr<mozilla::dom::Document> mDocument; RefPtr<nsContentList> mCollection; nsRefPtrHashtable<nsStringHashKey, nsContentList> mNamedMap; }; } // namespace dom } // namespace mozilla #endif // mozilla_dom_HTMLAllCollection_h
--- a/dom/html/nsHTMLDocument.cpp +++ b/dom/html/nsHTMLDocument.cpp @@ -4,17 +4,16 @@ * 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 "nsHTMLDocument.h" #include "nsIContentPolicy.h" #include "mozilla/DebugOnly.h" #include "mozilla/PresShell.h" -#include "mozilla/dom/HTMLAllCollection.h" #include "nsCommandManager.h" #include "nsCOMPtr.h" #include "nsGlobalWindow.h" #include "nsString.h" #include "nsPrintfCString.h" #include "nsReadableUtils.h" #include "nsUnicharUtils.h" #include "nsIContentSecurityPolicy.h" @@ -153,20 +152,16 @@ nsHTMLDocument::nsHTMLDocument() mIsPlainText(false) { mType = eHTML; mDefaultElementType = kNameSpaceID_XHTML; mCompatMode = eCompatibility_NavQuirks; } nsHTMLDocument::~nsHTMLDocument() {} -NS_IMPL_CYCLE_COLLECTION_INHERITED(nsHTMLDocument, Document, mAll) - -NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED_0(nsHTMLDocument, Document) - JSObject* nsHTMLDocument::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) { return HTMLDocument_Binding::Wrap(aCx, this, aGivenProto); } nsresult nsHTMLDocument::Init() { nsresult rv = Document::Init(); NS_ENSURE_SUCCESS(rv, rv); @@ -775,23 +770,16 @@ void nsHTMLDocument::GetSupportedNames(n // forms related stuff bool nsHTMLDocument::MatchFormControls(Element* aElement, int32_t aNamespaceID, nsAtom* aAtom, void* aData) { return aElement->IsNodeOfType(nsIContent::eHTML_FORM_CONTROL); } -HTMLAllCollection* nsHTMLDocument::All() { - if (!mAll) { - mAll = new HTMLAllCollection(this); - } - return mAll; -} - nsresult nsHTMLDocument::Clone(dom::NodeInfo* aNodeInfo, nsINode** aResult) const { NS_ASSERTION(aNodeInfo->NodeInfoManager() == mNodeInfoManager, "Can't import this document into another document!"); RefPtr<nsHTMLDocument> clone = new nsHTMLDocument(); nsresult rv = CloneDocHelper(clone.get()); NS_ENSURE_SUCCESS(rv, rv);
--- a/dom/html/nsHTMLDocument.h +++ b/dom/html/nsHTMLDocument.h @@ -22,17 +22,16 @@ class nsCommandManager; class nsIURI; class nsIDocShell; class nsICachingChannel; class nsILoadGroup; namespace mozilla { namespace dom { -class HTMLAllCollection; template <typename T> struct Nullable; class WindowProxyHolder; } // namespace dom } // namespace mozilla class nsHTMLDocument : public mozilla::dom::Document { protected: @@ -44,19 +43,16 @@ class nsHTMLDocument : public mozilla::d public: using Document::GetPlugins; using Document::SetDocumentURI; nsHTMLDocument(); virtual nsresult Init() override; - NS_DECL_ISUPPORTS_INHERITED - NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsHTMLDocument, Document) - // Document virtual void Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup) override; virtual void ResetToURI(nsIURI* aURI, nsILoadGroup* aLoadGroup, nsIPrincipal* aPrincipal, nsIPrincipal* aStoragePrincipal) override; virtual nsresult StartDocumentLoad(const char* aCommand, nsIChannel* aChannel, nsILoadGroup* aLoadGroup, @@ -68,18 +64,16 @@ class nsHTMLDocument : public mozilla::d protected: virtual bool UseWidthDeviceWidthFallbackViewport() const override; public: virtual Element* GetUnfocusedKeyEventTarget() override; nsContentList* GetExistingForms() const { return mForms; } - mozilla::dom::HTMLAllCollection* All(); - // Returns whether an object was found for aName. bool ResolveName(JSContext* aCx, const nsAString& aName, JS::MutableHandle<JS::Value> aRetval, mozilla::ErrorResult& aError); /** * Called when form->BindToTree() is called so that document knows * immediately when a form is added @@ -167,18 +161,16 @@ class nsHTMLDocument : public mozilla::d RefPtr<nsHTMLDocument> mDocument; RefPtr<nsContentList> mFormList; RefPtr<nsContentList> mFormControlList; }; friend class ContentListHolder; ContentListHolder* mContentListHolder; - RefPtr<mozilla::dom::HTMLAllCollection> mAll; - /** # of forms in the document, synchronously set */ int32_t mNumForms; static void TryHintCharset(nsIContentViewer* aContentViewer, int32_t& aCharsetSource, NotNull<const Encoding*>& aEncoding); void TryUserForcedCharset(nsIContentViewer* aCv, nsIDocShell* aDocShell, int32_t& aCharsetSource,
--- a/dom/webidl/Document.webidl +++ b/dom/webidl/Document.webidl @@ -271,17 +271,17 @@ partial interface Document { void clear(); // @deprecated These are old Netscape 4 methods. Do not use, // the implementation is no-op. // XXXbz do we actually need these anymore? void captureEvents(); void releaseEvents(); - //(HTML only)[SameObject] readonly attribute HTMLAllCollection all; + [SameObject] readonly attribute HTMLAllCollection all; }; // https://fullscreen.spec.whatwg.org/#api partial interface Document { // Note: Per spec the 'S' in these two is lowercase, but the "Moz" // versions have it uppercase. [LenientSetter, Unscopable, Func="Document::IsUnprefixedFullscreenEnabled"] readonly attribute boolean fullscreen;
--- a/dom/webidl/HTMLDocument.webidl +++ b/dom/webidl/HTMLDocument.webidl @@ -4,18 +4,16 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ [OverrideBuiltins] interface HTMLDocument : Document { // DOM tree accessors [Throws] getter object (DOMString name); - - readonly attribute HTMLAllCollection all; }; partial interface HTMLDocument { /* * Number of nodes that have been blocked by the Safebrowsing API to prevent * tracking, cryptomining and so on. This method is for testing only. */ [ChromeOnly, Pure]
--- a/testing/web-platform/meta/html/dom/interfaces.https.html.ini +++ b/testing/web-platform/meta/html/dom/interfaces.https.html.ini @@ -1,13 +1,10 @@ prefs: [dom.security.featurePolicy.enabled:true] [interfaces.https.html?include=(Document|Window)] - [Document interface: attribute all] - expected: FAIL - [Document interface: attribute oncancel] expected: FAIL [Document interface: attribute onsecuritypolicyviolation] expected: FAIL [Document interface: iframe.contentDocument must inherit property "defaultView" with the proper type] expected: FAIL @@ -25,19 +22,16 @@ prefs: [dom.security.featurePolicy.enabl expected: FAIL [Document interface: new Document() must inherit property "oncancel" with the proper type] expected: FAIL [Document interface: new Document() must inherit property "onsecuritypolicyviolation" with the proper type] expected: FAIL - [Document interface: document.implementation.createDocument(null, "", null) must inherit property "all" with the proper type] - expected: FAIL - [Document interface: document.implementation.createDocument(null, "", null) must inherit property "oncancel" with the proper type] expected: FAIL [Document interface: document.implementation.createDocument(null, "", null) must inherit property "onsecuritypolicyviolation" with the proper type] expected: FAIL [Window interface: attribute oncancel] expected: FAIL