karsumit94 / phpliteadmin

Automatically exported from code.google.com/p/phpliteadmin
0 stars 0 forks source link

Consider switching from xhtml to html5 #207

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by dreadnaut on 4 Apr 2013 at 9:42

GoogleCodeExporter commented 9 years ago
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.

Original comment by crazy4ch...@gmail.com on 4 Apr 2013 at 10:22

GoogleCodeExporter commented 9 years ago
| 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

Original comment by dreadnaut on 4 Apr 2013 at 11:09

GoogleCodeExporter commented 9 years ago
| 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.

Original comment by crazy4ch...@gmail.com on 4 Apr 2013 at 12:31

GoogleCodeExporter commented 9 years ago
| 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

Original comment by dreadnaut on 4 Apr 2013 at 12:56

GoogleCodeExporter commented 9 years ago
| 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.

Original comment by crazy4ch...@gmail.com on 4 Apr 2013 at 2:59

GoogleCodeExporter commented 9 years ago
| 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.)

Original comment by dreadnaut on 4 Apr 2013 at 3:04