⚓ T352875 Lists and other line breaking items appearing within paragraphs have the wrong vertical margins.
Page MenuHomePhabricator

Lists and other line breaking items appearing within paragraphs have the wrong vertical margins.
Closed, ResolvedPublic2 Estimated Story PointsBUG REPORT

Assigned To
Authored By
JScherer-WMF
Dec 6 2023, 3:17 PM
Referenced Files
F44418407: image.png
Apr 4 2024, 2:53 AM
F44416600: image.png
Apr 4 2024, 2:48 AM
F44416508: image.png
Apr 4 2024, 2:48 AM
F42188023: image.png
Feb 27 2024, 8:02 PM
F41822032: Screenshot 2024-02-08 at 7.50.03 PM.png
Feb 9 2024, 2:55 AM
F41817006: screenshot 433.png
Feb 8 2024, 5:17 PM
F41817005: screenshot 432.png
Feb 8 2024, 5:17 PM
F41715863: image.png
Jan 25 2024, 7:23 AM
Tokens
"The World Burns" token, awarded by stjn."The World Burns" token, awarded by Jack_who_built_the_house.

Description

Steps to replicate the issue (include links if applicable):

  • See comment in T351754
  • View article with <ol> or <ul>

What happens?:
Lists, pull quotes, and other "line breaking" items that appear within paragraphs have more vertical margins above them than they have below them.

What should have happened instead?:
If the list appears in the middle of a paragraph, the spacing above and below should be equidistan and smaller, if it appears at the end of a paragraph, the spacing above should be smaller than the spacing below.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):
Screenshots available in parent ticket.

QA

  1. See steps above
  1. Test case 2

What happens?:

  • top of UL has big margin
  • bottom of UL has small margin

image.png (463×1 px, 126 KB)

What should have happened instead?:

  • top of UL has big small margin
  • bottom of UL has big small margin

image.png (479×1 px, 87 KB)

Signoff

  • Create follow-up ticket for global solution for spacing within paragraphs

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Test wiki created on Patch demo by BWang (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/2e20a2b218/w

Test wiki created on Patch demo by BWang (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/d948466f8f/w

Test wiki on Patch demo by BWang (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/2e20a2b218/w/

Test wiki created on Patch demo by BWang (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/4d91ec315a/w

Test wiki created on Patch demo by BWang (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/3137e750b4/w

Test wiki on Patch demo by BWang (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/d948466f8f/w/

Test wiki on Patch demo by BWang (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/4d91ec315a/w/

Test wiki on Patch demo by BWang (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/3137e750b4/w/

Test wiki created on Patch demo by BWang (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/07095d3756/w

Test wiki created on Patch demo by BWang (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/544e98641d/w

Change 989903 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Simplify heading styles. Avoid using .vector-body

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

Test wiki on Patch demo by BWang (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/07095d3756/w/

Change 989911 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Update <p> spacing to improve consistency of ul/ol spacing, also update heading spacing to be more consistent, relying on mw defaults more

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

Test Result - Beta

Status: ❓Need More Info
Environment: beta
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps

view an article with a bulleted list
Test case 2
Visit https://en.wikipedia.org/wiki/Shakira:_Bzrp_Music_Sessions,_Vol._53?useskin=vector-2022#Legacy_and_records
❓ AC1: top of UL has big small margin
❓ AC2: bottom of UL has big small margin
@JScherer-WMF, The referenced task T351754 specifically calls out 14px at the end of a paragraph. This seems to no longer be the case. I wasn't sure if that is what Test case 1 was supposed to be. I've included screenshots with the spacing details so it can be determined if this was a pass or not. Qualitatively it looks fine. If it looks good let me know and I'll pass it.

screenshot 402.png (1×1 px, 399 KB)

screenshot 404.png (1×1 px, 415 KB)

screenshot 403.png (1×1 px, 397 KB)

The spec should have read 1em rather than a specific pixel value. This looks good. Thanks for checking @Edtadros .

Apart from T355805: Syntax highlighting in 2017 wikitext editor has extreme vertical cursor displacement the now reverted patch also caused part of hidden text to be visible on redirect pages:

image.png (477×682 px, 31 KB)

Change 993505 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@master] Update <p> spacing to improve consistency of ul/ol spacing, also update heading spacing to be more consistent, relying on mw defaults more (attempt 2)

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

Jdlrobson added a subscriber: Esanders.

@Esanders can we talk about this in the editing sync tomorrow? We need to understand exactly what needs to be fixed where before we can re-apply this patch.

Test wiki created on Patch demo by BWang (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/f094914739/w

Change 992760 had a related patch set uploaded (by Jdlrobson; author: DLynch):

[VisualEditor/VisualEditor@master] Zero out padding in source mode paragraphs as well

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

Change 992760 merged by jenkins-bot:

[VisualEditor/VisualEditor@master] Zero out padding in source mode paragraphs as well

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

@Esanders are we just waiting on https://gerrit.wikimedia.org/r/c/VisualEditor/VisualEditor/+/992760 to move forward with this ticket?

I'm not sure the issue mentioned above by @Nikerabbit is resolved?

Test wiki created on Patch demo by BWang (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/f094914739/w

The spacing on talk pages is still uneven with this patch, see T356065.

Change 997584 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (4ec4a75e4)

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

Change 997584 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (4ec4a75e4)

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

Change 997958 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] Explicitly define padding for redirect link

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

Change 997958 merged by jenkins-bot:

[mediawiki/core@master] Explicitly define padding for redirect link

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

Change 993505 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Changes to list spacing

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

Test Result - Beta

Status:
Environment: beta
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps

@JScherer-WMF take a look at the images below. I can't seem to see the padding in dev tools. Not sure if this is what it should look like.

View article with <ol> or <ul>
AC1: If the list appears in the middle of a paragraph, the spacing above and below should be equidistant and smaller, if it appears at the end of a paragraph, the spacing above should be smaller than the spacing below.

screenshot 432.png (581×1 px, 234 KB)

screenshot 433.png (836×1 px, 403 KB)

Visit https://en.wikipedia.org/wiki/Shakira:_Bzrp_Music_Sessions,_Vol._53?useskin=vector-2022#Legacy_and_records (prod testing only)
AC2: top of UL has small margin
bottom of UL has small margin

See above

The images here are correct. The Sharkira article has an error, though. Please see attached screenshot.

Screenshot 2024-02-08 at 7.50.03 PM.png (896×2 px, 395 KB)

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps

View article with <ol> or <ul>
✅ AC1: If the list appears in the middle of a paragraph, the spacing above and below should be equidistant and smaller, if it appears at the end of a paragraph, the spacing above should be smaller than the spacing below.
This is a pass per T352875#9527667 see screenshots above at at T352875#9525964

Visit https://en.wikipedia.org/wiki/Shakira:_Bzrp_Music_Sessions,_Vol._53?useskin=vector-2022#Legacy_and_records (prod testing only)
✅ AC2: top of UL has small margin
bottom of UL has small margin
This is a pass per T352875#9527667 see screenshots above at at T352875#9525964

ovasileva claimed this task.

Looks good, resolving

p + ul work well now. What's about p + .mw-highlight (the latter is created by <syntaxhighlight>)? The space is huge, 0.5em padding + 1em margin

image.png (401×1 px, 36 KB)

p + ul work well now. What's about p + .mw-highlight (the latter is created by <syntaxhighlight>)? The space is huge, 0.5em padding + 1em margin

image.png (401×1 px, 36 KB)

I've opened T358893 so this doesn't get lost (generally I recommend creating a new ticket for any additional concern - I for one sometimes miss notifications for closed tickets)

Sigh. Please don't use tricks like combining margin-top and padding-bottom. You're doing it to defeat margin collapsing, which is how the CSS box model is supposed to work. This patch makes Vector legacy and Vector 2022 behave very differently for certain inputs, mainly due to p-wrapping (T253072), and it's going to be a massive pain to work around from templates and TemplateStyles.

The skin should not be trying to control styling at such a quantum level for on-wiki content; you can kinda sorta get that to work for the Wikipedias and other projects whose content is supposed to follow One True House Style, but for a project like Wikisource that actually needs to vary this stuff from page to page doing this just makes it feel like the skin is fighting us every step of the way. I can deal with the 7px (.5rem) top and bottom margin if it's consistent across Vector 2010/2022, but a completely different way to achieve the effect between the two, with different values, and in a way deliberately designed to defeat basic box model behaviour…? Now I just want to throw a complete style reset in MediaWiki:Common.css and call it a day.

enWS has been dealing with the problem this patch is trying to address since the beginning, since the parser is too primitive to solve it properly (and Parsoid is just reimplementing the dumbness of the regex parser), by inserting three newlines between paragraphs that should be spaced as paragraphs, and two newlines between unspaced paragraphs (essentially separated just by the line-height). If you want extra space between your paragraphs, this is the way it has always been done, and it lets on-wiki contributors control whether the spacing is one or the other. This patch breaks ~20 years worth of content created based on that assumption, and it's trying to reimplement in the skin the behaviour of the parser. That's not going to end well.

(Tbh I'd really like to hear the rationale behind using margin-top + padding-bottom as opposed to e.g. negative margin for certain element sequences, like I suggested in T352875#9424919. I've never heard of such combination being an anti-pattern, but there certainly seems to be something fishy about it. Wouldn't want to see T360917 devolve into hunting for a multiplicity of one-off cases for no good reason.)

So I filed T361767. And one other thing: If you solved this issue by just removing top margins for lists, that's not a good fix. You've just moved it to another place where it will eventually surface. Like in this case:

So should I file a task that lists after tables (and God knows what else) have wrong vertical margins?.. I hope not.

In T360917 we will re-evaluate margins/paddings and aim to fix all the issues that have been documented. Creating new tickets that are not linked to from the description of that ticket and commenting on existing resolved tickets which are not being monitored will further fragment the conversation and likely lead to more problems on the long run. Please bubble up anything important to T360917 to make sure it's not missed

(I summarized the problem in T361767, so everything else is just trivia, but may reiterate it there if that helps.)

Test wiki on Patch demo by BWang (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/544e98641d/w/

Test wiki on Patch demo by BWang (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org/wikis/f094914739/w/