Re: Safari inadequate?
- From: Eric Lindsay <NOwebmasterSPAM@xxxxxxxxxxxxxxx>
- Date: Mon, 25 May 2009 20:13:42 +1000
In article <slrnh1fvg6.arc.foo@xxxxxxxxxxxxxxx>,
Ian Gregory <foo@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
On 2009-05-23, Sander Tekelenburg <user@xxxxxxxxxxxxxx> wrote:
In article
<NOwebmasterSPAM-63BE18.07092723052009@xxxxxxxxxxxxxxxxxxxxx>,
Eric Lindsay <NOwebmasterSPAM@xxxxxxxxxxxxxxx> wrote:
Using the .xhtml extension is handy, because then local copies of your
file (on a Macintosh) will be treated as XHTML. Safari, Opera and
Firefox will all use their XHTML parser, not their HTML parser.
Really? I haven't tested, but I'd expect doctype switching to be applied
to local files too. And then there is the <meta
http-equiv="content-type"> mess...
When I introduce a tag mismatch error into one of my local .xhtml files
Safari throws an error and only renders the page up to the mismatch (as
expected). If I then simply change the extension to .html there are no
errors and it appears to render fine (though of course due to the tag
mismatch it is no longer valid).
Clearly Safari is basing its choice of parser on the file name
extension. The original file in question is valid XHTML Basic 1.1.
I just tried adding the following line to the head section:
<meta http-equiv="Content-Type" content="application/xhtml+xml" />
Safari still uses the HTML parser - presumably the .html file extension
is overriding the meta tag.
I think the Content-Type meta should be ignored, and that the Apple file
system is doing it correctly.
If coming from a web server, the web server gets final say, so you do
not need the meta.
If coming from a local source, the file system needs to decide the type
of file. Unless it is looking inside the file for file creator details
or the meta tag, it will be using file system metadata or an extension.
I seem to recall seeing W3C material to the effect that the meta
content-type tag was not a good idea for .xhtml. So I mostly leave it
off these days for .xhtml (although not for .html). Not sure I am
correct in doing that, but if challenged, I think I could come up with
reasonable arguments for doing it my way.
--
http://www.ericlindsay.com
.
- Follow-Ups:
- Re: Safari inadequate?
- From: Sander Tekelenburg
- Re: Safari inadequate?
- From: JF Mezei
- Re: Safari inadequate?
- References:
- Safari inadequate?
- From: E Z Peaces
- Re: Safari inadequate?
- From: Davoud
- Re: Safari inadequate?
- From: Tim McNamara
- Re: Safari inadequate?
- From: Eric Lindsay
- Re: Safari inadequate?
- From: Sander Tekelenburg
- Re: Safari inadequate?
- From: Eric Lindsay
- Re: Safari inadequate?
- From: Sander Tekelenburg
- Re: Safari inadequate?
- From: Ian Gregory
- Safari inadequate?
- Prev by Date: First Review of MacSpeech Dictate 1.5 by Mel Martin
- Next by Date: Re: Safari inadequate?
- Previous by thread: Re: Safari inadequate?
- Next by thread: Re: Safari inadequate?
- Index(es):
Relevant Pages
|