summaryrefslogtreecommitdiffstats
path: root/dom/html
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-04-17 07:29:57 -0400
committerMatt A. Tobin <email@mattatobin.com>2020-04-17 07:29:57 -0400
commit010f37f47b9c15935a6113cd82e43f0673122016 (patch)
treeced1fbdc9767f6d87428f30331bf6305938a291e /dom/html
parent38056aa9c931ef7e769f7fd42613318dc8aeb77b (diff)
downloadUXP-010f37f47b9c15935a6113cd82e43f0673122016.tar
UXP-010f37f47b9c15935a6113cd82e43f0673122016.tar.gz
UXP-010f37f47b9c15935a6113cd82e43f0673122016.tar.lz
UXP-010f37f47b9c15935a6113cd82e43f0673122016.tar.xz
UXP-010f37f47b9c15935a6113cd82e43f0673122016.zip
Bug 1422197 - Add fast path to get DocGroup in binding code for [CEReactions]
Tag #1375
Diffstat (limited to 'dom/html')
-rw-r--r--dom/html/HTMLOptionsCollection.cpp6
-rw-r--r--dom/html/HTMLOptionsCollection.h2
-rw-r--r--dom/html/nsDOMStringMap.cpp6
-rw-r--r--dom/html/nsDOMStringMap.h5
4 files changed, 19 insertions, 0 deletions
diff --git a/dom/html/HTMLOptionsCollection.cpp b/dom/html/HTMLOptionsCollection.cpp
index 67de97fc4..da8a9d571 100644
--- a/dom/html/HTMLOptionsCollection.cpp
+++ b/dom/html/HTMLOptionsCollection.cpp
@@ -239,6 +239,12 @@ HTMLOptionsCollection::GetParentObject()
return mSelect;
}
+DocGroup*
+HTMLOptionsCollection::GetDocGroup() const
+{
+ return mSelect ? mSelect->GetDocGroup() : nullptr;
+}
+
NS_IMETHODIMP
HTMLOptionsCollection::NamedItem(const nsAString& aName,
nsIDOMNode** aReturn)
diff --git a/dom/html/HTMLOptionsCollection.h b/dom/html/HTMLOptionsCollection.h
index 496919555..9dd1561f6 100644
--- a/dom/html/HTMLOptionsCollection.h
+++ b/dom/html/HTMLOptionsCollection.h
@@ -23,6 +23,7 @@ class nsIDOMHTMLOptionElement;
namespace mozilla {
namespace dom {
+class DocGroup;
class HTMLElementOrLong;
class HTMLOptionElementOrHTMLOptGroupElement;
class HTMLSelectElement;
@@ -62,6 +63,7 @@ public:
virtual Element* GetElementAt(uint32_t aIndex) override;
virtual nsINode* GetParentObject() override;
+ DocGroup* GetDocGroup() const;
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(HTMLOptionsCollection,
nsIHTMLCollection)
diff --git a/dom/html/nsDOMStringMap.cpp b/dom/html/nsDOMStringMap.cpp
index 6d2bc424d..7e2ed0ece 100644
--- a/dom/html/nsDOMStringMap.cpp
+++ b/dom/html/nsDOMStringMap.cpp
@@ -62,6 +62,12 @@ nsDOMStringMap::~nsDOMStringMap()
}
}
+DocGroup*
+nsDOMStringMap::GetDocGroup() const
+{
+ return mElement ? mElement->GetDocGroup() : nullptr;
+}
+
/* virtual */
JSObject*
nsDOMStringMap::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
diff --git a/dom/html/nsDOMStringMap.h b/dom/html/nsDOMStringMap.h
index bf28957f7..6506f1464 100644
--- a/dom/html/nsDOMStringMap.h
+++ b/dom/html/nsDOMStringMap.h
@@ -16,6 +16,9 @@
namespace mozilla {
class ErrorResult;
+namespace dom {
+class DocGroup;
+} // namespace dom
} // namespace mozilla
class nsDOMStringMap : public nsStubMutationObserver,
@@ -32,6 +35,8 @@ public:
return mElement;
}
+ mozilla::dom::DocGroup* GetDocGroup() const;
+
explicit nsDOMStringMap(mozilla::dom::Element* aElement);
// WebIDL API