lhc/web/wiklou.git
9 years agoVerify parameter for MapCacheLRU::has() can be passed to array_key_exists()
Mark A. Hershberger [Sun, 30 Nov 2014 20:16:04 +0000 (15:16 -0500)]
Verify parameter for MapCacheLRU::has() can be passed to array_key_exists()

This prevents warnings from PHP from array_key_exists().

Also make sure Title::newFromText throws an exception before it can trigger this.

Bug: T76305
Change-Id: I2b36b7a3b96b37e29fe06f69c13a185b3ec592a7

9 years agoMerge "mediawiki.action.edit.preview: Disable if there is no #wpTextbox1"
jenkins-bot [Sun, 22 Mar 2015 12:07:54 +0000 (12:07 +0000)]
Merge "mediawiki.action.edit.preview: Disable if there is no #wpTextbox1"

9 years agomediawiki.action.edit.preview: Disable if there is no #wpTextbox1
Derk-Jan Hartman [Thu, 19 Mar 2015 21:45:53 +0000 (22:45 +0100)]
mediawiki.action.edit.preview: Disable if there is no #wpTextbox1

ProofreadPage has custom editforms for Index pages, which are not
supported by the API. These editforms have no #wpTextbox1, so disable
live preview in that case.

Bug: T78709
Change-Id: I90cba79e5a4a756454741c4070ebdf620520ab55

9 years agoBidi-isolate numbers of added/removed bytes in changes lists
Amir E. Aharoni [Sat, 21 Mar 2015 20:46:21 +0000 (22:46 +0200)]
Bidi-isolate numbers of added/removed bytes in changes lists

Bug: T93484
Change-Id: I26d3c46a843b2a2114ca50ec0a366fa6b76904a9

9 years agoMerge "mediawiki.helplink: Use a SVG+PNG icon"
jenkins-bot [Sat, 21 Mar 2015 17:50:39 +0000 (17:50 +0000)]
Merge "mediawiki.helplink: Use a SVG+PNG icon"

9 years agoMerge "Set wgAutoloadAttemptLowercase = true for some AutoLoaderTests"
jenkins-bot [Sat, 21 Mar 2015 17:36:45 +0000 (17:36 +0000)]
Merge "Set wgAutoloadAttemptLowercase = true for some AutoLoaderTests"

9 years agoSet wgAutoloadAttemptLowercase = true for some AutoLoaderTests
umherirrender [Sat, 21 Mar 2015 08:41:13 +0000 (09:41 +0100)]
Set wgAutoloadAttemptLowercase = true for some AutoLoaderTests

Avoids:
1) AutoLoaderTest::testWrongCaseClass
Failed asserting that false is true.

2) AutoLoaderTest::testWrongCaseSerializedClass
unserialize() can load classes case-insensitively.
Failed asserting that true is false.

Change-Id: Ic5c271906fb9b2e27639aa8ecfc04ffe6788d3eb

9 years agoMerge "Allow usage of mediawiki.api.options on mobile"
jenkins-bot [Sat, 21 Mar 2015 00:34:51 +0000 (00:34 +0000)]
Merge "Allow usage of mediawiki.api.options on mobile"

9 years agoMerge "Remove a hack, and a hack for the hack, for MediaWiki UI input fields"
jenkins-bot [Sat, 21 Mar 2015 00:20:07 +0000 (00:20 +0000)]
Merge "Remove a hack, and a hack for the hack, for MediaWiki UI input fields"

9 years agoMerge "Make sure template function is callable from processTemplate()"
jenkins-bot [Fri, 20 Mar 2015 22:28:08 +0000 (22:28 +0000)]
Merge "Make sure template function is callable from processTemplate()"

9 years agoMake sure template function is callable from processTemplate()
kaldari [Fri, 20 Mar 2015 00:09:13 +0000 (17:09 -0700)]
Make sure template function is callable from processTemplate()

Change-Id: Id9df4062754b02e7217779bc6c0ba42d457e9942

9 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Fri, 20 Mar 2015 20:09:00 +0000 (21:09 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: I2a30a623d1e70298d50d59fc7d2261bf638fb4db

9 years agoMerge "Add unicode-bidi: embed to mw-title on changeslists"
jenkins-bot [Fri, 20 Mar 2015 20:01:38 +0000 (20:01 +0000)]
Merge "Add unicode-bidi: embed to mw-title on changeslists"

9 years agoRemove table header from Special:Tags when there are no tags
Tina Johnson [Mon, 16 Mar 2015 19:26:46 +0000 (00:56 +0530)]
Remove table header from Special:Tags when there are no tags

The table header shows up even when there are no tags to be
listed in the table. This patch fixes the same

Bug: T92728
Change-Id: I22d2c0435bc365f65354cea604b1c87905c769f8

9 years agoMerge "Add more aliases for Special:Diff for language 'de'"
jenkins-bot [Fri, 20 Mar 2015 15:01:37 +0000 (15:01 +0000)]
Merge "Add more aliases for Special:Diff for language 'de'"

9 years agoAdd more aliases for Special:Diff for language 'de'
umherirrender [Thu, 19 Mar 2015 20:03:56 +0000 (21:03 +0100)]
Add more aliases for Special:Diff for language 'de'

The local community wants 'Diff' as canonical form, add also the long
form for what Diff stands.
Keep the old alias, was added with:
Ic2b34a948d527cee6b76abd7e24a6d8a33b65bd2

https://translatewiki.net/w/i.php?title=MediaWiki:Sp-translate-data-SpecialPageAliases/de&diff=6066852&oldid=6049012
https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=139947048#Spezial:Diff_.E2.86.92_Spezial:Unterschied

Change-Id: I504cd4b0e7c7b5c22812fe9eb0cf8dec9ff9514b

9 years agoUse rspec-expectations "expect" syntax instead of "should" syntax
jagori [Tue, 27 Jan 2015 11:53:31 +0000 (22:53 +1100)]
Use rspec-expectations "expect" syntax instead of "should" syntax

Bug: T68369
Change-Id: I502ba4b0d10c35aaf32fd4dcbfff8cec8ea34582

9 years agomediawiki.helplink: Use a SVG+PNG icon
Bartosz Dziewoński [Wed, 18 Mar 2015 17:19:47 +0000 (18:19 +0100)]
mediawiki.helplink: Use a SVG+PNG icon

Icon copied from OOjs UI library.

Bug: T45591
Change-Id: I0378e26471a72ab3a756e3cbb8c16a6878b3dbde

9 years agoAdd unicode-bidi: embed to mw-title on changeslists
Amir E. Aharoni [Fri, 20 Mar 2015 09:03:44 +0000 (11:03 +0200)]
Add unicode-bidi: embed to mw-title on changeslists

Bug: T93336
Change-Id: I49214553f7151b2abd3d48a60b476f5792ac3a89

9 years agobuild: Increase qunit browserNoActivityTimeout from 10s to 60s
Timo Tijhof [Fri, 20 Mar 2015 08:26:41 +0000 (08:26 +0000)]
build: Increase qunit browserNoActivityTimeout from 10s to 60s

Bug: T89075
Change-Id: I3ef601a38052e38247cebfb19475a31ac2448eac

9 years agoMerge "mediawiki.util: Add mw.util.isIPAddress"
jenkins-bot [Fri, 20 Mar 2015 02:41:38 +0000 (02:41 +0000)]
Merge "mediawiki.util: Add mw.util.isIPAddress"

9 years agobuild: Add assert-mw-env task when running grunt-qunit
Timo Tijhof [Fri, 20 Mar 2015 02:09:17 +0000 (02:09 +0000)]
build: Add assert-mw-env task when running grunt-qunit

Previously it gave cryptic error messages like:

> Running "karma" task
> > Warning: Parameter 'url' must be a string, not number

Change-Id: I0adb0f2f501dd5db2d6738a40efbce349f0175d2

9 years agomediawiki.util: Add mw.util.isIPAddress
Matthew Flaschen [Wed, 18 Mar 2015 02:02:15 +0000 (22:02 -0400)]
mediawiki.util: Add mw.util.isIPAddress

Test it by reusing all the IPv4 and IPv6 cases.

Also, spelling fix

Change-Id: I57e1f00d18a74147da3200be133a4ceb989b1b9d

9 years agoAllow usage of mediawiki.api.options on mobile
Erik Bernhardson [Thu, 19 Mar 2015 23:48:18 +0000 (16:48 -0700)]
Allow usage of mediawiki.api.options on mobile

Change-Id: Ic5b8bc2e5e5e87cd5545812b7c20d73f630ec8e7

9 years agoUpdate OOjs UI to v0.9.3
James D. Forrester [Thu, 19 Mar 2015 23:21:21 +0000 (16:21 -0700)]
Update OOjs UI to v0.9.3

Release notes:
 https://git.wikimedia.org/blob/oojs%2Fui.git/v0.9.3/History.md

Change-Id: Iab68173bddc023b874423ad87d1dd874925a227f

9 years agoAdd example code showing to completely disable logging
Ori Livneh [Thu, 19 Mar 2015 20:16:40 +0000 (13:16 -0700)]
Add example code showing to completely disable logging

Change-Id: I965e1ff51fe31579cf24502b148d9fad971cd298

9 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Thu, 19 Mar 2015 19:28:46 +0000 (20:28 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: Ib9939c0c66487999e57e72e57767612460023b04

9 years agoMerge "Remove EditFilterMerged detection define"
jenkins-bot [Thu, 19 Mar 2015 17:11:46 +0000 (17:11 +0000)]
Merge "Remove EditFilterMerged detection define"

9 years agoRemove FormSpecialPage::$fields
Kunal Mehta [Sun, 15 Mar 2015 02:41:55 +0000 (19:41 -0700)]
Remove FormSpecialPage::$fields

Just use the result of FormSpecialPage::getFormFields() directly

Change-Id: I2f6f8e20b83a24e744ab4c6ea5417d9627a3e0aa

9 years agoMerge "Split SiteLookup interface from SiteStore"
jenkins-bot [Thu, 19 Mar 2015 11:32:27 +0000 (11:32 +0000)]
Merge "Split SiteLookup interface from SiteStore"

9 years agoMerge "EditPage: Implement 'editnotice-notext' message"
jenkins-bot [Thu, 19 Mar 2015 02:26:25 +0000 (02:26 +0000)]
Merge "EditPage: Implement 'editnotice-notext' message"

9 years agoEditPage: Implement 'editnotice-notext' message
Timo Tijhof [Thu, 12 Mar 2015 22:01:59 +0000 (23:01 +0100)]
EditPage: Implement 'editnotice-notext' message

Bug: T91715
Change-Id: Iff6735d93da8b877063690ff67bda652a03d4906

9 years agoUpdate OOjs to v1.1.6
James D. Forrester [Thu, 19 Mar 2015 01:47:12 +0000 (18:47 -0700)]
Update OOjs to v1.1.6

Release notes:
 https://git.wikimedia.org/blob/oojs%2Fcore.git/v1.1.6/History.md

Change-Id: I7c1299c8049983746158a05e47a13f1f4bf7032f

9 years agobuild: Declare grunt-cli dependency
Timo Tijhof [Thu, 19 Mar 2015 01:08:57 +0000 (01:08 +0000)]
build: Declare grunt-cli dependency

A long time ago, npm did not support using command line programs
within 'npm test' (not unless harcoding a path to node_modules/bin/...
within packages.json/scripts/test). But this has been long supported.

Declaring a (dev)dependency will provide its binaries to the
PATH used by the subshell 'npm test' creates internally.

Add grunt-cli so that developers don't have to manually install it.

Change-Id: I6a7fafa3c6e40d2407f07c514167ab9fc7661685

9 years agoSend messages logged via MWLoggerLegacyLogger::log() to the debug toolbar
Kunal Mehta [Wed, 18 Mar 2015 22:42:23 +0000 (15:42 -0700)]
Send messages logged via MWLoggerLegacyLogger::log() to the debug toolbar

Bug: T93145
Change-Id: Ia96525faf4ffcbd2b5beae9716d6be009f2b6074

9 years agoMerge "mediawiki.api.options: Add module for API action=options"
jenkins-bot [Wed, 18 Mar 2015 23:43:55 +0000 (23:43 +0000)]
Merge "mediawiki.api.options: Add module for API action=options"

9 years agoMerge "Remove unused global define RLH_FOR_UPDATE"
jenkins-bot [Wed, 18 Mar 2015 23:41:59 +0000 (23:41 +0000)]
Merge "Remove unused global define RLH_FOR_UPDATE"

9 years agoRemove EditFilterMerged detection define
Chad Horohoe [Wed, 18 Mar 2015 23:38:01 +0000 (16:38 -0700)]
Remove EditFilterMerged detection define

We've supported this hook since 1.12 days and it's actually
deprecated by EditFilterMergedContent. No extensions in Git
or SVN check for this define anymore.

Change-Id: If638094a2fb2f047a3b40a24e11e2c0e2fa9c1b9

9 years agoRemove unused global define RLH_FOR_UPDATE
Chad Horohoe [Wed, 18 Mar 2015 23:32:10 +0000 (16:32 -0700)]
Remove unused global define RLH_FOR_UPDATE

Change-Id: I8f6df920e70ae1d94e6d9fe32cbaf468d31ffdc0

9 years agoMerge "Removed odd "partitionsNoPush" setting to simplify the code"
jenkins-bot [Wed, 18 Mar 2015 23:06:50 +0000 (23:06 +0000)]
Merge "Removed odd "partitionsNoPush" setting to simplify the code"

9 years agoSplit SiteLookup interface from SiteStore
aude [Fri, 6 Feb 2015 02:00:26 +0000 (21:00 -0500)]
Split SiteLookup interface from SiteStore

* SiteLookup interface is added, and SiteStore extends
  it. (any SiteStore type hints can be changed to use
  SiteLookup if all they need is lookup functionality)
* Memcached based SiteStore code is split from the
  database SiteStore, and SiteSQLStore is deprecated.
  If no caching is desired when using a SiteStore, then
  use a SiteDBStore instance, instead of passing $source
  parameter in SiteStore::getSite and SiteStore::getSites.
* SiteListFileCache renamed to FileBasedSiteLookup and
  implements SiteLookup.

Bug: T77990
Change-Id: I36b599884c211580ea6806a8a190c65c4f9087cf

9 years agomediawiki.api.options: Add module for API action=options
Bartosz Dziewoński [Sun, 14 Sep 2014 22:16:11 +0000 (00:16 +0200)]
mediawiki.api.options: Add module for API action=options

Implemented mw.Api#saveOptions to save user preferences.

If necessary, the options will be saved using several parallel API
requests. Only one promise is returned that resolves when all requests
are complete.

If a value of `null` is provided, the given option will be to reset to
the default value.

Any warnings returned by the API, including warnings about invalid
option names or values, are currently ignored. This basically means
that all requests will succeed (barring networks problems, internal
server errors and such).

Change-Id: Ia015898ca910923e00bc53f099b4e5631d6ad45c

9 years agoMerge "Force LocalFile::purgeMetadataCache use the master DB"
jenkins-bot [Wed, 18 Mar 2015 18:22:34 +0000 (18:22 +0000)]
Merge "Force LocalFile::purgeMetadataCache use the master DB"

9 years agoForce LocalFile::purgeMetadataCache use the master DB
Gergő Tisza [Wed, 18 Mar 2015 17:56:11 +0000 (17:56 +0000)]
Force LocalFile::purgeMetadataCache use the master DB

This used to happen automatically via markVolatile() but that was
removed in I808c3a6, which caused cache updates after move/delete
to retain outdated information from slaves.

Bug: T93009
Bug: T88506
Change-Id: Ie4a6c5fbecec9b38ad3ff45fbc22c5d74d66601c

9 years agoMerge "Add framework for file warnings"
jenkins-bot [Wed, 18 Mar 2015 17:25:20 +0000 (17:25 +0000)]
Merge "Add framework for file warnings"

9 years agoMerge "Drop outdated "documentation reviewed" tags"
jenkins-bot [Wed, 18 Mar 2015 16:56:58 +0000 (16:56 +0000)]
Merge "Drop outdated "documentation reviewed" tags"

9 years agoMerge "Fix and make PHPDoc tags in FileBackend more specific"
jenkins-bot [Wed, 18 Mar 2015 16:45:20 +0000 (16:45 +0000)]
Merge "Fix and make PHPDoc tags in FileBackend more specific"

9 years agoMerge "Drop not needed @dataProvider doc tags from MediaWikiTitleCodecTest"
jenkins-bot [Wed, 18 Mar 2015 16:43:04 +0000 (16:43 +0000)]
Merge "Drop not needed @dataProvider doc tags from MediaWikiTitleCodecTest"

9 years agoDrop outdated "documentation reviewed" tags
Thiemo Mättig [Wed, 18 Mar 2015 16:24:50 +0000 (17:24 +0100)]
Drop outdated "documentation reviewed" tags

We review documentation all the time. Even if this was a big, notable
review, it was 5 years ago. It's probably outdated again, e.g. because
methods changed but the corresponting documentaion did not. In my
opinion the fact that a review happened 5 years ago is not useful any
more.

Change-Id: I6f4fb88ea790520bf2443aae4144cdde394b5e78

9 years agoFix and make PHPDoc tags in FileBackend more specific
Thiemo Mättig [Wed, 18 Mar 2015 16:22:52 +0000 (17:22 +0100)]
Fix and make PHPDoc tags in FileBackend more specific

A pure documentation patch. Should almost be a no-brainer. ;-)

Change-Id: I9bf4d6056f7cde193fe5882a04a7973af9b5a7f4

9 years agoDrop not needed @dataProvider doc tags from MediaWikiTitleCodecTest
Thiemo Mättig [Wed, 18 Mar 2015 16:19:14 +0000 (17:19 +0100)]
Drop not needed @dataProvider doc tags from MediaWikiTitleCodecTest

No other @dataProvider in this file does have it's parameters documented.
We usually don't do this because it doesn't add useful information and
is not possible in all cases anyway, e.g. in providers for tests that
are expected to fail. The @param tags would be "mixed" there.

Change-Id: I12a44482e7934a4a18d284d57bf510cb0467cee3

9 years agoMerge "Localisation updates from https://translatewiki.net."
jenkins-bot [Wed, 18 Mar 2015 16:03:52 +0000 (16:03 +0000)]
Merge "Localisation updates from https://translatewiki.net."

9 years agoDon't log HttpErrors in the exception log, use MWLogger
Marius Hoch [Tue, 6 Jan 2015 11:36:28 +0000 (12:36 +0100)]
Don't log HttpErrors in the exception log, use MWLogger

Bug: T85795
Change-Id: Ic36f657a6447dd99c78681536e5dfb066d97b409

9 years agoAdd framework for file warnings
Mark Holmquist [Thu, 5 Mar 2015 18:52:11 +0000 (12:52 -0600)]
Add framework for file warnings

See I674bf7f6c1b21ffc9870aa84382479af5f966561 for an example in the
PdfHandler extension.

Bug: T89765
Change-Id: I3c4b7af7284b5e16e458dd72de789e74db489895

9 years agoFix exit code from rebuildLocalisationCache.php
Tim Starling [Mon, 16 Mar 2015 22:39:06 +0000 (09:39 +1100)]
Fix exit code from rebuildLocalisationCache.php

When --threads was used, the exit code was unconditionally 0, even if a
child thread threw an exception, because the exit code was "abused" for
the count of rebuilt languages. So, don't do that. We don't really need
a count of rebuilt languages that badly, just pass through the exit
status of the child.

Bug: T92900
Change-Id: I77922e686fe7da4fc25bb7f579ed70e1b107eaca

9 years agoMerge "Add help link to three other "minor" special pages"
jenkins-bot [Wed, 18 Mar 2015 14:43:18 +0000 (14:43 +0000)]
Merge "Add help link to three other "minor" special pages"

9 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 18 Mar 2015 14:35:24 +0000 (15:35 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: I0dcd569bbef7ee98f9341af08a2c3d19e7a02e4f

9 years agoFix "Bad value 1 for attribute autofocus" on special pages
umherirrender [Wed, 14 Jan 2015 18:36:52 +0000 (19:36 +0100)]
Fix "Bad value 1 for attribute autofocus" on special pages

Xml::inputLabel does not work with boolean parameters, therefore change
true to an empty string to avoid the '1' in html.

This is done for Special:BookSources (from the bug),
Special:ExpandTemplates, Special:Undelete and Special:Userrights

Bug: T68134
Change-Id: I53ff5701840750f17a2ea9a1ec56cd88c00f3cf5

9 years agoMigrate import log to new log system
umherirrender [Mon, 4 Aug 2014 19:35:18 +0000 (21:35 +0200)]
Migrate import log to new log system

There is no need for an extra formatter class, because at the moment
there is nothing extra to format.

This allows use of gender on Special:Log. Old messages are kept for use
in IRC. A test was added to ensure an unchanged IRC message.

The new log message for import-interwiki is used from
I3ca8b21bce49b41cac7109efb8056ca4469b88d7 to avoid "transwiki jargon".

Bug: T57404
Change-Id: I590075b203548c071a98c1eaa4b1bc9250f60e22

9 years agoAdd help link to three other "minor" special pages
Federico Leva [Wed, 4 Mar 2015 23:14:50 +0000 (00:14 +0100)]
Add help link to three other "minor" special pages

Bug: T45591
Change-Id: If8efa314fbd8f7469aa018135ad0f611f8806b48

9 years agoMerge "Truncate null revision comment for whole multibyte characters"
jenkins-bot [Wed, 18 Mar 2015 08:02:02 +0000 (08:02 +0000)]
Merge "Truncate null revision comment for whole multibyte characters"

9 years agoEmergency remove .mw-headline-anchor
Bartosz Dziewoński [Tue, 17 Mar 2015 21:59:13 +0000 (22:59 +0100)]
Emergency remove .mw-headline-anchor

Follows-up 6c7480e5f0d2a6a73d2.

The should stop the § character from being indexed by Google et al.

Bug: T18691
Bug: T93000
Change-Id: Ie9e334e973e3ded270f1897a2c3816d9df739fc0

9 years agoMerge "Optimize order of styles and scripts"
jenkins-bot [Tue, 17 Mar 2015 21:31:04 +0000 (21:31 +0000)]
Merge "Optimize order of styles and scripts"

9 years agoMerge "Fixed timestamp comparison in fixUserRegistration"
jenkins-bot [Tue, 17 Mar 2015 18:50:50 +0000 (18:50 +0000)]
Merge "Fixed timestamp comparison in fixUserRegistration"

9 years agoSync up with Parsoid parserTests.
Arlo Breault [Tue, 17 Mar 2015 17:02:25 +0000 (10:02 -0700)]
Sync up with Parsoid parserTests.

This now aligns with Parsoid commit 9d213e1eb420bfd9ef6fbc661556b40c8aee32f6

Change-Id: Icb9de1ae26a7148fb0fe68840c5a9cfd45640560

9 years agoMerge "Tidy up tidy usage"
jenkins-bot [Tue, 17 Mar 2015 16:06:24 +0000 (16:06 +0000)]
Merge "Tidy up tidy usage"

9 years agoMerge "API unittests, pass optional params to doApiRequest()"
jenkins-bot [Tue, 17 Mar 2015 14:05:42 +0000 (14:05 +0000)]
Merge "API unittests, pass optional params to doApiRequest()"

9 years agoMerge "New testing wrapper to circumvent object access"
jenkins-bot [Tue, 17 Mar 2015 14:03:39 +0000 (14:03 +0000)]
Merge "New testing wrapper to circumvent object access"

9 years agoNew testing wrapper to circumvent object access
Adam Roses Wight [Fri, 27 Feb 2015 17:22:16 +0000 (09:22 -0800)]
New testing wrapper to circumvent object access

The new TestingAccessWrapper class provides a convenient way to make
all of an object's methods and properties public.

TODO: We should organize test helpers into a source directory.  Note that the
helper and its test are in the same directory.

Change-Id: I958d55df18c74e9d2b25d98cd0316989a0fbbe6f

9 years agoFixed timestamp comparison in fixUserRegistration
Aaron Schulz [Tue, 17 Mar 2015 02:33:25 +0000 (19:33 -0700)]
Fixed timestamp comparison in fixUserRegistration

* Also optimized batching logic slightly

Change-Id: I0cedb5b39f996b7baec067890f230cff51468e4b

9 years agoOptimize order of styles and scripts
Ori Livneh [Mon, 16 Mar 2015 02:45:17 +0000 (19:45 -0700)]
Optimize order of styles and scripts

The current ordering of scripts and stylesheets in <head> causes all major
browsers to serialize and defer requests that could be performed in parallel.

The problem is that external stylesheets are loaded before inline scripts. As
Steven Souders explains, "all major browsers preserve the order of CSS and
JavaScript. The stylesheet has to be fully downloaded, parsed, and applied
before the inline script is executed. And the inline script must be executed
before the remaining resources can be downloaded. Therefore, resources that
follow a stylesheet and inline script are blocked from downloading."[1]

In other words: the browser could start loading body images, but it refuses to
do that until it has executed inline scripts in head. And it refuses to execute
those scripts until the external CSS is downloaded, parsed and applied. You can
see the effect of this in this image, showing the request waterfall for
[[en:Gothic Alphabet]]: [2]. Notice how no images were requested before the
browser had finished processing the three load.php requests at the top.

To fix this, we want to move the inline scripts above the external CSS. This is
a little bit tricky, because the inline scripts depend on mw.loader, which is
loaded via an external script. If we move the external script so that it too is
above the external stylesheet, we force the browser to serialize requests,
because the browser will not retrieve the external CSS until it has retrieved
and executed the external JS code. So what we want is to move the inline
scripts above the external stylesheet, but keep the external script (which the
inline scripts depend on) below the external stylesheet.

We can do this by wrapping the inline script code in a closure (which binds
'mw') and enqueuing the closure in a global array which will be processed by
the startup module at just the right time.

Net result: external CSS and JS is retrieved in parallel, retrieval of images
(and other external assets) is unblocked, but the order in which code is
evaluated remains the same.

[1]: <http://www.stevesouders.com/blog/2009/05/06/positioning-inline-scripts/>
[2]: <http://people.wikimedia.org/~ori/enwiki-waterfall.png> (excerpted from
 <http://www.webpagetest.org/result/150316_0C_7MB/1/details/>.

Change-Id: I98d383a6299ffbd10210431544a505338ca8643f

9 years agoAPI unittests, pass optional params to doApiRequest()
Yuri Astrakhan [Tue, 17 Mar 2015 01:07:24 +0000 (04:07 +0300)]
API unittests, pass optional params to doApiRequest()

ApiQueryTestBase::check() should pass all optional params
like session and user to the doApiRequest()

Change-Id: If1cb52b03faba06c97d330a91a23893fe08acf22

9 years agoMerge "Regenerate autoload.php"
jenkins-bot [Tue, 17 Mar 2015 00:19:07 +0000 (00:19 +0000)]
Merge "Regenerate autoload.php"

9 years agoRegenerate autoload.php
Timo Tijhof [Tue, 17 Mar 2015 00:08:01 +0000 (01:08 +0100)]
Regenerate autoload.php

Follows-up 87dfc20b1e.

It recently started generating dirty output because
BufferingStatsdDataFactory was manually placed – in a different
position than script would (i.e. not alphabetical).

Change-Id: I030a6ec9eb6f3a9b6cb54c9646acf2a898b93a80

9 years agoFixed phpunit exception test
Yuri Astrakhan [Mon, 16 Mar 2015 23:37:38 +0000 (02:37 +0300)]
Fixed phpunit exception test

phpunit has removed that class in
https://github.com/sebastianbergmann/phpunit/commit/f0322b6978bc2b6fd9a17f499950a4b023ef3db4
instead adding a dependency on "sebastian/comparator": "dev-master"
https://github.com/sebastianbergmann/comparator

The class name changed from PHPUnit_Framework_ComparisonFailure
to \SebastianBergmann\Comparator\ComparisonFailure\ComparisonFailure

Bug: T90880
Change-Id: I8988d0b07c00f54c8c8dd38a5e92a5736d88b163

9 years agoMerge "Ignore phpcs in autoload.php"
jenkins-bot [Mon, 16 Mar 2015 22:00:51 +0000 (22:00 +0000)]
Merge "Ignore phpcs in autoload.php"

9 years agoMerge "Add batching support to fixUserRegistration.php"
jenkins-bot [Mon, 16 Mar 2015 21:23:54 +0000 (21:23 +0000)]
Merge "Add batching support to fixUserRegistration.php"

9 years agoMerge "JsonContent: Pass FormatJson::UTF8_OK when beautifying JSON"
jenkins-bot [Mon, 16 Mar 2015 21:23:05 +0000 (21:23 +0000)]
Merge "JsonContent: Pass FormatJson::UTF8_OK when beautifying JSON"

9 years agoMerge "Fix log message for blocks without duration"
jenkins-bot [Mon, 16 Mar 2015 21:21:42 +0000 (21:21 +0000)]
Merge "Fix log message for blocks without duration"

9 years agoAdd batching support to fixUserRegistration.php
Kunal Mehta [Mon, 16 Mar 2015 20:07:33 +0000 (13:07 -0700)]
Add batching support to fixUserRegistration.php

Also:
* Add wfWaitForSlaves() call
* Clear User cache after updating registration time
* Don't use empty()
* Use the master for everything

Bug: T92890
Change-Id: I88b97befdbd78ef12eda9a9571f6943c7b232207

9 years agoJsonContent: Pass FormatJson::UTF8_OK when beautifying JSON
Bartosz Dziewoński [Mon, 16 Mar 2015 20:53:33 +0000 (21:53 +0100)]
JsonContent: Pass FormatJson::UTF8_OK when beautifying JSON

Currently it is not beautiful at all.

Change-Id: I82a07238b4213212b8e4a7150e35486f6dc90bc6

9 years agoTidy up tidy usage
Arlo Breault [Mon, 16 Mar 2015 18:26:52 +0000 (10:26 -0800)]
Tidy up tidy usage

 * There's a branch path in the sanitizer that depends on $wgUseTidy,
   which means the test output differs from on wiki.

 * In general, we should set these variables to match the wiki behaviour
   in tests.

 * Exposes T92892, Sanitizer removes empty tags when tidy is disabled.

 * Tweaked tests for T19663 to use an extension tag to show that
   HTML5 tags with non-word characters make it through the parser
   intact (before being ultimately sanitized).

Change-Id: I09c72fd739e11a8b757f37dc4c790758d782ad73

9 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 16 Mar 2015 20:32:14 +0000 (21:32 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: I4ca8bda44de1a3e7efec4e7322fb9659446d3988

9 years agoFix log message for blocks without duration
umherirrender [Fri, 13 Mar 2015 14:16:32 +0000 (15:16 +0100)]
Fix log message for blocks without duration

Very old blocks form 2004 have not any log_params and therefor enforce a
duration of infinite to be shown on Special:Log.

Follow-Up: Ibc7fcaa5a952ff90d42a6477da4baa429f3de64b
Change-Id: I4bdfab1ff865501a780ed0c7c50e2b1bab467a4b

9 years agoFix phpcs errors and warnings in includes/specials
Kunal Mehta [Sun, 15 Mar 2015 02:50:37 +0000 (19:50 -0700)]
Fix phpcs errors and warnings in includes/specials

Change-Id: I7608459fd50963fa8478b97ccd8f5a1a9d87aae8

9 years agoIgnore phpcs in autoload.php
Timo Tijhof [Mon, 16 Mar 2015 18:06:13 +0000 (19:06 +0100)]
Ignore phpcs in autoload.php

Causes 20 warnings for line length
https://integration.wikimedia.org/ci/job/mediawiki-core-phpcs-HEAD/13849/console

As being autogenerated, migth as well ignore so we can have
mediawiki-core pass.

Change-Id: Iedbe527456144c9b09b7ba93a8ce67edf0b47015

9 years agoMerge "Re-introduce AvailableRightsTest for User::getAllRights completeness"
jenkins-bot [Mon, 16 Mar 2015 18:00:02 +0000 (18:00 +0000)]
Merge "Re-introduce AvailableRightsTest for User::getAllRights completeness"

9 years agoMerge "registration: Fix merging of $wgExtensionCredits"
jenkins-bot [Mon, 16 Mar 2015 17:37:51 +0000 (17:37 +0000)]
Merge "registration: Fix merging of $wgExtensionCredits"

9 years agoMerge "Clean up $wgSQLiteDataDir handling and removed standalone sqlite class"
jenkins-bot [Mon, 16 Mar 2015 17:22:10 +0000 (17:22 +0000)]
Merge "Clean up $wgSQLiteDataDir handling and removed standalone sqlite class"

9 years agoregistration: Fix merging of $wgExtensionCredits
Kunal Mehta [Mon, 16 Mar 2015 16:47:48 +0000 (09:47 -0700)]
registration: Fix merging of $wgExtensionCredits

$wgExtensionCredits has two-levels of arrays, so it needs to be merged
recursively.

Bug: T91609
Change-Id: I4e5fc50059745a89fb69bc1e05a299fd9aaee968

9 years agoMerge "Lower timeout of upload stash -> image scaler requests"
jenkins-bot [Mon, 16 Mar 2015 15:10:21 +0000 (15:10 +0000)]
Merge "Lower timeout of upload stash -> image scaler requests"

9 years agoApiParse: Support previewing section=new
Derk-Jan Hartman [Tue, 10 Mar 2015 21:27:01 +0000 (22:27 +0100)]
ApiParse: Support previewing section=new

When live previewing a 'new' section, we want to automatically add the
edit summary/sectiontitle as an H2 element, as the Edit Page and API
do as well.

Bug: T84877
Change-Id: I40925c16284bb97a4d491e12a8e7878b9d1b4810

9 years agoMerge "Enable mw-ui-radio styles on Special:Preferences"
Prtksxna [Mon, 16 Mar 2015 10:36:07 +0000 (10:36 +0000)]
Merge "Enable mw-ui-radio styles on Special:Preferences"

9 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 15 Mar 2015 20:17:22 +0000 (21:17 +0100)]
Localisation updates from https://translatewiki.net.

Change-Id: I5547cae4cf155c31b20a231e1fd7f81848e14612

9 years agoSet main RequestContext title in api.php
Brad Jorsch [Sat, 14 Mar 2015 01:11:13 +0000 (21:11 -0400)]
Set main RequestContext title in api.php

We set $wgTitle to a dummy title, and RequestContext::getMain()->getTitle()
falls back to that so everything *works*, but RequestContext whines
about it.

Set the same dummy title explicitly on RequestContext::getMain() to shut
things up.

Bug: T78414
Change-Id: I5b90df16cf2f51a6edd5898e9712161f335202a7

9 years agoMerge "Fix phpcs errors and warnings in includes/specialpage"
jenkins-bot [Sun, 15 Mar 2015 19:14:01 +0000 (19:14 +0000)]
Merge "Fix phpcs errors and warnings in includes/specialpage"

9 years agoFix phpcs errors and warnings in includes/specialpage
Kunal Mehta [Sun, 15 Mar 2015 02:40:15 +0000 (19:40 -0700)]
Fix phpcs errors and warnings in includes/specialpage

Change-Id: Ie9276c162e20b28915d31e5a87b2f18cf1c295b6

9 years agoAPI: Return parsedsummary on onlypst
Fomafix [Thu, 18 Dec 2014 13:14:54 +0000 (13:14 +0000)]
API: Return parsedsummary on onlypst

This updates the summary preview on "Show changes" for LivePreview.

Bug: T84836
Change-Id: I169fd1e1b6ed4d4f43ca69f92bc7a38e7823ddae

9 years agoMerge "Fix phpcs errors and warnings in includes/site"
jenkins-bot [Sun, 15 Mar 2015 03:29:59 +0000 (03:29 +0000)]
Merge "Fix phpcs errors and warnings in includes/site"

9 years agoresourceloader: Add ResourceLoader::isModuleRegistered()
Kunal Mehta [Fri, 30 Jan 2015 21:36:52 +0000 (13:36 -0800)]
resourceloader: Add ResourceLoader::isModuleRegistered()

Currently if code wants to check whether a module is registered it
has to call getModule() and see if the response !== null.

Change-Id: I4b470083ddaa5d8cd6be50d5c5b690d4b99b6c4a