You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the optimizer does not seem to respect the XML Namespace. As SVG is XML, and thus case sensitive (opposed to HTML, which is case insensitive), the SVG viewBox attribute gets lowercased by the amp-optimizer. Browsers seem to ignore the problem, so this is more a nitpick.
As you note, HTML is case insensitive (unlike XML), so it is expected that SVG inside of (AMP) HTML would get lower-cased. In fact, if I try running an SVG with a viewbox attribute through the W3C Validator and it has no complaints:
Source I used (notice viewbox not viewBox):
<!DOCTYPE html><htmllang=en><head><title>SVG in HTML</title></head><body><svgxmlns="http://www.w3.org/2000/svg" viewbox="0 0 137.7 25.1"><!--...--></svg></body></html>
Hi there,
the optimizer does not seem to respect the XML Namespace. As SVG is XML, and thus case sensitive (opposed to HTML, which is case insensitive), the SVG viewBox attribute gets lowercased by the amp-optimizer. Browsers seem to ignore the problem, so this is more a nitpick.
See the
viewBox
attribute here:Before:
After optimization:
The w3c validator complains about the lowercased
viewbox
attribute when validated as SVG 1.1:The text was updated successfully, but these errors were encountered: