- From: Calogero Alex Baldacchino <alex.baldacchino@email.it>
- Date: Mon, 08 Dec 2008 03:20:18 +0100
Ian Hickson ha scritto: > What terminology would you prefer rather than "subtree"? (We can't say > document, since we are also trying to define conformance rules for > disconnected subtrees handled from scripts.) > I was thinking again on that. Let me suggest something like the following (and just do suggest, I'm far from wishing to impose my point of view, and don't want to be pedantic, but I belive deeply exploring every alternative may improve the specification). "The _id_ attribute represents an element unique identifier in the subtree within which the element finds itself and must contain at least one character. In this context, a subtree is either a whole document tree, or a tree of Node instances containing HTMLElements and disconnected from any HTML document; a subtree of a document tree is contained in a subtree of the first type, thus id values must be unique in the containing document (e.g. a duplicate id inside a document tree is always illegal, even if a branch of the document can be isolated where the id is unique, unless such branch is removed from the document). This specification requires the _id_ attribute value to be unique in a subtree of the former type, thus a subtree of the latter type (e.g. a document fragment manipulated by a script) to be inserted into an HTML document must fulfil such requirement, as well as any other requirements defined in this specification for conformance purpose. Any API dealing with ID properties in any type of subtree must consider the _id_ attribute value of an HTMLElement as the element's default ID property; however, this specification doesn't preclude an element having multiple IDs, if other, API-specific mechanisms can set an element's ID in a way that doesn't conflict with the id attribute" - then the rest. One rational for the above is that, formally, a subtree disconnected from any actual HTML document might be out of scope for current specification, which defines conformance rules for HTML documents and related contexts (such as a script context or a browsing context, both applying to a 'connected' subtree, as far as I've understood), while a subtree which is disconnected from a specific HTML document, but is contained into another one (thus coinciding with the containing document tree) is yet covered by the constraint for whole documents. Another rational is that current specification, while relying on at least one method affected by IDs uniqueness in a document tree (that is, DOM Core Document.getElementById), does not provide, nor refers to, any API which might be directly affected by the uniqueness of an id attribute value in a disconnected subtree, thus such an API may be indirectly related to id values uniqueness if ID properties are relevant for its facilities, but the subtree itself cannot be constrained by conformance rules before its insertion into an actual HTML document. A further rational is that a disconnected subtree might contain Node instances not implementing the HTMLElement interface, such as a DocumentFragment node, but also MathML/SVG elements, which might be embedded content elements coming from an HTML document tree, but also from a document of a different kind where the embedded content was represented by HTML elements, thus, without a sure knowledge on the subtree origin, applying an HTML-specific conformance rule might not be a correct choice, until the subtree is to be inserted into an HTML document. For the question related to space characters inside an id value, I'd suggest, "An ID property is not expected to contain space characters, so the value of an _id_ attribute should not contain any space characters. However, an id attribute can hold a decoded fragment identifier value for the purpose of same-document references, thus space characters are tolerated for the purpose of conformance, in order to avoid applying restrictions to an otherwise legal fragment identifier value not being part of a _URL_." Everything, of course, IMHO. Best regards, Alex. -- Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP autenticato? GRATIS solo con Email.it http://www.email.it/f Sponsor: CAPODANNO A RICCIONE * Speciale Capodanno Bambini con Animazione e Baby Sitter. * Un bimbo fino a 6 anni GRATIS. Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=8503&d=8-12
Received on Sunday, 7 December 2008 18:20:18 UTC