| Summary: | REGRESSION (267023@main): The language switching menu is broken on English Wikipedia | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | laiz+webkit |
| Component: | WebCore Misc. | Assignee: | Ryosuke Niwa <rniwa> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | ap, cdumez, karlcow, rniwa, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | BrowserCompat, InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Mac (Apple Silicon) | ||
| OS: | macOS 14 | ||
| URL: | https://en.wikipedia.org/ | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=262551 | ||
| Bug Depends on: | 260369 | ||
| Bug Blocks: | |||
|
Description
laiz+webkit
2023-09-29 01:49:09 PDT
I can reproduce as described. Shift-reload doesn't help, but opening the same article in a new window does. There aren't any errors in Web Inspector console. No events at all seem to be taking place.
The function which captures the clicks for the language selector is:
```
function loadContentLanguageSelector(ev) {
var $target = $(ev.currentTarget);
if ($target.attr('data-uls-loaded')) {
return;
}
ev.preventDefault();
mw.loader.using(['ext.uls.mediawiki', 'mediawiki.ui.button']).then(function() {
var parent, languageNodes, standalone, uls;
parent = document.querySelectorAll('.mw-portlet-lang, #p-lang')[0];
languageNodes = parent ? parent.querySelectorAll('.interlanguage-link-target') : [];
standalone = isUsingStandaloneLanguageButton();
$target.attr('data-uls-loaded', true);
launchULS($target, mw.uls.getInterlanguageListFromNodes(languageNodes), !standalone);
if (standalone) {
uls = $target.data('uls');
if (languageNodes.length) {
addActionsMenuTriggers(uls);
} else {
uls.$menu.find('#uls-settings-block').eq(0).hide();
addEmptyState(uls);
}
$target.trigger('click');
} else {
$target.trigger('click');
}
});
}
```
we could try to Autospade this (regression testing)
Important for the testers. Loading directly the page will not reproduce the issue. It is necessary to navigate from the homepage to another one. I get this range https://commits.webkit.org/compare/267023@main...267017@main I wonder if it's the activation of requestIdleCallback. loadContentLanguageSelector is available in Firefox Nightly but it has not even been loaded in STP, aka it doesn't exist. If we search for requestIdleCallback, we see that this is used to load a bunch of resources. for example in ``` mw.requestIdleCallback = window.requestIdleCallback ? window.requestIdleCallback.bind(window) : mw.requestIdleCallbackInternal; (function() { var queue; mw.loader.addSource({ "local": "/w/load.php", "metawiki": "//meta.wikimedia.org/w/load.php" }); ``` when requestIdleCallback was not available it was using ``` mw.requestIdleCallbackInternal = function(callback) { setTimeout(function() { var start = mw.now(); callback({ didTimeout: false, timeRemaining: function() { return Math.max(0, 50 - (mw.now() - start)); } }); }, 1); }; ``` Another confirmation, if in the Developer Menu -> Feature Flags and disable requestIdleCallback, the language selector is working again after reload. So there is something which is not quite fully working with the native implementation in terms of timing when doing: window.requestIdleCallback.bind(window) Interesting. We coincidentally have 10% memory regression on Wikipedia in iOS as well. I wonder if they're related. Pull request: https://github.com/WebKit/WebKit/pull/18532 Committed 268782@main (ffd8a014dd11): <https://commits.webkit.org/268782@main> Reviewed commits have been landed. Closing PR #18532 and removing active labels. |