xlink:href in <animate> doesn't work in sourceless iframes (on about:blank)
Categories
(Core :: SVG, defect, P3)
Tracking
()
People
(Reporter: mlbli, Unassigned)
References
Details
Attachments
(1 file)
|
1.98 KB,
text/html
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Safari/605.1.15
Steps to reproduce:
Have an SVG with <animate /> in a source-less iframe that links to an element in the same SVG using xlink:href.
Actual results:
The animation doesn't start
Expected results:
The animation should start
Comment 1•6 years ago
|
||
OK, so the animate stuff ends up creating a URI like:
#0 0x0000000109c81807 in mozilla::net::nsIOService::NewURI(nsTSubstring<char> const&, char const*, nsIURI*, nsIURI**) at netwerk/base/nsIOService.cpp:809
#1 0x0000000109c9830a in NS_NewURI(nsIURI**, nsTSubstring<char> const&, char const*, nsIURI*, nsIIOService*) [inlined] at netwerk/base/nsNetUtil.cpp:1628
#2 0x0000000109c982d7 in NS_NewURI(nsIURI**, nsTSubstring<char> const&, mozilla::NotNull<mozilla::Encoding const*>, nsIURI*, nsIIOService*) at netwerk/base/nsNetUtil.cpp:1640
#3 0x0000000109c98529 in NS_NewURI(nsIURI**, nsTSubstring<char16_t> const&, mozilla::NotNull<mozilla::Encoding const*>, nsIURI*, nsIIOService*) at netwerk/base/nsNetUtil.cpp:1666
#4 0x000000010bf6518a in mozilla::dom::SVGAnimationElement::UpdateHrefTarget(nsTSubstring<char16_t> const&) at dom/svg/SVGAnimationElement.cpp:362
#5 0x000000010bf650e3 in mozilla::dom::SVGAnimationElement::BindToTree(mozilla::dom::Document*, nsIContent*, nsIContent*) at dom/svg/SVGAnimationElement.cpp:157
#6 0x000000010ac931f5 in mozilla::dom::Element::BindToTree(mozilla::dom::Document*, nsIContent*, nsIContent*) at dom/base/Element.cpp:1744
#7 0x000000010bf6b06a in mozilla::dom::SVGElement::BindToTree(mozilla::dom::Document*, nsIContent*, nsIContent*) at dom/svg/SVGElement.cpp:230
#8 0x000000010ac931f5 in mozilla::dom::Element::BindToTree(mozilla::dom::Document*, nsIContent*, nsIContent*) at dom/base/Element.cpp:1744
#9 0x000000010bf6b06a in mozilla::dom::SVGElement::BindToTree(mozilla::dom::Document*, nsIContent*, nsIContent*) at dom/svg/SVGElement.cpp:230
#10 0x000000010ac931f5 in mozilla::dom::Element::BindToTree(mozilla::dom::Document*, nsIContent*, nsIContent*) at dom/base/Element.cpp:1744
#11 0x000000010bf6b06a in mozilla::dom::SVGElement::BindToTree(mozilla::dom::Document*, nsIContent*, nsIContent*) at dom/svg/SVGElement.cpp:230
#12 0x000000010bf9c400 in mozilla::dom::SVGSVGElement::BindToTree(mozilla::dom::Document*, nsIContent*, nsIContent*) at dom/svg/SVGSVGElement.cpp:393
#13 0x000000010ac931f5 in mozilla::dom::Element::BindToTree(mozilla::dom::Document*, nsIContent*, nsIContent*) at dom/base/Element.cpp:1744
#14 0x000000010bb2de36 in nsGenericHTMLElement::BindToTree(mozilla::dom::Document*, nsIContent*, nsIContent*) at dom/html/nsGenericHTMLElement.cpp:424
#15 0x000000010ad5f852 in nsINode::InsertChildBefore(nsIContent*, nsIContent*, bool) at dom/base/nsINode.cpp:1248
#16 0x000000010ad62738 in nsINode::ReplaceOrInsertBefore(bool, nsINode*, nsINode*, mozilla::ErrorResult&) at dom/base/nsINode.cpp:2363
#17 0x000000010afc60e9 in nsINode::InsertBefore(nsINode&, nsINode*, mozilla::ErrorResult&) [inlined] at dom/base/nsINode.h:1679
and passes "#circle-558014329836164" as href and "https://bug1553430.bmoattachments.org/attachment.cgi?id=9066655" as base URI.
I'm a bit confused why https://bug1157953.bmoattachments.org/attachment.cgi?id=8786769 (from bug 1157953) does work - it looks like we never hit newURI in that case, and maybe SVG resolves things separately, preserving the relative URI (but not for animated values?), or something? I also don't know if/how bug 1157953 comment 24 still applies or if the spec changed.
Comment 2•6 years ago
|
||
CSS explicitly stores url(#pattern) as that exact thing, not a fully resolved URL, and always resolves it as a same-document reference no matter what the document URL and base URL are. This is specified in the CSS spec, and is why attachment 8786769 [details] works.
For xlink:href, that's not the specified behavior; the specified behavior is to resolve relative to the base URL (which in this case differs from the document URL, by the way).
As far as I can tell, we're correctly following the spec here...
Comment 3•6 years ago
|
||
The priority flag is not set for this bug.
:heycam, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 4•6 years ago
|
||
Per comment 2
Comment 5•6 years ago
|
||
I do wonder whether we should push back on the spec. This sort of thing makes SVG hard to use in data:, blobs, srcdoc documents, etc, etc...
Comment 8•6 years ago
|
||
From WG discussions earlier this week it sounds like people want to solve this somehow. I'm going to leave this bug open.
Comment 9•3 years ago
|
||
animates now.
Description
•