Page MenuHomePhabricator

ResourceLoaderSkinModule style should be added to ensure user generated content is cleared
Closed, ResolvedPublic

Description

Per https://www.mediawiki.org/wiki/Talk:Reading/Web/Desktop_Improvements#Bug?_Footer_engulfes_content historically floats inside of user generated content have been cleared by skins (see also https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/608976).

This should not be the responsibility of the skins to know, but should be a documented feature of ResourceLoaderSkinModule.

The new clear style would likely live in the existing content feature or a new content-user-generated feature and be inherited by all skins.

.mw-parser-output::after {
	content: "";
	display: block;
	clear: both;
}

Sign off

The following should be pulled out into separate tasks or fixed as part of this change

  • Remove the redundant clear:both on #footer for CologneBlue
  • Remove the redundant div.mw_clear element inside Modern
  • Remove the redundant .visualClear inside Monobook
  • Remove the redundant .visualClear inside Timeless
  • Opt-into the new feature and remove the redundant clear on #page-secondary-actions inside Minerva.

Moved into T278470: Skins no longer have to clear user generated content and have redundant styling rules.

Event Timeline

Change 672051 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/core@master] mediawiki.skinning/content.less: Clear floated user contents

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

@Jdlrobson So that's the way out of https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/608976?
I still think having skins taking care about user formatting basic styles is the more correct way!

What if 3rd party decides to live without floating user content and this rule is delivered on every page load?
'mediawiki.skinning/content.less' should be as empty as possible.

What if 3rd party decides to live without floating user content and this rule is delivered on every page load?

'mediawiki.skinning/content.less' should be as empty as possible.

On the long term, ResourceLoaderSkinModule will have a sensible default for its features. One of these defaults would be floated user content.
If a skin developer doesn't want to support that, that's fine and their choice. They simply do not include the ResourceLoaderSkinModule feature that contains this rule. Note, the original goal is to split content up (see T269877)

The current status quo is that skin developers need to be aware that user-generated content can be floated but not cleared and that every skin copies and pastes this rule. They shouldn't have to do that.

Jdlrobson added a project: MW-1.36-release.

Change 673989 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/skins/Vector@master] Use content-parser-output RL SkinModule feature

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

Change 672051 merged by jenkins-bot:
[mediawiki/core@master] ResourceLoaderSkinModule: Add content-parser-output feature

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

Change 674452 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/core@master] The new content-parser-output feature is enabled by default

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

Change 674453 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/Example@master] Example skin no longer needs to clear content

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

Change 674453 merged by jenkins-bot:
[mediawiki/skins/Example@master] Example skin no longer needs to clear content

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

Change 674452 merged by jenkins-bot:
[mediawiki/core@master] The new content-parser-output feature is documented and enabled by default

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

Change 673989 merged by jenkins-bot:
[mediawiki/skins/Vector@master] Use content-parser-output RL SkinModule feature

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

Jdlrobson claimed this task.

I've opened up T278470 for the remaining work.