Open Bug 2088101 Opened 7 days ago Updated 7 days ago

WebDriver Refresh does a cache-bypassing reload, so the scroll position isn't restored [zcorpan/navigation-api-qa]

Categories

(Remote Protocol :: Marionette, defect)

defect

Tracking

(Not tracked)

People

(Reporter: zcorpan, Unassigned)

References

Details

WebDriver Refresh (https://w3c.github.io/webdriver/#refresh) initiates an overridden reload of the active document. Marionette's navigate.refresh reloads with Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE (https://searchfox.org/firefox-main/rev/e924f94175311819d7b549a732d0d8ee1263b31d/remote/marionette/navigate.sys.mjs#185), the flag a forced (Shift+Reload) reload uses, and as with Shift+Reload, Firefox doesn't restore the scroll position.

reload-scroll.html scrolls to 3000px, reloads, and reports scrollY after load. ?how=script reloads with location.reload(); otherwise the driver reloads (WebDriver Refresh, or CDP reload in Chrome).

location.reload() WebDriver Refresh / CDP reload
Chrome Canary 3000 3000
Firefox Nightly 3000 0
Safari TP 3000 3000

Over 382 top-10k pages, this made Firefox's scroll position after a WebDriver Refresh differ from Chrome's on 38 pages.

(Found in https://github.com/zcorpan/navigation-api-qa.)

Thank you for the bug report Simon. There is actually a WebDriver spec issue as well with refreshing a page. I filed https://github.com/w3c/webdriver/pull/1982 to get this corrected first.

You need to log in before you can comment on or make changes to this bug.