Open Bug 1489036 Opened 6 years ago Updated 1 year ago

Make StringBuilder::ToString look for characters to escape in each text node and attribute value only once

Categories

(Core :: DOM: Core & HTML, enhancement, P3)

enhancement

Tracking

()

Performance Impact low

People

(Reporter: hsivonen, Unassigned)

References

Details

After bug 1488697, we could make serialization even faster by trusting that the DOM can't change underneath us and that, therefore, it's OK to hold pointers that point into the text node and attribute value buffers.

This way, the first pass that generated Units could generate "foo", "&amp;" and "bar" units when it traverses a text node containing "foo&bar". The the second pass could work on just two types of units: char* + length and char16_t* + length. (I guess this would be mozilla::Variant<mozilla::Span<const char>, mozila::Span<const char16_t>>.)
Blocks: 1364861
Whiteboard: [qf]
No longer blocks: 1364861
Whiteboard: [qf] → [qfp3:f67]
Whiteboard: [qfp3:f67] → [qf:p3:f67]
Whiteboard: [qf:p3:f67] → [qf:p3]
Component: DOM → DOM: Core & HTML
Performance Impact: --- → P3
Whiteboard: [qf:p3]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.