Last modified: 2014-07-04 16:34:48 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T53245, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 51245 - Link MediaWiki styles and create Parsoid-specific CSS styling to match MediaWiki's for differing DOM elements
Link MediaWiki styles and create Parsoid-specific CSS styling to match MediaW...
Status: NEW
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Gabriel Wicke
:
Depends on: 37902 67540 53436 53505 66287
Blocks: 53784 56756 53783 60017 62511
  Show dependency treegraph
 
Reported: 2013-07-12 16:32 UTC by Gabriel Wicke
Modified: 2014-07-04 16:34 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Gabriel Wicke 2013-07-12 16:32:24 UTC
Starting points for content styles:
https://bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&modules=mediawiki.legacy.commonPrint%2Cshared%7Cskins.vector&only=styles&skin=vector and https://bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&modules=site&only=styles&skin=vector

We will also need additional styles at least for images, as our DOM structure is different here.

We can add a single CSS reference in the head served by Parsoid for our own testing, but should provide the Parsoid-specific add-on style separately so that they can be referenced by VE to render our DOM.
Comment 1 Gabriel Wicke 2013-07-12 16:33:16 UTC
Also, we should avoid making static copies of the default styles. Instead we should load them via RL as above, so that custom site-specific styles are respected.
Comment 2 C. Scott Ananian 2013-07-12 17:02:16 UTC
https://github.com/cscott/nell-wikipedia/blob/master/www/css/app.less is a reference for the parsoid-specific styling that might be required.
Comment 3 Gabriel Wicke 2013-09-06 18:45:07 UTC
(In reply to comment #2)
> https://github.com/cscott/nell-wikipedia/blob/master/www/css/app.less is a
> reference for the parsoid-specific styling that might be required.

This actually looks more like generic content styles to me.

To keep the overhead in the head element low, we should probably link one CSS file only, and compile that from default MW styles and our custom ones in our web server.
Comment 4 Gabriel Wicke 2013-12-18 17:58:50 UTC
Image styles for our figure output are being developed in https://gerrit.wikimedia.org/r/93417 , which is a big step ahead. Once those are ready we should integrate them into core.
Comment 5 spage 2014-03-18 19:46:26 UTC
(In reply to Gabriel Wicke from comment #4)
> Once [styles] are ready we should integrate them into core.

Sure but people resist enlarging core styles to support Parsoid, e.g. comments on https://gerrit.wikimedia.org/r/#/c/118447/1

I agree with comment 0 "provide the Parsoid-specific add-on style separately so that they can be referenced by VE to render our DOM."  The Parsoid extension could have its own CSS module and JS (e.g. for image Enlarge) for additional styling of its own HTML beyond MediaWiki's skin CSS . Then VE and Flow can addModule/Styles() these modules. Over time as core styles and CSS support Parsoid's HTML we can reduce the scope of this. I'm working on a patch along these lines for bug 60017.
Comment 6 Gabriel Wicke 2014-03-19 18:27:04 UTC
Some more info on getting the right modules from ResourceLoader:

http://en.wikipedia.org/w/load.php?modules=startup&only=scripts&debug=true has a call to mw.loader.register somewhere that sets up all modules. Unfortunately there is no separate API to retrieve just the data.

We can then start a blacklist of modules that we definitely don't need (JS / chrome-only ones), and construct a RL call with the remaining modules. Automating this and packaging it as an 'contentModules' API would be awesome in the longer term.
Comment 7 spage 2014-04-09 02:42:36 UTC
Gerrit change #124785 defines an 'ext.parsoid.styles' ResourceLoader module in the Parsoid extension, and begins to add Parsoid-specific CSS to it.
Comment 8 Gerrit Notification Bot 2014-04-29 21:08:33 UTC
Change 130489 had a related patch set uploaded by Spage:
Fix remoteExtPath to Parsoid module

https://gerrit.wikimedia.org/r/130489
Comment 9 Gerrit Notification Bot 2014-04-30 17:43:57 UTC
Change 130489 merged by jenkins-bot:
Fix remoteExtPath to Parsoid module

https://gerrit.wikimedia.org/r/130489
Comment 10 Gerrit Notification Bot 2014-06-06 19:41:07 UTC
Change 137969 had a related patch set uploaded by GWicke:
Link default content styles through RL

https://gerrit.wikimedia.org/r/137969
Comment 11 Gerrit Notification Bot 2014-06-06 19:41:28 UTC
Change 137981 had a related patch set uploaded by GWicke:
Indicate language & content directionality on body

https://gerrit.wikimedia.org/r/137981
Comment 12 Gerrit Notification Bot 2014-06-06 20:21:40 UTC
Change 137969 merged by jenkins-bot:
Link default content styles through RL

https://gerrit.wikimedia.org/r/137969
Comment 13 Gerrit Notification Bot 2014-06-06 20:22:15 UTC
Change 137981 merged by jenkins-bot:
Indicate language & content directionality on body

https://gerrit.wikimedia.org/r/137981
Comment 14 Gerrit Notification Bot 2014-06-10 16:16:06 UTC
Change 138617 had a related patch set uploaded by GWicke:
Bug 51245: Add auto-numbered link CSS to Parsoid styles

https://gerrit.wikimedia.org/r/138617
Comment 15 Gerrit Notification Bot 2014-06-10 17:44:39 UTC
Change 138617 merged by jenkins-bot:
Bug 51245: Add auto-numbered link CSS to Parsoid styles

https://gerrit.wikimedia.org/r/138617
Comment 16 Gabriel Wicke 2014-06-13 16:36:02 UTC
This round is now deployed in phase 1 wikis (mw.org etc).

Here are some more issues:

== Images ==
http://parsoid-lb.eqiad.w
ikimedia.org/mediawikiwiki/Help%3AImages?oldi
d=1022353

* The styling of non-thumb captioned images is off: 

[[File:example.jpg|center|100px|caption]]

Compare https://www.mediawiki.org/wiki/Help:Images#Horizontal_alignment

The caption should not render at all in this case.

* The gallery styles don't seem to apply to our output (see further down on the page). This is likely an issue with the gallery CSS selector being too specific / using something like div#content instead of .mw-body or .mw-body-content, very similar to bug 66461.
Comment 17 Gerrit Notification Bot 2014-06-13 16:59:42 UTC
Change 139424 had a related patch set uploaded by GWicke:
Bug 51245: Add some more RL modules

https://gerrit.wikimedia.org/r/139424
Comment 18 Gabriel Wicke 2014-06-13 17:42:36 UTC
(In reply to Gabriel Wicke from comment #16)
> * The gallery styles don't seem to apply to our output (see further down on
> the page). This is likely an issue with the gallery CSS selector being too
> specific / using something like div#content instead of .mw-body or
> .mw-body-content, very similar to bug 66461.

This turned out to be missing RL modules, which will be fixed by https://gerrit.wikimedia.org/r/139424.
Comment 19 Gerrit Notification Bot 2014-06-13 20:11:07 UTC
Change 139473 had a related patch set uploaded by GWicke:
Bug 51245: Hide the caption of frameless or inline images in Parsoid HTML

https://gerrit.wikimedia.org/r/139473
Comment 20 Gabriel Wicke 2014-06-13 20:14:42 UTC
(In reply to Gabriel Wicke from comment #16)
> * The styling of non-thumb captioned images is off: 
> 
> [[File:example.jpg|center|100px|caption]]
> 
> Compare https://www.mediawiki.org/wiki/Help:Images#Horizontal_alignment
> 
> The caption should not render at all in this case.

Will be fixed by https://gerrit.wikimedia.org/r/139473.
Comment 21 Gerrit Notification Bot 2014-06-13 20:28:25 UTC
Change 139473 had a related patch set uploaded by Bartosz Dziewoński:
Hide the caption of frameless or inline images in Parsoid HTML

https://gerrit.wikimedia.org/r/139473
Comment 22 James Forrester 2014-06-13 21:21:13 UTC
For easier copying/checking:

* http://parsoid-lb.eqiad.wikimedia.org/mediawikiwiki/Help%3AImages?oldid=1022353
* http://parsoid-lb.eqiad.wikimedia.org/enwiki/Wikipedia%3AExtended_image_syntax?oldid=611658800

(These won't work as well until wmf10 hits production on 26 June.)
Comment 23 Gerrit Notification Bot 2014-06-16 17:18:53 UTC
Change 139867 had a related patch set uploaded by GWicke:
Minor: more specific parsoid image styling with child selectors

https://gerrit.wikimedia.org/r/139867
Comment 24 Gerrit Notification Bot 2014-06-16 18:34:08 UTC
Change 139867 merged by jenkins-bot:
Minor: more specific parsoid image styling with child selectors

https://gerrit.wikimedia.org/r/139867
Comment 25 Gerrit Notification Bot 2014-06-23 19:18:51 UTC
Change 139473 merged by jenkins-bot:
Hide the caption of frameless or inline images in Parsoid HTML

https://gerrit.wikimedia.org/r/139473
Comment 26 Gabriel Wicke 2014-06-23 23:27:55 UTC
The basic linking is now done, and the styles are also starting to become fairly solid. Some remaining issues are:

* Linking page-specific styles (extensions primarily): Ideally RL would expose an API like 'give me all non-standard styles for page X' that we could link to. I heard that there might be a way to get the list of RL modules from action=parse output, but haven't been able to find them in the output yet. Pointers appreciated.

* Our styles are currently Vector-specific. We should perhaps split the styles into a 'common' and skin-specific part, following the model of core. Skin-specific Parsoid styling is already done for the minerva skin (mobile). Alternatively, we could try push our selectors into core soon, before the parsoid-only part becomes too complex. The disadvantage of the latter is that it'll create some overhead on all page views, so it's easier to sell once we actually use Parsoid HTML for normal page views.
Comment 27 Gabriel Wicke 2014-06-23 23:29:21 UTC
https://gerrit.wikimedia.org/r/#/c/133301/ also removes the thumb background & the border around the image, in sync with the same change in core for consistency.
Comment 28 Gabriel Wicke 2014-06-23 23:50:51 UTC
(In reply to Gabriel Wicke from comment #26)
> I heard that there might be a way to get the list of RL
> modules from action=parse output, but haven't been able to find them in the
> output yet. Pointers appreciated.

http://en.wikipedia.org/w/api.php?action=parse&format=json&page=MathML&prop=modules 

includes

"modulestyles":["ext.rtlcite","ext.math.styles","ext.geshi.language.xml","ext.geshi.local","ext.geshi.language.html5"]
Comment 29 Gerrit Notification Bot 2014-06-26 18:47:28 UTC
Change 139424 merged by jenkins-bot:
Bug 51245: Add some more RL modules

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links