Community Wishlist Survey 2020/Archive/Support CSS Shapes module

From Meta, a Wikimedia project coordination wiki

Support CSS Shapes module

NoN Does not meet MediaWiki browser compatibility standards

  • Problem: Some books are decorated with illustrations that are non-rectangular and lay out text along the irregular shape. This can some times be approximated by just using normal Mediawiki image syntax, but in some cases the only reasonable layout is as the original. For example, this page (illustrations by Howard Pyle). The proper way to achieve that is using CSS Shapes Level 1] shape-outside: url(…) pointing at an image whose alpha-channel gives the exclusion mask for the element it matches. However, there's no way to apply advanced (non-predefined) CSS rules to an image in Mediawiki, and the CSS sanitizer would (I believe) nuke the url() from inline styles in any case.
  • Who would benefit: All projects. The Wikisourcen run into this situation every so often, but all projects will have use for it every now and again.
  • Proposed solution: Extended syntax for applying arbitrary CSS to images? Let the CSS sanitizer accept url() for internal images? Bonus for some syntax where I can just use "File:Image.jpg" instead of "//upload.wikimedia.org/…". Parametrized values for TemplateStyles maybe? If we could have a template {{masked image |float=left |display=Image.jpg |mask=Image.png |threshold=0.5}} that could feed the latter two to its TemplateStyles stylesheet, that solves this problem. Cases where we need shape-inside would still be unresolved, as well as a myriad other cases for fancy CSS, that fully parametrized TemplateStyles would solve.
  • More comments:
  • Phabricator tickets: T200632, T203416
  • Proposer: Xover (talk) 21:08, 10 November 2019 (UTC)[reply]

Discussion

  • Hello! We have discussed this as a team and decided that CSS shapes are not supported well-enough to be used in MediaWiki, so I'm going to archive this proposal. It would seem we're just waiting on support for IE 11 to be dropped, then this will be OK. I cannot say when this will happen, unfortunately. It also seems url() is explicitly not supported because it's possible to load malicious assets (tracking pixels, for instance). Perhaps our Content Security Policy, when fully rolled out, will alleviate that concern (phab:T28508). Thanks for participating in the survey! MusikAnimal (WMF) (talk) 19:40, 19 November 2019 (UTC)[reply]