[whatwg] Reserved browsing context names

Ian Hickson ian at hixie.ch
Wed Dec 14 16:12:59 PST 2011


On Fri, 13 May 2011, Boris Zbarsky wrote:
> On 5/13/11 4:46 PM, Ian Hickson wrote:
> > The sum total of what the spec has to say on the matter is "User 
> > agents may support secondary browsing contexts, which are browsing 
> > contexts that form part of the user agent's interface, apart from the 
> > main content area"; I think it's perfectly reasonable for a user agent 
> > that implements such a thing to have an applicable specification that 
> > defines specific behaviour for its secondary browsing contexts that 
> > open links wherever they want.
> 
> OK, I see.
> 
> > > In addition, there is existing deployed content using the special 
> > > names to target the main content area which would break if the 
> > > special-casing of those names were removed....  so I doubt it'll be 
> > > removed.
> > 
> > Ah, interesting. Do you have any links to such documents so I could 
> > study them? What do these links do in other browsers?
> 
> I don't have links offhand, unfortunately; just past sidebar things I've 
> used and now forgotten the location of plus documentation on the web 
> about authoring things with target="_main" [1].
> 
> I just tested what this document does in the main content area:
> 
>   <!DOCTYPE html>
>   <a href="http://web.mit.edu" target="_main">Click me</a>
> 
> It looks like this opens a new browsing area in WebKit and Presto and 
> loads the link in the tab I clicked the link in in Gecko and Trident 
> (IE9).  I did not test the exact Trident behavior here; the Gecko 
> behavior is that in the content area "_main" is an alias for "_top" (as 
> opposed to targeting the currently open tab, say).  A bit of testing 
> seems to suggest that Trident treats it as an alias for "_self" in at 
> least some cases, corroborated by some threads out there [2].
> 
> A similar document with target="_content" loads in a new browsing area 
> in all the non-Gecko browsers; I can probably remove support for this 
> from Gecko as well.
> 
> I did some googling just now, and pretty quickly found an actual web 
> page that uses target="_main":  http://www.ejflavors.com/orangemoon/
> 
> The question of how to proceed here is a good one.  Supporting different 
> targeting algorithms in different browsing contexts is a bit of a pain, 
> so it would be good, imo, if we could converge the targeting algorithms 
> for primary and secondary browsing contexts for fixed names....  That 
> said, for target="_main" even the primary browsing context interop story 
> is sad, apparently.
> 
> [1] http://www.howtocreate.co.uk/tutorials/jsexamples/createSidebar.php
>     http://msdn.microsoft.com/en-us/library/aa753632%28v=vs.85%29.aspx
>     http://forum.maxthon.com/viewthread.php?tid=21723
> [2] http://www.windowskb.com/Uwe/Forum.aspx/ie6/76031/Link-in-a-frame-page-in-full-browser-window

Thanks for this research, it is quite illuminating.

Given the current situation of low interoperability on these target 
values, and possibly more importantly given that browsers as a whole are 
moving away from secondary browsing contexts at all, I think it's easier 
and simpler on the long run to just drop _main and _content entirely.

One could actually argue that the pages that exist that use _main and 
_content actually work _better_ in current UAs with those values being 
interpreted as browsing context names than they would if they were treated 
as synonyms for _self or _top, because it would let a user open the page 
up in a window and have the links open in a window next to it, reproducing 
the old behaviour with secondary browsing contexts.

Having said that, I think it's fine for a browser that supports secondary 
browsing contexts to implement a spec that itself defines _main or 
_content or both, even if that spec defines its meaning as different than 
the error-recovery behaviour defined in the HTML spec, and even if it 
defines it to apply to main browsing contexts too. Which is to say, if 
browsers ever go back to having secondary browsing contexts, it'd make 
sense for them to implement these values with relevant behaviours.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


More information about the whatwg mailing list