-
-
Notifications
You must be signed in to change notification settings - Fork 68
Description
MW has a mechanism for declaring whether or not a skin is "responsive": setting the responsive option when the skin (Skin class) is constructed. Once a skin is declared to be responsive, users can individually specify whether or not they want responsiveness, and the joint result is exposed via the public function Skin::isResponsive().
Based on the result of Skin::isResponsive(), MW adds one of two <meta> tags to page output:
- If isResponsive:
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0"/> - If not isResponsive:
<meta name="viewport" content="width=1000"/>
(See Skin::initPage().)
Chameleon is a responsive skin, but it does not tell that to the MW core via the responsive option to Skin. Instead, it manually adds a viewport specification to the page output, via Chameleon::initPage() (after calling parent::initPage():
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
As a result:
- the MW core and other extensions will always get a
falseresult fromSkin::isResponsive(), and consider chameleon to be not-responsive. - Every wiki page has two viewport tags, with competing
widthvalues:1000from MW core, anddevice-widthfrom chameleon.
I noticed this because chrome-based browsers on Android (e.g., Chromium, Vanadium, Brave) appear to favor the width=1000 depending on the page content. E.g., pages with long unbroken strings (like visible URLs) are mysteriously rendered as "unresponsive" fixed-width.
My recommendations for fixing this:
- Add
'responsive' => trueto the list of options toChameleoninSetupAfterCache::registerSkinWithMW(). - Remove
Chameleon::initPage()(since all it does is add the superfluous viewport tag).
(These recommendations appear to work for me.)