From bebec8fcb84dba6b684dfe1cc6c8a1e7741df374 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Tue, 14 Apr 2020 21:50:13 -0400 Subject: Bug 1321284 - Crash in nsCSSFrameConstructor::GetInsertionPrevSibling when trying to reframe native anonymous content * Make StyleChildrenIterator skip NAC generated by root element primary frame ancestors. * Add nsINode::GetFlattenedTreeParentNodeForStyle. * Add iterator class to find all restyle roots. NOTE: Parts 1, 2, and "4.2" Tag #1375 --- dom/base/nsContentUtils.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'dom/base/nsContentUtils.h') diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h index 64f7485cb..3f1a25504 100644 --- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h @@ -2742,6 +2742,16 @@ public: static bool AttemptLargeAllocationLoad(nsIHttpChannel* aChannel); + /** + * Appends all "document level" native anonymous content subtree roots for + * aDocument to aElements. Document level NAC subtrees are those created + * by ancestor frames of the document element's primary frame, such as + * the scrollbar elements created by the root scroll frame. + */ + static void AppendDocumentLevelNativeAnonymousContentTo( + nsIDocument* aDocument, + nsTArray& aElements); + /** * Detect whether a string is a (CSS) local-url. * https://drafts.csswg.org/css-values/#local-urls -- cgit v1.2.3 From 0d362ca50335d964a78dbba7e7d32574ee67899a Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 17 Apr 2020 05:01:17 -0400 Subject: Bug 1330843 - Allow JS to create NAC pseudo-elements Tag #1375 --- dom/base/nsContentUtils.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'dom/base/nsContentUtils.h') diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h index 3f1a25504..4ccc1aa25 100644 --- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h @@ -2762,6 +2762,12 @@ public: static bool IsWebComponentsEnabled() { return sIsWebComponentsEnabled; } + /** + * Walks up the tree from aElement until it finds an element that is + * not native anonymous content. aElement must be NAC itself. + */ + static Element* GetClosestNonNativeAnonymousAncestor(Element* aElement); + static bool IsCustomElementsEnabled() { return sIsCustomElementsEnabled; } -- cgit v1.2.3 From 70c8ff8e5af7d2661b64fb92a158f2860af7766c Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 17 Apr 2020 06:10:23 -0400 Subject: Bug 1377978 - Make nsRange use uint32_t to offset Tag #1375 --- dom/base/nsContentUtils.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'dom/base/nsContentUtils.h') diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h index 4ccc1aa25..c34f7e102 100644 --- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h @@ -339,6 +339,13 @@ public: * NOTE! If the two nodes aren't in the same connected subtree, * the result is 1, and the optional aDisconnected parameter * is set to true. + * + * XXX aOffset1 and aOffset2 should be uint32_t since valid offset value is + * between 0 - UINT32_MAX. However, these methods work even with + * negative offset values! E.g., when aOffset1 is -1 and aOffset is 0, + * these methods return -1. Some root callers depend on this behavior. + * On the other hand, nsINode can have ATTRCHILD_ARRAY_MAX_CHILD_COUN + * (0x3FFFFF) at most. Therefore, they can be int32_t for now. */ static int32_t ComparePoints(nsINode* aParent1, int32_t aOffset1, nsINode* aParent2, int32_t aOffset2, -- cgit v1.2.3 From 5524318fe73a1123da10491a6a545b50af88ea60 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 17 Apr 2020 07:07:09 -0400 Subject: Bug 1416999 - Remove document.registerElement Tag #1375 --- dom/base/nsContentUtils.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'dom/base/nsContentUtils.h') diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h index c34f7e102..fe076f0dc 100644 --- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h @@ -589,7 +589,7 @@ public: /** * Returns true if |aName| is a valid name to be registered via - * document.registerElement. + * customElements.define. */ static bool IsCustomElementName(nsIAtom* aName); @@ -2742,11 +2742,6 @@ public: mozilla::dom::LifecycleAdoptedCallbackArgs* aAdoptedCallbackArgs = nullptr, mozilla::dom::CustomElementDefinition* aDefinition = nullptr); - static void GetCustomPrototype(nsIDocument* aDoc, - int32_t aNamespaceID, - nsIAtom* aAtom, - JS::MutableHandle prototype); - static bool AttemptLargeAllocationLoad(nsIHttpChannel* aChannel); /** -- cgit v1.2.3 From b93fb57514781ea406fb152cf46b502cffd272ff Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 17 Apr 2020 07:36:25 -0400 Subject: Bug 1426536 - Remove nsContentUtils::IsContentInsertionPoint Tag #1375 --- dom/base/nsContentUtils.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'dom/base/nsContentUtils.h') diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h index fe076f0dc..b58b0e0e3 100644 --- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h @@ -2414,18 +2414,6 @@ public: */ static mozilla::LogModule* DOMDumpLog(); - /** - * Returns whether a content is an insertion point for XBL - * bindings or web components ShadowRoot. In web components, - * this corresponds to a element that participates - * in node distribution. In XBL this corresponds to an - * element in anonymous content. - * - * @param aContent The content to test for being an insertion point. - */ - static bool IsContentInsertionPoint(nsIContent* aContent); - - /** * Returns whether the children of the provided content are * nodes that are distributed to Shadow DOM insertion points. -- cgit v1.2.3