Skip to content

Commit

Permalink
bugfix in cache : make sure all used component children are marked
Browse files Browse the repository at this point in the history
  • Loading branch information
ncannasse committed Feb 9, 2022
1 parent 366bd67 commit 457da7c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions domkit/CssStyle.hx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class CssData {
needsInit = false;
rules.sort(sortByPriority);
// attribute component ids
var prev = COMPONENTS.length;
for( r in rules ) {
var cl = r.cl;
while( cl != null ) {
Expand All @@ -143,6 +144,16 @@ class CssData {
cl = cl.parent;
}
}
// add all children
while( prev < COMPONENTS.length ) {
var c = COMPONENTS[prev++];
for( c2 in @:privateAccess Component.COMPONENTS ) {
if( c2.parent == c && c2.id < 0 ) {
COMPONENTS.push(c2);
c2.id = CID++;
}
}
}
bytesSize = -1;
}
var reqSize = (CssData.CID + 7) & ~7;
Expand Down Expand Up @@ -413,12 +424,12 @@ class CssStyle {

/*
// debug check that the filtering doesn't forget any rule
for( r in this.rules ) {
for( r in data.rules ) {
if( ruleMatch(r.cl,e) && rules.indexOf(r) < 0 ) {
var comps = [];
for( id in 0...CID ) {
for( id in 0...CssData.CID ) {
if( componentsBits.get(id>>3)&(1<<(id&7)) != 0 )
comps.push(COMPONENTS[id]);
comps.push(CssData.COMPONENTS[id]);
}
throw "assert";
}
Expand Down

0 comments on commit 457da7c

Please sign in to comment.