Page MenuHomePhabricator

Address Voice and Tone issues in MultimediaViewer
Open, LowPublic

Description

Targets
    Occurrences of '(white|black)[ \-]?list' in Directory /Users/reedy/PhpstormProjects/mediawiki/extensions/MultimediaViewer
Found Occurrences  (28 usages found)
    extensions  (28 usages found)
        MultimediaViewer  (28 usages found)
            resources  (10 usages found)
                mmv  (1 usage found)
                    ui  (1 usage found)
                        mmv.ui.canvas.less  (1 usage found)
                            60 /* Whitelist file types that are potentially transparent.
                mmv.bootstrap  (8 usages found)
                    mmv.HtmlUtils.js  (8 usages found)
                        108 * Discards all nodes which do not match the whitelist,
                        109 * but keeps the text and whitelisted nodes inside them.
                        113 * @param {string} whitelist a jQuery selector string such as 'a, span, br'
                        115 HUP.whitelistHtml = function ( $el, whitelist ) {
                        126 this.whitelistHtml( $child, whitelist );
                        128 if ( !$child.is( whitelist ) ) {
                        230 this.whitelistHtml( $html, 'a, span, i, b, sup, sub' );
                        249 this.whitelistHtml( $html, 'a, span' );
                mmv.ui.ondemandshareddependencies  (1 usage found)
                    mmv.EmbedFileFormatter.js  (1 usage found)
                        86 * @param {Function} [formatterFunction] Format function for the text - defaults to whitelisting HTML links, but all else sanitized.
            tests  (18 usages found)
                qunit  (18 usages found)
                    mmv  (18 usages found)
                        mmv.HtmlUtils.test.js  (18 usages found)
                            99 QUnit.test( 'whitelistHtml()', function ( assert ) {
                            101 $whitelisted = $( '<div>abc<a>def</a>ghi</div>' ),
                            102 $nonWhitelisted = $( '<div>abc<span>def</span>ghi</div>' ),
                            103 $nonWhitelistedInWhitelisted = $( '<div>abc<a>d<span>e</span>f</a>ghi</div>' ),
                            104 $whitelistedInNonWhitelisted = $( '<div>abc<span>d<a>e</a>f</span>ghi</div>' ),
                            107 utils.whitelistHtml( $whitelisted, 'a' );
                            108 utils.whitelistHtml( $nonWhitelisted, 'a' );
                            109 utils.whitelistHtml( $nonWhitelistedInWhitelisted, 'a' );
                            110 utils.whitelistHtml( $whitelistedInNonWhitelisted, 'a' );
                            111 utils.whitelistHtml( $siblings, 'a' );
                            113 assert.ok( $whitelisted.has( 'a' ).length, 'Whitelisted elements are kept.' );
                            114 assert.notOk( $nonWhitelisted.has( 'span' ).length, 'Non-whitelisted elements are removed.' );
                            115 assert.ok( $nonWhitelistedInWhitelisted.has( 'a' ).length, 'Whitelisted parents are kept.' );
                            116 assert.notOk( $nonWhitelistedInWhitelisted.has( 'span' ).length, 'Non-whitelisted children are removed.' );
                            117 assert.notOk( $whitelistedInNonWhitelisted.has( 'span' ).length, 'Non-whitelisted parents are removed.' );
                            118 assert.ok( $whitelistedInNonWhitelisted.has( 'a' ).length, 'Whitelisted children are kept.' );
                            119 assert.notOk( $siblings.has( 'span' ).length, 'Non-whitelisted siblings are removed.' );
                            120 assert.ok( $siblings.has( 'a' ).length, 'Whitelisted siblings are kept.' );

Event Timeline

Aklapper triaged this task as Low priority.Jul 14 2022, 9:51 AM

Hi, @Reedy, I'm trying to use T-shirt sizes to measure the effort required for each task to invite folks at the WMF to join and decide which ones they'd like to tackle by giving them information about the effort and any other info you consider relevant.

SizeTimeScore
XSAt Most 1 Hour0
SAt Most 1 Day1
MAt Most 3 Days3
LAt Most 5 Days5
XLNeeds Re-Eval9
?Unknown

For this specific task, T277952, What would you say the size is?

Change #1050028 had a related patch set uploaded (by Simon04; author: Simon04):

[mediawiki/extensions/MultimediaViewer@master] Rename whitelist to allowlist

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