Commit graph

370 commits

Author SHA1 Message Date
Reedy bf17dd54e8 Remove 'UnitTestList' hook
No longer needed now that extension unittests are autodiscovered.

Bug: T142120
Change-Id: I03f1d1ea345a43685397e106fc5e27e1c2436f70
2016-08-05 22:42:12 +01:00
Translation updater bot e877b526fc Localisation updates from https://translatewiki.net.
Change-Id: Id14970c364acfb1c1c15f242440dd7b990b12b21
2016-07-21 23:01:21 +02:00
Translation updater bot 6626d3396b Localisation updates from https://translatewiki.net.
Change-Id: I55a6847b35c8fdbc68aff9b6fa66a209d0a95209
2016-04-22 22:24:41 +02:00
Bryan Davis a9cc53921f Use defined templatestyles-doc-header l10n message
s/templatestyles-doc-title/templatestyles-doc-header/

Change-Id: I1de180d49b3988d7fbe68fa3b1fab01411884557
2016-04-21 14:34:30 -06:00
Bryan Davis b39d76be08 General cleanup of CSSRenderer
* Add phpdoc comments
* Rename some variables to be a bit more clear for new readers
* Break up render() to make things more readable and reduce cyclomatic
  complexity

Change-Id: Iceeb1f6eb09b61efe6b81f359d28741f54fe88ad
2016-04-21 14:29:58 -06:00
Coren 1a6879c457 General cleanup of CSSParser
* Add phpdoc comments
* Update method signatures to reduce duplication
* Rename some variables to be a bit more clear for new readers
* Try to keep lines <80 chars (my own personal peeve I know)
* Use === instead of ==
* Fix a few other small code style issues

Change-Id: I52594fd34646af53fc91ec470fcf1d0be9c2b156
2016-04-21 14:29:58 -06:00
Bryan Davis 586694b64e Correct l10n message loading
s/MessageDirs/MessagesDirs/

Change-Id: I912b48442025fc381e6fc89671669717e834a76b
2016-04-21 14:27:30 -06:00
Bryan Davis 996b08ae93 Fix config loading
Change the ConfigRegistry setting in extension.json to the normal
GlobalVarConfig factor rather than a local wrapper.

Change-Id: I9a1b2869ee13fab59f628e4d5c83188a96062c42
2016-04-21 14:26:00 -06:00
Coren 29bdd0c18e Add property filtering
Properties listed in $wgTemplateStylesPropertyBlacklist, or
those that contain function-like values not listed in
$wgTemplateStylesFunctionWhitelist cause the containing
declaration to be omitted from rendering entirely.

Additionally, rule selectors are unconditionally prepended
with '#mw-content-text' so that they cannot be applied to
UI elements outside the actual page content.

Change-Id: Id3d7dff465363d0163e4a5a1f31e770b4b0a67e2
2016-04-21 05:16:06 +00:00
Bryan Davis 8b49e30b47 Ignore local Composer artifacts
Change-Id: Id88d177a43f7be4932fd774c519498871b42944e
2016-04-20 14:15:13 -06:00
Bryan Davis 1615767ae7 Pretty up the test suite
Add some comments and tweak the formatting of the test suite. Some
things that were hardcoded can now be tweaked by the
parse->render->verify tests if desired.

Change-Id: I36abc9fa2b9971d6b92d5714c4583dea6ad26b88
2016-04-20 14:15:13 -06:00
Coren 436370e59d Add unit tests for CSSParse and CSSRender
Test the roundtrip on a collection of correct and pathological
stylesheets to ascertain whether the parse is behaving as
expected.

Bug: T483
Change-Id: I484cc856b5696c1fa6265769320f79853365e1d6
2016-04-20 14:15:08 -06:00
Translation updater bot 37fbd09da5 Localisation updates from https://translatewiki.net.
Change-Id: Icddf99a2ee6ff79e948cd6c7e87cdf006003111f
2016-04-18 22:23:03 +02:00
Translation updater bot eea413648d Localisation updates from https://translatewiki.net.
Change-Id: Iafa8819d1c65d668c03577197f671026732deff9
2016-04-17 22:19:35 +02:00
Translation updater bot a4cea66515 Localisation updates from https://translatewiki.net.
Change-Id: I9981d2cc70a6b6f76fef44f5ae902cccd504b595
2016-04-16 23:15:42 +02:00
Translation updater bot 9ebf227e4e Localisation updates from https://translatewiki.net.
Change-Id: Iecb0616ed66cb6a6dceae5d2fd30626f3b9385de
2016-04-15 22:21:06 +02:00
Coren dfa7e27b5a Linting and slight tweak to parser
- add a tweak to the parser (keep the value tokens in a declaration
  separate in the parsed tree to ease matching at render time
- add error checking to encoding/decoding the templatestyles property
- pick some lint suggested by Brion and Bryan

Change-Id: If60b91e119102c0f0f559fe7e5a4c421c94b7ff4
2016-04-12 15:42:23 +00:00
Raymond b35763edbf Consisteny tweaks: Use lower case chars for message key only
In preparation for adding extension to translatewiki.net

Change-Id: I64fe725ceac7ec1b4d0da9c05e8285cc06278088
2016-04-10 22:49:25 +02:00
Coren 31743445bd TemplateStyles extension prototype
This extension adds a <templatestyles> tag that, when placed
on a template, allows specifying CSS for pages where that
template is transcluded.

Unlike inline styles, the per-template CSS supports rules
with proper selectors, and @media blocks.

THIS VERSION DOES NOT CURRENTLY FILTER DECLARATIONS and is
therefore unsuitable for wikis where unprivileged users should
not be allowed to influcence the pagewide CSS in unrestricted
ways!

Bug: T483
Change-Id: Ibc1cae3079d164f7ac7bcc7c4ded3f02bb048614
2016-04-08 11:08:59 -04:00
Alex Monk f063b69870 Add .gitreview
Change-Id: I28beb852d69a01be3f64ee8148b9ef2c8ab81e35
2016-04-05 15:47:06 +01:00