Page MenuHomePhabricator

Update the CSS selectors to support the new Content Service format
Open, MediumPublic

Description

From the email titled "Removing some DOM transforms for future endpoints" on the android mailing list:

  1. App dark mode and Minerva styles use .external.

Example: <a rel="mw:ExtLink" class="external"
The two listed attributes seem redundant to me. That's why I'd like to get rid of class="external".
For this one the replacement would be a CSS rule a[rel~=mw:ExtLink]. For compatibility with mobileview (when you fallback) you may still want to have an a.external rule.

  1. The client transforms depend on .image in several places. I don't see any transform to add .image but maybe we could replace these with something like img, figure?

The selector used for this transform is figure > a, span[typeof^=mw:Image] > a
See also https://phabricator.wikimedia.org/diffusion/GMOA/browse/master/lib/transforms.js;ba3ad5b83b357bc0ad6181db7f4b1da74b7b1f23$187

  1. I think the app depends on .app_media. There is a client transform to add the class but I'm not sure if it depends on the initial state of the page or not.

This client transform is one that's currently shared between the Android app and MCS. This means that if the Android app gets page content from MCS it doesn't do it. It only performs the transform when it's using mobileview page content.

https://phabricator.wikimedia.org/diffusion/APAW/browse/master/www/js/sections.js;e5f08134b33c7ce92e49f87727d7b5e46f60a4fb$105:

if (!window.fromRestBase) {
     // [...]
     transformer.transform( "anchorPopUpMediaTransforms", content );
}

(The MCS code is called from https://phabricator.wikimedia.org/diffusion/GMOA/browse/master/lib/transforms.js;ba3ad5b83b357bc0ad6181db7f4b1da74b7b1f23$285)

This might be related to T156916?

Event Timeline

Niedzielski renamed this task from Update the CSS classes to support the new Content Service endpoint to Update the CSS selectors to support the new Content Service format.Apr 25 2017, 9:55 PM
Niedzielski triaged this task as Medium priority.