mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RelatedArticles
synced 2024-12-22 12:53:02 +00:00
e5431a1c0b
We currently require support for IntersectionObserver. which is supported on Edge >= 15 (15 has partial support), Firefox >55, Chrome >58, Safari 12.1, Opera >=38, iOS Safari >=12.2, Android 100 Full ES6 is supported in Edge >=15, Firefox >=54, Chrome >=51, Safari >=10, Opera >=38, iOS Safari >=10, so such a change would only drop support for Edge 15 and Firefox 54. CSS.escape is guaranteed in all these browsers according to caniuse, with the only discrepancy being the Edge browser (versions 16-18) so it is also suggested we remove support for those browsers. Firefox 54 accounts for 0.0026% of page views Edge 15-18 accounts for 0.069% of page views Bug: T306355 Change-Id: Id2987e3456607b610c38da9ee157a026d1d00ada
29 lines
828 B
JavaScript
29 lines
828 B
JavaScript
( function () {
|
|
'use strict';
|
|
|
|
const CardModel = require( '../../resources/ext.relatedArticles.readMore/CardModel.js' ),
|
|
CardView = require( '../../resources/ext.relatedArticles.readMore/CardView.js' );
|
|
|
|
QUnit.module( 'ext.relatedArticles.cards/CardView' );
|
|
|
|
QUnit.test( '#_render escapes the thumbnailUrl model attribute', function ( assert ) {
|
|
const model = new CardModel( {
|
|
title: 'One',
|
|
url: mw.util.getUrl( 'One' ),
|
|
hasThumbnail: true,
|
|
thumbnailUrl: 'http://foo.bar/\');display:none;"//baz.jpg',
|
|
isThumbnailProtrait: false
|
|
} ),
|
|
view = new CardView( model );
|
|
|
|
const style = view.$el.find( '.ext-related-articles-card-thumb' )
|
|
.eq( 0 )
|
|
.attr( 'style' );
|
|
|
|
assert.strictEqual(
|
|
style,
|
|
"background-image: url(\"http://foo.bar/');display:none;\\\"//baz.jpg\");"
|
|
);
|
|
} );
|
|
}() );
|