Removing and adding SVG causes the style attribute to be serialized and reparsed

NEW
Unassigned

Status

()

Core
SVG
5 years ago
2 years ago

People

(Reporter: Jesse Ruderman, Unassigned)

Tracking

(Blocks: 3 bugs, {perf, testcase})

Trunk
perf, testcase
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
Created attachment 593693 [details]
testcase (clicking should have no effect)

Removing and adding SVG causes the style attribute to be serialized and reparsed. This seems inefficient.

Combined with serialization bugs such as bug 475216, this can lead to strange things happening!
Yes, SVG does this very very purposefully.  See nsSVGElement::BindToTree.

We could try to make this better by, say, storing the base URI in the attr value or something, and not doing the reparse if the base URI didn't change....

We wouldn't serialize the CSS decl if we actually have a string it came from, but in this case we don't, since it was built up programmatically.

Updated

5 years ago
Keywords: perf
(Reporter)

Updated

5 years ago
Blocks: 373610
OS: Mac OS X → All
Hardware: x86_64 → All

Comment 2

2 years ago
The testcase here works for me, but bug 720077 looks to be caused by the reparse.
Blocks: 720077
You need to log in before you can comment on or make changes to this bug.