Part 3 of this serie; today: doctype-switching.
This is about
doctype switching in IE:
HTML:
1
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
triggers quirksmode because there is no version URI present
HTML:
1 2
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
|
triggers standards-compliant mode because the version URI is present
But what exactly is a URI?
HTML:
1 2
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://tweakers.net">
|
yep, that's a URI, so we render in standards-compliant mode
HTML:
1 2
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"some gibberish">
|
nope, that's not a URI, so we render in quirksmode
HTML:
1 2
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"some gibberish http://">
|
sure, standards-compliant mode because it contains http:// so it must also be a URI...
Now let's just hope W3 doesn't decide to use a different protocol for the latest versions of their document type definitions:
HTML:
1 2
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"ftp://www.w3.org/TR/html4/loose.dtd">
|
doesn't contain http:// anywhere, so surely this can't be a valid URI...