Commit graph

13 commits

Author SHA1 Message Date
Umherirrender f8062128bf Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: Ie195f1614237370a19e91bf4e16f704cee678c0c
2024-10-20 13:21:02 +02:00
Reedy 3b337af58d Namespace extension
Change-Id: I7f64539f1c9c4c03088e28e99f77a9acc503f627
2022-02-06 15:05:09 +00:00
Roman Stolar cacfbe6a4f Override ContentHandler::validateSave instead of Content::prepareSave.
Prepare override for TemplateStylesContentHandler, remove usage in TemplateStylesContent.

Bug: T287159
Depends-On: I7f23e6e97b1c7d27a6aaefdb88b19b2fc6e8b3a8
Change-Id: I4d89a5871c8be9101b356dafe68fcbc0cf69f6ee
2021-11-04 13:51:27 +02:00
Alexander Vorwerk fe485d7c57 Override ContentHandler::fillParserOutput instead of Content::getParserOutput and TextContent::getHtml().
Prepare override for TemplateStylesContentHandler, remove usage in TemplateStylesContent.

Bug: T287158
Change-Id: Ia1c0a307337e43c26cc05a5a9b2883ad2349d07e
2021-10-19 17:09:58 +03:00
Thiemo Kreuz b76898e848 Fix remaining PHPCS warnings about missing PHPDocs
Change-Id: Ic1c638902066dd5bb9333a2607c9ff84093fb4a2
2020-10-15 08:53:57 +02:00
Umherirrender 6bfed64796 build: Updating mediawiki/mediawiki-phan-config to 0.8.0
Bug: T235049
Change-Id: Ic3e3b4a3b617fc3e82f20f1e2eeab4c7a72686d3
2019-11-06 20:24:26 +01:00
Brad Jorsch f7bf5a4e23 Add "wrapper" attribute to <templatestyles/>
The wrapper attribute may contain an extra CSS simple selector to
include when prefixing. For example, including a template as
<templatestyles src="..." wrapper="div.my-template"/> would transform

 .foo .bar { color:red; }

into

 .mw-parser-output div.my-template .foo .bar{color:red}

This can allow particular templates to opt in to the "styles are scoped
to the template itself" model that was desired by some when
TemplateStyles was being designed; the driving use case in the linked
task is doing so for the benefit of side-by-side comparisons of the
current and sandboxed versions of a template.

Bug: T200441
Change-Id: If49d4c5be31feca95abd21452238fd10ab1916b1
2018-10-17 14:17:59 -04:00
Brad Jorsch 435e06e2f5 Replace deprecated ContentHandler::makeParserOptions()
Having a different ParserOptions for each content model isn't feasible
in an MCR world. And the only thing using this was Wikibase, which has
been fixed to do what it needs in a different way.

Bug: T194263
Change-Id: Ia95f3e2c1ea944366ff9a478c3c86f8565023394
Depends-On: I01373b29ee25fa9346c6b0317155be4ccdc8c515
2018-07-11 12:34:25 -04:00
Brad Jorsch d1734fbeb2 Add tracking categories for errors
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
2018-05-29 14:36:03 -04:00
Kunal Mehta 37fc1df457 Use SPDX 3.0 license identifier
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
2018-03-03 23:27:16 +00:00
Fomafix c1c8bed584 Add ENT_NOQUOTES to htmlspecialchars
There is no need to encode double quotes in HTML content.

Change-Id: If30adcf9196ecbfdfd1a9e21fa7b1c0bcd0e51d2
2018-02-11 17:22:27 +01:00
Brad Jorsch f99d171c80 Fix coverage
* Fix test for TemplateStylesFontFaceAtRuleSanitizer so it's actually run
* Hack up a broken Sanitizer to test a code path in
  TemplateStylesContent::sanitize() that handles such things.
* Ignore an InvalidArgumentException in TemplateStylesContent::processError()
  that's not worth checking. User input can't hit that, only logic bugs.
* Ignore TemplateStylesHooks::getConfig(), it's tested but gets called
  before PHPUnit starts counting.
* Test TemplateStylesHooksTest::onCodeEditorGetPageLanguage()
* Test $wgTemplateStylesDisable
* Test a back-compat code path in TemplateStylesHooks::handleTag().

Change-Id: I7078e5a353a624aa53fe72de7990b93a77b44cf6
2018-02-05 22:36:58 -05:00
Kunal Mehta 9a1a06b77d Move PHP classes into includes/ directory
Change-Id: Ibc03a6c298ec3bf3bbfa435033095546db6fc5f0
2018-02-05 18:18:01 -08:00
Renamed from TemplateStylesContent.php (Browse further)