3 ms·
Thanks for the great feedback. I agree with what you said, though there are details I'd like to respond to. > XHTML is dead / retired the XHTML name / XML synt
by nayuki 2y ago
Thanks for the great feedback. I agree with what you said, though there are details I'd like to respond to.
> XHTML is dead / retired the XHTML name / XML syntax for HTML
It's complicated. XHTML 1.0 certainly existed, I coded to that standard, and I used W3C's validator. XHTML 1.0 is basically HTML 4.01 modified to fit XML syntax. XHTML 2 was drafted but never implemented as far as I knew. XHTML 1.0 code is still forward compatible with the current so-called XHTML5. In that sense, XHTML is not dead in name or in implementation, and it's just the trunk of history whereas XHTML 2 is a dead branch. I would prefer to continue using the XHTML name, despite what you legitimately pointed out regarding "XML syntax for HTML".
> boolean attributes
I never knew about that complicated behavior. Thanks for the introduction; I'll have to look further into it.
> <noscript> doesn’t work in XML syntax
It works perfectly fine and some of my pages have examples. I'm not even using CSS to hide the element; I'm solely relying on the browser's default behavior. https://www.nayuki.io/page/calculate-gcd-javascript https://www.nayuki.io/page/calculate-gcd-javascript
> <template> tag needs special-casing in the parser
I didn't know this and it saddens me that the <template> DocumentFragment behavior breaks the uniformity of the XML DOM.
> SGML is weird
It is indeed, just from my cursory study of it. I only know enough SGML to point out that it's weird and then give a few links to more information. I only mentioned SGML in my article to explain where the weirdness of HTML came from.
> It’s not omitting the attribute value like any sane person would expect, but rather the attribute value.
Looks like you misspelled something there, having repeated the same phrase.
> the minimised form of <alpha beta="gamma"> is <alpha gamma>; <alpha beta> would be invalid
I did not expect that, and it doesn't seem to match the behavior of HTML.
> why <nobr> was non-conforming
To me it seems to have a presentation quality like <b>, <i>, <u>, <tt>, <center>, etc.
> exactly as much as <wbr>
I think there's no way to design <wbr/> to be expressed CSS because it really is a single point in the text rather than a span.
- chrismorgan 2y ago• <noscript> doesn’t work in XML syntax. From the spec comes this description of why <https://html.spec.whatwg.org/multipage/scripting.html#the-noscript-element https://html.spec.whatwg.org/multipage/scripting.html#the-no...>: > The noscript element is only effective in the HTML syntax, it has no effect in the XML syntax. This is because the way it works is by essentially "turning off" the parser when scripts are enabled, so that the contents of the element are treated as pure text and not as real elements. XML does not define a mechanism by which to do this. That’s the sense in which I say it doesn’t work. In the way people most commonly use it, to add a “JS disabled so this won’t work” message in the body, you’re saved by the user agent stylesheet including `@media (scripting) { noscript { display: none !important; } }`. But if you try doing things like varying styles via <noscript>, that won’t work. And that’s why <noscript> is (nominally, as ever) disallowed in XML syntax. • As for <nobr> seeming presentational: it can be used presentationally, but so can <strong>, and often is. If I think to places where I’ve used it, most of the time perception of the content would have been materially harmed by line breaks. And that’s the real test of whether something is presentation; framed another way, in a Reader Mode, should it remain or disappear? I expect inline styles and spans may be stripped by a Reader Mode, including <span style="white-space:nowrap">, but I say <nobr> should remain. Drawing connections to Unicode may be helpful too; most things there are Unicode characters for, if there are HTML things for they should be preserved as likely content semantics: I wouldn’t expect a Reader Mode to mangle my Unicode NO-BREAK SPACE to SPACE or my NARROW NO-BREAK SPACE to THIN SPACE or SPACE—they can be presentational (or even stenographic!), but they’re used for content semantics. And <nobr> is content semantics. • <wbr> can be expressed in CSS easily: <span style="display:inline-block"></span>.