diff --git a/resources/skins.vector.js/setupIntersectionObservers.js b/resources/skins.vector.js/setupIntersectionObservers.js index 7097d7b9d..c55675bef 100644 --- a/resources/skins.vector.js/setupIntersectionObservers.js +++ b/resources/skins.vector.js/setupIntersectionObservers.js @@ -283,18 +283,12 @@ const setupTableOfContents = ( tocElement, bodyContent, initSectionObserverFn ) * @return {void} */ const main = () => { - const isIntersectionObserverSupported = 'IntersectionObserver' in window; - // // Table of contents // const tocElement = document.getElementById( TOC_ID ); const bodyContent = document.getElementById( BODY_CONTENT_ID ); - - const isToCUpdatingAllowed = isIntersectionObserverSupported && - window.requestAnimationFrame; - const tableOfContents = isToCUpdatingAllowed ? - setupTableOfContents( tocElement, bodyContent, initSectionObserver ) : null; + const tableOfContents = setupTableOfContents( tocElement, bodyContent, initSectionObserver ); // // Sticky header @@ -311,8 +305,7 @@ const main = () => { !!stickyIntersection && !!userLinksDropdown && allowedNamespace && - allowedAction && - isIntersectionObserverSupported; + allowedAction; const { showStickyHeader } = initStickyHeaderABTests( ABTestConfig, diff --git a/resources/skins.vector.legacy.js/collapsibleTabs.js b/resources/skins.vector.legacy.js/collapsibleTabs.js index 4f95e023a..aa0f2b65f 100644 --- a/resources/skins.vector.legacy.js/collapsibleTabs.js +++ b/resources/skins.vector.legacy.js/collapsibleTabs.js @@ -11,7 +11,6 @@ function init() { /** @type {boolean|undefined} */ let boundEvent; const isRTL = document.documentElement.dir === 'rtl'; - const rAF = window.requestAnimationFrame || setTimeout; // Mark the tabs which can be collapsed under the more menu // eslint-disable-next-line no-jquery/no-global-selector @@ -43,12 +42,12 @@ function init() { if ( !boundEvent ) { boundEvent = true; $( window ).on( 'resize', mw.util.debounce( () => { - rAF( $.collapsibleTabs.handleResize ); + requestAnimationFrame( $.collapsibleTabs.handleResize ); }, 10 ) ); } // call our resize handler to setup the page - rAF( $.collapsibleTabs.handleResize ); + requestAnimationFrame( $.collapsibleTabs.handleResize ); // When adding new links, a resize should be triggered (T139830). mw.hook( 'util.addPortletLink' ).add( $.collapsibleTabs.handleResize ); return this; @@ -161,7 +160,7 @@ function init() { $( this ).detach().prependTo( target ).data( 'collapsibleTabsSettings', outerData ); $( this ).attr( 'style', 'display: list-item;' ); collapsedContainerSettings.shifting = false; - rAF( $.collapsibleTabs.handleResize ); + requestAnimationFrame( $.collapsibleTabs.handleResize ); } ); }, moveToExpanded: function ( $moving ) { @@ -188,7 +187,7 @@ function init() { .data( 'collapsibleTabsSettings', data ) .animate( { width: expandedWidth + 'px' }, 'normal', function () { $( this ).attr( 'style', 'display: block;' ); - rAF( () => { + requestAnimationFrame( () => { // Update the 'expandedWidth' in case someone was brazen enough to // change the tab's contents after the page load *gasp* (T71729). This // doesn't prevent a tab from collapsing back and forth once, but at diff --git a/resources/skins.vector.search/instrumentation.js b/resources/skins.vector.search/instrumentation.js index 399ad3543..4578326f9 100644 --- a/resources/skins.vector.search/instrumentation.js +++ b/resources/skins.vector.search/instrumentation.js @@ -9,7 +9,6 @@ const INPUT_LOCATION_MOVED = 'header-moved', // mediawiki.searchSuggest performance. Marks and Measures will only be // recorded on the Vector skin and only if browser supported. shouldTestSearchPerformance = !!( window.performance && - !!window.requestAnimationFrame && !!performance.mark && !!performance.measure && !!performance.getEntriesByName && diff --git a/skin.json b/skin.json index 51fd441b3..86ce75fae 100644 --- a/skin.json +++ b/skin.json @@ -456,7 +456,8 @@ "mediawiki.experiments", "skins.vector.icons.js", "mediawiki.util", - "mediawiki.jqueryMsg" + "mediawiki.jqueryMsg", + "web2017-polyfills" ], "messages": [ "vector-search-loader",