(IE) Expressions Discussion

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    (IE) Expressions Discussion

    This thread has been split off of the thread about how to align a table in the middle of the page.

    @David Laakso:
    I finished reading the article and it made me look into using expressions in CSS. Although the author's solution was pretty neat I'm going to avoid using it. There are a few reasons for this decision:

    The first reason is because expressions are proprietary to Internet Explorer and so they are not going to work in other browsers.

    The second reason is because expressions were made available in IE5 but are no longer supported in IE8. One of the nice things about IE8 is that they are trying to become more standards complaint; but this means that stuff like expressions had to go.

    Another reason is because I'd be combining JavaScript into my CSS styles. This could possibly open the website to a cross site scripting attack which may be over looked.

    Also, expressions evaluation has a high runtime cost. Apparently they evaluated when the page is rendered, resized, when the page is scrolled, and even when the user moves the mouse over the page!

    I'm glad that you opened my eyes to the possibility of dynamic CSS solutions; however, I'm going to stay away from using CSS expressions.

    Thanks!

    -Frinny
  • David Laakso
    Recognized Expert Contributor
    • Aug 2008
    • 397

    #2
    I finished reading the article and it made me look into using expressions in CSS. Although the author's solution was pretty neat I'm going to avoid using it. There are a few reasons for this decision:
    Just for clarification:

    The first reason is because expressions are proprietary to Internet Explorer and so they are not going to work in other browsers.
    IE "expression s" are fed only to, and only seen, by non-compliant browsers IE/6 and down using "conditiona l comments" [1]. Compliant browsers do not need to be fixed, nor does IE/7.0, nor will the forthcoming IE/8.
    [1]


    One of the nice things about IE8 is that they are trying to become more standards complaint; but this means that stuff like expressions had to go.
    Please see above.

    Another reason is because I'd be combining JavaScript into my CSS styles. This could possibly open the website to a cross site scripting attack which may be over looked.
    That the inclusion of the DHTML used in IE "expression s" could possibly "open the website to a cross site scripting attack" is slim to none.

    Also, expressions evaluation has a high runtime cost. Apparently they evaluated when the page is rendered, resized, when the page is scrolled, and even when the user moves the mouse over the page!
    The load time using "expression s" is a very slightly slower than using a pure javascript solution. However, this is far outweighed by a much smoother less page jolting experience for users than that offered by a pure js solution.

    I'm glad that you opened my eyes to the possibility of dynamic CSS solutions; however, I'm going to stay away from using CSS expressions.
    CSS deals with the way stuff looks, not its behavior. With "expression s" you are attaching DHTML in order to make IE/6 and down behave as compliant browsers.

    A decision not to support IE/6 is up to you and your client. Not all authors and clients have that luxury. Regrettably, IE/6 will be around for some time to come even after the release of a stable IE/8. However, current thinking among some is that the time to provide IE/6 with pixel perfect emulation of compliant browser rendering are long gone...

    Comment

    • Stomme poes
      New Member
      • Aug 2007
      • 14

      #3
      The first reason is because expressions are proprietary to Internet Explorer and so they are not going to work in other browsers.
      The beauty of them is, only IE gets the penalty of using them, and the other browsers don't need it anyway. I've used expressions (not too many on any one page) for a few things for IE6 alone. 60% of my visitors will never load the expression-- they're using IE7 or a modern browser (I don't have an expression for display: table but I would consider one if I found it-- IE8 understands display: table AND has lost the Haslayout thing, so it wouldn't need the crutch either). Those who do load the expression give their inferior browser a helping hand. Some IE6 folks might have their security settings at the High level (a good thing if they can't switch browsers and are worried about security), and they don't get the expressions (just as they don't get any Java-junk anyway). They simply get a degraded experience. My rule, I think most web developers' rule, is that the site just needs to be readable and functioning, nothing more, for these people.

      An expression is a crutch for the crippled. You don't say, grandpa doesn't get his wheelchair because it doesn't help his relatives. Only grandpa needs it, and only grandpa gets it.

      There's another way to give scripts to IE alone-- a .htc file sitting on your server like Peterned's whatever:hover or that Edward Dean IE7 script thingie. You can try to make that file as secure as any on your server. It's your file and your server. : )

      Comment

      • drhowarddrfine
        Recognized Expert Expert
        • Sep 2006
        • 7434

        #4
        If you know Shelley Powers, as of January 2010, she refuses to give crutches to grandpa, err IE, of any kind. If IE can't run a current, standards compliant markup, too bad.

        Comment

        • David Laakso
          Recognized Expert Contributor
          • Aug 2008
          • 397

          #5
          Shelley Powers? That poor thing can't make a site that works properly in a compliant browser.

          Comment

          • drhowarddrfine
            Recognized Expert Expert
            • Sep 2006
            • 7434

            #6
            Have you been there lately? I hadn't till just now. I don't know if she sends different content to IE but she serves XHTML as application/xml+xhtml but she does have some errors in it. I don't know if it's because she's sloppy or because she runs on the bleeding edge.

            She works down the street from me so I have to give her props. :)

            Comment

            • David Laakso
              Recognized Expert Contributor
              • Aug 2008
              • 397

              #7
              Oh she's fine. Talented, knowledgeable, and on the cutting edge. I was just trying to stoke the stove. But April is almost here.

              Comment

              • David Laakso
                Recognized Expert Contributor
                • Aug 2008
                • 397

                #8
                Yet even more trivial pursuits:
                This is an IE expressions discussion. Not a CSS expressions discussion.

                Comment

                Working...