Questions about events

We are finding more implementation differences across browsers on events, which leads us to believe that we need to tighten the language here.  We could use some clarification on the following:

onabort:  we think this should fire the user presses a 'stop' button when loading an SVG document.  Are there any other cases?

onunload: what is the expected behavior here when there are multiple <svg> fragments in an XHTML/HTML document?

onload: 

Case 1:
<svg id = "a" />

"a" has no children. As soon as "a" has finished parsing, it should fire SVGLoad.

Case 2:
<svg id="a"> <g id="b"/> </svg>

"a" has a child that does not have an external resource. As soon as "b" has finished parsing it will fire SVGLoad. When "a" has finished parsing, it also fires SVGLoad since none of its children told it to wait. 

Case 3:
<svg id="a"><image id="b" /> </svg>

"b" has an external resource. When "b" finishes parsing, it tells all of its ancestors to wait. When "b" loads its image, and when it finishes loading, fires SVGLoad. It then fires SVGLoad on ancestors.

The following cases occur when the tree is modified before the image resources are loaded.

Case 4:
<svg id="a"> <image id="b" /> </svg>

After parsing, but before "b" loads its resource, "b" is removed from the child list of "a" leaving:


<svg id="a"> </svg>

"a" fires SVGLoad.

Case 5:
<svg id="a"> <image id="b" /> </svg>

After parsing, but before "b" loads its resource, unloaded image "c" is added to the child list of "a".

<svg id="a"> <image id="b" /> <image id="c" /> </svg>

"b" and "c" eventually load, fire their events, and then "a" fires.

Case 6:
<svg id="a" />

"a" fires SVGLoad on parse then an unloaded image is added to it.

<svg id="a"> <image id="b" /> </svg>

"a" has already fired so it ignores that request. "b" eventually loads and fires SVGLoad. Again it notifies "a", but "a" does not fire again.



Your help is appreciated,

Patrick 

Received on Wednesday, 24 March 2010 11:09:25 UTC