summaryrefslogtreecommitdiffstats
path: root/dom/html/HTMLSlotElement.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-04-17 12:27:45 -0400
committerMatt A. Tobin <email@mattatobin.com>2020-04-17 12:27:45 -0400
commit222d316c835019ce64603180e4a73b231b788d76 (patch)
tree6c397c7ea7ad627317bddaa157b30405f12314b5 /dom/html/HTMLSlotElement.cpp
parent38f206cb7288d8ef3f05e74e8201e9e662a0859a (diff)
downloadUXP-222d316c835019ce64603180e4a73b231b788d76.tar
UXP-222d316c835019ce64603180e4a73b231b788d76.tar.gz
UXP-222d316c835019ce64603180e4a73b231b788d76.tar.lz
UXP-222d316c835019ce64603180e4a73b231b788d76.tar.xz
UXP-222d316c835019ce64603180e4a73b231b788d76.zip
Bug 1425685 - Implement HTMLSlotElement.assignedElements();
Tag #1375
Diffstat (limited to 'dom/html/HTMLSlotElement.cpp')
-rw-r--r--dom/html/HTMLSlotElement.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/dom/html/HTMLSlotElement.cpp b/dom/html/HTMLSlotElement.cpp
index 18b8ef87b..1c17037af 100644
--- a/dom/html/HTMLSlotElement.cpp
+++ b/dom/html/HTMLSlotElement.cpp
@@ -168,6 +168,17 @@ HTMLSlotElement::AssignedNodes(const AssignedNodesOptions& aOptions,
aNodes = mAssignedNodes;
}
+void HTMLSlotElement::AssignedElements(const AssignedNodesOptions& aOptions,
+ nsTArray<RefPtr<Element>>& aElements) {
+ AutoTArray<RefPtr<nsINode>, 128> assignedNodes;
+ AssignedNodes(aOptions, assignedNodes);
+ for (const RefPtr<nsINode>& assignedNode : assignedNodes) {
+ if (assignedNode->IsElement()) {
+ aElements.AppendElement(assignedNode->AsElement());
+ }
+ }
+}
+
const nsTArray<RefPtr<nsINode>>&
HTMLSlotElement::AssignedNodes() const
{