It is causing build failures as follows:
Running "stylelint:src" (stylelint) task
resources/src/mediawiki.special.preferences.styles.ooui.less
33:2 ✖ Needless disable for "plugin/no-unsupported-browser-features" --report-needless-disables
35:2 ✖ Needless disable for "plugin/no-unsupported-browser-features" --report-needless-disables
48:2 ✖ Needless disable for "plugin/no-unsupported-browser-features" --report-needless-disables
I don't know why or how they became needless.
Change-Id: I14d9fdcc97b260b1fd67e67349214c7947733324
Remove check for window.JSON, redundant to check for es5
strict mode.
Remove check for window.addEventListener, we also check for
querySelector which is a newer part of the same API.
Bug: T290293
Change-Id: I95e62c7c1ed8f98f9df9e94fef86dda9aa77326b
- Add Skin::getOptions and Skin::getPortletLinkOptions, which are used
to provide skin options to mw.util.
- Add SkinFactory::getSkinOptions, which is used by
Skin::getPortletLinkOptions.
Depends-On: Ib23360e3439abc828404c1de8e0906915ee7d8b6
Bug: T289163
Change-Id: I801e7d583cb0b0c7da51f4da503268be736bb60c
This reverts commit 0faa22fc6d.
Reason for revert: Gzip is usually (and in this case) more efficient at
natively deduplicating repeated strings when transferring code from
server to client, than is possible through manual abbreviating through
a variable.
Fresnel confirmed this patch reduces JS transfer size by 10B. Not much,
but enough for the optimisation to not be needed.
Change-Id: I4ad22ca1220f33f018a6bc7e3da8389246cf5f9c
When invoked as a constructor, the created object gets returned
anyway. When not invoked as a construct (eg with
`var demo = mw.Message( mw.messages, 'brackets', [ 'param' ] )`
the `this` value is the global `mw` object, which is unexpected.
Using mw.Message as a method call is not supported, and it
causes other problems (the .format, .map, .key, and .parameters
properties get set on the global `mw` object) but those are left
to be dealt with separately.
This follows-up r89076 (6a408d444c) where it was added for no
apparent reason.
Change-Id: Ie25758f92df0a33e66c266e007a1b81f077a9790
It's not needed as part of the startup code, just for some modules
(in core the only place its used is in the mediawiki.inspect module)
and thus does not need to be defined so early, it can go in the
mediawiki.base module that is an implicit dependency of all
regular modules, where it can be loaded concurrently and take
advantage of the ResourceLoader module caching system.
Also tweak the documentation, the returned array is known to be
an array of strings.
Should have no effect on the functionality.
Change-Id: I18f5fae876a8b90f66b9c555d393169a5525f1af
Only supported by Android 4.3 as remaining basic supported browser.
Not worth to send down the wire from current usage across our products.
Bug: T278670
Bug: T290935
Change-Id: I3b5fb20b12f4f8d228c10ec8a03661df30426473
Deprecated in MW 1.36 and replaced with standard `box-shadow`
properties in all code repositories on our radar since.
Bug: T277819
Depends-On: Id199b33339e417792837384d28ef7f8d125bea60
Change-Id: I4adeb975dbf4e203c9a41d6564b1a68c10094019
The code to set the half-filled state was only included in:
* SkinTemplate.php (used when reloading the whole page, e.g. after
saving in the wikitext editor)
* WatchlistExpiryWidget (the special dropdown that appears inside a
notification after clicking the watch star)
If a page was temporarily watched by some other interface, for example
while making an edit with VisualEditor, the watch star would not
appear half-filled.
Bug: T251348
Change-Id: Ib8ccfbbde6c5fecb4a3db0f285893bb419c82c1e
Unicode characters out of the BMP (starting at U+10000) have in a
JavaScript string two UTF-16 surrogates.
On uppercase of the first character of a title this must be supported.
This change also adds test cases to verify this.
Bug: T291321
Change-Id: I88c4ddbd39000aa09455f67ca8435ce704b98bf8
Nothing in the code expects things to be on the left/right, it was just
a naming convention. However, it caused some issues because CSSJanus
flips the attributes in the stylesheet for RTL languages.
So just use more descriptive names that also avoid issues with RTL
languages.
Bug: T290731
Change-Id: I8a383cd1e3981dc8a826ff60eee523d9f71d1d3d
Previously, switching to mobile styling in responsive Monobook would show
the feed icon, but loading a page in mobile format would not. This patch allows
the styles to be loaded in mobile or desktop, fixing that inconsistency.
Bug: T291274
Change-Id: I897b85d3e77233b858ee85be263a14e401fe5fd2
Between 2015 and 2016, all major browsers removed support for this
due to abuse by pop-up ads and such. As such, we're invoking the
client-side wikitext message parser before the onbeforeunload event
can return, but not actually using its string anywhere except in IE11.
Remove this and let IE11 do the same native thing as all other
browsers have been doing regrardless. This is not a breaking change,
because any callers to confirmCloseWindow() passing a 'message' option
will still work and create the same behaviour as before. It just means
that in IE11 the "extra text" message is now ignored the same as it
was in other browsers already.
Browsers correctly understood that virtually the only legitimate use
of this feature was to remind users of unsaved changes, and their
default localised prompt reflects that understanding.
* Update callers to not bundle and pass down a custom message.
* Keep the message bundled with confirmCloseWindow.js for use in
the trigger() method. This no longer supports the override, but it
does still need a default localised string there since this method
uses a prompt() which unlike 'onbeforeunload' has no default.
I have moved the message parsing down to that method to still remove
its overhead from the most common code path.
Bug: T283193
Change-Id: I7b3c0579272f97243c9795c63d7193fefc3eddbe
This new hook allows extensions and gadgets to enhance indicators on
page load and on live preview. This is useful for the Kartographer
extension.
The hook gets fired only if there is at least one indicator present.
The new hook gets fired before `wikipage.content` fires, to have the
same order like in the DOM.
Bug: T280363
Change-Id: I154ebbf049fbce1e872548651953adb1419b6cba
=== Why
* More speed
In debug mode, the server should regenerate the startup manifest
on each page view to ensure immediate effect of changes. But,
this also means more version recomputation work on the server.
For most modules, this was already quite fast on repeat views
because of OS-level file caches, and our file-hash caches and
LESS compile caches in php-apcu from ResourceLoader.
But, this makes it even faster.
* Better integration with browser devtools.
Breakpoints stay more consistently across browsers when the
URL stays the same even after you have changed the file and
reloaded the page. For static files, I believe most browsers ignore
query parameters. But for package files that come from load.php,
this was harder for browsers to guess correctly which old script URL
is logically replaced by a different one on the next page view.
=== How
Change Module::getVersionHash to return empty strings in debug mode.
I considered approaching this from StartupModule::getModuleRegistrations
instead to make the change apply only to the client-side manifest.
I decided against this because we have other calls to getVersionHash
on the server-side (such as for E-Tag calculation, and formatting
cross-wiki URLs) which would then not match the version queries that
mw.loader formats in debug mode.
Also, those calls would still be incurring some the avoidable costs.
=== Notes
* The two test cases for verifying the graceful fallback in production
if version hash computations throw an exception, were moved to a
non-debug test case as no longer happen now during the debug
(unminified) test cases.
* Avoid "PHP Notice: Undefined offset 0" in testMakeModuleResponseStartupError
by adding a fallback to empty string so that if the test fails,
it fails in a more useful way instead of aborting with this error
before the assertion happens. (Since PHPUnit generally stops on the
first error.)
* In practice, there are still "version" query parameters and E-Tag
headers in debug mode. These are not module versions, but URL
"combined versions" crafted by getCombinedVersion() in JS and PHP.
These return the constant "ztntf" in debug mode, which is the hash
of an empty string. We could alter these methods to special-case
when all inputs are and join to a still-empty string, or maybe we
just leave them be. I've done the latter for now.
Bug: T235672
Bug: T85805
Change-Id: I0e63eef4f85b13089a0aa3806a5b6f821d527a92
Deprecating different mixins, where we forecast basic supported
browser will be unprefixed at time of MediaWiki 1.38.
Change-Id: I4dc902aa9d7eb6a42085b91fd78bb4281b8a933f
The mw-ui-icon-with-label-desktop class allows a label to hide
at mobile resolutions and display at desktop resolutions.
it was broken by the recent change to mw-ui-button.mw-ui-icon-element
so this code needs to be slightly adjusted for its existence so it
can be used in Minerva.
Bug: T288678
Depends-On: I4675be1e0b4b2a2a34507d85c551cc3234f1a9f6
Change-Id: I4eb28eae4c4e23d58f1f85bc41c0caf77197d8a1
Only used in a single place in the store, the other usage was just
removed. Has no references from outside of the store.
Follow-up: I19721db51b2edf5f416f3a6b629d6ee002f608ec
Change-Id: I5b931a7d51b924a121d165bd42f0be28c6415842
In 2015, when we stopped storing modules that were larger than
100kB, we also started checking the size of existing stored modules
on each prune() call to handle any oversized modules already
stored. This check should no longer be needed, because
any oversized module still stored from back then would be pruned
for having an outdated version anyway (versions changed from 7
characters to 5 in 2019, so even if the code hasn't changed the
version hash has).
Bug: T290705
Change-Id: I19721db51b2edf5f416f3a6b629d6ee002f608ec
The radio buttons on page history hidden by CSS/JavaScript could still
be selected with arrow keys on Firefox, so this makes sure they are
disabled, not just hidden.
Bug: T290709
Change-Id: I400189792e0e9503b21d3d9ef7c8fb282ee4d47b
If the script given is a string, this is executed via the `domEval()`
function - the documentation still referred to execution via
`$.globalEval()`. This was changed in 2018, when the startup code
was refactored to no longer depend on jQuery, see T192623.
Follow-up: Icdd5d76546a6c265a8e941c4e9b28f73bf9dd028
Change-Id: Ic3853a30ec50aafad55ac551a4848fe9db9b35cf
In mediawiki.loader.js, use a local variable for references to
the overall loader object, which helps to both reduce the output size
and simplify interactions.
Should be a no-op in terms of functionality.
Change-Id: I1d72c24b7a81ad00210056384a5f602c8f317667