Open Bug 1515344 Opened 6 years ago Updated 3 years ago

Computation of BaseURI is bound to the wrong svg element with <svg:use> before being bound to the DOM

Categories

(Core :: CSS Parsing and Computation, enhancement, P3)

65 Branch
enhancement

Tracking

()

People

(Reporter: jkt, Unassigned)

References

Details

Whilst working on https://bugzilla.mozilla.org/show_bug.cgi?id=1494356#c21 we established that the BaseURI is set to the wrong SVG element on the first pass through. doc.svg <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <marker id="circleMarker" markerWidth="8" markerHeight="8" refX="5" refY="5"> <circle cx="5" cy="5" r="2" style="stroke: none; fill: red;"/> </marker> </defs> <use xlink:href="embed.svg#path"/> </svg> embed.svg <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <marker id="circleMarker" markerWidth="8" markerHeight="8" refX="5" refY="5"> <circle cx="5" cy="5" r="2" style="stroke: none; fill: lime;"/> </marker> </defs> <path id="path" d="M20,20 L70,20 L120,20" style="stroke: blue; stroke-width: 2px; marker-start: url(#circleMarker);"/> </svg> If we remove the bind to tree restyling code https://searchfox.org/mozilla-central/rev/13788edbabb04d004e4a1ceff41d4de68a8320a2/dom/svg/nsSVGElement.cpp#235-254 the svg above in doc.svg has a red marker. Ultimately the issue then comes through into SVGObserverUtils::GetBaseURLForLocalRef() where the aDocURI ends up being a file://path/doc.svg#circleMarker which seems wrong to me. Ideally we should defer parsing of the baseURI until the anonymous subtree has been bound. I'm not entirely sure the direction and how to implement this though.
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.