summaryrefslogtreecommitdiff
path: root/dom/xul/XULDocument.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-06-13 08:21:48 -0400
committerMatt A. Tobin <email@mattatobin.com>2020-06-13 08:21:48 -0400
commit7b2976598712391cdde55b2cff903b164079400e (patch)
treee1ff1b11cc54e63b665aab1aa3776a62ee56250d /dom/xul/XULDocument.cpp
parent33474a12bc1d578f7055828cc4bbc728bdd2630b (diff)
downloadaura-central-7b2976598712391cdde55b2cff903b164079400e.tar.gz
Bug 1426494 - Share more code between nsIDocument and ShadowRoot
Tag mcp-graveyard/UXP%1375
Diffstat (limited to 'dom/xul/XULDocument.cpp')
-rw-r--r--dom/xul/XULDocument.cpp19
1 files changed, 4 insertions, 15 deletions
diff --git a/dom/xul/XULDocument.cpp b/dom/xul/XULDocument.cpp
index 929efc1af..d3b94920a 100644
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -1578,24 +1578,13 @@ XULDocument::GetCommandDispatcher(nsIDOMXULCommandDispatcher** aTracker)
}
Element*
-XULDocument::GetElementById(const nsAString& aId)
+XULDocument::GetRefById(const nsAString& aID)
{
- if (!CheckGetElementByIdArg(aId))
- return nullptr;
-
- nsIdentifierMapEntry *entry = mIdentifierMap.GetEntry(aId);
- if (entry) {
- Element* element = entry->GetIdElement();
- if (element)
- return element;
- }
-
- nsRefMapEntry* refEntry = mRefMap.GetEntry(aId);
- if (refEntry) {
- NS_ASSERTION(refEntry->GetFirstElement(),
- "nsRefMapEntries should have nonempty content lists");
+ if (nsRefMapEntry* refEntry = mRefMap.GetEntry(aID)) {
+ MOZ_ASSERT(refEntry->GetFirstElement());
return refEntry->GetFirstElement();
}
+
return nullptr;
}