This requires 1.42 for some new names
Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: I0f43f4db86de2990c8902a36976923ad9f0ae67a
The use of "HookHandlers" attribute in extension.json makes it possible
to inject services into hook handler classes in a future patch.
Bug: T338435
Change-Id: Iadeed8e4735f95387f2faed4bc4305327bff3c8a
This adds a config option so that the src attribute of the <templatestyles> tag can be set to default namespace other than Template.
Bug: T290250
Change-Id: Iec4f5d630d025e0bacba05d40cd74fc9312fcae2
::doUserEditContent() is available since 1.36 as a replacement
for ::doEditContent(), which has been deprecated. Bump the
required version of MediaWiki to 1.36 accordingly.
Bug: T255507
Change-Id: I5d19b24031872105a27e886242c8d580ad278354
This adds 'sanitized-css' content model pages to the list of default-sandboxed
content models provided by TemplateSandbox.
Bug: T279021
Depends-On: I702ffb9b196fe44a5bc099c7ee02b0e0e3fef283
Change-Id: I1e5d224c7c20ab49389744c99adcffd1971f9b08
* $wgTemplateStylesPropertyBlacklist is now $wgTemplateStylesDisallowedProperties
* $wgTemplateStylesAtRuleBlacklist is now $wgTemplateStylesDisallowedAtRules
Bug: T277962
Change-Id: I2eb120f5c52db1ea9c49bcaf04955771987c1d62
Extensions can register additional namespaces by setting the
"TemplateStylesNamespaces" attribte in their extension.json. This change is
analogous to Ia5d34cb78fa6af.
There isn't really a simpler way to do this here, as the config setting uses
namespaces as keys, while the attribute is using them as values. Furthermore,
keys with falsey values are ignored in the config setting, and attributes can't
use the same setting architecture, as array_merge_recursive doesn't maintain
numeric keys.
Bug: T200914
Depends-On: I9e62a02ed2044c847e9ab2dcdfab094001f88986
Change-Id: I2fa9b822ee39bcc5f95a293c8c4aad4d53ede30a
Two tracking categories are added:
* A category to track stylesheets with errors. While it's usually not
possible to save a stylesheet with errors, it can happen if a
server-side change makes formerly-valid CSS become invalid.
* A category to track pages displaying errors from incorrect use of
the <templatestyles/> tag.
Bug: T195676
Change-Id: I123679d4bffe36cb28aca1688c052470027ea2a8
SPDX released version 3 of their license list (<https://spdx.org/licenses/>),
which changed the FSF licenses to explicitly end in -only or -or-later
instead of relying on an easy to miss + symbol.
Bug: T183858
Change-Id: Ic9accb2eb34bc32d455f48dfe81a91d23a2d5f5e
wikimedia/css-sanitizer provides a real CSS parser, which should be
safer than poking at things with regular expressions.
Instead of the strange hybrid model that tried to both process inline
CSS and save CSS when the template is saved, it now looks for
<templatestyles src="Title" /> during the parse to do all the
transclusion of styles.
The output method is "<style> tags in the body", pending someone
implementing T160563.
It now also registers a "sanitized-css" content model, which should pick
up the CSS syntax highlighting and will validate the submitted CSS on
submit and prevent a save if it's not valid.
This patch also takes advantage of LGPL-2.x § 3 to relicense the
extension as GPL-2.0+, although at this point none of the LGPL code
remains anyway.
Bug: T133408
Bug: T136054
Bug: T135788
Bug: T135789
Change-Id: I993e6f18d32a43aac8398743133d227b05133bbd
Depends-On: If4eb5bf71f94fa366ec4eddb6964e8f4df6b824a
Change the ConfigRegistry setting in extension.json to the normal
GlobalVarConfig factor rather than a local wrapper.
Change-Id: I9a1b2869ee13fab59f628e4d5c83188a96062c42
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
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
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