[whatwg] Anchor target-attribute extension to enable dom targeting

Kornel Lesinski kornel at osiolki.net
Sun Apr 8 16:23:52 PDT 2007


On Sun, 08 Apr 2007 22:22:20 +0100, Georges MARZIN  
<gmarzin at club-internet.fr> wrote:

>> IMHO it isn't much better than:
>>
>> <a href="inc/foo.frg" target="main_area">
>> <iframe name="main_area"></iframe>
>>
>> It's still as evil as frames - subpages can't be used as standalone
>> documents (thus bookmarked, returned by search engines, etc), because
> they lack proper navigation menus and in your example they're not even
> proper documents.

> When the response will arrive, css rules will apply to the new content,
> and the result will be smart.

Yes, in this regard it's much better than iframe. However it doesn't solve  
the worst problem of frames - that subpages become separated from  
essential parts of the document.

> I am interested with your solution of xul-like id overlay for merging
> documents. But I know this for xul, but not for html. How can it work ?

I was just referring to the concept. Something similar could be made for  
HTML.

I think there should be an additional requirement that every subpage  
specifies its parent page. This would allow user agents to reconstruct  
full document from any subpage.

How about that?

index.html:

<h1>My page</h1>
<a href="subpage.html" rel=overlay>open subpage</a>
<div id=main>hello world</div>

I've used rel=overlay since you don't need to specify where should supage  
be included (elements with same IDs will be replaced).

subpage.html:

<a href="index.html" rev=overlay>my parent</a>
<div id=main>subpage</div>

This page has reV=overlay, which specifies the "parent" document. This has  
two roles:
- a fallback that allows users and bots to find parent page that contains  
navigation and rest of the content
- allows UAs that support overlays to rebuild complete page using this  
reference

resulting DOM would be:

<h1>My page</h1>
<a href="subpage.html" rel=overlay>open subpage</a>
<div id=main>subpage</div>


It should be enforced that subpages contain rev=overlay link and that  
parent pages and subpages are mutually connected:

If there's no rev=overlay link in the subpage or it has rev=overlay link  
that points to URL other than that of current page, browser should  
normally open subpage instead of overlaying it.
For example if index.html contains:
<a rel=overlay href="orphaned.html">
and orphaned.html does not contain <a rev=overlay href="index.html">,  
browser should not overlay it (ignore the rel=overlay).


When opening a page that has rev=overlay link, browser should load  
referenced page and overlay the current one on top of it.

For example if user opens subpage.html as a standalone document (types the  
address, opens a bookmark) and the document contains:
<a rev=overlay href="index.html">
browser should load index.html and overlay subpage.html on it.


And of course since DOM of pages gets shared, overlay should be subject to  
the same origin policy.

-- 
regards, Kornel Lesiński



More information about the whatwg mailing list