[whatwg] <a onlyreplace>

On Mon, Oct 19, 2009 at 3:49 AM, Markus Ernst <derernst at gmx.ch> wrote:
> What do you think about:
> 1. Defining which ids are to be replaced:
> - The list of IDs to replace is in <base> tag, as described earlier in this
> thread. <a> and <form> elements can have a boolean @onlyreplace attribute
> that specifically enables or disables the functionality for the element.
> - If at least one of the IDs is found in the linked document, replace the
> IDs that are found. Ignore IDs that are not present in the linked document,
> or in the document that contains the link (important for dynamic
> applications, so the <head> section is not forced to know the state of the
> <body>).
> - If none of the indicated IDs are found, *replace the whole page*. This
> makes it possible to prevent e.g. a wiki or forum from being @onlyreplaced
> by just using different IDs.

I'm definitely for the last one.  As well, if you recieve any response
that indicates the resource you've gotten isn't what you asked for
(like a 404 status code), also replace the whole page.  Simple things
like a 302 status code that then produces a 200 on the redirected
request should obviously be fine.

> 2. Possible further additions to the base tag:
> - Explicitly exclude parts of a site from @onlyreplace, e.g.:
> <base onlyreplaceExcludeDir="/wiki /forum /media/downloads">

This doesn't seem necessary if @onlyreplace on links is required to
indicate that they carry the onlyreplace semantics.

> - Explicitly specify the links that carry the onlyreplace feature:
> <base onlyreplaceLinkContainers="navigation orderform">

Similarly this isn't necessary, but it *might* be helpful.  I'd be
inclined to just keep things simple for now, though.

> When we add more attributes to <base> than just href and target, the
> sentence "There must be no more than one base element per document." in
> 4.2.3 of the spec should maybe be removed, as for every possible attribute
> in <base> there will be a note anyway saying "If there are multiple base
> elements with [attributename] attributes, all but the first are ignored."

Nah, the former sentence is an author conformance requirement.  The
latter is for UAs.  Both are required.

Received on Monday, 19 October 2009 07:32:15 UTC