HighDots Forums  

CSS and IE's CC evaluation (Was: Re: A stylesheet for IE, another one for web browsers)

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss CSS and IE's CC evaluation (Was: Re: A stylesheet for IE, another one for web browsers) in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jan Roland Eriksson
 
Posts: n/a

Default CSS and IE's CC evaluation (Was: Re: A stylesheet for IE, another one for web browsers) - 01-11-2005 , 06:21 PM






On 09 Jan 2005 12:24:39 +0000, "Jón Fairbairn"
<jon.fairbairn (AT) cl (DOT) cam.ac.uk> wrote:

Quote:
Daniel Déchelotte <maitre_yodan (AT) fr (DOT) club-internet.invalid> writes:
I am using for now conditional comment[3] (clean) to give
IE its CSS, and a IE parsing bug[4] (not clean) to hide
the real CSS from IE:
[...]

Quote:
I am wondering whether a better method exists, especially one that would:
* not rely on a IE bug to hide the CSS file
[...]

Quote:
I have no idea whether this would work (don't have IE
handy), but what does IE make of something like this:

!--[IF IE]
![IF !IE]
![endif]--
baz
!--[IF IE]
![endif]
![endif]--

-- for everything else it's just baz surrounded by a pair of
comments?
As reported, at least by Daniel, this CC attempt is "working" but it
also made me think a bit about what is really happening inside IE in
that case. Let's structure the "code" a bit at first.

1. <!--[IF IE]>
2. <![IF !IE]>
3. <![endif]-->
4. baz
5. <!--[IF IE]>
6. <![endif]>
7. <![endif]-->

I have always assumed that IE's CC evaluation is based on some form of
standard principle, similar to how conditional execution would take
place in any other "programming language". In which case I can not see
how that CC "code snip" could hide 'baz' from IE in the first place.

Let's send this to IE under that assumption of mine.

Line 1 will be evaluated to a BOOLEAN TRUE status.

Line 2 will start a new evaluation, which will at first
'push' the TRUE running value from Line 1 on the stack
to make room for a new running value, which will be FALSE
this time.

Line 3 "should" be the 'endif' statement for Line 2 which,
when evaluated, "should" 'pop' the stack to bring back the
original TRUE value from Line 1 as the running value.

/In which case/ Line 4. with its 'baz' lies fully open for
interpretation by IE.

After that, Line 5. and Line 6. becomes "dummies" for IE
and finally Line 7 will close the evaluation started in
Line 1.

I do fully agree with the statement that this "code snip" will present
'baz' fully undisturbed to real browsers, that part is not a problem.

But in order for it to work as expected in IE we need to assume that the
FALSE running value, that comes out of the evaluation in Line 2, will
also prohibit IE from evaluating Line 3?

In which case it will also not evaluate the 'baz' in Line 4 of course.

But then, why should it evaluate Line 5? Line 6? or even Line 7?

It would be really good, from a practical standpoint, to find a reliable
way to exclude some CSS from IE all together, but I can not make the ins
and outs of the presented "code", as seen in the light of a report that
it really does "work" as expected?

What gives?

--
Rex




Reply With Quote
  #2  
Old   
Martin Bialasinski
 
Posts: n/a

Default Re: CSS and IE's CC evaluation - 01-11-2005 , 07:47 PM






Jan Roland Eriksson <jrexon (AT) newsguy (DOT) com> wrote:

Quote:
As reported, at least by Daniel, this CC attempt is "working" but it
also made me think a bit about what is really happening inside IE in
that case. Let's structure the "code" a bit at first.

1. <!--[IF IE]
2. <![IF !IE]
3. <![endif]--
4. baz
5. <!--[IF IE]
6. <![endif]
7. <![endif]--
A possible sane explanation:

1. Conditional comments are used in a preprocessor way
2. The if/endif matching respects the type of the comment
("downlevel-hidden" vs. "downlevel-revealed")

Line 1 gives true
Look for an endif.
Output everthing inbetween.
Output line 4
Line 5 gives true
Look for an endif.
Output everthing inbetween.

Results in

8. <![IF !IE]>
9. baz
10. <![endif]>

Parse again.

Line 8 gives false
Skip to endif



Reply With Quote
  #3  
Old   
Jan Roland Eriksson
 
Posts: n/a

Default Re: CSS and IE's CC evaluation - 01-12-2005 , 12:15 PM



On Wed, 12 Jan 2005 17:53:14 +0100, Daniel Déchelotte
<maitre_yodan (AT) fr (DOT) club-internet.invalid> wrote:

Quote:
Dave Anderson a écrit :

| Daniel Déchelotte wrote:
| ...shouldn't this simple code work:
|
| <!--[if !IE]--
| <p>read by browsers, ignored by IE
| <!--[endif]--

Nope...
[...]
In an attempt to summarize the thread,
the minimum code would be:

!--[if IE]
... IE specific code here ...
![if !IE]>< --
... non-IE code here ...
!-- ><![endif]><![endif]--

W3C and Microsoft compliant, if not terribly legible.
Thanks for the investigation guys.

I'm saving this thread for a new entry in the ciwas authoring FAQ.

--
Rex




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.