Issue with "SVGSVGElement": In FF an unset viewBox property means viewBox.baseVal = null. For Chrome it is an SVGRect initialized to 0. #8907
Labels
Content:WebAPI
Web API docs
help wanted
If you know something about this topic, we would love your help!
needs BCD update
MDN URL: https://developer.mozilla.org/en-US/docs/Web/API/SVGSVGElement
What information was incorrect, unhelpful, or incomplete?
There are differences between the browsers implementation of the initial values of the viewBox (baseVal) property.
In Firefox
baseVal
isnull
. In Chrome it is anSVGRect {x: 0, y: 0, width: 0, height: 0}
.In my opinion it is nice to just write the values on the pre-initialized SVGRect and to let the browser synchronize the attribute.
Since the bug on this topic (https://bugzilla.mozilla.org/show_bug.cgi?id=888307) is closed and no one seems to care, at least developers should be informed of this difference.
I am not sure if this should be a "note" in the compability table, or if it should be described in the property section.
I am aware that this property is inherited from SVGFitToViewBox, but there is no page for this Interface. Since this is my first contribution I don't feel ready to create a new Page.
Specific section or headline?
new Property section named "viewBox" OR a note in the compability table
(see above)
What did you expect to see?
viewBox
property which is anSVGAnimatedRect {baseVal: SVGRect|null, animVal: SVGRect|null}
baseVal
property are reflected in theviewBox
attribute and vice-versanull
in FirefoxSVGRect {x: 0, y: 0, width: 0, height: 0}
in ChromeDid you test this? If so, how?
to test this the code from above can be executed in the browsers console
MDN Content page report details
en-us/web/api/svgsvgelement
The text was updated successfully, but these errors were encountered: