Bug 182287 - Rewrite fast/events/scroll-in-scaled-page-with-overflow-hidden.html to conform with CSSOM View
Summary: Rewrite fast/events/scroll-in-scaled-page-with-overflow-hidden.html to confor...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Frédéric Wang (:fredw)
Keywords: InRadar
Depends on:
Blocks: 5991 182230
  Show dependency treegraph
Reported: 2018-01-30 05:33 PST by Frédéric Wang (:fredw)
Modified: 2018-02-01 06:05 PST (History)
5 users (show)

See Also:

Patch (3.22 KB, patch)
2018-01-31 03:08 PST, Frédéric Wang (:fredw)
tonikitoo: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frédéric Wang (:fredw) 2018-01-30 05:33:40 PST
fast/events/scroll-in-scaled-page-with-overflow-hidden.html uses document.body.scrollTop to retrieve the vertical scroll offset of the viewport. This currently works because WebKit does not follow the CSSOM View spec (bug 5991). However, when CSSOMViewScrollingAPI is enabled, the HTML body is potentially scrollable (html, body have overflow: hidden see [1]) so document.body.scrollTop does not return the scroll offset [2]. Instead, the corresponding Chromium test [3] relies on internals.visualViewportScrollY().

[1] https://drafts.csswg.org/cssom-view/#potentially-scrollable
[2] https://drafts.csswg.org/cssom-view/#dom-element-scrolltop
[3] https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden.html?q=scroll-in-scaled-page-with-overflow-hidden.html&sq=package:chromium&dr
Comment 1 Frédéric Wang (:fredw) 2018-01-31 03:08:01 PST
Created attachment 332752 [details]
Comment 2 Frédéric Wang (:fredw) 2018-01-31 03:10:39 PST
(In reply to Frédéric Wang (:fredw) from comment #0)
> Instead, the
> corresponding Chromium test [3] relies on internals.visualViewportScrollY().

So it looks like internals.visualViewportRect().y would work too, but I've simply used window.scrollY which is what document.body.scrollTop is supposed to return when the body is not potentially scrollable:

Comment 3 Frédéric Wang (:fredw) 2018-02-01 06:03:51 PST
Committed r227962: <https://trac.webkit.org/changeset/227962>
Comment 4 Radar WebKit Bug Importer 2018-02-01 06:05:13 PST