New issue
Advanced search Search tips

Issue 864370 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

table cell's vertical-align is changed to top in the printed pdf

Reported by 0gentle0...@gmail.com, Jul 17

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36

Example URL:

Steps to reproduce the problem:
1. Create a html file with the content in the attached txt file. Place it on some place, e.g. E:\test.html.
2. Open the html using Chrome. Resize the Broswer to enusre the height is the table row's height. 
3. Print it to PDF.

What is the expected behavior?
Do not change the table cell's vertical-align in the printed pdf. As the attached PDF - incorrect.pdf.

What went wrong?
Table cell's vertical-align is changed to top in the printed pdf. As the attached PDF - correct.pdf.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 67.0.3396.99  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 30.0 r0

I found there is a related change, that forces everything to be top aligned in the cases that rows cross fragmentainer boundaries: https://codereview.chromium.org/2412923002/#ps20001

But in my case, after setting the table node's position and top, the displayed table row doesn't cross fragmentainer boundart. But the cell's alignment is still getting changed to be top.
 
testHTML.txt
555 bytes View Download
incorrect.pdf
26.3 KB Download
correct.pdf
26.0 KB Download
Components: -Blink Blink>Layout>Table
Owner: mstensho@chromium.org
Status: Assigned (was: Unconfirmed)
Assigning temporarily to mstensho@ to take a look (as the author of the CL).

Labels: Needs-Feedback
Where did correct.pdf come from? Could you check what Edge and Firefox do in this situation?
Attaching a demo that uses multicol instead. Not quite the same as printing, but easier to work with.

We apply the offset caused by position:relative after fragmenting, which is the correct thing to do. Before applying position:relative, the short cell in the second row will fit in the first column, but the tall cell won't. So vertical alignment will be meaningless, and the blamed change above comes into play, and essentially does something sensible. But the first (short) cell should be put below the content area in the first column (it will overflow the column), rather than being moved to the second one. Edge does it right. This is something that's almost impossible to fix in the current layout engine.
demo.html
393 bytes View Download

Sign in to add a comment