Page MenuHomePhabricator

Lint away 'pxpx'
Closed, ResolvedPublic

Description

For backwards-compatibility reasons, we allow "pxpx" as well as "px" when we parse image size options.

We should lint this away.

See T15500: Improper scaling of images sized with "pxpx", T53628: Images specified with size foopxpx render at native size (and parser test cases mentioning these phab tasks).

Event Timeline

ssastry triaged this task as Medium priority.Mar 8 2020, 1:00 AM
Sbailey subscribed.

This appears to be related to T215999
Linter does not detect invalid "500px500px" as a bogus file option

Change 867300 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/services/parsoid@master] [WIP] Lint away 'pxpx'

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

@Jonesey95 I put this question in the commit message. Maybe you have an opinion?

Question: Is bogus file options the correct category for this
considering that these options are accepted, they just have backwards
compatibility support we'd like to remove?`

Yes, bogus file options is the correct category for this. Thanks. Fixing Lint is (almost) all about removing backwards compatibility for hacks and workarounds and errors that are no longer accepted.

Change 867300 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Lint away 'pxpx'

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

Change 877256 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/vendor@master] Bump parsoid to 0.17.0-a10

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

Change 877256 merged by jenkins-bot:

[mediawiki/vendor@master] Bump parsoid to 0.17.0-a10

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

I recently (last week or so) added a tracking category in the legacy parser for 'pxpx' as well. So there should be warnings from both parsers now.