473,406 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

(IE) Expressions Discussion

Frinavale
9,735 Expert Mod 8TB
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
Mar 26 '09 #1
7 3376
David Laakso
397 Expert 256MB
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 "expressions" are fed only to, and only seen, by non-compliant browsers IE/6 and down using "conditional comments" [1]. Compliant browsers do not need to be fixed, nor does IE/7.0, nor will the forthcoming IE/8.
[1]
http://reference.sitepoint.com/css/conditionalcomments

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 "expressions" 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 "expressions" 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 "expressions" 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...
Mar 26 '09 #2
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. : )
Mar 27 '09 #3
drhowarddrfine
7,435 Expert 4TB
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.
Mar 27 '09 #4
David Laakso
397 Expert 256MB
Shelley Powers? That poor thing can't make a site that works properly in a compliant browser.
Mar 27 '09 #5
drhowarddrfine
7,435 Expert 4TB
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. :)
Mar 27 '09 #6
David Laakso
397 Expert 256MB
Oh she's fine. Talented, knowledgeable, and on the cutting edge. I was just trying to stoke the stove. But April is almost here.
Mar 27 '09 #7
David Laakso
397 Expert 256MB
Yet even more trivial pursuits:
This is an IE expressions discussion. Not a CSS expressions discussion.
Mar 29 '09 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

72
by: Raymond Hettinger | last post by:
Peter Norvig's creative thinking triggered renewed interest in PEP 289. That led to a number of contributors helping to re-work the pep details into a form that has been well received on the...
2
by: zipher | last post by:
It seems the debate over PEP 308 (if-then-else expression) occurred prior to the arrival of generator expressions. Mightn't this new latter syntax be the ticket to a "one obvious way" to write a...
10
by: tony kulik | last post by:
This code works fine in ie and opera but not at all in Mozilla. Anybody got a clue as to how to get it right? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <script...
102
by: me | last post by:
How do I prevent the save/print/email/mypictures toolbar from popping up when IE users place their cursor over photos at my website? Thank you in advance for your help. Signed, me
17
by: William L. Bahn | last post by:
=========== (N869, p8) An object is a region of data storage in the execution environment, the contents of which can represent values. When explaining this to students, is it reasonable to say...
10
by: nimmi_srivastav | last post by:
Below you will see an example of a nested conditional expression that this colleague of mine loves. He claims that it is more efficient that a multi-level if-else-if structure. Moreover, our...
20
by: Neroku | last post by:
Hello, i would like to know what the serious definition of statements and expressions is: i know an expression are evaluated to a value, i.e: 1 == 2 5+7 foo( 1,2) and a statement is...
13
by: Wiseman | last post by:
I'm kind of disappointed with the re regular expressions module. In particular, the lack of support for recursion ( (?R) or (?n) ) is a major drawback to me. There are so many great things that can...
3
by: RobG | last post by:
There has been a discussion on the iPhone web development group where an opinion has been expressed that function expressions are bad for performance and can be avoided by using function...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.