Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions domkit/CssStyle.hx
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,8 @@ class CssStyle {

for( r in rules ) {
if( !ruleMatch(r.cl,e) ) continue;
if(r.cl.pseudoClasses.has(NeedChildren) && e.parent != null)
e.parent.hasNeedChildren = true;
var i = r.style.length - 1;
while( i >= 0 ) {
var p = r.style[i--];
Expand Down Expand Up @@ -591,6 +593,8 @@ class CssStyle {
// parent style has changed, we need to sync children
force = true;
}
if (force)
e.hasNeedChildren = false;
var obj : Model<Dynamic> = e.obj;
for( c in @:privateAccess obj.getChildren() ) {
var c : Model<Dynamic> = c;
Expand Down
3 changes: 2 additions & 1 deletion domkit/Properties.hx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class Properties<T:Model<T>> {
var dirtyPrev : Properties<T>;
var dirtyNext : Properties<T>;
var depth : Int = 0;
var hasNeedChildren = false;

static var KEEP_VALUES = false;

Expand Down Expand Up @@ -138,7 +139,7 @@ class Properties<T:Model<T>> {
if( p == null ) {
dirty = new DirtyList<T>();
depth = 0;
if( prev != null )
if( prev != null && prev.hasNeedChildren)
prev.needRefresh(); // can change :first-child etc.
} else {
dirty = p.dirty;
Expand Down