script Exclude CDATASection nodes from Node::normalize() (#37550)

Exclude CDATASection nodes from Node::normalize. I made it under the
assumption that CDATAs can't have children so we don't need to go into
the `else node.Normalize()` branch on line 3485 with them, hope this is
correct.

Testing: covered by `dom/nodes/Node-normalize.html`
Fixes: https://github.com/servo/servo/issues/37006

---------

Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>
This commit is contained in:
Rodion Borovyk 2025-06-19 12:08:07 +02:00 committed by GitHub
parent 06b5422abf
commit 3a54ddd034
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 9 deletions

View file

@ -1260,7 +1260,7 @@ impl WeakRangeVec {
.extend(ranges.drain(..));
}
/// Used for steps 7.1-2. when normalizing a node.
/// Used for steps 6.1-2. when normalizing a node.
/// <https://dom.spec.whatwg.org/#dom-node-normalize>
pub(crate) fn drain_to_preceding_text_sibling(&self, node: &Node, sibling: &Node, length: u32) {
if self.is_empty() {
@ -1287,7 +1287,7 @@ impl WeakRangeVec {
sibling.ranges().cell.borrow_mut().extend(ranges.drain(..));
}
/// Used for steps 7.3-4. when normalizing a node.
/// Used for steps 6.3-4. when normalizing a node.
/// <https://dom.spec.whatwg.org/#dom-node-normalize>
pub(crate) fn move_to_text_child_at(
&self,