Commit graph

6857 commits

Author SHA1 Message Date
Bartosz Dziewoński
75021af9f2 Update OOUI to v0.29.2
Release notes:
 https://phabricator.wikimedia.org/diffusion/GOJU/browse/master/History.md;v0.29.2

Bug: T206344
Depends-On: I607825c7df3d843f80f8d151c5c79c39cd629c17
Change-Id: I6db8fbb28ae1c190b1d9e2b4d4defdb20579a169
2018-10-09 00:44:22 +00:00
Fomafix
5632815976 Write Latin and other scripts with captial letter
Change-Id: I16c660e54191b63cd6eb3407cb00504665930c4e
2018-10-05 18:49:08 +02:00
James D. Forrester
86ff8ccdcd Update OOUI to v0.29.1
Release notes:
 https://phabricator.wikimedia.org/diffusion/GOJU/browse/master/History.md;v0.29.1

Local fix to rcfilters for renamed parent method.

Bug: T130434
Bug: T165650
Bug: T183299
Bug: T196756
Bug: T205472
Bug: T205692
Bug: T205979
Bug: T206153
Bug: T206155
Depends-On: Ie847465af6762fd0322a5be4adf601cabda2d458
Change-Id: I704e3197e86d484be3ab91b9282d6ac1b7db2251
2018-10-04 10:41:14 -07:00
Fomafix
1472f02b36 Phabricator: Use Tddddd instead of Bug ddddd in comments
Change-Id: Ic9fe03cab270bd6be738af346164ad5d31a0d780
2018-10-04 09:15:02 +02:00
jenkins-bot
306fe0ec7c Merge "Special:Preferences: Drop non-OOUI legacy form version" 2018-10-03 23:57:26 +00:00
jenkins-bot
947d79685c Merge "RCFilters: better vertical alignment of checkbox and text in menus" 2018-10-03 00:43:17 +00:00
Stephane Bisson
d1143076ca RCFilters: better vertical alignment of checkbox and text in menus
- Remove min-height so menu items are a little smaller and
  their content is vertically-aligned.

- Force `vertical-align: middle;` for checkboxes by overriding
  OOUI with extreme specificity.

Bug: T200364
Change-Id: If0b2b5c1b749f913badbd0c02a85852ec0007020
2018-10-03 00:18:14 +00:00
jenkins-bot
95bbac0655 Merge "Use pseudo elements to style changelist-separators on Contributions" 2018-10-02 12:24:58 +00:00
James D. Forrester
dcf3eb793a Special:Preferences: Drop non-OOUI legacy form version
Change-Id: I65b89385c3ec28ef01b86dd933dae3801e503631
2018-10-01 17:47:02 -07:00
James D. Forrester
e45b64c2ca CategoryTagItemWidget: Drop backwards-compatibility "Capsule" name
Not used for months.

Change-Id: Ie85d2d0ef6ebc3e1e2502519a02b8fadd8d53b7a
2018-10-01 17:33:41 -07:00
jdlrobson
fd993dd4bc Use pseudo elements to style changelist-separators on Contributions
Currently, these separators are unnecessarily hardcoded in HTML.
This is problematic, as it limits the extent to which skins such
as Minerva and Timeless can skin these pages.

If the pseudo selector is not available (e.g. legacy browsers)
this degrades nicely to whitespace and the page is still useable.

Right now, these changes are scoped to pages uses the ContribsPager
(used by Special:Contributions)
but we can adopt them in other pages once we have this approach set in
stone (CSS)

Bug: T205581
Change-Id: Ia2c485e6058ebf4282ed2f7eb7b046b2deb03f57
2018-10-01 16:29:46 -07:00
jenkins-bot
c5d44cc0cf Merge "Forward X-Search-ID header to search suggest tracking" 2018-09-25 20:24:41 +00:00
Erik Bernhardson
a7bf9ac2c5 Forward X-Search-ID header to search suggest tracking
This header can be injected into api responses that include
search results to provide a link between the backend logs
and any frontend logging. Associating autocomplete tracking
with backend logs will allow us to determine autocomplete
examination probabilities, and more generally be able to
evaluate autocomplete effectiveness.

Bug: T205348
Change-Id: I1663906e2fd71f7df215e563b09a0b4fb8948ab8
2018-09-25 12:36:58 -07:00
James D. Forrester
ac6e8495f2 resources: Make jquery.cookie a multi-file resource with changelog, licence
Change-Id: I47e25b1a7ac7d53932dfdfd37a47a38141f91be4
2018-09-24 10:14:31 -07:00
Timo Tijhof
137bba78ef 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
2018-09-23 20:18:47 +01:00
jenkins-bot
62c6f40d73 Merge "Set break-word on figcaption" 2018-09-20 12:55:37 +00:00
jenkins-bot
2f5d888197 Merge "resourceloader: Simplify StringSet fallback" 2018-09-20 07:58:03 +00:00
jenkins-bot
fc2a88f666 Merge "resourceloader: Use null-objects for 'sources' and 'registry'" 2018-09-20 07:57:58 +00:00
jenkins-bot
59e694408b Merge "resourceloader: Minor clean up in mw.loader and mw.html" 2018-09-20 07:42:30 +00:00
jenkins-bot
7c4b637cca Merge "mw.jqueryMsg: Handle non-string parameters to functions that expect strings better" 2018-09-19 19:08:46 +00:00
Bartosz Dziewoński
2240a3c4ef 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
2018-09-19 20:00:28 +02:00
jenkins-bot
f84721d9a5 Merge "Use new isTalkPage/isTalkNamespace methods" 2018-09-19 17:20:53 +00:00
jenkins-bot
3f7d9854fc Merge "DateInputWidget: Update OOUI variables to latest" 2018-09-19 17:14:24 +00:00
jenkins-bot
56230b8911 Merge "DateTimeInputWidget: Rename vars to reflect latest WikimediaUI theme vars" 2018-09-19 17:10:17 +00:00
jenkins-bot
e44151068e Merge "Special:Preferences: Reduce PanelLayout border contrast slightly" 2018-09-19 17:10:12 +00:00
Ed Sanders
c5c7980c7d Use new isTalkPage/isTalkNamespace methods
Change-Id: I291738ff6ebb63df2e405e98131dd80f3ddf2db6
2018-09-19 10:07:15 -07:00
Volker E
be2734b548 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
2018-09-19 09:13:14 -07:00
jenkins-bot
27cb4c5ee2 Merge "resourceloader: Remove check for Function#bind and Object.defineProperty" 2018-09-19 15:43:31 +00:00
jenkins-bot
76930d6c91 Merge "Avoid ResourceLoader LESS parsing bug" 2018-09-19 15:33:58 +00:00
Timo Tijhof
b102734292 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
2018-09-19 14:35:19 +00:00
Ed Sanders
30a949dae8 Avoid ResourceLoader LESS parsing bug
Bug: T204816
Change-Id: I4558e2c05dd3377090de11aa79f20911fa3365eb
2018-09-19 12:18:00 +01:00
Volker E
587851c43f DateTimeInputWidget: Rename vars to reflect latest WikimediaUI theme vars
Change-Id: Icdae37127633e7fb17f77550d4900addf076cbfd
2018-09-18 17:33:29 -07:00
Volker E
92ebd0cfd1 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
2018-09-18 17:26:38 -07:00
jenkins-bot
6df38a8d26 Merge "mediawiki.util: Optimise addPortletLink" 2018-09-18 21:41:32 +00:00
Timo Tijhof
be2774703a 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
2018-09-18 19:42:51 +00:00
jenkins-bot
8fb14da2d2 Merge "mediawiki.Title: Add isTalkPage/getTalkPage methods to mw.Title.js" 2018-09-18 15:00:30 +00:00
Ed Sanders
9222f5248b mediawiki.Title: Add isTalkPage/getTalkPage methods to mw.Title.js
These are identical to methods in Title.php

Change-Id: Ie57243bac1aa5e23bc8b1c027bcb1b83090ee433
2018-09-17 20:52:00 +01:00
jenkins-bot
fe94275c8f Merge "resources: Strip '$' and 'mw' from file closures" 2018-09-17 18:41:32 +00:00
Timo Tijhof
fb11be8c45 resourceloader: Simplify StringSet fallback
Covered by tests.

Change-Id: I6a287f27d0830561275bf0be525992c59cbe441f
2018-09-15 20:46:07 +00:00
Timo Tijhof
46daa86cb1 resourceloader: Use null-objects for 'sources' and 'registry'
Follows-up e5912535ae, and removes the last use of
Object.prototype-inheriting objects for map-like objects, in
mediawiki.js.

I'd like to consider using ES6 Map as well, with a partial shim
like we do for StringSet/Set, but that'll require some more
refactoring. It's also not clear whether it will improve
execution speed and/or memory use. Worth trying at a later time,
though.

The current change simply removes the inheritance and simplifies
the code. Apart from slightly smaller code, I could not find any
notable/reproducible improvement in either NavTiming metrics or
CPU time spent in 'Scripting'. The metrics are in the same range
as before this changes.

Change-Id: Ie0016667d9291dcfafde61289d5444817be3447d
2018-09-15 18:53:45 +00:00
Timo Tijhof
d0a80f222e resourceloader: Minor clean up in mw.loader and mw.html
* Remove redundant registry check in the internal
  queueModuleScript function. Like most internal methods,
  it can only be inside the mw.loader closure, and is only
  called with extant module name.

* Remove redundant registry check from execute().

* Rename local variable in mw.loader.state() from 'modules'
  to 'states' to avoid confusion.

* Shorten exception messages in mw.html to not prefix the method
  names, because we don't do that anywhere else in RL JS.

Change-Id: Idf1a49fd98445477f2d940624ca0d079325bd15b
2018-09-15 18:45:50 +01:00
jenkins-bot
bf24c89196 Merge "mediawiki.language: Use the 'mw' global" 2018-09-14 01:40:56 +00:00
jenkins-bot
e7a7a7823e Merge "mediawiki.language: Remove unused private method 'procPLURAL'" 2018-09-14 00:34:05 +00:00
Timo Tijhof
add9bd191f resources: Strip '$' and 'mw' from file closures
Follows-up Id6d13bbea6:
- '$': mw.loader.implement does this already.
- 'mw': Use the canonical name directly.

This replaces the following patterns:

File closures (common):
- `( function ( $, mw ) {`     => `( function () {`
- `( function ( $ ) {`         => `( function () {`
- `( function ( mw ) {`        => `( function () {`
- `( function ( mw, $ ) {`     => `( function () {`

File closures (rare):
- `( function ( mw, $, OO ) {`    => `( function () {`
- `( function ( mw, OO, $ ) {`    => `( function () {`
- `( function ( mw, document ) {` => `( function () {`

Combined dom-ready and file closure (rare):
- `jQuery( function ( $ ) {` => `$( function () {
- `jQuery( function () {` => `$( function () {

Remaining references in files without a closure, as found by
the new ESLint setting (rare):
- `jQuery`    => `$`
- `mediaWiki` => `mw`

Change-Id: I7cf2426cde597259e8c6f3f6f615a1a81a0ca82b
2018-09-14 00:59:27 +01:00
Timo Tijhof
8889c6a80c mediawiki.language: Use the 'mw' global
Follows-up Id6d13bbea6.

Change-Id: I16de5ef6190aa4bb322b03416d51bbf28ff15dc9
2018-09-14 00:48:42 +01:00
jenkins-bot
bc7f55fcf4 Merge "resourceloader: Optimise and simplify state propagation logic" 2018-09-13 23:40:28 +00:00
Timo Tijhof
6a83163b1c resourceloader: Optimise and simplify state propagation logic
aka "handlePending 2.0",
aka "don't recurse 300x before executing a module",
aka "don't break DevTools flame graphs".

== Impact

Comparison based on viewing the default Main page on Chrome stable.
The local MediaWiki has a few extensions installed (EventLogging,
ULS, Navigation Timing).

Measured by alternating between before/after and logging 'mediaWikiLoadEnd'
from ext.navigationTiming.js, and evaluating the following on the console:
```
({ responseStart: performance.timing.responseStart - performance.timing.navigationStart,
   domInteractive: performance.timing.domInteractive - performance.timing.navigationStart,
   domComplete: performance.timing.domComplete - performance.timing.navigationStart,
   loadEventEnd: performance.timing.loadEventEnd - performance.timing.navigationStart });
```

This was repeated five times, and I picked three results based on similar
responseStart values. This provides a fairer comparison by avoiding bias of
fluctuation from the network/server. The actual values ended up slightly
favouring the older code.

| -------------- | ---------------- | ---------------- | -------- |
|                | Before           | After            | Avg diff |
| -------------- | ---------------- | ---------------- | -------- |
| responseStart  | 1044, 1001, 1016 | 1025, 1023, 1024 | +3ms     |
| domInteractive | 2080, 2069, 2059 | 1872, 2101, 2050 | -61ms    |
| domComplete    | 4361, 4239, 3927 | 3691, 4023, 3981 | -227ms   |
| loadEventEnd   | 4366, 4244, 3932 | 3691, 4023, 3982 | -282ms   |
| mwLoadEnd      | 4524, 4416, 4113 | 3994, 4320, 4297 | -147ms   |
| -------------- | ---------------- | ---------------- | -------- |

== Implementation

While technically a single logical change, this commit does
resolve multiple long-standing issues and inefficiencies.

* handlePending (now called doPropagation) was called way more
  often than needed. When a load.php response arrived with calls
  to mw.loader.implement(), each one could execute and immediately
  call handlePending().
  Now, the first implementation in a batch schedule one call
  doPropagation(), and the later ones ride along that one call.

* Most calls to handlePending were only able to execute one
  pending module, which in turn created its own handlePending
  call that started all over again. This meant that by the time
  control returned to an outer call, there was nothing left to
  do, except it still needed to continue its iteration over the
  whole registry before knowing there was nothing left to dos.

* Due to recursive calls to handlePending() from execute(), and
  due to immediate execution from implement() - as called from
  load.php or asyncEval - the stack was often already 100s of
  level deep before *starting* the execution of a module.
  Such deep stacks caused:
  - a larger memory footprint (for the stacks themselves).
  - confusing flame graphs. It was impossible to analyze
    performance of module initialisation, I typically could only
    look at code from dom-ready handlers or other events.
    The stacks were so big, they actually caused rendering
    bugs inside Chrome where higher parts of the stack would be
    trimmed, and thus related code would no longer be visually
    grouped by the same parent.
  - confusing error messages (long stack traces).

* The eager execution from mw.loader.implement() calls meant
  that it was not possible to separate the parsing/loading of
  code (by load.php and asyncEval), from the execution of code.
  Now, this is separated by a 1ms yield (in practice it's
  larger than 1ms, but it has high priority). This means that the
  batch of localStorage eval() and the batch response from
  load.php can now first do one type of work (allocating of functions
  and objects, stashing them in the registry), and then later the
  other type of work (execution of the module code) - with some
  breathing room allowed for rendering.

Bug: T127328
Bug: T202703
Change-Id: I499ae3f095545abcc03e8989f54422b1997738d3
2018-09-13 16:19:58 -07:00
Volker E
ab7cabe672 Replace 'help' with better fitting 'helpNotice' icon on tags panel
Bug: T204165
Change-Id: I90a9619c976ff37c8b7d4a9bb03a3573e00bd19d
2018-09-13 19:11:35 +00:00
Arlo Breault
92ddf5dc64 Set break-word on figcaption
This is using the non-standard value of word-break, instead of
overflow-wrap/word-wrap, since the latter doesn't produce the desired
effect.  That may be due to figure being displayed as a table, without
the layout being "fixed".

Unfortunately, non-Webkit based browsers don't implement this and
break-all is a little heavy handed for the few cases this turns up in
practice.

Bug: T171761
Change-Id: If123d30addb4c707ebed63bafd18dccba9afe158
2018-09-13 11:29:32 -05:00
jenkins-bot
9464d13770 Merge "HTMLForm: Drop this never-used backwards-compatibility" 2018-09-13 12:27:43 +00:00