Consider switching from xhtml to html5

Issue #207 open
dreadnaut created an issue

Originally reported on Google Code with ID 207

Are there any advantages in using xhtml for PLA's output?

Switching to simple html (keeping the same xml serialization) would allow us to use
new features that already enjoy wide browser support.

A good example would be forms: we could use 'autofocus' and 'required' for input field
to improve* user interaction, as "progressive enhancement" in browsers that support
them. Also, remove default action attributes (Issue #172).

Our current output is already 99% valid html, except for a few 'javascript:void' and
table styling attributes (border, cellpadding, cellspacing, valign, width) that can
be replaced by css.

Reported by dreadnaut on 2013-04-04 09:42:26

Comments (6)

  1. Christopher Kramer
    I guess we are talking about html5?
    
    Yeah, we can do the switch I guess. Although I don't see a huge advantage currently.
    
    > Our current output is already 99% valid html, except for a few 'javascript:void'
    and 
    > table styling attributes (border, cellpadding, cellspacing, valign, width) that can
    
    > be replaced by css.
    Well, usually stuff that has been removed has been removed for a good reason ;-)
    So that shouldn't stop us from using html5.
    "javascript:void" causes error messages in Firefox anyway and I am not sure if it is
    even valid xhtml 1.1.
    

    Reported by crazy4chrissi on 2013-04-04 10:22:13

  2. dreadnaut reporter
    | I guess we are talking about html5?
    
    html5 is the buzzword, 'html' is the language. We would not be switching to "html5"
    because we cannot introduce tags which are not compatible with older browsers* [without
    js hacks.]
    
    What we can do is switch doctype to html, which gives us standard rendering in all
    browsers (IE6 includes). Standard mode means using the latest html and css implementation
    supported by the browser, be it 4,5,6,n. Again, the version number is actually not
    important.
    
    If the browser supports a feature, it will use it; if it does not, it will ignore it
    —contrary to xhtml, where stuff can break (e.g., IE vs application/xml+xhtml)
    
    [*] http://html5doctor.com/how-to-get-html5-working-in-ie-and-firefox-2/
    
    
    | Although I don't see a huge advantage currently.
    
    Agreed, but we'll switch "someday" anyway, and unless there's any good reason to stay
    on xhtml, I could finally add autofocus to the password field in the login screen!
    
    I'll try in the next days maybe, and check whether it breaks every single theme :-p
    

    Reported by dreadnaut on 2013-04-04 11:09:16 - Status changed: Accepted

  3. Christopher Kramer
    | html5 is the buzzword, 'html' is the language.
    Well, yes. But switching to html < 5 would simply be a step backwards.
    
    It would allow us to use <font>, omit <body> and stuff like this. HTML4 days are gone.
    Using HTML5 without the new features is not the same as using html4: not everything
    that was valid html4 is valid html5 (although it "works" and does not break).
    
    | We would not be switching to "html5" because we cannot introduce tags which are not
    
    | compatible with older browsers* [without js hacks.]
    Switching to html5 doesn't necessarily mean we have to use all (or even any) of the
    new features.
    
    | Again, the version number is actually not important.
    Which would mean we could also use html3!?
    
    The difference that xhtml is more strict does not mean it is worse. In fact I consider
    this one of the things that made markup used nowadays a lot cleaner - even in html5.
    
    | we'll switch "someday" anyway
    Not necessarily, but probably yes.
    

    Reported by crazy4chrissi on 2013-04-04 12:31:49

  4. dreadnaut reporter
    | Well, yes. But switching to html < 5 would simply be a step backwards.
    
    I see, we are just approaching from two different sides. I don't want to switch to
    either html4 or html5, but to `html`, the current version available :)  Some of it
    is part of html5, some of it is not yet part of html5, most of it is compatible with
    html4.
    
    In the end, the doctype is `html`, not `html5` :) [ok, to be fair it's `html` just
    to trigger standard mode in IE6]
    
    XHTML is two separate things: is a different language (that happens to overlap a lot
    with html) and is the xml serialization of html. The first is becoming obsolete, the
    second (the stricter rules you mention) are in any case good practice. I'd like to
    keep the latter of course (still served as text/html, because application/xml+xhtml
    means looking for trouble).
    
    More here: http://wiki.whatwg.org/wiki/HTML_vs._XHTML
    
    Anyway, the above is philosophy. I think we both understood the overall idea:
    - change doctype to <!doctype html>
    - fix what does not validate
    - when possible and useful, introduce new html[5] features
    - ensure backward compatibility
    

    Reported by dreadnaut on 2013-04-04 12:56:34

  5. Christopher Kramer
    | Anyway, the above is philosophy. I think we both understood the overall idea
    Yes. Just go ahead and prepare a patch if you feel it is already worth it.
    

    Reported by crazy4chrissi on 2013-04-04 14:59:44

  6. dreadnaut reporter
    | Yes. Just go ahead and prepare a patch if you feel it is already worth it.
    
    Actually, I think I'll wait: we should "batch" css-breaking changes together and go
    through the alternative themes only once. (the table/th stuff is still pending, etc.)
    

    Reported by dreadnaut on 2013-04-04 15:04:52 - Labels added: Priority-Low - Labels removed: Priority-Medium

  7. Log in to comment