Recovering scroll position after regression problems. (#12727)

The fix for "Panels get unnecessary scroll bars in WebKit when content is 100% wide (#12727)" introduced side effects to #6731. This fix solves the problem.

Change-Id: I15ca926c0ee4cad49e9eea0c578c9cc73c850588