New issue
Advanced search Search tips

Issue 904447 link

Starred by 4 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug-Regression



Sign in to add a comment

not hiding elements after setting attribute hidden or setting display none in print preview

Reported by visrut...@gmail.com, Nov 12

Issue description

This is bug can be reproduced in any mobile having chrome-70.0.3538.80. There was no issue with previous versions and there is no issue in desktop chrome. 

Device name: Huawei P Smart

From "Settings > About Chrome"
Application version: 70.0.3538.80
Operating system:8.0.0

URLs (if applicable):

Steps to reproduce:
(1) open the test.html in chrome which is attached along with this ticket
(2) click on any button which will popup print preview
(3) Check the print preview you can see both buttons are visible. 

Expected result: The clicked button should be hidden in the preview.

Actual result: Both buttons are visible


 
test.html
341 bytes View Download
window.print seems to be an asynchronous function so I implemented onbeforeprint and onafterprint to fix this issue.
Components: Internals>Printing
Labels: Needs-triage-Mobile
Cc: chelamcherla@chromium.org
Labels: -Pri-3 hasbisect-per-revision RegressedIn-70 ReleaseBlock-Stable Target-70 Target-71 Target-72 M-70 Triaged-Mobile FoundIn-71 FoundIn-70 FoundIn-72 Pri-1 Type-Bug-Regression
Owner: ctzsm@chromium.org
Status: Assigned (was: Unconfirmed)
Tested the issue in Android and able to reproduce the issue. 

Steps Followed:
1. Opened attached html file
2. Clicked on first button and on preview page both the buttons are seen.

Chrome versions tested:
70.0.3538.80, 72.0.2608.3(Latest canary)

OS:
Android 9.0.0

Android Devices:
Pixel 2 XL


Using the per-revision bisect providing the bisect results,
Good Build - 70.0.3522.0
Bad Build - 70.0.3523.0

CL: https://chromium.googlesource.com/chromium/src/+/46582a40a0dfad471818e1bd04d2514d20b71adc

@ ctzsm: Could you please look into the issue, pardon me if it has nothing to do with your changes and if possible please assign it to owner concerned. Adding RB-Stable for M-70, Please remove if this not the case. 

Thanks!

Cc: thestig@chromium.org changwan@chromium.org
+ changwan & thestig

visruthcv@, thanks for providing this example, I think I made a wrong assumption that window.print() is always async on Android. But it turns out that's not true.

When window.print() is inside onClick event as the attached example shows, it is blocking before my change. I was always testing in main context, so didn't realize window.print() could be blocking in this case.

I made a small tweak to the attached example to illustrate what I mean, I have a function called doPrint() that changes the visibility of a third button before calling window.print() then restore the visibility after that. When make doPrint() as onClick listener, it behaviors blocking, however, if we call it independently, it is non-blocking.

I must misunderstood something here, Lei, is there any advice?
test_tweak.html
724 bytes View Download

Comment 6 Deleted

Comment 7 Deleted

Comment 8 Deleted

@ctzsm I tested test_tweak.html in Chrome-70.0.3538.80 (in android). The three buttons are still visible. Instead of writing code inside onclick itself you refactored it as a function so obviously it will not solve the issue. But as you said it proves that calling doPrint outside onclick also behaves as window.print non-blocking in other chrome browsers also (I tried in desktop version of chrome). This a valuable test.

will window.print() be non-blocking in its future releases also?

Regards,
Visruth
Cc: benmason@chromium.org
Friendly ping to look into this issue as this issue is marked as Stable blocker.

Thanks!
Any update here?
Labels: -ReleaseBlock-Stable
Removing RBS since there are beforeprint and afterprint events could resolve related issues.

We haven't decide to make window.print() blocking or not, I am actually not quite sure about the blocking vs non-blocking behavior on desktop. Android will probably follow whatever the behavior is on desktop after we address the issue on desktop. 
ctzsm@

beforeprint and afterprint cannot solve this issue in Chrome Version 71.0.3578.80 (Desktop). This is also reported here https://bugs.chromium.org/p/chromium/issues/detail?id=914019
visruthcv@,  issue 914019  (dup of  issue 912966 ) has been resolved, you will get an update soon I believe.
ctzsm@, thank you!

Comment 17 by ctzsm@chromium.org, Jan 16 (6 days ago)

Cc: ctzsm@chromium.org
 Issue 917492  has been merged into this issue.

Sign in to add a comment