WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
91515
SVGUseElement does not allow foreignObject as ancestor of SVGSVGElement
https://bugs.webkit.org/show_bug.cgi?id=91515
Summary
SVGUseElement does not allow foreignObject as ancestor of SVGSVGElement
Dirk Schulze
Reported
2012-07-17 10:10:34 PDT
If a use element references an SVGSVGElement or document, it is not allowed to have a foreignObject as decedent. This is not disallowed according to SVG spac
http://www.w3.org/TR/SVG/struct.html#UseElement
: <svg xmlns="
http://www.w3.org/2000/svg
" xmlns:xlink="
http://www.w3.org/1999/xlink
"> <defs> <svg id="svg"> <foreignObject> <p xmlns="
http://www.w3.org/1999/xhtml
">Test</p> </foreignObject> </svg> </defs> <use xlink:href="#svg"/> </svg> It doesn't matter if the SVG element is in a defs section or not. In both cases the foreignObject and it's content get ignored. Other ancestors get drawn.
Attachments
Add attachment
proposed patch, testcase, etc.
Nikolas Zimmermann
Comment 1
2012-07-17 23:40:38 PDT
True. We disallow it on purpose because of potential problems involved with fO. It needs to be well-tested, that's all. There are new types of cycles references that we need to take care about, when enabling that, and this is where it gets hairy. foo.svg, contains <symbol id="symbol"><fO> <iframe src="other.html"/></fO></symbol> blub.svg references the "symbol". other.html includes foo.svg as html:img. ... -> cycle Or consider the case when the <fO> contains <div style="background-image: blub.svg"... We basically need to extend cycle detection to all HTML elements/attributes that can reference other files. If you feel challenged feel free to start on this, otherwise I'd leave this non-implemented.
hesamse
Comment 2
2020-09-27 01:10:53 PDT
Any updates?
Said Abou-Hallawa
Comment 3
2020-09-28 10:03:39 PDT
The above test case works in FireFox but it doe not work in WebKit or Chrome. The foreignObject and its descendants are removed by removeDisallowedElementsFromSubtree() because foreignObjectTag is not one of the allowed tags createAllowedElementSet. But even adding it will not solve the problem because the HTML <p> element will be removed because its tag is not allowed. To fix this we need to reimplement removeDisallowedElementsFromSubtree() and, as Nikolas mentioned above, we need to extend the cycle detection to all HTML elements in case any of them reference other files.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug