| Summary: | window.scrollTo(null) throws an exception | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | zyscoder <zyscoder> |
| Component: | WebCore Misc. | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED WONTFIX | ||
| Severity: | Normal | CC: | bugs-noreply, cdumez, mcatanzaro, simon.fraser |
| Priority: | P2 | ||
| Version: | WebKit Local Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
|
Description
zyscoder@gmail.com
2021-05-30 06:01:25 PDT
If you type window.scrollTo on icann.org, you'll notice they are using some kind of polyfill:
function (){void 0!==arguments[0]&&(!0!==c(arguments[0])?g.call(t,e.body,void 0!==arguments[0].left?~~arguments[0].left:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:t.scrollY||t.pageYOffset):o.scroll.call(t,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:t.scrollY||t.pageYOffset))} = $1
They are not calling our window.scrollTo() implementation. As a matter of fact, our window.scrollTo() implementation never throws.
Chrome and Firefox are not getting the polypill for window.scrollTo, unclear why. (In reply to Chris Dumez from comment #2) > Chrome and Firefox are not getting the polypill for window.scrollTo, unclear > why. I think we are getting the polyfill because of this check: if (!("scrollBehavior" in e.documentElement.style) || !0 === t.__forceSmoothScrollPolyfill__) { We seem to be failing this: "scrollBehavior" in e.documentElement.style (In reply to Chris Dumez from comment #3) > (In reply to Chris Dumez from comment #2) > > Chrome and Firefox are not getting the polypill for window.scrollTo, unclear > > why. > > I think we are getting the polyfill because of this check: > if (!("scrollBehavior" in e.documentElement.style) || !0 === > t.__forceSmoothScrollPolyfill__) { > > We seem to be failing this: "scrollBehavior" in e.documentElement.style On WebKit trunk, in the develop menu, there is an experimental feature called CSSOM View Smooth Scrolling, which is off by default. If I turn it on, then icann.org stops using the polyfill and instead calls our native window.scrollTo(). I have verified that window.scrollTo(null) doesn't throw in such case. Anyway, this is not really a but with our window.scrollTo implementation. The Website merely makes the decision NOT to use our window.scrollTo implementation because we don't support CSSOM View Smooth Scrolling. Simon may know more about CSSOM View Smooth Scrolling, I have no idea what that is or if we're close to enabling it. ScrollBehavior is bug 188043. Anyway, this bug is a website bug. |