XHTML 1.1 and Firefox
Moderator: General Moderators
XHTML 1.1 and Firefox
Is there any reason why Firefox removes ending slashes from xhtml 1.1 documents?
e.g. <input type="text" /> is now <input type="text">
e.g. <input type="text" /> is now <input type="text">
Re: XHTML 1.1 and Firefox
It's just how it works, I don't think W3 has specified how it should be (I didn't found anything about it), so they implemented it as they wanted.
edit: FF does that for all doctypes. Safari also does it.
edit: FF does that for all doctypes. Safari also does it.
Re: XHTML 1.1 and Firefox
Are you actually serving your pages as XHTML?? If not, then firefox will convert it to HTML in order to display it.
Re: XHTML 1.1 and Firefox
Yes, I have the correct doctype and syntax. I guess I found what it is. When you 'view source' it shows alright but if you 'view selection source' it seems it converts it to plain html because Firefox can't find the doctype.
Re: XHTML 1.1 and Firefox
But what content-type are you setting?Sindarin wrote:Yes, I have the correct doctype and syntax.
Re: XHTML 1.1 and Firefox
When you "view source", you view the code as it was first sent to the browser. When you "view selection source", you are viewing the current source code - complete with any changes Firefox may have made, as well as any code changes resulting from Javascript.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: XHTML 1.1 and Firefox
Ah, thanks for clearing it up.
Re: XHTML 1.1 and Firefox
No, seriously what content-type are you setting?!?!
Surely firefox wouldn't need to convert XHTML to HTML if it is served as XHTML. I would have thought it only need convert it if the content-type is set as HTML...that way it has to validate it all and stuff. With XHTML there's no need.
Surely firefox wouldn't need to convert XHTML to HTML if it is served as XHTML. I would have thought it only need convert it if the content-type is set as HTML...that way it has to validate it all and stuff. With XHTML there's no need.
Re: XHTML 1.1 and Firefox
If that's what you want:
Code: Select all
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />Re: XHTML 1.1 and Firefox
Yeah...you're sending it as text/html. If you want it to render as XHTML, you have to send it as application/xhtml+xml or something similar. That's probably why it's being converted...
Re: XHTML 1.1 and Firefox
D: Wow, there is a need to actually define a different content type for xhtml documents? How come the w3c validator didn't catch this in my code?
btw, I've seen <?xml version="1.0" encoding='UTF-8'?> tags on some pages, is this necessary as well for xhtml documents?
btw, I've seen <?xml version="1.0" encoding='UTF-8'?> tags on some pages, is this necessary as well for xhtml documents?
Re: XHTML 1.1 and Firefox
please don't try to serve it as xml.. you're entering a world of pain
Re: XHTML 1.1 and Firefox
If you validate your page with the "mobile validator" or whatever it is, I think you get warned about sending the wrong content-type...
But the thing is, IE doesn't understand XHTML at all, and will prompt the user to download the page since it can't display it...despite it stating that it accepts all content types in its headers. So most people still send their pages as HTML. But then obviously the advantages of XHTML's rendering speed are lost since the browser will have to validate and convert it all.
With XHTML, since invalid syntax results in an error, the browser doesn't need to validate it...so in theory, it should be faster.
You could do a bit of user agent sniffing to check for IE, and send the relevant content-type headers.
And I'm not entirely sure about the <?xml....> tbh
I suppose that stricly, yes...there should be an XML declaration. But since XHTML isn't actually XML I don't think it's required.
Anyway, that's all what I've heard
Hope this helps...
But the thing is, IE doesn't understand XHTML at all, and will prompt the user to download the page since it can't display it...despite it stating that it accepts all content types in its headers. So most people still send their pages as HTML. But then obviously the advantages of XHTML's rendering speed are lost since the browser will have to validate and convert it all.
With XHTML, since invalid syntax results in an error, the browser doesn't need to validate it...so in theory, it should be faster.
You could do a bit of user agent sniffing to check for IE, and send the relevant content-type headers.
And I'm not entirely sure about the <?xml....> tbh
Anyway, that's all what I've heard
Re: XHTML 1.1 and Firefox
Surely that's the point of XHTMLpytrin wrote:please don't try to serve it as xml.. you're entering a world of pain
Re: XHTML 1.1 and Firefox
Oh yes! Whip me more Mistress w3c!please don't try to serve it as xml.. you're entering a world of pain
I am confused now. I think I should migrate back to html as xhtml is "kind of" discontinued D: