summaryrefslogtreecommitdiffstats
path: root/dom/base/nsINode.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /dom/base/nsINode.h
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/base/nsINode.h')
-rw-r--r--dom/base/nsINode.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/dom/base/nsINode.h b/dom/base/nsINode.h
index 3a47992cc8..d2a2fd008d 100644
--- a/dom/base/nsINode.h
+++ b/dom/base/nsINode.h
@@ -1099,7 +1099,7 @@ class nsINode : public mozilla::dom::EventTarget {
: nullptr;
}
- enum FlattenedParentType { eNotForStyle, eForStyle };
+ enum FlattenedParentType { eNormal, eForStyle, eForSelection };
/**
* Returns the node that is the parent of this node in the flattened
@@ -1121,6 +1121,15 @@ class nsINode : public mozilla::dom::EventTarget {
*/
inline nsINode* GetFlattenedTreeParentNodeForStyle() const;
+ /**
+ * Similar to GetFlattenedTreeParentNode, it does two things differently
+ * 1. For contents that are not in the flattened tree, use its
+ * parent rather than nullptr.
+ * 2. For contents that are slotted into a UA shadow tree, use its
+ * parent rather than the slot element.
+ */
+ inline nsIContent* GetFlattenedTreeParentNodeForSelection() const;
+
inline mozilla::dom::Element* GetFlattenedTreeParentElement() const;
inline mozilla::dom::Element* GetFlattenedTreeParentElementForStyle() const;
@@ -1629,7 +1638,7 @@ class nsINode : public mozilla::dom::EventTarget {
* not in same subtree, this returns the root content of the closeset subtree.
*/
MOZ_CAN_RUN_SCRIPT nsIContent* GetSelectionRootContent(
- mozilla::PresShell* aPresShell);
+ mozilla::PresShell* aPresShell, bool aAllowCrossShadowBoundary = false);
nsINodeList* ChildNodes();
@@ -2074,6 +2083,14 @@ class nsINode : public mozilla::dom::EventTarget {
ClearBoolFlag(ElementCreatedFromPrototypeAndHasUnmodifiedL10n);
}
+ mozilla::dom::ShadowRoot* GetShadowRoot() const;
+
+ // Return the shadow root of the node if it is a shadow host and
+ // it meets the requirements for being a shadow host of a selection.
+ // For example, <details>, <video> and <use> elements are not valid
+ // shadow host for selection.
+ mozilla::dom::ShadowRoot* GetShadowRootForSelection() const;
+
protected:
void SetParentIsContent(bool aValue) { SetBoolFlag(ParentIsContent, aValue); }
void SetIsInDocument() { SetBoolFlag(IsInDocument); }