diff --git a/scour/scour.py b/scour/scour.py index 992dc66..7ccf830 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -1456,7 +1456,7 @@ def repairStyle(node, options): for uselessStyle in ['fill', 'fill-opacity', 'fill-rule', 'stroke', 'stroke-linejoin', 'stroke-opacity', 'stroke-miterlimit', 'stroke-linecap', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-opacity'] : - if uselessStyle in styleMap: + if uselessStyle in styleMap and not styleInheritedByChild(node, uselessStyle): del styleMap[uselessStyle] num += 1 @@ -1477,7 +1477,7 @@ def repairStyle(node, options): # if fill:none, then remove all fill-related properties (fill-rule, etc) if 'fill' in styleMap and styleMap['fill'] == 'none' : for fillstyle in [ 'fill-rule', 'fill-opacity' ] : - if fillstyle in styleMap : + if fillstyle in styleMap and not styleInheritedByChild(node, fillstyle): del styleMap[fillstyle] num += 1 @@ -1486,7 +1486,7 @@ def repairStyle(node, options): fillOpacity = float(styleMap['fill-opacity']) if fillOpacity == 0.0 : for uselessFillStyle in [ 'fill', 'fill-rule' ] : - if uselessFillStyle in styleMap: + if uselessFillStyle in styleMap and not styleInheritedByChild(node, uselessFillStyle): del styleMap[uselessFillStyle] num += 1 @@ -1496,7 +1496,7 @@ def repairStyle(node, options): if strokeOpacity == 0.0 : for uselessStrokeStyle in [ 'stroke', 'stroke-width', 'stroke-linejoin', 'stroke-linecap', 'stroke-dasharray', 'stroke-dashoffset' ] : - if uselessStrokeStyle in styleMap: + if uselessStrokeStyle in styleMap and not styleInheritedByChild(node, uselessStrokeStyle): del styleMap[uselessStrokeStyle] num += 1 @@ -1506,7 +1506,7 @@ def repairStyle(node, options): if strokeWidth.value == 0.0 : for uselessStrokeStyle in [ 'stroke', 'stroke-linejoin', 'stroke-linecap', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-opacity' ] : - if uselessStrokeStyle in styleMap: + if uselessStrokeStyle in styleMap and not styleInheritedByChild(node, uselessStrokeStyle): del styleMap[uselessStrokeStyle] num += 1