New issue
Advanced search Search tips

Issue 918225 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows
Pri: 3
Type: Bug



Sign in to add a comment

Wheel scrolling problem after document.write

Reported by guany...@spap.com, Dec 29

Issue description

Chrome Version       : 71.0.3578.98
OS Version: 10.0
URLs (if applicable) :
Other browsers tested:
  Add OK or FAIL after other browsers where you have tested this issue:
     Safari:OK
    Firefox:OK
    IE/Edge:OK

What steps will reproduce the problem?
1.Run the code I provided or open the file in the attachment

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>document.write BUG</title>
</head>
<body>
    <button onclick="start()">Click Me</button>
    <script>
        function start() {
            document.write(`<html>
                <head></head>
                <body>
                    <div style="position: absolute;height: 240px;overflow: auto;width: 320px;">
                        Try rolling the mouse wheel<br/><br/><br/><br/><br/>
                        Try rolling the mouse wheel<br/><br/><br/><br/><br/>
                        Try rolling the mouse wheel<br/><br/><br/><br/><br/>
                        Try rolling the mouse wheel<br/><br/><br/><br/><br/>
                        Try rolling the mouse wheel<br/><br/><br/><br/><br/>
                        Try rolling the mouse wheel<br/><br/><br/><br/><br/>
                    </div>
                </body>
            </html>`);
            document.close();
        }
    </script>
</body>
</html>

What is the expected result?
Mouse wheel scrolling normally

What happens instead of that?
Mouse wheel is not available

Please provide any additional information below. Attach a screenshot if
possible.

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



 
example.html
1.0 KB View Download
Cc: vamshi.kommuri@chromium.org
Components: Blink>Scroll
Labels: Needs-Triage-M71 Needs-Feedback Triaged-ET
Thanks for filing the issue!

Unable to reproduce the issue on reported chrome version 71.0.3578.98 using Windows 10 with the below mentioned steps.
1. Launched Chrome
2. Opened example.html in a new tab
3. Clicked "Click me"
We were able to scroll without any issues. Attaching the screen cast of the same for reference.

@Reporter: Could you please have a look at the screencast and let us know if we have missed anything in the process. Any further inputs from your end may be helpful.
918225.mp4
2.0 MB View Download
Thank you, I have seen your recorded video.

There is no problem with your steps, but I don't know why you can't reproduce it over there. 

What is certain is that my colleagues have this problem. Some are Chrome 69, windows 7 also happened.

In short, except for mac, none of them works.

This time I provided a screen recording, you can watch it.

I think you should use more device tests, or more chrome versions, starting with 68. I can help with the test if needed. (PS: I am in China)


Recording #2.mp4
2.4 MB View Download
Project Member

Comment 3 by sheriffbot@chromium.org, Jan 3

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
guanyong@spap.com: I think you are doing autoscroll (middle-click, then move the mouse to scroll) here in #c2, as opposed to rolling the wheel w/o pressing it as in #c1.  Is this correct?

Labels: OS-Linux
Owner: sahel@chromium.org
Status: Assigned (was: Unconfirmed)
Summary: Wheel scrolling problem after document.write (was: Serious problem with the new version of Google Chrome)
Ah, I see, the bug reproduces in Linux with wheel-scrolling.  Keyboard scrolling works, so does scrolling through scrollbar.

Here is a minimal repro, removing "overflow: auto" fixes the problem in Linux:


<button onclick="start()">Click Me</button>
<script>
  function start() {
      document.write(`<div style="height: 240px; overflow: auto;">
                      Try wheelscrolling<br/><br/><br/><br/><br/>
                      Try wheelscrolling<br/><br/><br/><br/><br/>
                      Try wheelscrolling<br/><br/><br/><br/><br/>
                      Try wheelscrolling<br/><br/><br/><br/><br/>
                      Try wheelscrolling<br/><br/><br/><br/><br/>
                      Try wheelscrolling<br/><br/><br/><br/><br/>
                      </div>`);
      document.close();
  }
</script>

mustaq@chromium.org: Thanks, After removing "overflow: auto", the scroll bar acts on the body. The wheel-scrolling on the body is normal, but this is not enough.

Fortunately, after I added an <iframe> to the page, the scroll wheel will work.

    <button onclick="start()">Click Me</button>
	
    <script>
        function start() {
            document.write(`<html>
                <head></head>
                <body>
                    <div style="height: 240px;overflow: auto;width: 320px;">
                        Try rolling the mouse wheel<br/><br/><br/><br/><br/>
                        Try rolling the mouse wheel<br/><br/><br/><br/><br/>
                        Try rolling the mouse wheel<br/><br/><br/><br/><br/>
                        Try rolling the mouse wheel<br/><br/><br/><br/><br/>
                        Try rolling the mouse wheel<br/><br/><br/><br/><br/>
                        Try rolling the mouse wheel<br/><br/><br/><br/><br/>
                    </div>
		    <iframe></iframe>
                </body>
            </html>`);
            document.close();
        }
    </script>

I think this problem is caused by a rendering state error. I hope this helps you.

Sign in to add a comment