Page MenuHomePhabricator

API parse, headhtml properties, key CSS modules such as "mediawiki.action.edit.styles" missing
Closed, ResolvedPublic

Description

For AWB to do page previews, we extract stylesheet calls using API parse call for headhtml properties e.g. https://en.wikipedia.org/w/api.php?format=xml&action=parse&prop=headhtml&title=a&text=a.

This API headhtml seems to be missing key CSS stylesheet modules. This returns stylesheets whose links include site.styles and user.styles modules (I believe this uses the "ResourceLoader" functionality of mediawiki). However, rendering page preview HTML with just these stylesheets, pages are NOT as per browser display, items such as grey box around TOC are missing. Investigating, with a page preview in browser, the HTML source contains stylesheet calls for a series of additional modules including "mediawiki.action.edit.styles" and other important-sounding modules: encoded list for en-wiki is "ext.gadget.DRN-wizard%2CReferenceTooltips%2Ccharinsert%2Cextra-toolbar-buttons%2Cfeatured-articles-links%2CrefToolbar%2Cswitcher%2Cteahouse%2Cwatchlist-notice%7Cext.tmh.thumbnail.styles%7Cext.uls.nojs%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediaBadges%7Cmediawiki.action.edit.styles%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.sectionAnchor%7Cmediawiki.skinning.interface%7Cskins.vector.styles%7Cwikibase.client.init"

When logged in there are additional modules requested, seemingly for installed gadgets and scripts etc. According to user reports (T143868) something changed mediawiki-side in the last week or so. I would expect, and need for AWB, the API parse headhtml to return at least all default CSS modules for the given wiki.

Comments at VP:T at https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#API_parse.2C_headhtml_properties.2C_modules_such_as_.22mediawiki.action.edit.styles.22_not_returned.3F suggested that issue may be due to gerrit:299272

Event Timeline

Krinkle triaged this task as Medium priority.
Krinkle moved this task from Inbox, needs triage to Doing (old) on the Performance-Team board.
Krinkle moved this task from Inbox to Backlog on the MediaWiki-ResourceLoader board.

Change 307659 had a related patch set uploaded (by Krinkle):
OutputPage: Ensure setupSkinUserCss() always applies to headElement()

https://gerrit.wikimedia.org/r/307659

Change 307659 merged by jenkins-bot:
OutputPage: Ensure setupSkinUserCss() always applies to headElement()

https://gerrit.wikimedia.org/r/307659