SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,011
    Mentioned
    56 Post(s)
    Tagged
    0 Thread(s)

    Dear Santa, I want a browser for Christmas

    Dear Santa.

    I am a web developer. The bane of my existence are programs called web browsers. You might have heard of a few - Internet Explorer is probably the one that's gotten me the closest to landing on the naughty list for untoward language in the workplace. I have to test the browsers that people use to see the net as long as they are common enough for the clients that pay my bills to care (this thankfully means I stopped testing Netscape 4 ages ago).

    You may be bewildered as to why I'd want another browser to test on. Let me explain. I have noticed that if I write my code precisely and to specifications I can be fairly certain it will work on all browsers not manufactured by Microsoft, and that it will even work on the Microsoft browsers much of the time if I follow certain guidelines, like avoiding css float calls when possible.

    However, all browsers want to be a hero. They want my page to look nice no matter how deplorable my coding habits are. They will try to smooth over outright errors and mistakes on my part and here lies my problem. The mistakes that one browser tolerates may cause another fits. There are validation programs out there sure, and they work fairly well, but often I find myself using them after the error has been in the page for some time, and working it back out can be a problem.

    So what I want is a browser that doesn't want to be a hero. I even have a name for it. I would like it to be called Canary. As in, miner's Canary. I'm not too particular about the engine it rests on - be it Webkit or Gecko - as long as the engine is standards compliant. However, unlike standard browsers which will ignore errors, Canary will die when it hits errors, and chirp warnings about deprecated calls.

    I mean, in theory, shouldn't it be easier to write a browser that can't parse bad code on purpose. Sure the general public would never want such a browser - Ahem, I wouldn't want it as a general use browser since I'm guessing 90% of all pages on the web are coded badly anyway. But as a programmer I could find a lot of use out of a browser so picky about the code that, once you got it to actually parse a page, you could be confident the more tolerant browsers of the world will parse it too.

    As long as they aren't manufactured by Microsoft that is...

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,604
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Have you checked out Amaya? It is supposed to be the closest to enforcing the standards since it was written by the same people as wrote the standards.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,457
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)
    AFAIK, if you serve an XHTML page as XHTML (Firefox, Opera?) will not render the page if it contains any outright errors. The problem is when there are differences between how one wants the page to render and how one's written it to be rendered. Although it might seem like a good idea to want a browser that can read minds and render pages as intended instead of how they're actually written, that would take a lot of the fun out of writing pages no? I think a lot has to do with learning by trial-and-error. Say a newbie mungs together some code (not really knowing the whats or whys), and tries it out in a browser. If it looks OK, then it's natural to assume things were done right. And the newbie thinks they know how to write code. With experience one learns that one is always learning and they never know everything (especially since the rules keep changing )

  4. #4
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,011
    Mentioned
    56 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mittineague View Post
    AFAIK, if you serve an XHTML page as XHTML (Firefox, Opera?) will not render the page if it contains any outright errors. The problem is when there are differences between how one wants the page to render and how one's written it to be rendered. Although it might seem like a good idea to want a browser that can read minds and render pages as intended instead of how they're actually written, that would take a lot of the fun out of writing pages no? I think a lot has to do with learning by trial-and-error. Say a newbie mungs together some code (not really knowing the whats or whys), and tries it out in a browser. If it looks OK, then it's natural to assume things were done right. And the newbie thinks they know how to write code. With experience one learns that one is always learning and they never know everything (especially since the rules keep changing )
    XHTML is a myth. Seriously.

    IE can't read XHTML pages under their proper header AT ALL - even IE 8 can't. While 90&#37; of the world can't use it, it's utterly useless.

    XHTML is worse than a buzzword - it's a misconception and misapplication of a technology that knaws at the very marrow of the web.

    It was a grand idea to be sure - that it is a myth is yet another in a long list of crimes against the progress of computer science committed by Microsoft and their monopoly.

    Serving XHTML pages with text/html just sends IE 6 into quirks mode. Since it's FAR easier to write pages for IE 6 in standards mode (such as it is with Microsoft) it is best to use HTML 4.01 Strict.

    I say again, XHTML is a myth.

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,604
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    IE with a valid XHTML 1.0 doctype does NOT go into quirks mode but displays identically with the way it would display with an HTML 4.01 doctype.

    Writing XHTML 1.0 and serving it that way to any browser except Interweb Exploder is a perfectly valid way of testing that the XHTML code is 100&#37; correct. You'd then add the JavaScript and serve it as text/html so that the 50% of people who haven't yet upgraded to a modern web browser can see it as well as the 50% who have. It isn't worth trying to actually serve it to visitors as XHTML yet (unless you want to ignore all those running antique browsers) as the JavaScript will be significantly different between the HTML and XHTML versions.

    Michael Morris is a myth - XHTML is real and has its uses (of which serving web pages to the public is NOT one).
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #6
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mittineague View Post
    AFAIK, if you serve an XHTML page as XHTML (Firefox, Opera?) will not render the page if it contains any outright errors.
    That's corrrect when it comes to well-formedness errors. They will do their best if you have well-formed, but invalid, markup though. Like a block-level element nested inside an inline element. It's only the XML parser that aborts, and it doesn't know anything about validity, only about well-formedness.

    Quote Originally Posted by felgall View Post
    IE with a valid XHTML 1.0 doctype does NOT go into quirks mode but displays identically with the way it would display with an HTML 4.01 doctype.
    IE6 will use quirks mode if you have an XML declaration before the doctype declaration (which you should have, since XML is meant to be self-describing). IE7 handles that particular case (but, IIRC, goes into quirks mode if you have anything else, like a comment, before the doctype declaration).
    Birnam wood is come to Dunsinane

  7. #7
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,011
    Mentioned
    56 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    XHTML is real and has its uses (of which serving web pages to the public is NOT one).
    Riight. Nice ad homenim - I didn't know SitePoint set their standards so low for mentors. Go on then, keep serving tag-soup. You cannot escape the truth which is this:

    1) If the document is VALID XML it MUST have an XML doctype header. Period - end of discussion.

    2) XHTML is a subset of XML and all rules that apply to XML apply to XHTML.

    3) If the document is VALID XHML it MUST be served with the MIME type application/xhtml+xml

    THESE are the specifications of W3C. I didn't write them. And here's the trick, you CANNOT serve XHTML to IE according to that standard. You can fudge it sure - but what the hell is the point? I would think the point was to move to a more stable markup - but kludges like the ones you mention undo work on that front.

    The point you seem to miss is that the moment you go to the wrong mime type header you LOSE everything XHTML is supposed to bring to the table - validation. At that point, even in Firefox, Opera, Safari and Chrome your page no longer HAS a type as far as the browser is concerned. It's "tag soup" time and each browser will be puzzling things out as best they can using the most likely standards match.

    Until IE supports XHTML you can't make any use of it because the best valid markup that IE does support - HTML 4.01 Strict - is different enough from XHTML that simply changing headers isn't going to validate it. For example - <br /> (or any /> short tag closing) is illegal under HTML. The browsers out there are smart enough to figure out what's going on - but in so doing they regard your page as invalid and start parsing it in whatever quirks mode they have (yes, Firefox and Safari do have quirks modes of their own).

  8. #8
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,457
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)
    I use PHP (rather than javascript) to look for HTTP_ACCEPT application/xhtml+xml headers and serve the pages as XHTML to those that accept it.

    I guess it's a matter of chosing between older IE browsers and the rest.

    For a while I was more on the IE side, but a while I've been on the other. True, it means some additional testing and tweaking to make sure IE doesn't make a total mess of things, but so far any differences I've noticed have been acceptable to me.

    What concerns me is the vast number of browsers that I can't test for. It's more of a hunch, or wishful thinking perhaps, but I like to think that the other browsers are most likely to render valid XHTML more closely to my intentions than if I catered to IE.

    I guess if it realy bothered me, I could wrap the offending tags (eg. self-closers) in conditional comments or write something that removed the close slash for IE, but I haven't bothered to yet.

  9. #9
    SitePoint Member
    Join Date
    Apr 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Michael Morris View Post
    Dear Santa.

    I am a web developer. The bane of my existence are programs called web browsers. You might have heard of a few - Internet Explorer is probably the one that's gotten me the closest to landing on the naughty list for untoward language in the workplace. I have to test the browsers that people use to see the net as long as they are common enough for the clients that pay my bills to care (this thankfully means I stopped testing Netscape 4 ages ago).

    You may be bewildered as to why I'd want another browser to test on.

    I would like it to be called Canary. As in, miner's Canary. I'm not too particular about the engine it rests on - be it Webkit or Gecko - as long as the engine is standards compliant. However, unlike standard browsers which will ignore errors, Canary will die when it hits errors, and chirp warnings about deprecated calls.

    I mean, in theory, shouldn't it be easier to write a browser that can't parse bad code on purpose. Sure the general public would never want such a browser - Ahem, I wouldn't want it as a general use browser since I'm guessing 90% of all pages on the web are coded badly anyway. But as a programmer I could find a lot of use out of a browser so picky about the code that, once you got it to actually parse a page, you could be confident the more tolerant browsers of the world will parse it too.

    As long as they aren't manufactured by Microsoft that is...
    Although I'm not a programmer myself, I do have some in my circle & can guarantee you that they have similar thoughts & frustrations. I would support the Canary browser for programmers for sure.
    Cheers.

  10. #10
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,604
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Michael Morris View Post
    1) If the document is VALID XML it MUST have an XML doctype header. Period - end of discussion.
    If that were true then the standards would not specify that the XML header is optional. Also the XML header isn't a doctype header, where the XML header exists the doctype header follows it.

    Also the standards specify that XHTML 1.0 is allowed to be served as HTML provided that the additional rules in appendix C are followed.

    It is only versions of XHTML from 1.1 onward that must be served as XHTML.

    At least that is what the W3C standards actually say (obviously you missed reading those parts).
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  11. #11
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Michael Morris View Post
    1) If the document is VALID XML it MUST have an XML doctype header. Period - end of discussion.
    A doctype declaration is only required if you have a validating XML parser, which browsers don't. Non-validating XML parsers only require that the markup is well-formed.

    Quote Originally Posted by Michael Morris View Post
    2) XHTML is a subset of XML and all rules that apply to XML apply to XHTML.
    XHTML is an application of XML 1.0, not a subset (in the same way that HTML is – in theory – an application of SGML; XML is a subset of SGML). XML rules apply for XHTML, provided it's served with an XML MIME type (e.g., application/xhtml+xml).

    Quote Originally Posted by Michael Morris View Post
    3) If the document is VALID XHML it MUST be served with the MIME type application/xhtml+xml
    No. It SHOULD be served as application/xhtml+xml, application/xml or text/xml. An informal W3C note states that it MAY also be served as text/html, but of course that makes it (invalid) HTML, not XHTML.
    Birnam wood is come to Dunsinane


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •