Element insertion breaks "+" adjacent sibling selector #226

Open
lhwparis opened this Issue Jun 28, 2012 · 6 comments

Comments

Projects
None yet
2 participants

first-child and last-child selector problem was mentoned here: #54
but there is aproblem with the css + selector too. this selector is supported by ie7 and ie8.

if you have something like

div.test + div.test and you apply PIE on this div the + selector is no longer working because the css3-container will be inserted between the two divs. can we get another class like pie_adjacent-sibling ?

in some cases its also needed that this classes are modified if the dom changes for example when an element is inserted before the pie_first-child element.

Owner

lojjic commented Jun 28, 2012

"can we get another class like pie_adjacent-sibling" ... can you elaborate on this proposed class and how it would be used?

you have set a pie_first-child to habdle the problem that the element is no more first-child when oie css3-container is included. the same problem exists with the css "+" selector. if you use that selector to target a div directly following another div ( div + div { color: red; } für example this selector is no more working when you use PIE on the second div because the pie css3-container will be includec between the two div and the "+" selector no longer works. with a class pie_adjacent-sibling we can round work that with div ~ .pie_adjacent-sibling. but i see thats a problem to set this class correctly. another way is to innerShiv the css3-containers so we can use something like that div + css-3container + div { }. do you think its possible to do the innerShiv with PIE so we can "use" the PIE container in css?

Owner

lojjic commented Jun 28, 2012

If you want to use the css3-container in your selector then that should work, there shouldn't be any "innerShiv"-ing necessary.

no not in my native IE7/8 it works within IE9 and IE9 in "ie8 mode" but not in an native ie8

Owner

lojjic commented Jun 28, 2012

works fine for me in native IE8 and IE7

Owner

lojjic commented Feb 18, 2013

I've tested this a bit more. Adding the rendering element in the selector (div + css3-container + div, or div + css3pie + div in 2.0beta) does indeed work. However it doesn't work immediately. It seems that IE's style matching has a bug where when PIE's element is inserted in between, IE does not perform a style recalculation right away. It takes some extra event, such as mousing over the element or resizing the window, for IE to pick it up.

I don't know if there's anything I can do to work around this IE bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment