@@ -28,6 +28,9 @@ exports.addon = function (renderer) {
28
28
style . setProperty ( kebab ( property ) , newDecl [ property ] ) ;
29
29
this . decl = newDecl ;
30
30
} ;
31
+ VRule . prototype . del = function ( ) {
32
+ removeRule ( this . rule ) ;
33
+ } ;
31
34
32
35
function VSheet ( ) {
33
36
/**
@@ -42,17 +45,14 @@ exports.addon = function (renderer) {
42
45
this . tree = { } ;
43
46
}
44
47
VSheet . prototype . diff = function ( newTree ) {
45
- var sh = renderer . sh . sheet ;
46
- var msh = renderer . msh . sheet ;
47
48
var oldTree = this . tree ;
48
49
49
50
// Remove media queries not present in new tree.
50
51
for ( var prelude in oldTree ) {
51
52
if ( newTree [ prelude ] === undefined ) {
52
53
var rules = oldTree [ prelude ] ;
53
- for ( var selector in rules ) {
54
- removeRule ( msh , rules [ selector ] ) ;
55
- }
54
+ for ( var selector in rules )
55
+ rules [ selector ] . del ( ) ;
56
56
}
57
57
}
58
58
@@ -72,7 +72,7 @@ exports.addon = function (renderer) {
72
72
// Remove rules not present in new tree.
73
73
for ( var selector in oldRules )
74
74
if ( ! newRules [ selector ] )
75
- deleteRule ( sh , oldRules [ selector ] ) ;
75
+ oldRules [ selector ] . del ( ) ;
76
76
77
77
// Apply new rules.
78
78
for ( var selector in newRules ) {
@@ -92,5 +92,6 @@ exports.addon = function (renderer) {
92
92
this . tree = newTree ;
93
93
} ;
94
94
95
- renderer . VSheet = VSheet
95
+ renderer . VRule = VRule ;
96
+ renderer . VSheet = VSheet ;
96
97
} ;
0 commit comments