dom: refacto html collection to handle root or descendant only

HTMLCollection works on two different way:
* by default it must walk over root's descendants only
* on document, since the given root must be included in the walk.
This commit is contained in:
Pierre Tachoire
2023-12-12 15:22:33 +01:00
parent 2b298708ba
commit 6566df6338
2 changed files with 93 additions and 58 deletions

View File

@@ -110,6 +110,7 @@ pub const Document = struct {
alloc,
parser.elementToNode(root),
tag_name,
true,
);
}
@@ -123,6 +124,7 @@ pub const Document = struct {
alloc,
parser.elementToNode(root),
classNames,
true,
);
}