Re: [WSG] ie-only hack
At 12/18/2006 01:58 AM, Barney Carroll wrote: Geoff Pack wrote: Gunlaug Sørtun wrote: So, old hacks like the 'star html' hack for IE6 (and older versions) is now perfectly valid IMO, while hacks relying on bugs that have survived into IE7, are extremely unsafe. 'extremely unsafe'? I'd say they are safe until Microsoft releases another IE version. With their track record, that could be *years*. Given the choice between littering my html (thousands of pages) with conditional comments, or adding couple of hacks to a single CSS file, I'll take the hacks, thank you very much. Despite all the doomsayers, I had zero problems with pages breaking when IE7 came out. cheers Geoff. I agree with this. If we're going for zen purity, I agree that theoretically hacks could be a liability. But seriously, how many years have you been telling yourself the star hack is unsafe? What did that lack of safety ever mean? Same as it means now -- the likelihood that someday your code will fail because it depends on the coincidence of two unrelated bugs in an evolving software product. Lack of support for multiple classes can hardly be called a 'bug' at this point. It's more like a 'feature'. Only if you accept Microsoft's bugs as standards in preference to the W3C spec. It's slightly arrogant to believe that you can exploit a program's invisible weaknesses to cover its visible others; but it's more naive to believe that Microsoft would tackle hacks like this. Seriously - if you're going to ascribe IE's dev team the virtue of wanting to tackle IE's problems, you'd think their priority list would start with rendering flaws and end with let's see how css coders are fixing our browser and screw it up for them. Given their recent work on IE7, I don't think it's too naive to ascribe to them a desire to fix their software to match the spec: __ To match a subset of class values, each value must be preceded by a .. Example(s): For example, the following rule matches any P element whose class attribute has been assigned a list of space-separated values that includes pastoral and marine: p.marine.pastoral { color: green } This rule matches when class=pastoral blue aqua marine but does not match for class=pastoral blue. http://www.w3.org/TR/CSS21/selector.html#class-html __ Lack of support for multiple classes can hardly be called a 'feature' at this point. It's more like a 'bug'. Regards, Paul *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] ie-only hack
Paul Novitski wrote: But seriously, how many years have you been telling yourself the star hack is unsafe? What did that lack of safety ever mean? Same as it means now -- the likelihood that someday your code will fail because it depends on the coincidence of two unrelated bugs in an evolving software product. I believe that even the most clueless of futurologists can believe that IE6 isn't going to get any radical updates in our lifetimes :) Lack of support for multiple classes can hardly be called a 'bug' at this point. It's more like a 'feature'. Only if you accept Microsoft's bugs as standards in preference to the W3C spec. It's not just a question of what we and the w3 believe. The only reason we tackle these things in the first place is because Microsoft is incredibly influential. We have to consider the fact that to this day (and the concept has been floating a pretty long time) they still don't want to implement multiple class selectors. When I say this, I'm not suggesting that multiple class rules are a bad thing at all. I'm asserting what I believe to be a fairly certain judgment that Microsoft don't like the notion. If they do, they've had plenty of time to implement it and haven't. It's an incredibly basic translation process, after all. I would like to see IE support multiple classes, but if it resolutely doesn't, we can use this feature inventively. Given their recent work on IE7, I don't think it's too naive to ascribe to them a desire to fix their software to match the spec: I am by no means suggesting that IE7 is less advanced than IE6, but it is still plenty buggy in both familiar and fresh ways. A significant update such as this creates all sorts of new problems and new ways to solve them. We have to evolve with them. All of us. Hackers have developed sites which fail to some degree under IE7, and they have had to investigate, look over their code, test and amend. The same has happened to everyone else. There seems to be this notion that hackers run the risk of having to do some extra work when a new browser comes out. Who doesn't? Regards, Barney *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] ie-only hack
Geoff Pack wrote: Gunlaug Sørtun wrote: So, old hacks like the 'star html' hack for IE6 (and older versions) is now perfectly valid IMO, while hacks relying on bugs that have survived into IE7, are extremely unsafe. 'extremely unsafe'? I'd say they are safe until Microsoft releases another IE version. With their track record, that could be *years*. Sounds like a reasonable time frame. I seem to remember a suggested time frame of three years (after the first IE7 beta) before IE8 (or whatever it's going to be called/numbered) will be released. Given the choice between littering my html (thousands of pages) with conditional comments, or adding couple of hacks to a single CSS file, I'll take the hacks, thank you very much. I don't recommend 'conditional comments', so, you're most welcome. There are some weak spots in your argumentation, as you seem to only make a division between 'conditional comments' and 'other hacks'. To me a 'conditional comment' is a constructed hack, and I see no reason to litter anything with it, unless there's no other option. However, those 'conditional comments' won't target any other versions than they are set up, so they are pretty safe in themselves. It's when it comes to _what_ we use a particular hack for that it becomes a bit more diverse. It is always unsafe to use one bug to fix another - unless both bugs are brought under control in _all_ the latest browser-versions. 'Conditional comments' can be even worse unless one adds one for each IE-version/upgrade as they are released, as all targeted bugs can be fixed in a way that makes the CC-injected fix break the newly fixed browser. New browser-versions that are patched-up versions of old ones - like IE7 - are really unpredictable in this respect, so at least it's a good thing that the 'star html' hack won't affect IE7 - unless one wants it to. I am not hooked on purity, and couldn't care less about _how many_ (if any) hacks and/or workarounds there are in stylesheets - as long as they are really needed in order to make things work. All I'm interested in is to minimize the chance for such hacks to backfire in future browser-versions. I want hacks, _all_ hacks, to break (stop working) in future browser-versions - preferably along with the bugs they are supposed to fix, so I can use those very hacks to fix bugs and weaknesses in older versions as long as those older versions are around in significant numbers. So, I don't stop using hacks when they stop working in the latest browser-version. Instead, that is when I really start using them. The 'multiple-class-selectors' bug/hack is still not safe to use, IMO. regards Georg -- http://www.gunlaug.no *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] ie-only hack
Gunlaug Sørtun wrote: To me a 'conditional comment' is a constructed hack, and I see no reason to litter anything with it, unless there's no other option. However, those 'conditional comments' won't target any other versions than they are set up, so they are pretty safe in themselves. A point worth making. A valid html page with conditional comments linking to valid css would not load that css in a valid environment. Imagine an IE only stylesheet that is called, in one instance, by a conditional comment and in the second, by a regular comment - but in this instance every selector ends in a comma. 1.In terms of valid computing, the first one contains content in the comments. The second contains extra content, but the css called by this content 'doesn't have selectors'. 2.In terms of human readability, you can pretty much work out what those 'comments' are doing. In the second instance, a semantic filename might make it equally clear what's going on in the special stylesheet - when you look at it you may or may not get thrown by the commas but hopefully their significance is pretty clear. 3.In practice, IE has no problem with either method. They make as much of a difference due to key differences in what IE can conceivably understand. Validity-respecting browsers will give errors for every rule of the second method, but at least they can see everything. The only reason the first method passes is because utterly invalid functions are being hidden from it. Validity is abused on both counts as far as I see it. The psychology of the first count is that you're saying validators can't accept browser differences, so you're duping them into thinking there are none and hiding crucial content from the validation process. My psychology is that what could be debated as ambiguous or just plain wrong in the status quo of valid css coding does in fact get digested in IE. Both of these methods rely on abusing bugs in the validation process. I believe both would be fixed in an ideal world - but actually none of us have suggested this because we need these methods. The notion that IE should coherently evolve in the scope of standards at a faster rate than the development of standards is one that has never stood the test of time, but one espousers of the first philosophy take for support when suggesting their methods are safer. Regards, Barney *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] ie-only hack
On Sat, Dec 16, 2006 at 09:48:58PM -0800, Paul Novitski wrote: I believe the reason it's an ie-only hack is that standards-compliant browers won't apply the selector .ie-only.foo to any element because no element has both classes ie-only and foo div class=foo ie-only This element has both classes /div -- David Dorward http://dorward.me.uk *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] ie-only hack
David Dorward wrote: On Sat, Dec 16, 2006 at 09:48:58PM -0800, Paul Novitski wrote: I believe the reason it's an ie-only hack is that standards-compliant browers won't apply the selector .ie-only.foo to any element because no element has both classes ie-only and foo div class=foo ie-only This element has both classes /div That's the way I saw it at first too, but in fact there would be no ie-only class plugged anywhere in the markup. It'd only appear in the styles sheet. I think it's a rather smart hack... BTW, do we know if it works in IE Mac too? --- Regards, Thierry | www.TJKDesign.com *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] ie-only hack
At 12/17/2006 01:17 PM, Thierry Koblentz wrote: David Dorward wrote: On Sat, Dec 16, 2006 at 09:48:58PM -0800, Paul Novitski wrote: I believe the reason it's an ie-only hack is that standards-compliant browers won't apply the selector .ie-only.foo to any element because no element has both classes ie-only and foo div class=foo ie-only This element has both classes /div That's the way I saw it at first too, but in fact there would be no ie-only class plugged anywhere in the markup. It'd only appear in the styles sheet. I think it's a rather smart hack... BTW, do we know if it works in IE Mac too? Clever as it is, this hack is mis-named -- it should be: .browsers-that-dont-support-multiple-class-selectors.foo {...} It stops being ie-only as soon as Microsoft fixes this particular bug without fixing others.The reason it's a hack is that it doesn't actually address the problem directly -- the problem being IE's box model or whatever other IE bug you're working around with this selector. It's highly unlikely that this multiple-class selector hack will ever be used to address the problem of IE not supporting multiple-class selectors, which is the only context in which it could be considered good engineering. I'm with Rob -- use conditional comments if you don't want your hack to break one or two browser versions from now.It know it seems like tomorrow will never come, but it will, and when it does (as is happening even now with IE7) hacks will fail. If you don't think the web pages you're creating today will still be here in five years, look around. I am, by the way, the pot criticizing the kettle's soot -- I'm still weaning myself off * html selectors. Regards, Paul *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] ie-only hack
At 12/15/2006 09:14 AM, Rafael Mumme wrote: .foo { background:red;width:100px;height:100px; } .ie-only.foo { background:blue; } At 12/15/2006 11:08 AM, Thierry Koblentz wrote: Actually, unless I'm missing something, it should be .non-ie I believe the reason it's an ie-only hack is that standards-compliant browers won't apply the selector .ie-only.foo to any element because no element has both classes ie-only and foo, while IE will apply it to any element with the class foo because it sees only the final class of a multiple-class selector. Regards, Paul *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] ie-only hack
Paul Novitski wrote: At 12/15/2006 09:14 AM, Rafael Mumme wrote: .foo { background:red;width:100px;height:100px; } .ie-only.foo { background:blue; } At 12/15/2006 11:08 AM, Thierry Koblentz wrote: Actually, unless I'm missing something, it should be .non-ie I believe the reason it's an ie-only hack is that standards-compliant browers won't apply the selector .ie-only.foo to any element because no element has both classes ie-only and foo, while IE will apply it to any element with the class foo because it sees only the final class of a multiple-class selector. Hi Paul, There was no markup associated with the original post, so after David's post: If by it works you mean that IE 6 and 7 get a red background while other browsers get a blue background, then you'd be right. I assumed the attribute included *both* classes: class=ie-only foo So thanks for the heads-up, *now* it makes more sense. :) --- Regards, Thierry | www.TJKDesign.com *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] ie-only hack
Rafael I would recommend never hack. Where you feel it absolutely necssary / it is totally unavoidable use external style sheets and call using I.E. conditional comments -- Regards - Rob Kirton Raising web standards : http://ele.vation.co.uk Connecting to others: http://www.linkedin.com/in/robkirton On 15/12/06, Rafael Mumme [EMAIL PROTECTED] wrote: Is it safe to use this hack? style .foo { background:red;width:100px;height:100px; } .ie-only.foo { background:blue; } /style It works in IE 6 and IE 7. Will Microsoft support this in next versions of IE? Thanks. *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *** *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] ie-only hack
On Fri, Dec 15, 2006 at 03:14:51PM -0200, Rafael Mumme wrote: Is it safe to use this hack? It's a hack, so no. style .foo { background:red;width:100px;height:100px; } .ie-only.foo { background:blue; } /style It works in IE 6 and IE 7. If by it works you mean that IE 6 and 7 get a red background while other browsers get a blue background, then you'd be right. Internet Explorer doesn't support combinations of multiple class selectors. Will Microsoft support this in next versions of IE? Support the hack? No, if the hack continues to work it will be because they haven't gotten around to fixing the bug. They support conditional comments (which, since they don't depend on bugs or lack of support in CSS parsers, are rather more dependable). Support combinations of multiple class selectors? I hope so. -- David Dorward http://dorward.me.uk *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] ie-only hack
Cool hack, Rafael I love the way people live in constant fear of Microsoft fixing bugs. And when their developers eventually do sit down to tackle IE's problems and release an update, they're not going to tackle any of the crippling rendering problems and will instead devote their time to removing all the life-saving compiling methods. Based on personal experience, I find no real cause for worry. An .ie-only selector is a fantastic little creature that I hadn't seen before. It has the advantage of being semantic - people will look at your code and know what's going on. My alternative is ending your selector with a comma , which causes everything apart from IE to ignore the rule. I'd say that in this case IE performs logically, but (especially if you don't know about it) it's easily missed and can easily confuse my target audience (other designers reading through my CSS code). But whereas the star hack * html relies on a bug which remains (it is often used to compensate for behaviour that IE7 has mostly fixed, so I hardly think the sites that rely on it are turning in their graves), I think the two hacks above are not exploiting bugs (I can't imagine .ie-only being a mistake, somehow). Regards, Barney *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] ie-only hack
Barney Carroll wrote: An .ie-only selector is a fantastic little creature that I hadn't seen before. It has the advantage of being semantic - people will look at your code and know what's going on. Actually, unless I'm missing something, it should be .non-ie --- Regards, Thierry | www.TJKDesign.com *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***