New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 735059 link

Starred by 15 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Table borders are omitted when printing <iframe style=display:none>

Reported by renesis...@gmail.com, Jun 20 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.104 Safari/537.36

Example URL:
http://jsfiddle.net/nuw8v2Ln/19/

Steps to reproduce the problem:
1. Go to link that I provided
2. Click "print"

What is the expected behavior?
Table printed as it seen on the page

What went wrong?
Table printed without borders

Does it occur on multiple sites: N/A

Is it a problem with a plugin? No 

Did this work before? Yes 58

Does this work in other browsers? Yes

Chrome version: 59.0.3071.104  Channel: stable
OS Version: XUbuntu 17.04
Flash Version:
 
Components: UI>Browser>PrintPreview
Labels: Needs-Feedback
Tested this issue using latest stable #59.0.3071.104 on Ubutnu 14.04 and able to see the table in the print preview as per the steps mentioned in original comment.


@reporter: Could you please find the attached screenshot and let us know your observations.
Screenshot from 2017-06-21 15:50:28.png
168 KB View Download
I mean not printing from browser menu, but initiating printing of iframe from javascript (in my snippet you should click the "print" button that is right below the test table).
Result is gonna be like on the attached screenshot (without borders).
This issue appears only when printing Iframes, sorry that I didn't mention that in the title.
Снимок экрана_2017-06-21_15-03-48.png
74.4 KB View Download
Project Member

Comment 3 by sheriffbot@chromium.org, Jun 21 2017

Cc: sandeepkumars@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "sandeepkumars@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Any chance for this to be fixed in any of following versions?
Labels: Needs-Feedback
In the original bug report, you wrote: "Did this work before? Yes 58"

I tried this on Linux with Chrome 58 and 59. Neither version would print the table with borders. Are you sure this worked before?

You also wrote: "Does this work in other browsers? Yes"

- I tried Firefox, which threw an error: document.printFrame is undefined.
- With Edge on Windows, the table also does not have borders, and it is not laid out properly.
- With Safari on Mac, it behaves the same way as Chrome 59, without borders.

So, what other browser does this test page work properly in?
Here's an updated version: http://jsfiddle.net/nuw8v2Ln/22/
It works in Firefox and Chrome 58
It was quite hard to reproduce because I was not permitted to provide the real-world example from proprietary system
Project Member

Comment 7 by sheriffbot@chromium.org, Jun 28 2017

Cc: thestig@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "thestig@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: Needs-Triage-M59
Components: Blink>HTML>IFrame Blink>CSS Blink>Layout
Labels: -Type-Compat Hotlist-Interop OS-Windows Type-Bug-Regression
Status: Untriaged (was: Unconfirmed)
This happens because the iFrame is hidden with display: none;.
Workaround -
Use -
visibility: hidden;
pointer-events: none;
border: none;

:(

Reduced further -
Fails -
data:text/html,<iframe style="display: none" srcdoc="<table border=1><tr><td>Test</td></tr></table><script>print()</script>"></iframe>

Works -
data:text/html,<iframe style="visibility: hidden; border: none; pointer-events: none;" srcdoc="<table border=1><tr><td>Test</td></tr></table><script>print()</script>"></iframe>

Edge 15 (using BrowserStack) and Firefox 53 print the JSFiddle test with borders.
Internet Explorer 11 prints the outer iFrame instead. :)
Chrome 59 prints without borders.
Chrome 58 (using BrowserStack) prints with borders.

Perhaps related to work done over at  issue 650433 .
Summary: Table borders are omitted when printing <iframe style=display:none> (was: Table borders don't appear when printing the page)
Am able to reproduce the issue.

Chrome version : 59.0.3071.115 (Official Build) (64-bit)
Tested OS : macOS Sierra version 10.12.5,Windows10,Windows 8.1,Ubuntu 16.04

There is no issue with previous Chrome version.

Labels: OS-Mac
Am able to fix my prints issue with workaround given phistuck@chromium.org.

The workaround works in following 
Chrome version : 59.0.3071.115 (Official Build) (64-bit)
Tested OS : macOS Sierra version 10.12.5,Windows10,Windows 8.1,Ubuntu 16.04

thankyou phistuck@chromium.org
thanks phistuck@chromium.org ...  This trick temporarily solves the issue

Comment 15 by tkent@chromium.org, Jun 30 2017

Components: -Blink>HTML>IFrame
Owner: erikc...@chromium.org
Status: Assigned (was: Untriaged)
Cc: erikc...@chromium.org
Labels: Needs-Bisect
Owner: ----
Status: Untriaged (was: Assigned)
The CL in question is still an experimental feature, so it shouldn't affect stable users. We need a bisect.
Labels: -Needs-Bisect -Type-Bug-Regression -Needs-Triage-M59 M-61 Type-Bug
Able to reproduce this issue on Mac 10.12.5, Win-10 and Ubuntu 14.04 using chrome stable version #59.0.3071.115 and latest canary #61.0.3144.0.

This is a non-regression issue as it is observed from M45 old builds. 

Hence, marking it as untriaged to get more inputs from dev team.

Thanks...!!
Labels: -Type-Bug Needs-Bisect Type-Bug-Regression
#17 - I tested it using BrowserStack and it printed borders before Chrome 59. Have you tested the code from comment 9 or comment 6? Because the initial report above has a slightly erroneous test case which indeed did not work, but it was reduced further in comments 6 and 9 and one of those those should be bisected instead.
Components: Blink>Paint>Invalidation
Labels: -Pri-2 -Needs-Bisect hasbisect-per-revision Pri-1
Owner: wangxianzhu@chromium.org
Status: Assigned (was: Untriaged)
phistuck@ - Thanks for your feedback...!!

Able to reproduce the issue on Windows 10, Ubuntu 14.04 and Mac 10.12.5 using chrome stable version #59.0.3071.115 and latest canary #61.0.3144.0 by using the URL from comment #6.

Bisect Information:
=====================
Good build: 58.0.2991.0	 Revision(445609)
Bad Build : 58.0.2992.0	 Revision(445908)

Change Log URL: 
https://chromium.googlesource.com/chromium/src/+log/cd207440f74f112ed24d1e72b63fddbca063dcc9..9686be68e53348bab6f4ce846bf07d494f1575a0

From the above change log suspecting below change
Review URL: https://codereview.chromium.org/2647393002

wangxianzhu@ - Could you please check whether this is caused with respect to your change, if not please help us in assigning it to the right owner.

Thanks...!!
Labels: Needs-Bisect
#19 -
Thank you!
In order to narrow down the regression range even further (that change list enables a big feature that was developed for months), can you bisect again, but this time, also make sure Chrome is run with the following command line flag?
--enable-blink-features="SlimmingPaintInvalidation"
Components: -Blink>CSS -Blink>Layout -UI>Browser>PrintPreview
Labels: -Needs-Bisect
I think we have got enough information that this bug is related to SlimmingPaintInvalidation.
Cc: wangxianzhu@chromium.org
Owner: chrishtr@chromium.org
TL;DR: We need walk detached frames for PrePaint before printing.

Assigning to chrishtr@ because I will be on vacation until mid August.

The test passes for non-SlimmingPaintInvalidation because we walk detached frames during paint invalidation. The walk ensures the frame is ready for painting, e.g. getting PaintLayer NeedsPaintPhaseXXX flags updated and table collapsed borders not updated. We also need the walk for SlimmingPaintInvalidation.

More details of diagosis:
Chrome with DCHECK enabled crashes at:

[1:1:0630/113942.841717:FATAL:LayoutTable.h(345)] Check failed: collapsed_borders_valid_. 
#0 0x558c6c573027 base::debug::StackTrace::StackTrace()
#1 0x558c6c58cf71 logging::LogMessage::~LogMessage()
#2 0x558c6eedeff8 blink::TablePainter::PaintObject()
...
#32 0x558c6eeb7eed blink::PaintLayerPainter::Paint()
#33 0x558c6ee81e5b blink::FramePainter::PaintContents()
#34 0x558c6eae7aca blink::LocalFrameView::PaintContents()
#35 0x558c6f01c4a1 blink::ChromePrintContext::SpoolPage()
#36 0x558c6f016045 blink::ChromePrintContext::SpoolSinglePage()

Even with collapsed borders updated, we still don't paint the collapsed borders because the PaintLayer's NeedsPaintPhaseXXX flags are not updated which will cause more issues other than collapsed borders.

Comment 24 by phistuck@gmail.com, Jun 30 2017

With the following flags -
--force-device-scale-factor=1 --disable-blink-features=SlimmingPaintInvalidation --disable-slimming-paint-invalidation
Print preview shows (beside the print headers) an empty page.

Also, while  issue 738543  still reproduces with flags above, it seems like a related issue as well.
Owner: pdr@chromium.org
pdr, sending to you to loadbalance.
Labels: -Pri-1 Pri-2
 Issue 752138  has been merged into this issue.

Comment 28 by pdr@chromium.org, Aug 22 2017

Owner: wangxianzhu@chromium.org
I did not get around to this from July. Xianzhu, can you take a look again?
Project Member

Comment 29 by bugdroid1@chromium.org, Sep 8 2017

Labels: Merge-Request-62
The test case is causing crash in M62 official build, so we need to merge into M62. 
Project Member

Comment 31 by sheriffbot@chromium.org, Sep 9 2017

Labels: -Merge-Request-62 Hotlist-Merge-Approved Merge-Approved-62
Your change meets the bar and is auto-approved for M62. Please go ahead and merge the CL to branch 3202 manually. Please contact milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), bhthompson@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: TE-Verified-M63 TE-Verified-63.0.3212.0
Verified this issue on chrome Windows-10, Ubuntu 14.04 and Mac OS 10.12.6 using chrome latest canary #63.0.3212.0 by using the test case provided in the comment #6, observed the table borders are seen in print-preview page of chrome as expected. Hence adding TE-Verified label for M-63.

Thanks!

735059.png
1.4 KB View Download
Project Member

Comment 33 by bugdroid1@chromium.org, Sep 11 2017

Labels: -merge-approved-62 merge-merged-3202
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f912cab710250e5d8074967188a7911bf2d7a500

commit f912cab710250e5d8074967188a7911bf2d7a500
Author: Xianzhu Wang <wangxianzhu@chromium.org>
Date: Mon Sep 11 16:42:41 2017

Update life cycle for detached frames for printing

We need to let detached frames up-to-date for painting because we can
print a detached frame directly with javascript.

TBR=wangxianzhu@chromium.org

(cherry picked from commit 0f447f657e78625331f2b69318d69aa97eb7805a)

Bug:  735059 
Change-Id: Ifbb27c4178bb7fe310e5637b6205186b78ca12a9
Reviewed-on: https://chromium-review.googlesource.com/653769
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#500512}
Reviewed-on: https://chromium-review.googlesource.com/660800
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/branch-heads/3202@{#128}
Cr-Branched-From: fa6a5d87adff761bc16afc5498c3f5944c1daa68-refs/heads/master@{#499098}
[modify] https://crrev.com/f912cab710250e5d8074967188a7911bf2d7a500/third_party/WebKit/Source/core/exported/WebFrameTest.cpp
[modify] https://crrev.com/f912cab710250e5d8074967188a7911bf2d7a500/third_party/WebKit/Source/core/frame/LocalFrameView.cpp
[modify] https://crrev.com/f912cab710250e5d8074967188a7911bf2d7a500/third_party/WebKit/Source/core/frame/LocalFrameView.h
[modify] https://crrev.com/f912cab710250e5d8074967188a7911bf2d7a500/third_party/WebKit/Source/core/frame/LocalFrameViewTest.cpp
[modify] https://crrev.com/f912cab710250e5d8074967188a7911bf2d7a500/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
[add] https://crrev.com/f912cab710250e5d8074967188a7911bf2d7a500/third_party/WebKit/Source/core/testing/data/print-detached-iframe.html

Status: Fixed (was: Assigned)

Sign in to add a comment