SitePoint Sponsor

User Tag List

Results 1 to 19 of 19
  1. #1
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,658
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)

    IE getting rid of CC's in version 10

    First I heard of it. Good maybe now everyone can stop pushing them.

  2. #2
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,117
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    It's a handy hack though, this sort of thing allows for solutions like http://james.padolsey.com/javascript...onal-comments/

  3. #3
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,658
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    If you buy bigger pants (AKA CC's) it allows for slips in your diet (AKA standard compliance). Good analogy huh

  4. #4
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,314
    Mentioned
    19 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by EricWatson View Post
    Good maybe now everyone can stop pushing them.
    You're certainly free to dislike them, but you should at least be aware that the web community in general likes and has embraced the conditional comment class solution. And for good reason, I think. The traditional drawbacks of CCs, such as multiple stylesheets, are no longer an issue, and our CSS becomes cleaner and self-documenting. .ie selector {} is much more clear than virtually every hack.
    "First make it work. Then make it better."

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Getting rid of them in IE10 shouldn't be a problem as IE10 is compliant to all the same standards as the other browsers are - so all the conditional comments will be just comments as far as IE10 is concerned just as they are for other browsers.

    Also just because IE10 gets rid of them will not prevent them from working in IE9 and earlier.
    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 Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,314
    Mentioned
    19 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by felgall View Post
    ...shouldn't be a problem as IE10 is compliant to all the same standards as the other browsers are...
    Crossing my fingers that we won't uncover any inexplicable bugs that IE has historically been notorious for.
    "First make it work. Then make it better."

  7. #7
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,319
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by Jeff Mott View Post
    Crossing my fingers that we won't uncover any inexplicable bugs that IE has historically been notorious for.
    Every browser has its little quirks here and there. No doubt IE10 will have them too. At least (we hope) that M$ has tried to be standards compliant this time. And hopefully they will be good to their word and start pushing regular browser updates like the other browser makers do.

  8. #8
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Every browser has its little quirks here and there. No doubt IE10 will have them too.
    Hopefully they will be no different than the minor quirks with other browsers.

    The biggest problem I had with conditional comments was in IE9 which still supports the JScript conditional comments but where most of the things those comments are actually needed for are not what IE9 expects. So having IE10 not recognise conditional comments will resolve the last of the Javascript/JScript incompatibilities.
    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="^$">

  9. #9
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,319
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by felgall View Post
    having IE10 not recognise conditional comments will resolve the last of the Javascript/JScript incompatibilities.
    I don't know much about JScript, except what a massive PITA it is for a noob trying to learn JS, but this page makes me wonder if IE10 really doesn't understand JScript comments:

    http://en.wikipedia.org/wiki/Conditi...nts_in_JScript

    Code:
    @if (@_jscript_version == 10)
        document.write("You are using IE10");

  10. #10
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by ralph.m View Post
    I don't know much about JScript, except what a massive PITA it is for a noob trying to learn JS, but this page makes me wonder if IE10 really doesn't understand JScript comments:

    http://en.wikipedia.org/wiki/Conditi...nts_in_JScript
    Well first of all document.write has been obsolete since Netscape 4 and IE3 so that is an extremely poor example in the first place.

    A better example would be creating an input tag with a name (where you can't add a name to a field after it is first created in IE8 and earler):

    Code:
    var newIN;
    /*@cc_on
      @if(@_jscript)
         @if (@_jscript_version < 9)
            newIN = document.createElement("<input name='"+nam+"'>");
         @else
            newIN = document.createElement("input");
            newIN.name = nam;
         @end
      @else */
         newIN = document.createElement("input");
         newIN.name = nam;
    /* @end @*/
    Note that IE9 does not support the JScript way of creating input tags with names even though it claims to support JScript as well as JavaScript. I would hope that after IE9 supporting both that IE10 would drop support for JScript and only support JavaScript (but I coded the above to allow for it either way).
    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
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,892
    Mentioned
    123 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by EricWatson View Post
    If you buy bigger pants (AKA CC's) it allows for slips in your diet (AKA standard compliance). Good analogy huh
    Sure, but if you are a lardy butt, buying really tight pants just means you won't be able to wear them!

    If IE10 is sufficiently standards-compliant that it doesn't need conditional comments then this is great news. But it has to be that way round. Remember when we thought that IE7 was going to be the great saviour? And then that IE8 would? Yes, each of these has been a major step forwards, but we've still needed conditional comments all the way through. Hopefully with IE10 we have, at long last, a version that doesn't need them.

  12. #12
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,526
    Mentioned
    182 Post(s)
    Tagged
    6 Thread(s)
    Playing the devil's advocate I'm a little worried about losing CCs I must admit. IE9 is pretty good but due to its sub pixel sizing algorithms it's often 1px out in alignment of text and inline images due to its line height calculations and while that may not matter to me or you, some of my clients refuse to accept it especially when its something that should be simple. Although I tell my clients you can't control every pixel it does look bad when things are supposed to be aligned nicely in a row and they are 1px out vertically. I don't think the layout should look the same in different browsers but it shouldn't look broken in a modern browser.

    Mind you these days most of the comments I get from clients are "this looks wrong in Chrome" and although its usually something minor (not always though) it is a pain to work around. Maybe we should take the CC's from IE and give them to webkit

  13. #13
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,658
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    It's probably a good move. People fear change. e.g. Obama gets 2nd term. They think to themselves, "he's total !*%# but the new guy could be bigger *^%#. Don't forget he could be better.

  14. #14
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,314
    Mentioned
    19 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by EricWatson View Post
    People fear change.
    One of the weakest rebuttals ever. Some of the most highly respected people here at SitePoint, as well as highly respected people in the larger web community, have made rational and reasonable arguments in favor of CCs, but you dodged those arguments and instead chalked it up to fear or change.
    "First make it work. Then make it better."

  15. #15
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,658
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Dude stop poking at me. I don't care what you use. Nor should you I. I am mearly pointing out they are leaving. Make what you will of it.

  16. #16
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,314
    Mentioned
    19 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by EricWatson View Post
    I am mearly pointing out they are leaving.
    You did more than that, actually. You made a claim about why people use, and would like to keep using, CCs. And according to you, it isn't for any of the reasons we've expressed, but because we "fear change." How could you even expect such a questionable claim to go undisputed?
    "First make it work. Then make it better."

  17. #17
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,820
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    CCs are/were a good idea. CSS hacks are far more spotty and just as likely to break down in future versions. Most times when you use a CSS you were targeting an OLDER IE anyway and you could easily change the scope of the CC. But as it has been mentioned newer IE versions are fairly compliant and CCs as no longer as vital for basic page layout or 'bug fixes'.

    That being said, I will miss them too. It's not fear of change or even reliance on CCs ( I seldom used them but when I do they are a life saver!) ; it's that a tool has been taken out of my kit and that's never any fun.

  18. #18
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,658
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    For the record I have nothing against them. Why would why. For those busting out sites I see their need. But I have found there is 99.99% of the time a way to surcumvent their use without the need for hacks. Either let ie get square corners (ie users like that apparently) or code it using method number 7 instead of 11. They are somewhat (not all obviously) the lazy way out. If I could eat all I wanted (aka sloppy coding) and simply take a pill the next day (aka CCs) that would be lazy. Or easy depending on your perception. And YOUR perception being the key word. I've always been an advocate for do as you please I could care less. I only care what I do.

  19. #19
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by dresden_phoenix View Post
    CCs are/were a good idea.
    They would have been if they were actually implemented properly but the jscript ones were implemented incorrectly in IE9 - IE9 only supports part of JScript and has implemented full support for JavaScript - unfortunately a part of JScript that it supports is condifional comments and a part it doesn't support is the only code I have ever come across that needs those conditional comments to handle it - creating a named input or textarea field in a single command because JScript doesn't allow you to add the name after the field is created.


    @if(@_jscript) <-- this JScript CC recognised by IE9
    newIN = document.createElement("<input name='"+nam+"'>"); <-- this JScript invalid in IE9

    So you have to implement another JScript conditional comment to test specifically for IE9 because IE9 doesn't support that one JScript statement that you can't use feature sensing to detect.

    CC as implemented by Microsoft are are almost useless because they didn't implement them consistently. The one instance where a CC is needed in JScript is broken in IE9 because that's the one part of JScript that IE9 doesn't support.

    Unlike in HTML where IE changed what it supports between each version of the browser, the only change regarding JScript/JavaScript is that IE8 and earlier support JScript but not JavaScript and all other non-IE browsers support JavaScript and not JScript. IE9 supports JavaScript and JScript conditional comments but not the parts of JScript that need conditional comments to distinguish them from the JavaScript version. IE9 would work better if it didn't support JScript conditional comments and so force you to rewrite the code everywhere you have used them in order for IE9 to be able to run the JavaScript version instead of seeing the JScript code that it can't run.
    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="^$">


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
  •