Posible CSS Selector regression
Difference in CSS transform behaviour on attribute between 2.9.0-1/2.4-M4 and 2.4-M3
Class attribute is being added instead of replaced in some but not all elements. ( Using Html5Properties -- maybe irrelevant )
Ref: http://groups.google.com/group/liftweb/browse_thread/thread/c47929b035a3020d/120f7a2230b2dbc6?hl=en&lnk=gst&q=css+selector+transforms+unexpected+behavior#120f7a2230b2dbc6
Test snippet snippet
def test = {
//class replace on tr and td elem. acts like a [class+] on tr elem in M4
val m: Map[Integer,String] = Map((1,"a"),(2,"b")) //just to have something to trigger the behaviour, data is not used
"tbody *" #> ( "tr" #> m.map(n => ".even [class]" #> Text("odd") ) )
}
2.4-M4 css transform result
<table>
<tbody>
<tr class="odd even"> <<=====M4 is adding 'odd' attr instead of replacing 'even' with 'odd' (as in M3)
<td class="odd">v1</td><td class="odd">v2</td> <<=====On the td class attr it works fine
</tr><tr class="odd even">
<td class="odd">v1</td><td class="odd">v2</td>
</tr>
</tbody>
</table>
2.4-M3 result
<table>
<tbody>
<tr class="odd">
<td class="odd">v1</td><td class="odd">v2</td>
</tr><tr class="odd">
<td class="odd">v1</td><td class="odd">v2</td>
</tr>
</tbody>
</table>
template html5 code
<table class="lift:Test.test">
<tbody>
<tr class="even">
<td class="even">v1</td><td class="even">v2</td>
</tr>
</tbody>
</table>
Class attribute is being added instead of replaced in some but not all elements. ( Using Html5Properties -- maybe irrelevant )
Ref: http://groups.google.com/group/liftweb/browse_thread/thread/c47929b035a3020d/120f7a2230b2dbc6?hl=en&lnk=gst&q=css+selector+transforms+unexpected+behavior#120f7a2230b2dbc6
Test snippet snippet
def test = {
//class replace on tr and td elem. acts like a [class+] on tr elem in M4
val m: Map[Integer,String] = Map((1,"a"),(2,"b")) //just to have something to trigger the behaviour, data is not used
"tbody *" #> ( "tr" #> m.map(n => ".even [class]" #> Text("odd") ) )
}
2.4-M4 css transform result
<table>
<tbody>
<tr class="odd even"> <<=====M4 is adding 'odd' attr instead of replacing 'even' with 'odd' (as in M3)
<td class="odd">v1</td><td class="odd">v2</td> <<=====On the td class attr it works fine
</tr><tr class="odd even">
<td class="odd">v1</td><td class="odd">v2</td>
</tr>
</tbody>
</table>
2.4-M3 result
<table>
<tbody>
<tr class="odd">
<td class="odd">v1</td><td class="odd">v2</td>
</tr><tr class="odd">
<td class="odd">v1</td><td class="odd">v2</td>
</tr>
</tbody>
</table>
template html5 code
<table class="lift:Test.test">
<tbody>
<tr class="even">
<td class="even">v1</td><td class="even">v2</td>
</tr>
</tbody>
</table>
Leave a comment
on 2011-09-13 09:17 *
By daviddphillips
Might be related to #1110
I hope it is okey that I assigned it to you Peter
Peter
Peter
As discussed and concluded in the thread you started Pete
http://groups.google.com/group/liftweb/browse_thread/thread/562e0b90657f20f7/0099392615ad3429?lnk=raot
this is not a regression.
The reason for the change is the element merging rule which kicks in on the tr element.
To accomplish what I want in M4 i should change this
"tbody *" #> ( "tr" #> m.map(n => ".even [class]" #> Text("odd") ) )
to this
"tbody *" #> (m.map(n => ".even [class]" #> Text("odd") ) )
http://groups.google.com/group/liftweb/browse_thread/thread/562e0b90657f20f7/0099392615ad3429?lnk=raot
this is not a regression.
The reason for the change is the element merging rule which kicks in on the tr element.
To accomplish what I want in M4 i should change this
"tbody *" #> ( "tr" #> m.map(n => ".even [class]" #> Text("odd") ) )
to this
"tbody *" #> (m.map(n => ".even [class]" #> Text("odd") ) )