w3c/IntersectionObserver

rootRect without passed root parameter

ZachBird opened this issue · 1 comments

if not pass root parameter when create instance, dependence on mdn document

Defaults to the browser viewport if not specified or if null.

so, in 「_getRootRect」 function,if without 「this.root」, may the rootRect should be:

 rootRect = {
      top: 0,
      left: 0,
      right: window.innerWidth,
      width: window.innerWidth,
      bottom: window.innerHeight,
      height: window.innerHeight
};

innerWidth/innerHeight represent the browser window's layout viewport. Issue #26 discusses whether the implicit root should be the layout viewport or the visual viewport, with the balance of opinion favoring the visual viewport. The IntersectionObserver spec needs to be updated, but I'm going to close this issue and attach any PR's to issue #26.