unneeded SVG text attributes, one (writing-mode) warns in Firefox
Submitted by skierpage
Assigned to Jakub Steiner
Description
Created attachment 57288 diff/patch that removes unneeded text styles from one icon
The pdf.js project uses Tango's scalable/actions/list-add.svg as a zoom-in icon.
This leads to Firefox warnings Warning: Unknown property 'writing-mode'. Declaration dropped. Source File: resource://pdf.js/web/images/zoom-in.svg because the SVG includes writing-mode:lr-tb in several path styles, and writing-mode isn't implemented in Mozilla's SVG engine (bug https://bugzilla.mozilla.org/show_bug.cgi?id=311545 filed).
But... these icons have no text in them!?
It seems by removing the text attributes you'd have smaller more performant SVGs with fewer compatibility issues.
I deleted writing-mode and all the other text attributes (font-size, font-family, text-align, etc.) from the path styles in list-add.svg. The modified SVG is 400 bytes smaller, looks the same, and when I save as PDF and Cairo PNG from Inkscape it is bit-for-bit identical. So it seems unneeded text attributes could/should be removed from all the icons in the icon set. Patch and updated svg supplied. And thanks for a handsome set of icons.
Steps to reproduce:
- Open any of the listed icons in any Mozilla browser, e.g. a) Visit https://commons.wikimedia.org/wiki/File:List-add.svg b) click the link to the svg file itself.
- Open Tools > Web Developer > Error Console and note the warnings about writing-mode.
- View > Source of the SVG and note all the text attributes in the path styles of text-free icons.
Here's a list of all the icons with writing-mode. I verified format-text-bold.svg also causes warnings.
% cd tango-icon-theme-0.8.90/scalable % grep -ril writing-mode * | sort actions/address-book-new.svg actions/contact-new.svg actions/format-text-bold.svg actions/format-text-italic.svg actions/format-text-strikethrough.svg actions/format-text-underline.svg actions/list-add.svg actions/list-remove.svg actions/system-lock-screen.svg apps/accessories-calculator.svg apps/accessories-character-map.svg apps/help-browser.svg apps/internet-news-reader.svg apps/office-calendar.svg apps/preferences-desktop-font.svg apps/preferences-desktop-keyboard-shortcuts.svg apps/preferences-desktop-screensaver.svg apps/preferences-desktop-wallpaper.svg apps/utilities-terminal.svg devices/computer.svg devices/multimedia-player.svg devices/video-display.svg emblems/emblem-photos.svg mimetypes/font-x-generic.svg mimetypes/x-office-address-book.svg mimetypes/x-office-calendar.svg status/network-error.svg status/network-idle.svg status/network-offline.svg status/network-receive.svg status/network-transmit-receive.svg status/network-transmit.svg
Patch 57288, "diff/patch that removes unneeded text styles from one icon":
list-add_remove_text_styles.diff
Version: CVS