jenkins-bot [Mon, 24 Sep 2018 15:45:43 +0000 (15:45 +0000)]
Merge "resources: Register jquery.cookie as foreign resource"
Fomafix [Sun, 23 Sep 2018 20:50:16 +0000 (22:50 +0200)]
resources: Register jquery.cookie as foreign resource
Change-Id: Ia6b1aed25ad6d70aa2035340205406f68297e8bb
jenkins-bot [Mon, 24 Sep 2018 13:48:21 +0000 (13:48 +0000)]
Merge "RevisionStoreDbTestBase, remove redundant needsDB override"
Translation updater bot [Mon, 24 Sep 2018 06:50:27 +0000 (08:50 +0200)]
Localisation updates from https://translatewiki.net.
Change-Id: I679340214f984a89d207db7b865519010d4737e0
jenkins-bot [Mon, 24 Sep 2018 05:43:18 +0000 (05:43 +0000)]
Merge "registration: Let extensions add PHP version requirements"
jenkins-bot [Mon, 24 Sep 2018 00:09:18 +0000 (00:09 +0000)]
Merge "Pass title to Revision constructor in Title::getFirstRevision "
jenkins-bot [Sun, 23 Sep 2018 23:07:24 +0000 (23:07 +0000)]
Merge "Fix caller name in Title::loadRestrictions"
jenkins-bot [Sun, 23 Sep 2018 20:41:49 +0000 (20:41 +0000)]
Merge "resources: Update mustache.js from 0.8.2-
d9aa703 to v1.0.0"
jenkins-bot [Sun, 23 Sep 2018 20:41:44 +0000 (20:41 +0000)]
Merge "resources: Register mustache.js as foreign resource"
jenkins-bot [Sun, 23 Sep 2018 20:29:58 +0000 (20:29 +0000)]
Merge "Remove MimeMagic"
Reedy [Fri, 21 Sep 2018 01:40:59 +0000 (02:40 +0100)]
Remove MimeMagic
Deprecated since 1.28
Change-Id: I793deb8669e353525464ccd840801e5015c545c8
Timo Tijhof [Sun, 23 Sep 2018 19:18:47 +0000 (20:18 +0100)]
resources: Update mustache.js from 0.8.2-
d9aa703 to v1.0.0
Upstream commit '
d9aa703' is the commit right before the tagging
of v1.0.0. The only difference is the version string.
Change-Id: Icf7b7abacac583984977183da6f93f5fd02404fa
Timo Tijhof [Sun, 23 Sep 2018 19:13:42 +0000 (20:13 +0100)]
resources: Register mustache.js as foreign resource
The original commit that added it (
7c52c9265b) did not specify
where it came from or which version. The source refers to
<https://github.com/janl/mustache.js> and contains a version string
stating "0.8.2". However, this file does not match the source
code of released version "0.8.2".
Instead, our copy seems to match the source ode of release
v1.0.0 (except for the version string).
The only commit in the uptream repository that matches our
copy is the commit right before the "Tag v1.0.0" commit,
at which point it had all changes of v1.0.0, but still had
the version string of the last published version. I assume then
at this file was copied from the GitHub master branch at the
time.
I'll update it to v1.0.0 proper in a separate commit.
Change-Id: I37c69e71fd4b005532cb0ac80964c72d3921eae6
Translation updater bot [Sun, 23 Sep 2018 07:47:04 +0000 (09:47 +0200)]
Localisation updates from https://translatewiki.net.
Change-Id: I8256de37811bb514aeca3153f98f8aefdf8cc489
Umherirrender [Sat, 22 Sep 2018 14:03:35 +0000 (16:03 +0200)]
Pass title to Revision constructor in Title::getFirstRevision
The information for a title already in the select result.
Give it to Revision class to avoid extra Title::newFromId in
Revision::ensureTitle for each row
Change-Id: I6f1a936ce2ed1834feb29850e65a497dafe35238
Umherirrender [Sat, 22 Sep 2018 13:47:03 +0000 (15:47 +0200)]
Fix caller name in Title::loadRestrictions
Seeing {closure} in the logs as caller is not helpful
Change-Id: I34aead30c55aefb7591cbc6031522d0f0e5bd17a
Translation updater bot [Sat, 22 Sep 2018 07:28:29 +0000 (09:28 +0200)]
Localisation updates from https://translatewiki.net.
Change-Id: I693c5ed47ebe4326ec6c7e61f692cae48b71d8b6
MGChecker [Sat, 8 Sep 2018 00:02:53 +0000 (02:02 +0200)]
registration: Let extensions add PHP version requirements
While MediaWiki Core already sets requirements for PHP versions, it should be
possible for extensions to tighten these requirements. This mirrors the PHP
parameter of extension infoboxes as well.
This change introduces a new 'platform' key (in addition to 'MediaWiki', 'skins'
and 'extensions', where non-MediaWiki software requirements will be listed
in the future, starting with a PHP version constraint. Further keys are
supposed to be added to allow setting constraints against php extensions
and other abilities of the platform.
Bug: T197535
Change-Id: I6744cc0be2363b603331af9dc860eb8603a1a89a
Brian Wolff [Thu, 20 Sep 2018 06:28:40 +0000 (06:28 +0000)]
Fix some double escaping, and some incorrect escaping for convert()
convert() is weird and requires things to be escaped before it
is called.
This fixes a bunch of phan-taint-check warnings.
Change-Id: I422b313ca05ff61ae05e06856347cc0de832cc49
Brian Wolff [Thu, 20 Sep 2018 05:38:05 +0000 (05:38 +0000)]
Fix some phan-taint-check false positives
Change-Id: Ic5ccbb3f97722476bee7188b83b80cdc652d2a64
Brian Wolff [Thu, 20 Sep 2018 04:31:21 +0000 (04:31 +0000)]
Deprecate QuickTemplate::msgHtml & fix phan-taint-warning in includes/skins
QuickTemplate::msgHtml() (And the weird override that does the
same thing a different way - BaseTemplate::msgHtml()) are inherently
unsafe as they echo out a raw html message. This is strongly
discouraged in modern code. According to codeSearch tool, nothing
uses these methods, and there is a "@private" annotation on the
QuickTemplate::msgHtml() docblock. Thus hard deprecating it.
Change-Id: I4e9e157e922a36787adef4d0bf7608605c27f0c4
jenkins-bot [Fri, 21 Sep 2018 23:40:45 +0000 (23:40 +0000)]
Merge "Remove global namespaced LBFactory"
jenkins-bot [Fri, 21 Sep 2018 20:18:24 +0000 (20:18 +0000)]
Merge "Set consistent min value options for RC and Watchlist filters"
Kosta Harlan [Fri, 21 Sep 2018 19:17:16 +0000 (15:17 -0400)]
Set consistent min value options for RC and Watchlist filters
Bug: T204623
Bug: T199049
Change-Id: If73b7cf6734f4a6a8d8e47ce8051a827ae5452e1
jenkins-bot [Fri, 21 Sep 2018 18:42:23 +0000 (18:42 +0000)]
Merge "CommentStore: Hard-deprecate newKey()"
Reedy [Fri, 21 Sep 2018 01:24:43 +0000 (02:24 +0100)]
Remove global namespaced LBFactory
Change-Id: Ia87aa5c9426af83627a1bbc9bd914546c89c1e47
jenkins-bot [Fri, 21 Sep 2018 15:37:46 +0000 (15:37 +0000)]
Merge "Hard deprecate non-Remex tidy modes"
C. Scott Ananian [Thu, 20 Sep 2018 21:27:59 +0000 (17:27 -0400)]
Hard deprecate non-Remex tidy modes
Let's rip the band-aid off. Remex is pure PHP so there's no reason to
be running any of the other tidy implementations any more, and we won't
be able to support them in the future.
Follow-up to
7b23382823f2ea7bab8d20ad68950ff34f50a005.
Bug: T198214
Change-Id: Id3d07d44f8434231826e86e623554cac3decfa96
daniel [Mon, 10 Sep 2018 19:02:26 +0000 (21:02 +0200)]
Don't show unsaved revision in DifferenceEngine::renderNewRevision.
There was a conditional that was documented to make the method bail out
if the current revision was unsaved, but it was missing the actual return
statement.
Note that preview code in EditPage does not use
DifferenceEngine::renderNewRevision.
Change-Id: I86a25e9464435ac17c72f78f7ce1f354adf3d055
jenkins-bot [Fri, 21 Sep 2018 07:59:13 +0000 (07:59 +0000)]
Merge "selenium: invoke jobs to enforce eventual consistency"
Translation updater bot [Fri, 21 Sep 2018 07:35:22 +0000 (09:35 +0200)]
Localisation updates from https://translatewiki.net.
Change-Id: I3c35fe761a9e90b551fb1435a354e337808f9f00
jenkins-bot [Fri, 21 Sep 2018 03:05:19 +0000 (03:05 +0000)]
Merge "tests: Stop using deprecated LBFactory, use namespaced version"
jenkins-bot [Fri, 21 Sep 2018 02:44:00 +0000 (02:44 +0000)]
Merge "Stop MailAddress accepting a User object"
Reedy [Fri, 21 Sep 2018 01:21:24 +0000 (02:21 +0100)]
tests: Stop using deprecated LBFactory, use namespaced version
Change-Id: Ifbbbfe1bc58e57739b88588e3b6feb703f20534d
jenkins-bot [Fri, 21 Sep 2018 02:20:23 +0000 (02:20 +0000)]
Merge "Collapse some unnecessary else conditions"
Reedy [Fri, 21 Sep 2018 01:12:43 +0000 (02:12 +0100)]
Stop MailAddress accepting a User object
Bug: T204863
Change-Id: I98f110e47ec7ba3b1cd22e8d76eea4bdf7d3d155
jenkins-bot [Fri, 21 Sep 2018 00:37:45 +0000 (00:37 +0000)]
Merge "Drop support for array syntax for $wgSpecialPages"
Reedy [Thu, 20 Sep 2018 22:56:48 +0000 (23:56 +0100)]
Drop support for array syntax for $wgSpecialPages
Bug: T204863
Change-Id: I03fc19cf70a7feeb7d0003de7fbc7b254a3e9560
Reedy [Thu, 20 Sep 2018 23:06:07 +0000 (00:06 +0100)]
Collapse some unnecessary else conditions
Change-Id: I9fe505f2f4ed4d10e13813d9f05127fd6571c874
jenkins-bot [Thu, 20 Sep 2018 23:04:22 +0000 (23:04 +0000)]
Merge "Ensure parserTests pass even if wiki has wgUsePigLatin enabled"
jenkins-bot [Thu, 20 Sep 2018 22:31:11 +0000 (22:31 +0000)]
Merge "user: Allow "CAS update failed" exceptions to be normalised"
Reedy [Thu, 20 Sep 2018 21:53:49 +0000 (22:53 +0100)]
Update HISTORY for 1.27.5/1.29.3/1.30.1/1.31.1
Bug: T199025
Change-Id: Iaf6b8f32d1c4c21b20483817ad0e9d3dbf3e7e22
Kunal Mehta [Fri, 20 Jul 2018 20:29:14 +0000 (22:29 +0200)]
SECURITY: Don't exclude .htaccess files from `git archive`
Bug: T199029
Change-Id: I7ada3dddc4f5f7f2800882ccc9c73c8494f7fac9
Brian Wolff [Sun, 13 May 2018 19:37:09 +0000 (19:37 +0000)]
SECURITY: Do not allow botpassword login if account locked.
Reported by Rxy
Bug: T194605
Change-Id: Ib41005e69ab4db6f849837de12f0d41398b58f9a
Chad Horohoe [Tue, 13 Mar 2018 18:43:30 +0000 (18:43 +0000)]
SECURITY: Make 'newbie' limit in $wgRateLimits really override 'user' limit
The order of operations was incorrect.
Bug: T169545
Change-Id: Ia910aa2a494914d3b0017daac9ab294ea9fa8705
jenkins-bot [Thu, 20 Sep 2018 20:34:31 +0000 (20:34 +0000)]
Merge "Soft deprecate non-Remex tidy configurations"
jenkins-bot [Thu, 20 Sep 2018 20:29:00 +0000 (20:29 +0000)]
Merge "Hard-deprecate the $wgUseTidy option"
jenkins-bot [Thu, 20 Sep 2018 18:19:27 +0000 (18:19 +0000)]
Merge "Use wfIsHHVM() instead of a HipHop-specific environment variable"
James D. Forrester [Thu, 20 Sep 2018 17:13:26 +0000 (10:13 -0700)]
CommentStore: Hard-deprecate newKey()
Not used by any extensions known to Wikimedia git.
Change-Id: I3c07ad6db9d88feddad1cf29d4794fef622298ea
C. Scott Ananian [Tue, 26 Jun 2018 13:58:47 +0000 (09:58 -0400)]
Soft deprecate non-Remex tidy configurations
Future parsers will not be able to emit output compatible with these
configurations.
Bug: T198214
Change-Id: Id7921a166a62457f289e6c0c4bba6c8563be4760
C. Scott Ananian [Tue, 26 Jun 2018 13:35:26 +0000 (09:35 -0400)]
Hard-deprecate the $wgUseTidy option
This has been soft-deprecated since MW 1.26; this hard-deprecation
sets the stage for future removal of this old cruft.
Bug: T198214
Depends-On: Idf246d05d116f63a73105b50a1929a7721fbe7b9
Change-Id: I2e7d990da1da378eb6e828d4b3c0f5a41791dd92
C. Scott Ananian [Thu, 20 Sep 2018 13:21:47 +0000 (09:21 -0400)]
Use wfIsHHVM() instead of a HipHop-specific environment variable
Change-Id: I5bbf3e4f65d9b6a0d7419f67e3931e77e92b7e6c
jenkins-bot [Thu, 20 Sep 2018 12:55:37 +0000 (12:55 +0000)]
Merge "Set break-word on figcaption"
Pablo Grass [Tue, 11 Sep 2018 14:57:48 +0000 (16:57 +0200)]
selenium: invoke jobs to enforce eventual consistency
Many tests use the API during their setup phase, which does not
participate in clearing the job queue, but constantly adds new items.
Consequently the job count keeps mounting. In order to be able to assert
the state of the application once all jobs are processed we need a way
to invoke them.
This is a minimalistic alternative to Idd4924e16925cbf0cb9e42645670c3fd76b72353
Bug: T199446
Change-Id: Ifc49bc5c06eef71da8aff1b1837c32debc2c45dd
jenkins-bot [Thu, 20 Sep 2018 07:58:03 +0000 (07:58 +0000)]
Merge "resourceloader: Simplify StringSet fallback"
jenkins-bot [Thu, 20 Sep 2018 07:57:58 +0000 (07:57 +0000)]
Merge "resourceloader: Use null-objects for 'sources' and 'registry'"
jenkins-bot [Thu, 20 Sep 2018 07:42:30 +0000 (07:42 +0000)]
Merge "resourceloader: Minor clean up in mw.loader and mw.html"
Translation updater bot [Thu, 20 Sep 2018 07:14:17 +0000 (09:14 +0200)]
Localisation updates from https://translatewiki.net.
Change-Id: Ifab02635d866e244cff2ab4eecccdc70119e413a
Ed Sanders [Tue, 3 Apr 2018 21:08:52 +0000 (22:08 +0100)]
Define which languages explicitly fallback to 'en'
In the message store, all messages fall through to English,
but only a few languages should actually explicitly fallback
to English (English variants and dialects).
These new explicit fallbacks are used by ResourceLoaderImageModule,
and this change doesn't affect the message fall through system.
Bug: T203350
Change-Id: I6b68a17f4d69341bccdae748727b5133a600d8bc
jenkins-bot [Wed, 19 Sep 2018 22:45:03 +0000 (22:45 +0000)]
Merge "Add MessagesBi.php"
jenkins-bot [Wed, 19 Sep 2018 21:51:33 +0000 (21:51 +0000)]
Merge "Add MessagesSco.php"
jenkins-bot [Wed, 19 Sep 2018 19:08:46 +0000 (19:08 +0000)]
Merge "mw.jqueryMsg: Handle non-string parameters to functions that expect strings better"
jenkins-bot [Wed, 19 Sep 2018 19:08:40 +0000 (19:08 +0000)]
Merge "mw.jqueryMsg: Add tests for non-string parameters to functions that expect strings"
jenkins-bot [Wed, 19 Sep 2018 18:53:14 +0000 (18:53 +0000)]
Merge "Special:Preferences: Remove unnecessary OOUI styles override"
jenkins-bot [Wed, 19 Sep 2018 18:40:36 +0000 (18:40 +0000)]
Merge "resourceloader: Add internal RLPAGEMODULES constant"
jenkins-bot [Wed, 19 Sep 2018 18:33:34 +0000 (18:33 +0000)]
Merge "resourceloader: Make ResourceLoader::makeLoaderRegisterScript() internal"
jenkins-bot [Wed, 19 Sep 2018 18:33:29 +0000 (18:33 +0000)]
Merge "resourceloader: Factor out encodeJsonForScript"
Bartosz Dziewoński [Wed, 19 Sep 2018 18:00:28 +0000 (20:00 +0200)]
Special:Preferences: Remove unnecessary OOUI styles override
Since OOUI v0.24.4, menus/popups of infused PHP widgets are placed
into the default overlay, so this workaround is not needed.
Change-Id: I4f8a76cb258e44ed4f2fbba41425100d2e0e9b45
jenkins-bot [Wed, 19 Sep 2018 17:37:55 +0000 (17:37 +0000)]
Merge "StructureTest::testUnitTestFileNamesEndWithTest() should not shell out"
jenkins-bot [Wed, 19 Sep 2018 17:20:53 +0000 (17:20 +0000)]
Merge "Use new isTalkPage/isTalkNamespace methods"
jenkins-bot [Wed, 19 Sep 2018 17:14:24 +0000 (17:14 +0000)]
Merge "DateInputWidget: Update OOUI variables to latest"
jenkins-bot [Wed, 19 Sep 2018 17:10:17 +0000 (17:10 +0000)]
Merge "DateTimeInputWidget: Rename vars to reflect latest WikimediaUI theme vars"
jenkins-bot [Wed, 19 Sep 2018 17:10:12 +0000 (17:10 +0000)]
Merge "Special:Preferences: Reduce PanelLayout border contrast slightly"
Ed Sanders [Thu, 13 Sep 2018 18:43:04 +0000 (19:43 +0100)]
Use new isTalkPage/isTalkNamespace methods
Change-Id: I291738ff6ebb63df2e405e98131dd80f3ddf2db6
Volker E [Wed, 19 Sep 2018 16:13:14 +0000 (09:13 -0700)]
Special:Preferences: Reduce PanelLayout border contrast slightly
The border choice for `#a2a9b1` was intended to provide AA conforming
contrast for widgets. In case of framed PanelLayout it is not necessary
due to it's different use case and the additional high padding.
Change-Id: Ia425594c1795d1d8668cd62daff32ff9b97d67c2
jenkins-bot [Wed, 19 Sep 2018 15:43:31 +0000 (15:43 +0000)]
Merge "resourceloader: Remove check for Function#bind and Object.defineProperty"
jenkins-bot [Wed, 19 Sep 2018 15:33:58 +0000 (15:33 +0000)]
Merge "Avoid ResourceLoader LESS parsing bug"
Timo Tijhof [Sat, 15 Sep 2018 18:46:51 +0000 (19:46 +0100)]
resourceloader: Remove check for Function#bind and Object.defineProperty
* Function#bind is a given per the explicit feature test for Grade A.
* Object.defineProperty is part of ES5 which is also tested for.
This code is from before we required ES5 and is now redundant.
Also remove the unused eslint-disable rule for global 'console' use,
the code in question does not use console as global unconditionally.
Change-Id: I6c77b25856da8b7717aeba8298b17a9231540d58
Ed Sanders [Wed, 19 Sep 2018 11:16:56 +0000 (12:16 +0100)]
Avoid ResourceLoader LESS parsing bug
Bug: T204816
Change-Id: I4558e2c05dd3377090de11aa79f20911fa3365eb
Translation updater bot [Wed, 19 Sep 2018 07:28:39 +0000 (09:28 +0200)]
Localisation updates from https://translatewiki.net.
Change-Id: I383c3794e40e4269c1f8ddcc60ddf1bc202b5eff
Volker E [Wed, 19 Sep 2018 00:33:29 +0000 (17:33 -0700)]
DateTimeInputWidget: Rename vars to reflect latest WikimediaUI theme vars
Change-Id: Icdae37127633e7fb17f77550d4900addf076cbfd
Volker E [Tue, 18 Sep 2018 23:59:51 +0000 (16:59 -0700)]
DateInputWidget: Update OOUI variables to latest
In course of icon overhaul we've also unified base widget font-size
to `14px` in I693d168d2ccf2. DateInputWidget has been left behind.
Let's amend it and also align other variables like
`transition-medium`.
Change-Id: I033bfa17b665d7e36f6d18c3adfa0315c4b26cb0
jenkins-bot [Tue, 18 Sep 2018 21:41:32 +0000 (21:41 +0000)]
Merge "mediawiki.util: Optimise addPortletLink"
jenkins-bot [Tue, 18 Sep 2018 21:30:47 +0000 (21:30 +0000)]
Merge "mediawiki.util: Improve unit tests"
Timo Tijhof [Tue, 18 Sep 2018 02:15:07 +0000 (03:15 +0100)]
mediawiki.util: Optimise addPortletLink
* Use prop() instead of attr().
- Avoids extra overhead from attr() relating to XML/SVG compat.
- Makes the code consistent with jquery.accessKeyLabel, which,
reads the node.accessKey value as property already, and we now
set it the same way.
* Use append() instead of wrap().parent().
Most use of adding portlets is as links in the sidebar or
as menu items for the page actions menu. For this, simply
assign the <li> directly, and append the link. Instead of
wrapping it in the DOM and then unwrapping the jQuery
collection. This also saves a bunch of clone operations
internally due to how jQuery objects keep a stack of
mutations.
* Set 'textContent' directly instead of text().
* Use $('<li>') instead of $().wrap('<li></li>') which allows jQuery
to take a fast path for element creation. Also consistent with
MW code conventions which say to avoid <tag></tag>.
* Use node.querySelector(str) instead of $(node).find(str).eq(0).
The latter does a lot more, including querySelectorAll(),
and twice a clone/push/merge of the jQuery collection.
* Use createElement() for the anchor tag, given that none of the
remaining code needed the jQuery object anymore. The return
value was already the DOM Node directly as well.
Bug: T204625
Change-Id: I9070f63a4c75411c0eff7757bd2d8aed46c182e9
Umherirrender [Sun, 16 Sep 2018 19:44:42 +0000 (21:44 +0200)]
StructureTest::testUnitTestFileNamesEndWithTest() should not shell out
Bug: T169005
Change-Id: I17b35f31c3989ca0b9056252866a45434c31a105
James D. Forrester [Tue, 18 Sep 2018 18:29:38 +0000 (11:29 -0700)]
Special:Preferences: Enable OOUI mode by default
Developers and other users can temporarily still opt out with ?ooui=0.
Bug: T117781
Change-Id: I1466e67161b5155552ffa7d80c383064913ec4dc
daniel [Mon, 28 May 2018 19:19:11 +0000 (21:19 +0200)]
Use "Unknown user" instead of an empty user name.
This changes the user name to "User unknown" when constructing a RevisionRecord
from a database row that has an empty ar_user_text resp rev_user_text field.
This may cause "User unknown" to be written to the database, if the
RevisionRecord is used as the basis for a new revision that is being created,
particularly during undeletion. Since "Unknown user" is listed in
$wgReservedUsernames, this should never lead to conflicts with actual user
names.
It is assumed that empty ar_user_text and rev_user_text fields will be
fixed during migration to the new actor based database schema.
Bug: T195692
Change-Id: I506c513b019778d83741e47f0d11093f5ab67a54
Brad Jorsch [Tue, 18 Sep 2018 16:01:32 +0000 (12:01 -0400)]
WatchedItemStore::countVisitingWatchersMultiple() shouldn't query all titles when asked for none
If a caller gives an empty array for $targetsWithVisitThresholds, per
the documentation it should be expecting an empty array in return, not a
count of watchers for every title in the database.
Bug: T204729
Change-Id: I0f25fae301450d077bb30597281aaef0fba209d4
jenkins-bot [Tue, 18 Sep 2018 15:52:02 +0000 (15:52 +0000)]
Merge "Allow edit.php to modify different slots."
jenkins-bot [Tue, 18 Sep 2018 15:00:30 +0000 (15:00 +0000)]
Merge "mediawiki.Title: Add isTalkPage/getTalkPage methods to mw.Title.js"
Translation updater bot [Tue, 18 Sep 2018 07:14:02 +0000 (09:14 +0200)]
Localisation updates from https://translatewiki.net.
Change-Id: If4369a94a3165a063ccc3061a6f3a5e6e6487ad5
Timo Tijhof [Tue, 18 Sep 2018 02:59:08 +0000 (03:59 +0100)]
mediawiki.util: Improve unit tests
* Simplify fixture.
* Use more obvious example values.
* Add strict test for nodeType and nodeName on the return value.
Previously it was only asserting the return value to be a Node,
now it asserts it to be an html anchor element.
* Improve wording of some assertion messages.
* Line breaks.
Bug: T204625
Change-Id: I75442a4d86ac328410f0f7bc9976a2316f00cf95
jenkins-bot [Tue, 18 Sep 2018 02:26:10 +0000 (02:26 +0000)]
Merge "Article: Fix reference to view() in documentation comment"
Roan Kattouw [Tue, 18 Sep 2018 01:29:55 +0000 (21:29 -0400)]
Article: Fix reference to view() in documentation comment
WikiPage::view() doesn't exist; Article::view() does.
Change-Id: I3fbffa15be4cff6cb3f5c7dc5cc178102472f25b
Timo Tijhof [Mon, 17 Sep 2018 23:48:14 +0000 (00:48 +0100)]
resourceloader: Add internal RLPAGEMODULES constant
Expose this constant for internal use by Navigation Timing,
so that it can compute mwLoadEnd based on when these modules
finish loading.
The way mwLoadEnd is currently computed is by building a list
of all registered module names, and narrowing it down to the
ones in 'loading' state at the time that ext.navigationTiming.js
executes. The problem with doing that, is that it is includes
various lazy-loaded modules that aren't critical to the page and
aren't meant to be tracked by that metric. For example:
* Preloading of modules from various extensions (including VE,
and Popups).
* Background chains for EventLogging schemas from mw.loader.using,
including the one started by Navigation Timing itself.
On my local install, the list of filtered down modules always
includes 'schema.SaveTiming', '...rumSpeedIndex', etc.
Exporting the list passed to the initial load() call as constant
will enable Navigation Timing to instead only await only those
modules (and their dependneices).
Bug: T204426
Change-Id: Ida134b4dfee218db16c2d1f88d4f26e8d761e154
Timo Tijhof [Sat, 15 Sep 2018 21:31:18 +0000 (22:31 +0100)]
resourceloader: Make ResourceLoader::makeLoaderRegisterScript() internal
* There is only a single non-test caller to this method in the entire
codebase, and no callers elsewhere (Wikimedia Git, Codesearch).
It's only used with an array, so remove the other unused code paths,
and mark it internal (to my knowledge, nothing ever used it outside
RL in the past, either).
* Add test coverage for the module indexing logic.
Change-Id: I9e0f95416d5b2fdd87323288231ee6d8c85d88e7
Timo Tijhof [Sat, 15 Sep 2018 20:51:43 +0000 (21:51 +0100)]
resourceloader: Factor out encodeJsonForScript
Follows-up
dc3fc6cf81, which documented the reasoning for the
specific json flags in StartupModule. In wanting to re-use them
in a different module it became apparant that perhaps it was a
bit too conservative in only allowing the flags to be used in
a script HTTP response.
Lax the contract a little bit (that is, do more escaping) to also
allow safe re-use in HTML context.
I considered making these separate methods (e.g. forScriptResponse,
and forInlineScript) but decided not to because the vast majority
of callers would have to be forInlineScript eventhough the code
in question had no responsiblity or knowledge of it becoming an
inline script, because ResourceLoader allows most modules to
become embedded if they support a private or preview mode.
Those modes are implemented by calling makeModuleResponse, and
wrapping it an inline script. It seems appealing and simplifying
to the API to require that script output is always safe for
embedding rather than complicating the API for winning back
a literal handful of bytes in the edge case that a user-generated
string contains a '<' and was not embedded. I estimate that with
gzip, it will literally save only a single byte, even if used
multiple times. Let's focus optimisation efforts elsewhere :)
Change-Id: I7742dabba6750deecf6fbf51cf9a77ee8cbfc727
jenkins-bot [Mon, 17 Sep 2018 21:03:36 +0000 (21:03 +0000)]
Merge "Handle invalid input to Special:FilePath?file="
Ed Sanders [Thu, 13 Sep 2018 18:21:30 +0000 (19:21 +0100)]
mediawiki.Title: Add isTalkPage/getTalkPage methods to mw.Title.js
These are identical to methods in Title.php
Change-Id: Ie57243bac1aa5e23bc8b1c027bcb1b83090ee433