Re: [css-d] Intervening HTML comments break CSS adjacent sibling selection in IE7

2006-04-30 Thread Ingo Chao
Philippe Wittenbergh wrote:
 On Apr 29, 2006, at 8:13 AM, Greg Reimer wrote:
 
 Is the correct behavior that CSS adjacent sibling selection should NOT
 be affected by HTML comments? I ask because IE7 adjacent sibling
 selection fails when an HTML comment intervenes between the adjacent
 siblings. For example h1+h2 won't select
 h1text/h1!--foo--h2text/h2 in the most recent IE7 beta.
 
 If that is what you have in your html, then that should work (it does  
 everywhere on my Mac, except IE 5 Mac).


h1+h2 {color:green}

h1+*+h2 {color:red}


h1test h1/h1
!-- comment --
h2This h2 should be green./h2

IE7 (build 5346.5, April 25) renders the h2 in RED.

http://www.satzansatz.de/cssd/ie7apr25_sibling.html

CSS wouldn't be fun without IE.

Ingo

-- 
http://www.satzansatz.de/css.html
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Intervening HTML comments break CSS adjacent sibling selection in IE7

2006-04-30 Thread Ingo Chao
Ingo Chao wrote:
 
 h1+h2 {color:green}
 
 h1+*+h2 {color:red}
 
 
 h1test h1/h1
 !-- comment --
 h2This h2 should be green./h2
 
 IE7 (build 5346.5, April 25) renders the h2 in RED.
 
 http://www.satzansatz.de/cssd/ie7apr25_sibling.html
 
 CSS wouldn't be fun without IE.


Does IE7 style a HTML comment?

body
pparagraph, followed by two comments/p
!-- comment1 --
!-- comment2 --
/body

p+* {display: block; padding: 10px; margin: 5px; border: 2px solid red;}

p+*+* {display: block; padding: 10px; margin: 5px; border: 2px solid 
green; }


And will a comment react on hover?

p+*+*:hover {background: fuchsia}

Sure.

http://www.satzansatz.de/cssd/ie7apr25_sibling2.html

Screenshot (build 5346.5, April 25).:
http://www.satzansatz.de/cssd/ie7apr25_sibling2.png



Ingo

-- 
http://www.satzansatz.de/css.html
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Intervening HTML comments break CSS adjacent sibling selection in IE7

2006-04-30 Thread Gunlaug Sørtun
 CSS wouldn't be fun without IE.

 Does IE7 style a HTML comment?
[...]

Guess IE7 has to count in comments, since some might be conditional ones
that it shouldn't miss.
Also: if IE7 ignored comments (as it should) then all those nice 'quirks
mode' triggering comments in and around the DTD would fail too :-)
Maybe we'll have to make the DTD comments conditional ones - just to be
on the safe side ;-)

Can we style the comments to 'display: none;' too ?
Would give us the perfect tool for styling in and out of IE7, and making
valid nonsense appear or disappear in IE7.

How about...

html+*+body {display: none;}
html+body {display: block;}

...and a nice little comment above body.
Just a thought, as maybe IE7 will count - and style - all comments in
the head too, and maybe even the head itself..?

 And will a comment react on hover?
 
 p+*+*:hover {background: fuchsia}
 
 Sure.
 
 http://www.satzansatz.de/cssd/ie7apr25_sibling2.html
 
 Screenshot (build 5346.5, April 25).: 
 http://www.satzansatz.de/cssd/ie7apr25_sibling2.png

Hilarious!
We can make a whole series of IE7 hacks out of that comment-behavior, if
they keep it as is.

CSS sure is fun... and it keeps getting funnier with each upgrade of
Internet Explorer.

Georg
-- 
http://www.gunlaug.no
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Intervening HTML comments break CSS adjacent sibling selection in IE7

2006-04-30 Thread Kenny Graham
just curious... I know served as XML, the comments should be
completely ignored, but if it's served as text and parsed all
SGML-ish, are comments supposed to count as nodes?  I'm one of the
lucky young ones who never dealt with the fun old ways of spacer gifs
and table layouts, so I haven't a clue.  And if they do count as
comment nodes or whatever, would IE's behavior there be correct?
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Intervening HTML comments break CSS adjacent sibling selection in IE7

2006-04-30 Thread Nick Fitzsimons
Kenny Graham wrote:
 just curious... I know served as XML, the comments should be
 completely ignored, but if it's served as text and parsed all
 SGML-ish, are comments supposed to count as nodes?  I'm one of the
 lucky young ones who never dealt with the fun old ways of spacer gifs
 and table layouts, so I haven't a clue.  And if they do count as
 comment nodes or whatever, would IE's behavior there be correct?

No it's not correct, according to CSS 2.1:

Adjacent sibling selectors have the following syntax: E1 + E2, where E2 
is the subject of the selector. The selector matches if E1 and E2 share 
the same parent in the document tree and E1 immediately precedes E2, 
ignoring non-element nodes (such as text nodes and comments).

http://www.w3.org/TR/CSS21/selector.html#adjacent-selectors

At a guess, their code for implementing adjacent selectors (which is 
part of the new IE 7 code and thus not yet thoroughly testes) is looking 
through the DOM tree for the next element node, but is somehow getting 
the impression that the comment node _is_ an element node. Quite how one 
would manage to write code that does this is hard to see, but then again 
it's the kind of idiotic mistake I and every other programmer in the 
world make all the time :-)

You might want to add the above CSS 2.1 reference to your bug report at 
the IE feedback site, just so they know.

Cheers,

Nick.
-- 
Nick Fitzsimons
http://www.nickfitz.co.uk/


__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Intervening HTML comments break CSS adjacent sibling selection in IE7

2006-04-30 Thread Nick Fitzsimons
Nick Fitzsimons wrote:
 At a guess, their code for implementing adjacent selectors (which is 
 part of the new IE 7 code and thus not yet thoroughly testes)

TESTED! I meant TESTED, dammit!

Hell of a Freudian slip though...

Nick.
-- 
Nick Fitzsimons
http://www.nickfitz.co.uk/


__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Intervening HTML comments break CSS adjacent sibling selection in IE7

2006-04-29 Thread Philippe Wittenbergh

On Apr 29, 2006, at 8:13 AM, Greg Reimer wrote:

 Is the correct behavior that CSS adjacent sibling selection should NOT
 be affected by HTML comments? I ask because IE7 adjacent sibling
 selection fails when an HTML comment intervenes between the adjacent
 siblings. For example h1+h2 won't select
 h1text/h1!--foo--h2text/h2 in the most recent IE7 beta.

If that is what you have in your html, then that should work (it does  
everywhere on my Mac, except IE 5 Mac).
I don't have IE 7 beta to test.

Have you tried to put them on separate lines ?
h1test/h1
!-- comment --
h2 other text/h2

Maybe it is another incarnation of those odd white-space parsing bugs  
in IE...
Just curious.

Philippe
---
Philippe Wittenbergh
http://emps.l-c-n.com




__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Intervening HTML comments break CSS adjacent sibling selection in IE7

2006-04-29 Thread Greg Reimer
On 4/29/06, Philippe Wittenbergh [EMAIL PROTECTED] wrote:
 Have you tried to put them on separate lines ? h1test/h1
 !-- comment --
 h2 other text/h2

Yep, I tried that, and as many variations as I could think of. I'm
assuming that IE7 is behaving incorrectly. I submitted a bug against
it in their public bug/feedback thing. I hope they fix it before
final.
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/