Page MenuHomePhabricator

Deleting a colspan column breaks the table layout failing to adjust the rowspan (also leaving an extra empty row)
Open, Needs TriagePublic

Description

@C933103 provided a very good minimal testing set for this bug. Start with a table like this:

{| class="wikitable"
|-
! rowspan=2|ColA
! colspan=2|ColB
|-
!ColB1
!ColB2
|-
|Field1
|Field2
|Field3
|}

Now open the page in VisualEditor and remove all columns except the first ("ColB", including ColB1 and ColB2). (EDIT: to clarify, view the sample table in VE, click on the cell "ColB", click on the menu triangle above the column, click "Delete Columns". --Jaufrecht)

The display in the visual editor is exactly what you expect:

ColA
Field1

However, the actual result upon saving is:

{| class="wikitable"
|-
! rowspan=2|ColA
|-

|-
|Field1
|}

This actual result upon saving looks like this:

ColAField1

The expected result displays differently:

{| class="wikitable"
|-
!ColA
|-
|Field1
|}

[Note further that, after saved, the table continues to render differently in VE vs Read. In VE, it has two rows and one column; in Read, it has one row and two columns. --Jaufrecht]

See examples at https://zh.wikipedia.org/w/index.php?diff=38947510&oldid=38607870 and https://en.wikipedia.org/w/index.php?diff=703143357&oldid=703143009

Event Timeline

Whatamidoing-WMF raised the priority of this task from to Needs Triage.
Whatamidoing-WMF updated the task description. (Show Details)
Restricted Application added a project: VisualEditor. · View Herald TranscriptFeb 3 2016, 7:45 PM
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald Transcript

This looks like a VE issue to me. Parsoid won't add the rowspan=2 attribute unilaterally -- it just reproduces it from the HTML it receives from VE.

I can't reproduce. The display I get in the visual editor is:

ColA
Field1
Jdforrester-WMF changed the task status from Open to Stalled.Feb 9 2016, 8:17 PM
Jdforrester-WMF set Security to None.
JAufrecht updated the task description. (Show Details)Feb 9 2016, 8:24 PM
ferveo added a subscriber: ferveo.Jun 2 2016, 1:07 PM

To extend on this, the issue is related to how VE displays tables. If you have:

{| class="wikitable"
|-
!rowspan=2|A
|-
|B
|}

i.e.:

<tr>
  <th rowspan="2">A</th>
</tr>
<tr>
  <td>B</td>
</tr>

any browser would show this in a single row (since rowspan takes precedent). However VE renders this in 2 rows/single column formation.

Aklapper changed the task status from Stalled to Open.May 30 2020, 12:19 PM

On https://www.mediawiki.org/wiki/User:AKlapper_(WMF)/Sandbox#phab:T125703 , the HTML is:

<table class="wikitable">
<tbody><tr>
<th rowspan="2">A
</th></tr>
<tr>
<td>B
</td></tr></tbody></table>

Firefox 76 displays as:

Going to https://www.mediawiki.org/w/index.php?title=User:AKlapper_(WMF)/Sandbox&veaction=edit displays as:

I don't know if that's good (task should have status declined) or bad (task should have status open).

Restricted Application added a subscriber: Cosine02. · View Herald TranscriptMay 30 2020, 12:19 PM
ssastry added a subscriber: JTannerWMF.

This is still a bug and this looks like a VE bug, I could reproduce the bug by following the directions in the description. In addition, if you open https://www.mediawiki.org/w/index.php?title=User:SSastry_(WMF)/Sandbox&oldid=3916809 in VE, you see that it looks different from how it renders.

The HTML VE sends Parsoid has the rowspan=2 attribute. In VE, I wasn't able to unmerge cells to try to get rid of rowspan=2.

I am going to untag Parsoid here. FYI: @JTannerWMF