Bug 174892 - When animating in a sidebar, if it contains an <input> with autofocus, the page scrolls sideways
Summary: When animating in a sidebar, if it contains an <input> with autofocus, the pa...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: Safari 10
Hardware: Mac macOS 10.12
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-07-27 08:20 PDT by Bob Lail
Modified: 2017-07-28 05:56 PDT (History)
6 users (show)

See Also:


Attachments
.html document exhibiting the bug (2.51 KB, text/html)
2017-07-27 08:20 PDT, Bob Lail
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bob Lail 2017-07-27 08:20:59 PDT
Created attachment 316547 [details]
.html document exhibiting the bug

I've attached a static web page that exhibits the problem and shows how <html>'s bounding client rect is static when animating a surface containing `<input>` and how it changes when animating a surface containing `<input autofocus>`.

This issue sounds like it might be related to Bug 131293, but I couldn't reproduce that bug.
Comment 1 Radar WebKit Bug Importer 2017-07-27 10:57:08 PDT
<rdar://problem/33571236>
Comment 2 Simon Fraser (smfr) 2017-07-27 22:20:57 PDT
Does this happen if you don't use display:flex?
Comment 3 Simon Fraser (smfr) 2017-07-27 22:23:37 PDT
Chrome shows this same behavior. Firefox is similar; it pins the document to the left side, but the document width is still changing as the sidebar comes in.

This is a weird way to animate in the sidebar, because the document width is changing (look at the scrollbars).
Comment 4 Bob Lail 2017-07-28 05:49:02 PDT
(In reply to Simon Fraser (smfr) from comment #2)
> Does this happen if you don't use display:flex?

Yes, it does. `display:flex` is only on the body causing the #surfaces div to be as tall as the window minus the height of the header. If you comment that out, you'll see the bug, it's just that the sidebar will only be 64px tall
Comment 5 Bob Lail 2017-07-28 05:52:32 PDT
(In reply to Simon Fraser (smfr) from comment #3)
> Chrome shows this same behavior. Firefox is similar; it pins the document to
> the left side, but the document width is still changing as the sidebar comes
> in.
> 
> This is a weird way to animate in the sidebar, because the document width is
> changing (look at the scrollbars).

Yeah, I noticed the scrollbars and thought at first that setting `max-width` on something would circumvent the problem; but part of strangeness here is that the widths of `#surfaces`, `body`, and `html` *aren't* changing. If you modify the step function in my example to output those values, you'll see what I mean.
Comment 6 Bob Lail 2017-07-28 05:54:58 PDT
Simon, I changed
Comment 7 Bob Lail 2017-07-28 05:56:17 PDT
Simon, I changed the summary to remove the part about "shrinking flex items" since that seems to be a red herring. If you remove all the flexbox CSS from my example, you can still see the bug: the page just looks goofier ;-)