This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5191 - Does SVGViewSpec track changes to the original SVGSVGElement?
Summary: Does SVGViewSpec track changes to the original SVGSVGElement?
Status: NEW
Alias: None
Product: SVG
Classification: Unclassified
Component: SVG Document Object Model (DOM) (show other bugs)
Version: SVG 2.0
Hardware: Macintosh All
: P2 normal
Target Milestone: Errata
Assignee: Doug Schepers
QA Contact: SVG Public List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-14 05:27 UTC by Eric Seidel
Modified: 2013-03-14 16:33 UTC (History)
3 users (show)

See Also:


Attachments
an example test case of currentView "standard" behavior (3.24 KB, application/xhtml+xml)
2007-10-14 05:29 UTC, Eric Seidel
Details

Description Eric Seidel 2007-10-14 05:27:52 UTC
Does SVGViewSpec track changes to the original SVGSVGElement?

http://www.w3.org/TR/SVG/struct.html#InterfaceSVGSVGElement

Does not make it clear if "currentView" returns an SVGViewSpec object which tracks changes to the original (such as all the SVGAnimated* classes must do: e.g. var width = rect.width; rect.width.baseVal.value = 10; alert(width.baseVal.value); // expect 10), or if it is a normal "plain old data" object which is a copy of what SVGSVGElement had and never changes?

Either way is fine, it just needs to be clarified.  if SVGViewSpec is just a copy of the original and never changes once copied, that's easier to implement.

One possible implementation problem if it tracks changes to SVGSVGElement, is what happens when that SVGSVGElement is removed from the document?  Do then all of the viewPort, targetElement, preserveAspectRatio accessors then go undefined?

var svg = document.getElementById("mysvg");
var currentView = svg.currentView;
var svgParent = svg.parentNode;

svgParent.removeNode(svg);

alert(currentView.targetNode); // does this still work?

One particularly thorny side effect of them *not* changing to undefined is that targetElement could be used to re-insert the SVGSVGElement, example:

svgParent.removeNode(svg);
svgParent.appendNode(currentView.targetNode.ownerSVGElement);

Or equally fun to implement, I assume targetNode should at least update when nodes come and go from the document/change ids?

Just looking for some guidance from you spec folks, thanks.
Comment 1 Eric Seidel 2007-10-14 05:29:54 UTC
Created attachment 494 [details]
an example test case of currentView "standard" behavior

Note the test case is not stand alone and will not run in your browser.  This test case assumes that SVGViewSpec objects *should* update when the original SVGSVGElement changes.
Comment 2 Dirk Schulze 2013-03-14 13:28:48 UTC
Putting it into the scope of SVG2. It needs testing what current browsers do here.
Comment 3 Robert Longson 2013-03-14 14:40:28 UTC
You mean should this animate? http://hoffmann.bplaced.net/svgtest/viewviewbox01.svg#view1

It does in Opera and Firefox.
Comment 4 Florin Malita 2013-03-14 15:20:32 UTC
(In reply to comment #3)
> You mean should this animate?
> http://hoffmann.bplaced.net/svgtest/viewviewbox01.svg#view1
> 
> It does in Opera and Firefox.

No, this is related to SVGViewSpec, as accessed via SVGSVGElement.currentView: http://www.w3.org/TR/SVG/struct.html#__svg__SVGSVGElement__currentView


AFAICT currentView is not supported in FF19:

Error: NS_ERROR_NOT_IMPLEMENTED: Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMSVGSVGElement.currentView]
Comment 5 Robert Longson 2013-03-14 16:33:13 UTC
Oh that. We can't figure out how what it should do see http://www.w3.org/Graphics/SVG/WG/track/issues/2444 and https://bugzilla.mozilla.org/show_bug.cgi?id=503855#c6