Last modified: 2014-09-20 21:12:17 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T68091, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 66091 - ResourceLoaderLESSFunctions::embed does not support CSSJanus flipping for RTL, affecting .background-image-svg() and others
ResourceLoaderLESSFunctions::embed does not support CSSJanus flipping for RTL...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
1.23.0
All All
: High normal (vote)
: 1.24.0 release
Assigned To: Bartosz Dziewoński
: i18n
: 66773 68326 70742 (view as bug list)
Depends on:
Blocks: rtl
  Show dependency treegraph
 
Reported: 2014-06-03 22:15 UTC by Matthew Flaschen
Modified: 2014-09-20 21:12 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Matthew Flaschen 2014-06-03 22:15:50 UTC
The LESS embed function in ResourceLoaderLESSFunctions does not support using the flipped version for rtl.

That means that if you use, for example, .background-image() (from mediawiki.mixins.less) it will only use the flipped version for the fallback (for browsers that don't support data URIs).

CSSJanus does not actually flip the image in this case.  It just uses a filename ending in -rtl when the original filename ended in -ltr (see https://www.mediawiki.org/wiki/ResourceLoader/Features#Flipping).  

This approach would require some refactoring of the CSSJanus class, so embed could call it on a URL or filename.
Comment 1 Matthew Flaschen 2014-06-03 22:18:44 UTC
(In reply to Matthew Flaschen from comment #0)
> CSSJanus does not actually flip the image in this case.  It just uses a
> filename ending in -rtl when the original filename ended in -ltr (see
> https://www.mediawiki.org/wiki/ResourceLoader/Features#Flipping).  

It's a little more complicated that that.  It should reuse the same regex/logic as CSSJanus, rather than reinventing it.
Comment 2 Amir E. Aharoni 2014-06-18 09:54:44 UTC
I'm finding more and more issues that are caused by this, so it should be addressed some time soon.
Comment 3 Krinkle 2014-07-01 15:17:21 UTC
I've filed bug 67368 for the removal of the 'embed()' function. See there for more details on how this bug is caused.

Note that we already do this in OOjs UI where the less is compiled by less via Grunt, and thus MediaWiki-specific functions aren't available. And yet there's no sacrifice in efficiency because the /* @embed */ comments are still picked by CSSMin when it loads in MediaWiki.
Comment 4 Matthew Flaschen 2014-07-26 01:40:29 UTC
This could be fixed with or without removing custom LESS, so it's not a blocker (although it might be easier one way than the other).
Comment 5 Bartosz Dziewoński 2014-09-11 21:20:37 UTC
*** Bug 70742 has been marked as a duplicate of this bug. ***
Comment 6 Bartosz Dziewoński 2014-09-11 21:22:34 UTC
(Restoring previous bug summary for searchability. I also want to kill embed() (bug 67368), but killing it in bug summaries is not a good idea.)
Comment 7 Gerrit Notification Bot 2014-09-18 15:13:45 UTC
Change 161245 had a related patch set uploaded by Bartosz Dziewoński:
Fix CSSJanus flipping in LESS mixins and remove broken custom LESS functions

https://gerrit.wikimedia.org/r/161245
Comment 8 Krinkle 2014-09-18 17:24:50 UTC
*** Bug 68326 has been marked as a duplicate of this bug. ***
Comment 9 Gerrit Notification Bot 2014-09-20 20:59:32 UTC
Change 161751 had a related patch set uploaded by Krinkle:
Fix CSSJanus flipping in LESS mixins and remove broken custom LESS functions

https://gerrit.wikimedia.org/r/161751
Comment 10 Gerrit Notification Bot 2014-09-20 21:05:38 UTC
Change 161245 merged by jenkins-bot:
Fix CSSJanus flipping in LESS mixins and remove broken custom LESS functions

https://gerrit.wikimedia.org/r/161245
Comment 11 Gerrit Notification Bot 2014-09-20 21:07:01 UTC
Change 161751 merged by jenkins-bot:
Fix CSSJanus flipping in LESS mixins and remove broken custom LESS functions

https://gerrit.wikimedia.org/r/161751
Comment 12 Bartosz Dziewoński 2014-09-20 21:11:29 UTC
*** Bug 66773 has been marked as a duplicate of this bug. ***
Comment 13 Bartosz Dziewoński 2014-09-20 21:11:53 UTC
*** Bug 68326 has been marked as a duplicate of this bug. ***
Comment 14 Bartosz Dziewoński 2014-09-20 21:12:17 UTC
Fixed and backported.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links