mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
dom: Move child_list to rare data (#35592)
This is only created when calling the ChildNodes method. Gecko also stores it in their similar data structure at https://searchfox.org/mozilla-central/rev/155d514d72473453492a822e97dc1c68cf49d110/dom/base/nsINode.h#1464 Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
parent
6a182c345c
commit
f7c1cd4635
3 changed files with 19 additions and 15 deletions
|
@ -7,7 +7,7 @@ use std::rc::Rc;
|
|||
use euclid::default::Rect;
|
||||
use servo_atoms::Atom;
|
||||
|
||||
use crate::dom::bindings::root::Dom;
|
||||
use crate::dom::bindings::root::{Dom, MutNullableDom};
|
||||
use crate::dom::customelementregistry::{
|
||||
CustomElementDefinition, CustomElementReaction, CustomElementState,
|
||||
};
|
||||
|
@ -16,6 +16,7 @@ use crate::dom::htmlslotelement::SlottableData;
|
|||
use crate::dom::intersectionobserver::IntersectionObserverRegistration;
|
||||
use crate::dom::mutationobserver::RegisteredObserver;
|
||||
use crate::dom::node::UniqueId;
|
||||
use crate::dom::nodelist::NodeList;
|
||||
use crate::dom::range::WeakRangeVec;
|
||||
use crate::dom::shadowroot::ShadowRoot;
|
||||
use crate::dom::window::LayoutValue;
|
||||
|
@ -42,6 +43,9 @@ pub(crate) struct NodeRareData {
|
|||
/// twice in this vector, even if both the start and end containers
|
||||
/// are this node.
|
||||
pub(crate) ranges: WeakRangeVec,
|
||||
|
||||
/// The live list of children return by .childNodes.
|
||||
pub(crate) child_list: MutNullableDom<NodeList>,
|
||||
}
|
||||
|
||||
#[derive(Default, JSTraceable, MallocSizeOf)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue