Re: [SVGMobile12] Section 14.2 -- What is the difference between "_replace" and "_self"

On Monday, July 17, 2006, 5:52:24 AM, Boris wrote:

BZ> Chris Lilley wrote:
>>> I'm not quite sure what the difference between target="_replace" and 
>>> target="_self" is for <svg:a> elements.  When do they actually behave 
>>> differently?
>> 
>> For a stand-alone SVG file, they will not behave differently.

BZ> OK.

>> These constructs are what is meant by "presentation context":

BZ> Which constructs?  <iframe>s, <object>s, and so forth? 

Yes
 
BZ>  Does "presentation
BZ> context" refer to the DOM Element involved or to some other object?

It refers to the fact that some resource can be presented there, and
that the resource can change by changing the URI.

>>   This attribute specifies the name or portion of the target window,
>>   frame, pane, tab, or other relevant presentation context (e.g., an
>>   HTML or XHTML frame, iframe, or object element) into which a document
>>   is to be opened when the link is activated.

BZ> That makes it sound like a "presentation context" is "something you can stick a
BZ> document into".

Yup.
 
BZ>   So the "inside" of an <iframe>, say?  I'm assuming this is the
BZ> case from now on, but if I'm wrong please let me know and I'll adjust my
BZ> thinking as needed.

>> The names and descriptions are taken from WebCGM:
>> http://www.w3.org/TR/REC-WebCGM/REC-03-CGM-IC.html#webcgm_3_1_2_2

BZ> OK.  But you're not normatively referencing this, right?  That is, you're using
BZ> your own definitions of "_replace" and "_self"?

Well, it would be wierd if it said "the WebCGM can be" and "this only
applies to WebCGM to WebCGM links, not HTML to WebCGM" and so on. The
wording was not suitable for just referencing as is.

>> which in turn took them from HTML4, although adding better description
>> and a new value.

BZ> Yes, the new value is what I'm trying to understand.

>> The names are probably not the most intuitive ones but are historical.

BZ> Sure.  I don't really care about the names, as long as I can tell what they
BZ> mean.  ;)

>> So for example if I have a frame document displaying an xhtml document X
>> and an SVG document S; and the xhtml document has two object elements,
>> o1 and o2, displaying SVG files S1 and S2.
>> 
>> Drawing this as a tree, where children are linked from their parent:
>> 
>> F -+- S
>>    |
>>    +- X -+- S1
>>          |
>>          +- S2
>> 
>> 
>> Lets suppose S1 has some 'a' elements (a1, a2, etc).
>> 
>> a1 has target="_self". Traversing this link would result in X being
>> replaced

BZ> Wait.  Why "X" and not "S1"?

Because that is what WebCGM says for self, and we do the same thing.

BZ>  Would the behavior be different if <iframe> were
BZ> used instead of <object>?

Not that I can see, although the HTML description is less clear and
seems to be specific to framesets. I assume that this also applies to
iframe, but perhaps it does not.

BZ> Note that if <iframe> were used and an HTML file "S1" were loaded in
BZ> the <iframe>, then, in the HTML4 meaning of _self, "S1" would be
BZ> replaced by the linked content, not "X".

BZ> I guess this all comes down to a precise definition of the term "the same frame
BZ> as the current SVG image" (though I'm not sure how the "The current SVG image is
BZ> replaced" part of the SVG 1.2 Tiny description of "_self" can be interpreted to
BZ> mean "replace X" in your example.

>> a2 has target="_replace". Traversing this link results in S1 being
>> replaced by whatever a2 linked to.

BZ> This sounds more like what _self does in HTML.

BZ> In general, it sounds like your description for _self is what
BZ> _parent does in HTML and your description for _replace is what _self
BZ> does in HTML. At least for <iframes>. This does raise the question
BZ> of whether <object> and <iframe> in HTML should behave differently
BZ> for link-targeting purposes. In Gecko they do not, last I checked.
BZ> For example:

BZ> <object type="text/html"
BZ>          data='data:text/html,
BZ>                <a target="foo"
BZ>                   href="http://www.mozilla.org">Click me</a>'
BZ>          name="foo">
BZ> </object>

BZ> will behave as your description of _replace. Similar if I use
BZ> target=_self. If I use target=_parent, then the document that the
BZ> <object> lives in is replaced.

>> Probably more useful, though, would be to work with the CDF WG to ensure
>> that all of these options are tested in the CDF test suite. The main use
>> case is with compound documents.

BZ> In that case, I'd really like to see the differences from HTML resolved.

I will point the CDF WG at this thread. Also the WebCGM group, actually.

BZ> Thanks a ton for the explanation; I hope I understood correctly!

BZ> -Boris




-- 
 Chris Lilley                    mailto:chris@w3.org
 Interaction Domain Leader
 Co-Chair, W3C SVG Working Group
 W3C Graphics Activity Lead
 Co-Chair, W3C Hypertext CG

Received on Monday, 17 July 2006 13:15:24 UTC