summaryrefslogtreecommitdiffstats
path: root/dom/base/StaticRange.h
diff options
context:
space:
mode:
Diffstat (limited to 'dom/base/StaticRange.h')
-rw-r--r--dom/base/StaticRange.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/dom/base/StaticRange.h b/dom/base/StaticRange.h
index a6f677130d..af7054f843 100644
--- a/dom/base/StaticRange.h
+++ b/dom/base/StaticRange.h
@@ -8,6 +8,7 @@
#define mozilla_dom_StaticRange_h
#include "mozilla/RangeBoundary.h"
+#include "mozilla/RangeUtils.h"
#include "mozilla/dom/AbstractRange.h"
#include "mozilla/dom/StaticRangeBinding.h"
#include "nsTArray.h"
@@ -70,6 +71,21 @@ class StaticRange final : public AbstractRange {
*/
bool IsValid() const;
+ void NotifyNodeBecomesShadowHost(nsINode* aNode) {
+ if (aNode == mStart.Container()) {
+ mStart.NotifyParentBecomesShadowHost();
+ }
+
+ if (aNode == mEnd.Container()) {
+ mEnd.NotifyParentBecomesShadowHost();
+ }
+ }
+
+ private:
+ // Whether the start and end points are in the same tree.
+ // They could be in different trees, i.e, cross shadow boundaries.
+ bool mAreStartAndEndInSameTree = false;
+
protected:
explicit StaticRange(nsINode* aNode)
: AbstractRange(aNode, /* aIsDynamicRange = */ false) {}