Page MenuHomePhabricator

ArticleFeedback .svg icons contain 100 kb unused code each
Open, Needs TriagePublic

Description

While applying T328144: Drop PNG fallback for SVG icons / etc. across all Wikimedia products to the ArticleFeedbackv5 codebase we noticed (again) that a lot of the .svg files in the codebase contain extremely large <defs> sections with hundreds of gradients, masks, and filters. It looks like a copy of the entire Inkscape gradient library. This dead, unused code adds up to a total of 1.5 megabytes in only 14 files.

This is a problem because:

  1. These .svg files are actually used as background images in .css.
  2. Some of them are even marked as /* @embed */, which implies a ~33% increase in size when base64 encoded.

Proposed steps:

Event Timeline

Change 922818 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/ArticleFeedbackv5@master] Drop .png fallbacks where an .svg file is present

https://gerrit.wikimedia.org/r/922818

Change 922827 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/ArticleFeedbackv5@master] Dramatically minimize .svg files

https://gerrit.wikimedia.org/r/922827