parent
aa48c90d56
commit
3b68fdacf8
1 changed files with 9 additions and 9 deletions
|
|
@ -1529,22 +1529,22 @@ def repairStyle(node, options):
|
||||||
num += 1
|
num += 1
|
||||||
|
|
||||||
if 'overflow' in styleMap :
|
if 'overflow' in styleMap :
|
||||||
# overflow specified on element other than svg, marker, pattern
|
# remove overflow from elements to which it does not apply,
|
||||||
if not node.nodeName in ['svg','marker','pattern']:
|
# see https://www.w3.org/TR/SVG/masking.html#OverflowProperty
|
||||||
|
if not node.nodeName in ['svg','symbol','image','foreignObject','marker','pattern']:
|
||||||
del styleMap['overflow']
|
del styleMap['overflow']
|
||||||
num += 1
|
num += 1
|
||||||
# it is a marker, pattern or svg
|
# if the node is not the root <svg> element the SVG's user agent style sheet
|
||||||
# as long as this node is not the document <svg>, then only
|
# overrides the initial (i.e. default) value with the value 'hidden', which can consequently be removed
|
||||||
# remove overflow='hidden'. See
|
# (see last bullet point in the link above)
|
||||||
# http://www.w3.org/TR/2010/WD-SVG11-20100622/masking.html#OverflowProperty
|
|
||||||
elif node != node.ownerDocument.documentElement:
|
elif node != node.ownerDocument.documentElement:
|
||||||
if styleMap['overflow'] == 'hidden':
|
if styleMap['overflow'] == 'hidden':
|
||||||
del styleMap['overflow']
|
del styleMap['overflow']
|
||||||
num += 1
|
num += 1
|
||||||
# else if outer svg has a overflow="visible", we can remove it
|
# on the root <svg> element the CSS2 default overflow="visible" is the initial value and we can remove it
|
||||||
elif styleMap['overflow'] == 'visible':
|
elif styleMap['overflow'] == 'visible':
|
||||||
del styleMap['overflow']
|
del styleMap['overflow']
|
||||||
num += 1
|
num += 1
|
||||||
|
|
||||||
# now if any of the properties match known SVG attributes we prefer attributes
|
# now if any of the properties match known SVG attributes we prefer attributes
|
||||||
# over style so emit them and remove them from the style map
|
# over style so emit them and remove them from the style map
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue