Follows-up
5b0749d, which first introduced a call to performance.mark
outside of startup.js – thus triggering this excotic bug in Safari.
In Safari the native thread MAY (emphasis on MAY) decide at any
point to recreate window.performance and blow away any previously
succesfully attached properties.
Bug: T112287
Change-Id: I653e580566da5335d34f1cf1ef52f51ceee2cf5a
"mediaWiki": true,
"JSON": true,
"OO": true,
"mediaWiki": true,
"JSON": true,
"OO": true,
"jQuery": false,
"QUnit": false,
"sinon": false
"jQuery": false,
"QUnit": false,
"sinon": false
} );
} );
$.when.apply( $, loading ).then( function () {
} );
} );
$.when.apply( $, loading ).then( function () {
- performance.mark( 'mwLoadEnd' );
+ mwPerformance.mark( 'mwLoadEnd' );
mw.hook( 'resourceloader.loadEnd' ).fire();
} );
} );
mw.hook( 'resourceloader.loadEnd' ).fire();
} );
} );
* continue loading jQuery and the MediaWiki modules. This code should work on
* even the most ancient of browsers, so be very careful when editing.
*/
* continue loading jQuery and the MediaWiki modules. This code should work on
* even the most ancient of browsers, so be very careful when editing.
*/
+/*jshint unused: false, evil: true */
+/*globals mw, RLQ: true, $VARS, $CODE, performance */
-var mediaWikiLoadStart = ( new Date() ).getTime();
+var mediaWikiLoadStart = ( new Date() ).getTime(),
-if ( !window.performance ) {
- window.performance = {};
-}
-if ( !performance.mark ) {
- performance.mark = function () {};
-}
-performance.mark( 'mwLoadStart' );
+ mwPerformance = ( window.performance && performance.mark ) ? performance : {
+ mark: function () {}
+ };
+
+mwPerformance.mark( 'mwLoadStart' );
/**
* Returns false for Grade C supported browsers.
/**
* Returns false for Grade C supported browsers.
* - https://www.mediawiki.org/wiki/Compatibility#Browsers
* - https://jquery.com/browser-support/
*/
* - https://www.mediawiki.org/wiki/Compatibility#Browsers
* - https://jquery.com/browser-support/
*/
-
-/*jshint unused: false, evil: true */
-/*globals mw, RLQ: true, $VARS, $CODE */
function isCompatible( ua ) {
if ( ua === undefined ) {
ua = navigator.userAgent;
function isCompatible( ua ) {
if ( ua === undefined ) {
ua = navigator.userAgent;