>>! In T37247#3230407, @Krinkle wrote:
> It's not clear to me why a separate class is needed here. How is `mw-parser-output` semantically different from `mw-body-content`?

`.mw-body-content` includes a lot more than just the parser output, for example the edit form, the diff tables, and so on, and so wouldn't fix the complaints about those being affected by TemplateStyles.

Also `.mw-body-content` is added by the skin. Of the 42 skins in extensions/skins, it looks like only 12 have any mention of it.[1] Of the skins on enwiki, Monobook and Vector have it while CologneBlue and Modern don't.

[1]: Based on a grep for `mw-body-content`

> I assume that `mw-parser-output` would solely be applied to output that literally comes from the parser, no exception.

That's the plan.

> 1. Is it valid for MediaWiki core interface styles and skin styles to ever target `mw-parser-output`? I propose no, they must use `mw-body-content` instead.

I doubt there'd be reason for them to.

> 2. Do we support outputting `mw-parser-output` on a MediaWiki-powered HTML response without being a descendant of `mw-body-content`? I propose no, an element with `mw-parser-output` must either also have `mw-body-content` or be a descendant of an element with that class.

Since 70% of skins in Gerrit don't even wrap the main content of the page in `mw-body-content`, yes, we support that. I have no objection to someone deciding to fix that somehow, but let's not let it block this.

> This leaves the question: What is the risk of allowing TemplateStyles to target `mw-body-content`?

For affecting things it shouldn't affect, largely the same as it targeting `#mw-content-text` since in Monobook and Vector `#mw-content-text` is a child of `.mw-body-content`.

For not affecting things is should affect, pretty large since 70% of skins in Gerrit don't wrap the main page content in that class.

> The answer, as I understand it, is that we have some interface components (like page heading, categories, notices/banners, Translate extension controls, FlaggedRevs extension controls) that should be styled the same way as page content (e.g. their headings and links etc.) but don't always come straight out of the parser. And presumably we want to avoid these elements from being styled by a template on the current page.

Yes, that seems accurate.

> * Would it be appropiate to instead have these common styles use `mw-body` instead of `mw-body-content` in their CSS? E.g. for skin headings, links etc. Thus turning mw-body-content into the proposed `mw-parser-output`.

Only if we kill `mw-body-content` from all skins and start adding it in core in the way the current patch adds `mw-parser-output`. I'd rather pick a new name than try to make major changes to an old one.

Again, `mw-body` is added by skins. It looks like 15 of 42 skins in Gerrit don't add it, but all four of the skins on enwiki do.[2]

[2]: Based on a grep for `mw-body($|[^a-z-])`

> * Given that firstHeading is partially provided by Parser. And banners are entirely parsed by the parser. Will the class name apply there?

Currently, it is not applied to firstHeading. I don't have banners on my local wiki to test, but if they use `Parser::parse()` rather than something like `Message::parse()` they would. Or whatever generates the banner could always add the wrapper itself if necessary.

> If yes, then the current page has the ability to affect the notices, which are supposed to be restricted. If not, then notices cannot use templates properly. Perhaps it makes sense to have mw-parser-output be a dynamically generated class instead of a fixed name (e.g. mw-parser-output-123), so that TemplateStyles can be restricted to the correct context only?

Hmm, that's not a bad idea. OTOH, callers that didn't want the default `mw-parser-output` could always use `ParserOptions->setWrapOutputClass()` to set something else.

> * Besides elements provided by the parser (first heading, and site notices), is there a problem with moving the Translate and FlaggedRevs extension controls out of mw-body-content? Or more specifically, is there a problem with removing mw-body-content from `#bodyContent` in Vector and instead applying it to the relevant child nodes only?

Just that it would be a major redefinition of what exactly `.mw-body-content` applies to.