Commit graph

986 commits

Author SHA1 Message Date
Timo Tijhof
f31e3902c9 resourceloader: Simplify ResourceLoader::isFileModule()
Method already has 100% test coverage.

Change-Id: I695e0ecca7a749e1721e489007f3b9f99358a96b
2018-07-02 18:04:48 -07:00
Krinkle
c04f2eb05d Merge "resourceloader: Embed 'mediawiki' directly in startup response" 2018-06-28 01:43:55 +00:00
jdlrobson
8faba225fe ResourceLoaderImage module definitions can define a defaultColor
Bug: T197909
Change-Id: I0745e112d11026ed59d8daca990b313305cd094a
2018-06-27 20:36:47 +00:00
Timo Tijhof
b7b84d55d4 resourceloader: Embed 'mediawiki' directly in startup response
Embed the essential files to define mw.loader directly as part of
the startup module.

* This means the internal 'mediawiki' module no longer exists.
  This is safe to remove because:
  1) While registered server-side for loading from startup.js, a PHPUnit
     structure test disallowed being specified as a dependency.
  2) Anything that attempted to load it client-side failed because the
     module was marked in the registry as 'raw', thereby excluding it
     from the data sent to the client-side. As such, it was seen as an
     unknown module that the client refused to fetch from the server.

* Deprecate getStartupModules() and getLegacyModules().
  These are no longer needed. There are no known callers anywhere in
  Wikimedia Git or elsewhere indexed by Codesearch, but easy enough
  to leave as no-op for one release.

* Remove ResourceLoaderRawFileModule class.
  No longer needed. Was created as a hack specifically for the 'mediawiki'
  module so that it would not leak global variables in debug mode.
  It has no usage anywhere in Wikimedia Git, nor elsewhere in Codesearch.
  Remove without deprecation given this was meant to be a 'private' class.

* Introduce (private) getBaseModules(). Previously, this list only existed
  locally in getStartupModulesUrl() by merging getStartupModules() and
  getLegacyModules(). This value was factored out into its own method.

* Make getStartupModulesUrl() private and rename to getBaseModulesUrl().
  It is only used internally to export the 'baseModulesUri' value.
  Its name was already confusing before, but it would've been even more
  confusing now given it doesn't even call getStartupModules() any more.

Bug: T192623
Change-Id: I14ba282d7b65e99ca54b7c2f77ba6e1adaddd11c
2018-06-27 17:06:35 +00:00
Timo Tijhof
a0339862ac resourceloader: Add @covers for FileModuleTest
Add @covers for various helper methods used by public methods, where the helper
methods actually contain most of the logic being tested in FileModuleTest.

I've changed these methods from protected to private (confirmed no usage)
to further pin down that their contract doesn't matter beyond making the
public methods work.

Change-Id: I2aef0d322b38bc3595e7d2c2339112b16fc66b8d
2018-06-26 02:06:03 +00:00
Timo Tijhof
14d8291c5e resourceloader: Update StartUpModule to use file hash instead of mtime
This was overlooked as part of the whole shift from timestamps
to file hashes (T94074, f37cee996e, T104950, 28f6d7fbde).

The key name and method call here matches that of FileModule.

The impact of this still using mtimes was fairly low, given:

* The startup module is only cached for 5 minutes.

* The startup module's hash varies on "everything" which includes
  wgVersion, as such, when a new branch is cut and cloned and this file's
  timestamp is reset, there will still be other factors causing the
  overall hash to vary. As such, this change is unlikely to improve
  200-304 response ratio.

Change-Id: I6543fb75575e9a793a7fc93e15d2f3e0b5a04342
2018-06-25 18:40:30 +00:00
Timo Tijhof
1d1178535f resourceloader: Fix duplicate semi-colon in generated startup code
The startup.js template used '$CODE.registrations();', which makes
sense syntatically (and for the linter), but the substitution logic
was only replacing the '$CODE.registrations()' portion.

This made the generated output contain two consecutive semi-colons.

Change-Id: Ibef1a0d932b19037987a7effa12aa57f578a142d
2018-06-25 18:40:18 +00:00
Aaron Schulz
b87c6d3f0b resourceloader: spin base module code out as a proper module
Bug: T192623
Change-Id: I6f7dc40488a990d0f8a25e84ebc9eb25ad4c2975
2018-06-25 16:05:29 +01:00
Timo Tijhof
941e3c66ba resourceloader: Un-deprecate ClientHtml::setModuleStyles()
This follows 80e5b160e0, which introduced ClientHtml::setModuleScripts()
and setModuleStyles() with @deprecated marks. There was a vague intention
to remove both at some point.

The commit did not deprecate the related methods in OutputPage and ParserOutput.

The plan that eventually formed at T188689 was to keep methods relating to
"setModuleStyles" for the time being, and focus first on the removal of the
methods relating to "setModuleScripts". The latter since been properly
marked as deprecated and removal is scheduled for 1.33.

There is no current plan to deprecate/remove addModuleStyles
from OutputPage and ParserOutput. As such, the internal helper method
that makes those possible, probably shouldn't me marked as deprecated.

Bug: T188689
Change-Id: Ia36c057b73fe834bcbb2e3e8993d1a793a12ab72
2018-06-14 23:15:59 +01:00
daniel
e8632ab0f6 [MCR] Factor PageUpdater out of WikiPage
This introduces PageUpdater to replace WikiPage::doEditContent,
and DerivedPageDataUpdater, to replace WikiPage::doEditUpdates
and WikiPage::prepareContentForEdit.

See docs/pageupdater.txt for a description of their
functionality.

MCR migration notes:

* The interface of PageUpdater is expected to
remain mostly stable after this patch. Code that has been using
WikiPage::doEditContent can be confidently migrated to using the
new mechanism for revision creation.

* This patch keeps the code inside PageUpdater largely aligned
with the old code in WikiPage, to make review easier to to avoid
mistakes. It is intended to be refactored further, moving
application logic into stateless services.

* DerivedPageDataUpdate is intended as a stepping stone for further
refactoring. Its behavior is designed to be compatible with
callback code that currently relies on
WikiPage::prepareContentForEdit. Much of the code that currently
lives in DerivedPageDataUpdate should be factored out into
services, all behavior relevant to calling code should be exposed
via narrow interfaces.

Bug: T174038
Bug: T196653
Change-Id: If610c68f4912e89af616cdcac1d35a1be3946afa
2018-06-14 13:22:13 +00:00
Max Semenik
6e956d55aa Replace call_user_func_array(), part 2
Uses new PHP 5.6 syntax like ...parameter unpacking and
calling anything looking like a callback to make the code more readable.
There are much more occurrences but this commit is intentionally limited
to an easily reviewable size.

In one occurrence, a simple conditional instead of trickery was much more readable.

This patch finishes all the easy stuf in the core, the remainder is either unobvious
or would result in smaller readability gains. It will be carefully dealt with in
further commits.

Change-Id: I79a16c48bfb98b75e5b99f2f6f4fa07b3ae02c5b
2018-06-07 20:19:26 -07:00
Timo Tijhof
96d25f6bcc resourceloader: Remove support for Module::getModifiedTime() and getModifiedHash()
Deprecated since 1.26. No subclasses in Wikimedia Git define these methods,
no calls to methods by this name in Wikimedia Git.

If a module subclass were to still define such a method, it is simply
not called anymore. The version hash system introduced in 1.26 will
still invalidate modules based on wgCacheEpoch.

Bug: T94074
Change-Id: I65b2a625a30f22c8a9d14a3505605546fa5bab83
2018-06-05 02:02:06 +01:00
Bartosz Dziewoński
485f66f174 Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/
Replace with: '\1 ?? '

(Everywhere except includes/PHPVersionCheck.php)
(Then, manually fix some line length and indentation issues)

Then manually reviewed the replacements for cases where confusing
operator precedence would result in incorrect results
(fixing those in I478db046a1cc162c6767003ce45c9b56270f3372).

Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
2018-05-30 18:06:13 -07:00
jenkins-bot
5123888304 Merge "ResourceLoaderLessVarFileModule: Add parameter 'lessMessages'" 2018-05-30 12:06:17 +00:00
Timo Tijhof
eaf40e6dd5 Remove deprecated wgResourceLoaderLESSImportPaths
The last remaining users of this feature were MobileFrontend and Minerva,
which have been migrated to direct imports.

Bug: T140807
Change-Id: I1a66a2ad314bde332297798520e5ec3e0e3d4c9b
2018-05-29 15:49:28 +01:00
jenkins-bot
474daae531 Merge "resourceloader: Include global LESS variables in LESS cache key" 2018-05-28 11:36:32 +00:00
Alexia E. Smith
8a1da0a43b resourceloader: Include global LESS variables in LESS cache key
This prevents cache churn when the wiki-global LESS variables vary
between wikis because the cache key is used as a "global" instead of
db-local. This is good for the common case, but should still explicitly
vary if the vars differ between wikis.

Bug: T191937
Change-Id: If12fd07a7062792205384150d6f5fd9a83f996cc
2018-05-25 18:13:10 +00:00
Timo Tijhof
03db2f5b3c Enable merging of WrappedStringList between 'bottomscripts' and 'reportime'
* Fix ResourceLoaderClientHtml to return what it was documented to
  return, a WrappedStringList. It accidentally used the wrong join()
  method, causing it to create a plain string too early.

* Update method documentations from ClientHtml::getBodyHtml to
  BaseTemplate::getTrail for 'bottomscripts', and from
  ResourceLoader::makeInlineScript for 'reporttime'.

* Update BaseTemplate::getTrail to join by new line instead of native string
  concatenation.

This by itself would suffice for the most common case, but in order
to also account for the possibility of extensions using hooks for
'SkinAfterBottomScripts' that concatenate, update bottomScripts()
to pass a plain string to the hook and merge it later.

Change-Id: If0d227cb9db67229a27d489c082db790ea8e3840
2018-05-24 14:23:17 +01:00
jenkins-bot
9957322e44 Merge "resourceloader: Move style deprecation warnings to <body>" 2018-05-24 13:03:21 +00:00
Timo Tijhof
1c657b06e8 resourceloader: Remove 'user.styles' dependency from 'user' module
Follows-up c3f200849b, which made isKnownEmpty() return false
for modules that have dependencies.

This had the side-effect of causing the 'user' module to be loaded
in its own HTTP request on all page views, even for logged-out users
and for registered users without scripts, because it has a dependency
on the 'user.styles' module.

This commit fixes that regression by removing the dependency so
that the 'user' module can, once again, be considered "empty".

The dependency isn't needed. It was only added for the transitional
period after the 'user' module was split up so that existing cached
views for logged-in users (in theory, e.g. 304 Not Modified) would
still trigger a load for the styles.

But that transition ended over a year ago. Now, both modules act
independently and are always queued separately, with user.styles
explicitly added as a style module (as it should be).

Even for the case of an AJAX preview (if it is somehow possible for
the 'user' module to not be loaded already), the API would respond
with a module list that contains both 'user' and 'user.styles'.

Bug: T195380
Change-Id: I9852516af1bd55c84a9213628c7796e2c2168745
2018-05-23 15:53:33 +01:00
Timo Tijhof
2db395abfc resourceloader: Move style deprecation warnings to <body>
Follows-up If35a106c7. These log messages are not criticial and
should not be in the <head> competing with stylesheets and article
content. Move them to the end of <body> instead, nearby other
low-priority script tags.

The getBodyHtml() method from ClientHtml was empty, but has been
non-empty in the past. It's fine to repopulate.

Also, while ClientHtml::getBodyHtml was empty, there are additional
RLQ scripts created by OutputPage that do exist even without this.
Namely, there is a <script> for wgPageParseReport, and one for
wgBackendResponseTime etc.

Change-Id: Ibda7091bdcd5ed207395b20196cdc33df926a24c
2018-05-22 22:14:22 +00:00
jenkins-bot
1339c129e0 Merge "Autofix MediaWiki.Commenting.FunctionComment.SpacingDoc* errors" 2018-05-19 22:24:34 +00:00
Kunal Mehta
230958d97c Autofix MediaWiki.Commenting.FunctionComment.SpacingDoc* errors
Change-Id: I63761ebce04c03b9b13237919c27cc10180f198f
2018-05-19 14:07:03 -07:00
Timo Tijhof
ee8a5e488e resourceloader: Apply safemode to startup module registry
This effectively applies safemode to the mw.loader client,
without the client itself needing specific knowledge of safemode.

Test Plan:
* Unchanged: When viewing a page in safemode, the 'user' and
  'site' modules are still not queued by OutputPage.
* New: mw.loader.getState('site'), previously would yield
  'registered', but will now yield null.
* New: mw.loader.load('site'), previously loaded the module,
  it now logs a dependency warning for unknown module, like for
  any other unknown module.
* New: mw.loader.using('site'), previously resolved, it is now
  rejected.

Bug: T185303
Change-Id: I672e3891c8e1b3c2d13655fa134d0f1d031b8247
2018-05-19 22:14:33 +02:00
jenkins-bot
28d17d2b10 Merge "resourceloader: Allow style-only modules to have deprecation warnings" 2018-05-19 08:47:21 +00:00
Timo Tijhof
0980f94e13 resourceloader: Refactor CSP $nonce passing
Follows-up 70941efd35 which broke various public
signatures of the ClientHtml class that I'd prefer to handle
differently.

This commit mainly restores support for all previously public
signatures, and either removes the need for a parameter, or moves
it to the end of the original signature (as optional param).

* ClientHtml::getHeadHtml: Remove the positional/required parameter
  that was added. Restoring the method to being a stateless computer
  that requires no parameters. Pass the option via construct instead.

* ClientHtml::makeLoad:
  - Make $nonce optional.
  - Restore $extraQuery as optional.

* ResourceLoader::makeInlineScript: Document $nonce as optional
  (matching the implementation).

Change-Id: Iaf33f2a060048e6606fba8d875b6d2953b21ef45
2018-05-17 22:28:23 -07:00
Bartosz Dziewoński
febb1aefe0 resourceloader: Allow style-only modules to have deprecation warnings
The deprecation warning for the module 'mediawiki.ui' (used
e.g. on Special:UserLogin) is now actually shown.

Change-Id: If35a106c77622dbf7e8b5628fbea28f9e7ffd76d
2018-05-17 10:12:12 +00:00
Brian Wolff
70941efd35 Initial support for Content Security Policy, disabled by default
The primary goal here is a defense in depth measure to
stop an attacker who found a bug in the parser allowing
them to insert malicious attributes.

This wouldn't stop someone who could insert a full
script tag (since at current it can't distinguish between
malicious and legit user js). It also would not prevent
DOM-based or reflected XSS for anons, as the nonce value
is guessable for anons when receiving a response cached
by varnish. However, the limited protection of just stopping
stored XSS where the attacker only has control of attributes,
is still a big win in my opinion. (But it wouldn't prevent
someone who has that type of xss from abusing things like
data-ooui attribute).

This will likely break many gadgets. Its expected that any
sort of rollout on Wikimedia will be done very slowly, with
lots of testing and the report-only option to begin with.

This is behind feature flags that are off by default, so
merging this patch should not cause any change in default
behaviour.

This may break some extensions (The most obvious one
is charinsert (See fe648d41005), but will probably need
some testing in report-only mode to see if anything else breaks)

This uses the unsafe-eval option of CSP, in order to
support RL's local storage thingy. For better security,
we may want to remove some of the sillier uses of eval
(e.g. jquery.ui.datepicker.js).

For more info, see spec: https://www.w3.org/TR/CSP2/
Additionally see:
https://www.mediawiki.org/wiki/Requests_for_comment/Content-Security-Policy

Bug: T135963
Change-Id: I80f6f469ba4c0b608385483457df96ccb7429ae5
2018-05-13 21:01:11 -07:00
Fomafix
ce6ae6ada0 ResourceLoaderLessVarFileModule: Add parameter 'lessMessages'
This change allows to add internationalized messages into CSS. The new
parameter 'lessMessages' contains the array of message keys that get
set as Less variables.

In Less the variables must enclosed in double quotes (") or single
quotes (') to prevent CSS injection.

Example usage:
Resources:
	"class": "ResourceLoaderLessVarFileModule",
	"lessMessages": [ "editsection" ],
Message 'editsection':
	edit
Less file:
	content: '[@{msg-editsection}]';
Generated CSS file:
	content: '[edit]';

Also add a type case (object) to ensure that an empty object is
serialized as '{}' and not as '[]'.

Also include Less variables from parent.

Change-Id: I280b52c6745fe8e5755dc5d58c5621a64757d99d
2018-05-12 17:46:15 +02:00
Timo Tijhof
b6a2e22acd resourceloader: Improve coverage of SkinModule
* Ignore getLogoData() which is a one-line proxy to ::getLogo,
  that can't really be tested because static methods can't be stubbed.
  It exists so that this method can be stubbed instead. The actual
  method is already covered.

* Simplify @covers for getStyles() to allow indirect coverage within
  the class because it's intended as a higher-level integration tests.
  The other tests in the suite still cover a specific method only.

Change-Id: I1445a016c1f12a6d8ceaaf745023a28cf20e5371
2018-05-04 17:31:04 +01:00
jenkins-bot
b363b8f21b Merge "Introduce ResourceLoaderLessVarFileModule" 2018-04-26 00:16:09 +00:00
jdlrobson
1bc62c548c Introduce ResourceLoaderLessVarFileModule
This ResourceLoader module provides a way to ship
messages to CSS variables.

We will need this going forward to deal with flash of
unstyled content in various JavaScript based UIs that
are subject to i18n such as table sorting and
collapsible elements.

To avoid overhead of hitting the database to fetch and
transform localisation messages we make use of the MessageBlobStore
making use of `messages` definition already inside
ResourceLoaderFileModule. Given this resource is only intended
for render blocking styles without JavaScript this should be okay
(although if requested in JavaScript will also ship associated
messages)

Bug: T42812
Change-Id: I2bf12cdc848478889acbe9a7a970e46f8aefa287
2018-04-25 11:27:11 -07:00
Brad Jorsch
3f1142045f Generalize ResourceLoader 'excludepage' functionality
There has long been a hack for previewing edits to user JS/CSS, where
OutputPage would pass an 'excludepage' parameter to
ResourceLoaderUserModule to tell it not to load one particular page and
would instead embed that page statically. That's nice, but there are
other places where we could use the same thing.

This patch generalizes it:
* DerivativeResourceLoaderContext may now contain a callback for mapping
  titles to replacement Content objects.
* ResourceLoaderWikiModule::getContent() uses the overrides, and
  requests embedding when they're used. All subclasses in Gerrit should
  pick it up automatically.
* OutputPage gains methods for callers to add to the override mapping,
  which it passes on to RL. It loses a bunch of the special casing it
  had for the 'user' and 'user.styles' modules.
* EditPage sets the overrides on OutputPage when doing the preview, as
  does ApiParse for prop=headhtml. TemplateSandbox does too in I83fa0856.
* OutputPage::userCanPreview() gets less specific to editing user CSS
  and JS, since RL now handles the embedding based on the actual
  modules' dependencies and EditPage only requests it on preview.

ApiParse also gets a new hook to support TemplateSandbox's API
integration (used in I83fa0856).

Bug: T112474
Change-Id: Ib9d2ce42931c1de8372e231314a1f672d7e2ac0e
2018-04-25 00:37:08 +00:00
jdlrobson
c3f200849b resourceloader: Consider having dependencies as non-empty in WikiModule::isKnownEmpty
If a module itself is empty, it must consider any dependencies
it has before bailing out as empty.

Bug: T191596
Change-Id: I2b45b948a6f78060e53513d3b4b77f48d7bf4a6b
2018-04-24 20:56:32 +00:00
jenkins-bot
248dae37e7 Merge "resourceloader: Improve titleInfo docs and simplify title key" 2018-04-20 22:43:19 +00:00
jenkins-bot
8518006b9b Merge "resourceloader: Support loading group=user modules with addModules()" 2018-04-19 19:01:10 +00:00
James D. Forrester
de6dab71e3 Remove $wgScriptExtension (deprecated and ignored since 1.25)
* Remove left-over mention of the .php5 entry points in docs.

* Remove dead logic in NoLocalSettings for php5 entry points.

* Remove dead match in WebRequest for php5 entry points (they'd
  redirect since 1.25, and not seen by PHP).

Change-Id: Ia0ee8588591860b8fe34030c8503f38e9bce31f3
2018-04-19 01:11:23 +01:00
James D. Forrester
225b462a50 Drop deprecated EnableAPI and EnableWriteAPI settings
The siteinfo API response's 'writeapi' value is now hard-set to true,
as are the ResourceLoader variables wgEnableAPI and wgEnableWriteAPI,
to be deprecated later.

Bug: T115414
Change-Id: I54ff9428b247ba203d67aba079149393f323d5a9
2018-04-18 00:30:34 +00:00
Timo Tijhof
d8b0d0bb30 resourceloader: Remove getHashMtime() and getDefinitionMtime() methods
Deprecated since 1.26, no callers or implementors in Wikimedia Git.

Change-Id: Ie44b4be47db7a4799fe39d66294c41238c62f51f
2018-04-17 01:44:26 +01:00
Timo Tijhof
dfb754cbc6 resourceloader: Improve titleInfo docs and simplify title key
* Document the structure of the in-process $titleInfo cache.
  Specifically, specify that it is not the value from getTitleInfo(),
  but rather a container for zero or more versions of such values.
  The reason this is fragmented is because ResourceLoaderContext
  is a parameter to most methods and as such, makes everything
  variable. Tracked as T99107.

* Make various bits easier to understand by consistently refering
  to the container keys as "batchKey", and referring to the internal
  keys as "titleKey".

* Centralise title key logic by moving to private method.

* Replace the internal creation of titleKey to be based on LinkTarget
  with plain namespace IDs and db keys, instead of invoking the
  expensive getPrefixedTitle function which involves quite a lot
  of overhead (TitleCodec, GenderCache, Database, Language,
  LocalisationCache, ..).

Change-Id: I701e5156ef7815a0e36caefae5871524eff3f688
2018-04-10 19:44:40 +01:00
Timo Tijhof
cec597e2b3 resourceloader: Remove deprecated ResourceLoaderGetLessVars hook
Deprecated since 1.30, only had one caller (MobileFrontend)
which has been fixed since.

Bug: T140804
Change-Id: I39b594e3082ebe321bae463780cfadbfb3de1d5c
2018-04-10 15:11:00 +01:00
Timo Tijhof
5ab0dd0888 resourceloader: Support loading group=user modules with addModules()
When a module has group=user specified, it means that its module contents
can vary by user. These kinds of requests have two special needs:
1) They need an additional "user" parameter in their load.php request,
   so that the response knows which user-context to use.
2) They need to have their 'version' hash pre-computed based on which assets
   will be loaded for this user. The general 'version' hash associated with
   this module name in the main registry (modules=startup) will be "wrong"
   as that is computed based on logged-out status.

We do this by omitting the module name from the `mw.load.load(Array modules)`
call in the HTML, and instead output a request for the full url.

This currently works fine for most cases, such as the 'user' module loaded
by MediaWiki core. The branch in getData() dealing with legacy 'only=scripts'
behaviour also covers this case.

But the case of an extension registering a group=user module and loading it the
general way (e.g. not with legacy only=scripts behaviour), would currently end
up in the Array-queue and dynamically loaded by the client-side without knowing
the correct version hash. Fortunately, no code exists that I know of that meets
these three critera (extension registered, group=user, non-legacy). However,
for the GlobalCssJs extension to migrate from legacy to non-legacy, they will
need to start doing this. This commit makes sure that that will work.

The makeLoad() method in ClientHtml has code ensuring the full-url form (with
pre-computed 'version' hash) is used for any modules with group=user. Before
this patch, we didn't get to call makeLoad() because getData() was assuming
that we only need makeLoad() when either the module should be embedded (group=private),
or when it is a style/scripts-only module. It didn't consider group=user.

Bug: T188689
Change-Id: Iaab15e5f5c12e7e28b8c81beab90948cd07cd352
2018-04-06 02:30:30 +00:00
Ed Sanders
b964607dce Use fallback languages in ResourceLoaderImage
Bug: T191120
Change-Id: Ic72aead466c12d344bac359654e6dcc7f0e5c8cb
2018-04-01 20:41:01 +01:00
Timo Tijhof
cfdc440d40 resourceloader: Replace ClientHtml 'target' param with 'options' array
In preparation for passing down 'safemode' from OutputPage.

Only used in one place in Wikimedia Git: OutputPage::getRlClient().

Bug: T185303
Change-Id: If01eca96986ff8d7dcdaab6910bf183ba7c7311f
2018-03-27 18:17:43 -07:00
jenkins-bot
72266c7b35 Merge "resourceloader: Use getRawVal instead of slower getVal in StartupModule" 2018-03-26 17:39:18 +00:00
jenkins-bot
a8bdc16856 Merge "resourceloader: Document 'target' query param in StartupModule" 2018-03-23 18:38:09 +00:00
jenkins-bot
77e3624cab Merge "mediawiki.language: Implement non-digit-grouping of four-digit numbers" 2018-03-23 10:07:46 +00:00
Timo Tijhof
558b007585 resourceloader: Use getRawVal instead of slower getVal in StartupModule
For the same reasons as in ResourceLoaderContext. The only valid values
here are known strings like "desktop" and "mobile". No Language/UTF
normalisation required.

Ensures that Language instance won't get initialised just for this.

Change-Id: If219463d80a66132786710184329388080fbe713
2018-03-22 07:04:28 +00:00
Timo Tijhof
0de0945cc8 resourceloader: Document 'target' query param in StartupModule
Bug: T127268
Change-Id: I38150b2d82420f5058137d611c63e07cbd9c2f96
2018-03-21 20:34:40 -07:00
Timo Tijhof
3bf06ad80c resourceloader: Remove redundant state assignment for styles in ClientHtml
The same variable index was set to the same value from two places,
one unconditionally, and two times within a conditional block after
the first one.

The second ones are a completely redundant remnant from a refactor
sometime last year.

Change-Id: Ia234d4aca398b1b365d457a439d9e449229f28fb
2018-03-20 23:44:41 +00:00