summaryrefslogtreecommitdiffstats
path: root/dom/base/nsIContent.h
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-01-19 08:08:18 +0000
committerMoonchild <moonchild@palemoon.org>2021-01-19 08:08:18 +0000
commitc76214f0b54cf74b69d0fb4afa0d2eca2e898a98 (patch)
tree15ee2e9776727ecabcdc52d06de55dfd576485c1 /dom/base/nsIContent.h
parent810c2bf8080da2bc8ec4efb05223fea31817944b (diff)
parent75286e68d703b1d8a4e0a7c72ce45d089024c124 (diff)
downloadUXP-c76214f0b54cf74b69d0fb4afa0d2eca2e898a98.tar
UXP-c76214f0b54cf74b69d0fb4afa0d2eca2e898a98.tar.gz
UXP-c76214f0b54cf74b69d0fb4afa0d2eca2e898a98.tar.lz
UXP-c76214f0b54cf74b69d0fb4afa0d2eca2e898a98.tar.xz
UXP-c76214f0b54cf74b69d0fb4afa0d2eca2e898a98.zip
Master merge
This merges master into release to replace Redwood. # Conflicts: # CLOBBER # build/moz.configure/old.configure # config/milestone.txt # config/moz.build # config/system-headers # dom/abort/AbortController.cpp # dom/abort/AbortController.h # dom/abort/AbortSignal.cpp # dom/abort/AbortSignal.h # dom/abort/moz.build # dom/abort/tests/moz.build # dom/animation/KeyframeEffect.cpp # dom/base/CustomElementRegistry.cpp # dom/base/DocGroup.cpp # dom/base/ResizeObserverController.cpp # dom/base/ResizeObserverController.h # dom/base/nsContentUtils.cpp # dom/base/nsContentUtils.h # dom/base/nsDocument.cpp # dom/base/nsIDocument.h # dom/fetch/FetchObserver.cpp # dom/fetch/FetchObserver.h # dom/heapsnapshot/AutoMemMap.cpp # dom/heapsnapshot/AutoMemMap.h # dom/heapsnapshot/CoreDump.proto # dom/heapsnapshot/HeapSnapshot.cpp # dom/heapsnapshot/HeapSnapshotTempFileHelperChild.h # dom/heapsnapshot/HeapSnapshotTempFileHelperParent.cpp # dom/heapsnapshot/HeapSnapshotTempFileHelperParent.h # dom/heapsnapshot/PHeapSnapshotTempFileHelper.ipdl # dom/heapsnapshot/moz.build # dom/heapsnapshot/tests/gtest/moz.build # dom/html/nsGenericHTMLElement.h # dom/media/platforms/PlatformDecoderModule.h # dom/media/platforms/moz.build # dom/script/ModuleLoadRequest.cpp # dom/script/ModuleLoadRequest.h # dom/script/ModuleScript.cpp # dom/script/ModuleScript.h # dom/script/ScriptElement.cpp # dom/script/ScriptElement.h # dom/script/ScriptLoadHandler.cpp # dom/script/ScriptLoadHandler.h # dom/script/ScriptLoader.cpp # dom/script/ScriptLoader.h # dom/script/ScriptSettings.cpp # dom/script/ScriptSettings.h # dom/script/nsIScriptElement.h # dom/script/nsIScriptLoaderObserver.idl # dom/webidl/HTMLLinkElement.webidl # gfx/gl/moz.build # gfx/graphite2/src/moz.build # gfx/layers/moz.build # js/ductwork/inspector/moz.build # js/ductwork/moz.build # js/src/gc/Heap.h # js/src/moz.build # js/src/vm/UnboxedObject-inl.h # js/src/vm/UnboxedObject.cpp # js/src/vm/UnboxedObject.h # layout/base/crashtests/crashtests.list # layout/build/moz.build # layout/generic/AspectRatio.h # layout/generic/crashtests/crashtests.list # layout/reftests/bidi/reftest-stylo.list # layout/reftests/reftest-stylo.list # layout/reftests/table-bordercollapse/reftest.list # layout/reftests/writing-mode/reftest-stylo.list # layout/style/StyleSheet.cpp # layout/style/nsRuleNode.cpp # layout/style/nsStyleStruct.cpp # layout/style/nsStyleStruct.h # modules/libpref/init/all.js # nsprpub/pr/src/linking/prlink.c # parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/AttributeName.java # parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/ElementName.java # parser/html/nsHtml5AtomList.h # parser/html/nsHtml5AttributeName.cpp # parser/html/nsHtml5AttributeName.h # parser/html/nsHtml5ElementName.cpp # parser/html/nsHtml5ElementName.h # parser/html/nsHtml5TreeBuilderCppSupplement.h # parser/htmlparser/nsElementTable.cpp # parser/htmlparser/nsHTMLTagList.h # security/nss/lib/nss/nss.h # security/nss/lib/softoken/pkcs11.c # security/nss/lib/softoken/softkver.h # security/nss/lib/util/nssutil.h # testing/web-platform/tests/tools/html5lib/html5lib/html5parser.py # testing/web-platform/tests/tools/html5lib/html5lib/treebuilders/_base.py # toolkit/modules/AppConstants.jsm
Diffstat (limited to 'dom/base/nsIContent.h')
-rw-r--r--dom/base/nsIContent.h94
1 files changed, 61 insertions, 33 deletions
diff --git a/dom/base/nsIContent.h b/dom/base/nsIContent.h
index 405090865..4d7d76e25 100644
--- a/dom/base/nsIContent.h
+++ b/dom/base/nsIContent.h
@@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */
@@ -26,7 +25,7 @@ namespace mozilla {
class EventChainPreVisitor;
namespace dom {
class ShadowRoot;
-struct CustomElementData;
+class HTMLSlotElement;
} // namespace dom
namespace widget {
struct IMEState;
@@ -145,7 +144,14 @@ public:
* Skip native anonymous content created for placeholder of HTML input,
* used in conjunction with eAllChildren or eAllButXBL.
*/
- eSkipPlaceholderContent = 2
+ eSkipPlaceholderContent = 2,
+
+ /**
+ * Skip native anonymous content created by ancestor frames of the root
+ * element's primary frame, such as scrollbar elements created by the root
+ * scroll frame.
+ */
+ eSkipDocumentLevelNativeAnonymousContent = 4,
};
/**
@@ -187,7 +193,7 @@ public:
void SetIsNativeAnonymousRoot()
{
SetFlags(NODE_IS_ANONYMOUS_ROOT | NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE |
- NODE_IS_NATIVE_ANONYMOUS_ROOT);
+ NODE_IS_NATIVE_ANONYMOUS_ROOT | NODE_IS_NATIVE_ANONYMOUS);
}
/**
@@ -690,18 +696,35 @@ public:
virtual mozilla::dom::ShadowRoot *GetContainingShadow() const = 0;
/**
- * Gets an array of destination insertion points where this content
- * is distributed by web component distribution algorithms.
- * The array is created if it does not already exist.
+ * Gets the shadow host if this content is in a shadow tree. That is, the host
+ * of |GetContainingShadow|, if its not null.
+ *
+ * @return The shadow host, if this is in shadow tree, or null.
*/
- virtual nsTArray<nsIContent*> &DestInsertionPoints() = 0;
+ nsIContent* GetContainingShadowHost() const;
/**
- * Same as DestInsertionPoints except that this method will return
- * null if the array of destination insertion points does not already
- * exist.
+ * Gets the assigned slot associated with this content.
+ *
+ * @return The assigned slot element or null.
+ */
+ virtual mozilla::dom::HTMLSlotElement* GetAssignedSlot() const = 0;
+
+ /**
+ * Sets the assigned slot associated with this content.
+ *
+ * @param aSlot The assigned slot.
*/
- virtual nsTArray<nsIContent*> *GetExistingDestInsertionPoints() const = 0;
+ virtual void SetAssignedSlot(mozilla::dom::HTMLSlotElement* aSlot) = 0;
+
+ /**
+ * Gets the assigned slot associated with this content based on parent's
+ * shadow root mode. Returns null if parent's shadow root is "closed".
+ * https://dom.spec.whatwg.org/#dom-slotable-assignedslot
+ *
+ * @return The assigned slot element or null.
+ */
+ mozilla::dom::HTMLSlotElement* GetAssignedSlotByMode() const;
/**
* Gets the insertion parent element of the XBL binding.
@@ -724,26 +747,9 @@ public:
*/
inline nsIContent *GetFlattenedTreeParent() const;
- /**
- * Helper method, which we leave public so that it's accessible from nsINode.
- */
- nsINode *GetFlattenedTreeParentNodeInternal() const;
-
- /**
- * Gets the custom element data used by web components custom element.
- * Custom element data is created at the first attempt to enqueue a callback.
- *
- * @return The custom element data or null if none.
- */
- virtual mozilla::dom::CustomElementData *GetCustomElementData() const = 0;
-
- /**
- * Sets the custom element data, ownership of the
- * callback data is taken by this content.
- *
- * @param aCallbackData The custom element data.
- */
- virtual void SetCustomElementData(mozilla::dom::CustomElementData* aData) = 0;
+ // Helper method, which we leave public so that it's accessible from nsINode.
+ enum FlattenedParentType { eNotForStyle, eForStyle };
+ nsINode* GetFlattenedTreeParentNodeInternal(FlattenedParentType aType) const;
/**
* API to check if this is a link that's traversed in response to user input
@@ -961,10 +967,18 @@ public:
return false;
}
+ // Returns true if this element is native-anonymous scrollbar content.
+ bool IsNativeScrollbarContent() const {
+ return IsNativeAnonymous() &&
+ IsAnyOfXULElements(nsGkAtoms::scrollbar,
+ nsGkAtoms::resizer,
+ nsGkAtoms::scrollcorner);
+ }
+
// Overloaded from nsINode
virtual already_AddRefed<nsIURI> GetBaseURI(bool aTryUseXHRDocBaseURI = false) const override;
- virtual nsresult PreHandleEvent(
+ virtual nsresult GetEventTargetParent(
mozilla::EventChainPreVisitor& aVisitor) override;
virtual bool IsPurple() = 0;
@@ -978,6 +992,12 @@ protected:
*/
nsIAtom* DoGetID() const;
+ /**
+ * Returns the assigned slot, if it exists, or the direct parent, if it's a
+ * fallback content of a slot.
+ */
+ nsINode* GetFlattenedTreeParentForMaybeAssignedNode() const;
+
public:
#ifdef DEBUG
/**
@@ -1031,9 +1051,17 @@ inline nsIContent* nsINode::AsContent()
{ \
return aContent->_check ? static_cast<_class*>(aContent) : nullptr; \
} \
+ static const _class* FromContent(const nsIContent* aContent) \
+ { \
+ return aContent->_check ? static_cast<const _class*>(aContent) : nullptr; \
+ } \
static _class* FromContentOrNull(nsIContent* aContent) \
{ \
return aContent ? FromContent(aContent) : nullptr; \
+ } \
+ static const _class* FromContentOrNull(const nsIContent* aContent) \
+ { \
+ return aContent ? FromContent(aContent) : nullptr; \
}
#define NS_IMPL_FROMCONTENT(_class, _nsid) \