Scripsit fjanon:
I went through the HTML spec without finding the description of what
the browsers behavior should/must be regarding tags or attributes they
don't understand.
The good old HTML 2.0 specification is a great improvement over its
successors in this area, too. It said:
"4.2.1. Undeclared Markup Error Handling
To facilitate experimentation and interoperability between
implementations of various versions of HTML, the installed base of
HTML user agents supports a superset of the HTML 2.0 language by
reducing it to HTML 2.0: markup in the form of a start-tag or end-
tag, whose generic identifier is not declared is mapped to nothing
during tokenization. Undeclared attributes are treated similarly. The
entire attribute specification of an unknown attribute (i.e., the
unknown attribute and its value, if any) should be ignored. - -
- -
Support for notifying the user of such errors is encouraged.
Information providers are warned that this convention is not binding:
unspecified behavior may result, as such markup does not conform to
this specification."
(If you read the full story in the HTML 2.0 spec, with examples, note that
there was no <DIVelement in HTML 2.0.)
Of course, this wasn't _rigorous_, and it's basically descriptive, not
prescriptive (normative); and the idea of notifying users was never
implemented. It's still better than the sloppier prose in HTML 3.2 and HTML
4 specs and formal vagueness in XHTML. (People often say that XHTML does not
tolerate any syntax errors, and they regard this is a key benefit. However,
browsers aren't required to have validating parsers.)
What HTML 4.01 says about the issue is the (non-normative) clause B.1, see
http://www.w3.org/TR/html401/appendi...s-invalid-docs
<mytag style='display:none'>
<h3>Hello</h3>
</mytag>
and to my surprise instead of ignoring the <mytagand </mytag>
alltogether and showing the <h3content, the browser did not display
the content between <mytagand </tag>.
Which browser, for which specific test document? (The DOCTYPE declaration
might matter; probably it doesn't, but still you should specify a full
example.)
Anyway, the practice described in the HTML 2.0 spec means that the <mytag
....and </mytagtags are ignored, and this is what the HTML 4.01 spec
really _means_ in this context. Other processing would indeed be surprising
and undesirable, but technically not wrong. Your document is not an HTML
document, so an HTML user agent may do anything it likes with it, as far as
HTML specs are concerned.
I am working on having some proprietary tags
Well, stop right now and solve the original problem by some other means. If
you need help with the original problem, it might help if you gave a hint of
what the original problem is.
and I need to know what
the specs say about non standard tags.
Now you know, and this should imply that you start looking at some other
direction.
Of course, if you intend to use _widely supported_ de facto extensions, such
as <embedor <nobr>, then the practical question is how widely and how
consistently supported they are and what browsers actually do if they don't
support them. You might even try and make an educated guess on how long the
extensions will be supported; this tends to depend on how widely known and
used the extension is. The specifications are not useful in such an
analysis.
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/