Previously, the order of styles outputted by this module was
arbitrary, based on the order of the feature files passed in.
This was not how it was intended to work - the ResourceLoaderSkinModule
should be aware of the correct ordering.
In the case of normalize for example - it should always be the first
file output.
The implementation is adapted to check for valid features once in
the constructor and to also consider a DEFAULT_FEATURES value has been
set.
We use the FEATURE_FILES constant to determine
the order of CSS output.
This is all documented in the class.
Bug: T269618
Change-Id: Iecbf11b5f09882e55d694651210d6d132d3cd412
Since the legacy parser will also be emitting the new media structure
that requires these styles. For now, the feature is only shipped by
default when $wgUseNewMediaStructure is enabled.
Bug: T51097
Bug: T266148
Change-Id: Id20d716ce145e0bae37621fd6e218a793b5332ae
Follow up to I755e5e6784481b419e35, which used array_unshift
to prepend the 'feature' stylesheets. This works as expected when
there is only one 'feature' enabled.
When there are multiple, use of unshift will effectivel reverse
the order as it unshifts then one at a time.
To mitigate this, collect them normally in the correct order,
and then prepend them all at once with array_merge.
Bug: T262507
Change-Id: Ibe2c9f8d024f6be06588a59df10a37681b60d6bc
For stylesheets provided by features such as normalize or elements,
skins will want to override some styles. Given that ResourceLoader
concatenates all styles, having feature styles override skin provided
styles is counter productive.
Bug: T261080
Change-Id: I755e5e6784481b419e35b338fe3a8129e94b9f61
The name change happened some time ago, and I think its
about time to start using the name name!
(Done with a find and replace)
My personal motivation for doing this is that I have started
trying out vscode as an IDE for mediawiki development, and
right now it doesn't appear to handle php aliases very well
or at all.
Change-Id: I412235d91ae26e4c1c6a62e0dbb7e7cf3c5ed4a6
getAvailableLogos() can now also return multiple items if a 'wordmark'
logo is defined, but this method only cares about the DPI variants
('1x'/'1.5x'/'2x') and should return a string if there's only '1x'.
Bug: T244405
Change-Id: I69ddb1f9f97d06253b661caf112b48343cd2453f
Add getAvailableLogos static method and wgLogos config variable
Longterm we'll phase out wgLogo and wgLogoHD for this more extendable
config.
wgLogoHD is marked as deprecated. wgLogo continues to function as before
when wgLogos doesn't exist to cause minimum disruption.
From now on all logos should be accessed via getAvailableLogos. Patches
in Minerva and Vector follow. See I00899c16c0325f36b671baf17e88c2b5187b3526,
I569e0d800e147eabc7852567acd140108613f074 and
I013bd0904fe8c55efa49d14e84cf06ec1412896f.
Bug: T232140
Change-Id: I66a971631c623cc94b58eb0e5e5bad804789bf1c
All mediawiki.skinning modules are repurposed as variants of the
ResourceLoaderSkinModule and those ResourceLoader modules are marked for
deprecation. Skins will now be encouraged to use the ResourceLoaderSkinModule
class themselves as part of their own style module rather than using a
module defined in core.
Bug: T118134
Bug: T114695
Change-Id: I4bc8b9b4da1c16eed34f3a517ec695019381e764
This existed for internal use by OutputPage, which is no longer
the case as of I11b390f2e4f5e7db.
Also move the unit tests from OutputPageTest,
to ResourceLoaderSkinModuleTest.
Change-Id: I8b23f976f5f89b1005b387a827f75031f5c96141
* Ignore getLogoData() which is a one-line proxy to ::getLogo,
that can't really be tested because static methods can't be stubbed.
It exists so that this method can be stubbed instead. The actual
method is already covered.
* Simplify @covers for getStyles() to allow indirect coverage within
the class because it's intended as a higher-level integration tests.
The other tests in the suite still cover a specific method only.
Change-Id: I1445a016c1f12a6d8ceaaf745023a28cf20e5371
Clean up use of @codingStandardsIgnore
- @codingStandardsIgnoreFile -> phpcs:ignoreFile
- @codingStandardsIgnoreLine -> phpcs:ignore
- @codingStandardsIgnoreStart -> phpcs:disable
- @codingStandardsIgnoreEnd -> phpcs:enable
For phpcs:disable always the necessary sniffs are provided.
Some start/end pairs are changed to line ignore
Change-Id: I92ef235849bcc349c69e53504e664a155dd162c8
SVGs could already be used through $wgLogo. However, if a PNG fallback
is desired for older browsers, using SVGs was previously not possible.
This commit adds support for using an SVG image in $wgLogoHD and,
using $wgLogo as the fallback image.
Usage example:
> $wgLogo = '/path/to/png';
> $wgLogoHD = [
> 'svg' => 'path/to/svg',
> ];
Note: When the 'svg' key is set in $wgLogoHD, any '1.5x' and '2x' keys will
no longer be used because SVGs can render optimally on any screen sizes.
@Reedy, @Krinkle and @Brion VIBBER helped me alot with this.
Bug: T86229
Change-Id: I6197d96ce9110f4711ef2c4b198445bc5c6ae110