mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 15:58:39 +09:00
Bug 1377993 - Make node slots less memory hungry in common cases.
Tag UXP Issue #1344
This commit is contained in:
parent
7f03d02552
commit
dd7fa403a8
9 changed files with 203 additions and 178 deletions
|
|
@ -497,7 +497,7 @@ nsGenericHTMLElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
|||
// We need to consider a labels element is moved to another subtree
|
||||
// with different root, it needs to update labels list and its root
|
||||
// as well.
|
||||
nsDOMSlots* slots = GetExistingDOMSlots();
|
||||
nsExtendedDOMSlots* slots = GetExistingExtendedDOMSlots();
|
||||
if (slots && slots->mLabelsList) {
|
||||
slots->mLabelsList->MaybeResetRoot(SubtreeRoot());
|
||||
}
|
||||
|
|
@ -524,7 +524,7 @@ nsGenericHTMLElement::UnbindFromTree(bool aDeep, bool aNullParent)
|
|||
|
||||
// We need to consider a labels element is removed from tree,
|
||||
// it needs to update labels list and its root as well.
|
||||
nsDOMSlots* slots = GetExistingDOMSlots();
|
||||
nsExtendedDOMSlots* slots = GetExistingExtendedDOMSlots();
|
||||
if (slots && slots->mLabelsList) {
|
||||
slots->mLabelsList->MaybeResetRoot(SubtreeRoot());
|
||||
}
|
||||
|
|
@ -1730,7 +1730,7 @@ nsGenericHTMLElement::Labels()
|
|||
{
|
||||
MOZ_ASSERT(IsLabelable(),
|
||||
"Labels() only allow labelable elements to use it.");
|
||||
nsDOMSlots* slots = DOMSlots();
|
||||
nsExtendedDOMSlots* slots = ExtendedDOMSlots();
|
||||
|
||||
if (!slots->mLabelsList) {
|
||||
slots->mLabelsList = new nsLabelsNodeList(SubtreeRoot(), MatchLabelsElement,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue