mirror of
https://github.com/servo/servo
synced 2026-04-26 01:25:32 +02:00
script: Introduce HtmlSerialize to support extensible node serialization (#40568)
XML and HTML serialization routines relied on a single, shared implementation of the `markup5ever::Serialize` trait for the DOM Node type. These changes introduce the HtmlSerialize type to make it possible to support XML serialization and fix other issues. Testing: It does not change any behavior and it builds. Fixes: #40552 --------- Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>
This commit is contained in:
@@ -119,6 +119,7 @@ use crate::dom::pointerevent::{PointerEvent, PointerId};
|
||||
use crate::dom::processinginstruction::ProcessingInstruction;
|
||||
use crate::dom::range::WeakRangeVec;
|
||||
use crate::dom::raredata::NodeRareData;
|
||||
use crate::dom::servoparser::html::HtmlSerialize;
|
||||
use crate::dom::servoparser::{ServoParser, serialize_html_fragment};
|
||||
use crate::dom::shadowroot::{IsUserAgentWidget, LayoutShadowRootHelpers, ShadowRoot};
|
||||
use crate::dom::svg::svgsvgelement::{LayoutSVGSVGElementHelpers, SVGSVGElement};
|
||||
@@ -3241,7 +3242,7 @@ impl Node {
|
||||
let mut writer = vec![];
|
||||
xml_serialize::serialize(
|
||||
&mut writer,
|
||||
&self,
|
||||
&HtmlSerialize::new(self),
|
||||
xml_serialize::SerializeOpts { traversal_scope },
|
||||
)
|
||||
.map_err(|error| {
|
||||
|
||||
Reference in New Issue
Block a user