Closed
Bug 835048
Opened 11 years ago
Closed 10 years ago
Figure out if SVGElement.ownerSVGElement should throw
Categories
(Core :: SVG, defect)
Core
SVG
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: Ms2ger, Assigned: longsonr)
References
Details
(Keywords: dev-doc-needed)
Attachments
(2 files)
4.27 KB,
patch
|
jwatt
:
review+
|
Details | Diff | Splinter Review |
184 bytes,
image/svg+xml
|
Details |
The spec (<https://svgwg.org/svg2-draft/types.html#__svg__SVGElement__ownerSVGElement>) says: ownerSVGElement (readonly SVGSVGElement) The nearest ancestor ‘svg’ element. Null if the given element is the outermost svg element. Our implementation has: 1138 // If we didn't find anything and we're not the outermost SVG element, 1139 // we've got an invalid structure 1140 if (!ownerSVGElement && Tag() != nsGkAtoms::svg) { 1141 rv.Throw(NS_ERROR_FAILURE); 1142 } which doesn't seem to make sense to me.
Assignee | ||
Comment 1•11 years ago
|
||
It throws if you write <g xmlns="xmlns="http://www.w3.org/2000/svg"><rect id="r"></g> which is not a valid svg file as the root element is not <svg>. Since the specification doesn't say to throw and returning null is reasonable I think we should do that.
Assignee | ||
Comment 2•10 years ago
|
||
Assignee: nobody → longsonr
Attachment #785522 -
Flags: review?(jwatt)
![]() |
||
Comment 3•10 years ago
|
||
What do Chrome and IE do?
Assignee | ||
Comment 4•10 years ago
|
||
Firefox throws and displays an error in the console IE 9 prints null Opera prints null Dunno about Chrome.
Flags: needinfo?(jwatt)
Reporter | ||
Comment 5•10 years ago
|
||
null in Chrome too.
![]() |
||
Comment 6•10 years ago
|
||
Comment on attachment 785522 [details] [diff] [review] patch Okay, sounds like we should definitely do this then. Thanks!
Attachment #785522 -
Flags: review?(jwatt) → review+
Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(jwatt)
![]() |
||
Comment 7•10 years ago
|
||
Can you change: return GetCtx(); to: return GetCtx(); // this may return nullptr
Assignee | ||
Comment 8•10 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=b243553fff42
Assignee | ||
Comment 9•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/bd5a82670cf9
Flags: in-testsuite+
Reporter | ||
Updated•10 years ago
|
Keywords: dev-doc-needed
Comment 10•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/bd5a82670cf9
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in
before you can comment on or make changes to this bug.
Description
•