{"action":"created","issue":{"url":"https://api.github.com/repos/w3ctag/spec-reviews/issues/51","labels_url":"https://api.github.com/repos/w3ctag/spec-reviews/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/w3ctag/spec-reviews/issues/51/comments","events_url":"https://api.github.com/repos/w3ctag/spec-reviews/issues/51/events","html_url":"https://github.com/w3ctag/spec-reviews/issues/51","id":68916923,"number":51,"title":"CSSOM View document.scrollingElement","user":{"login":"zcorpan","id":244772,"avatar_url":"https://avatars.githubusercontent.com/u/244772?v=3","gravatar_id":"","url":"https://api.github.com/users/zcorpan","html_url":"https://github.com/zcorpan","followers_url":"https://api.github.com/users/zcorpan/followers","following_url":"https://api.github.com/users/zcorpan/following{/other_user}","gists_url":"https://api.github.com/users/zcorpan/gists{/gist_id}","starred_url":"https://api.github.com/users/zcorpan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zcorpan/subscriptions","organizations_url":"https://api.github.com/users/zcorpan/orgs","repos_url":"https://api.github.com/users/zcorpan/repos","events_url":"https://api.github.com/users/zcorpan/events{/privacy}","received_events_url":"https://api.github.com/users/zcorpan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"slightlyoff","id":97331,"avatar_url":"https://avatars.githubusercontent.com/u/97331?v=3","gravatar_id":"","url":"https://api.github.com/users/slightlyoff","html_url":"https://github.com/slightlyoff","followers_url":"https://api.github.com/users/slightlyoff/followers","following_url":"https://api.github.com/users/slightlyoff/following{/other_user}","gists_url":"https://api.github.com/users/slightlyoff/gists{/gist_id}","starred_url":"https://api.github.com/users/slightlyoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slightlyoff/subscriptions","organizations_url":"https://api.github.com/users/slightlyoff/orgs","repos_url":"https://api.github.com/users/slightlyoff/repos","events_url":"https://api.github.com/users/slightlyoff/events{/privacy}","received_events_url":"https://api.github.com/users/slightlyoff/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/w3ctag/spec-reviews/milestones/2","html_url":"https://github.com/w3ctag/spec-reviews/milestones/2015-05-06-tag-telcon","labels_url":"https://api.github.com/repos/w3ctag/spec-reviews/milestones/2/labels","id":1081292,"number":2,"title":"2015-05-06-tag-telcon","description":"","creator":{"login":"torgo","id":287526,"avatar_url":"https://avatars.githubusercontent.com/u/287526?v=3","gravatar_id":"","url":"https://api.github.com/users/torgo","html_url":"https://github.com/torgo","followers_url":"https://api.github.com/users/torgo/followers","following_url":"https://api.github.com/users/torgo/following{/other_user}","gists_url":"https://api.github.com/users/torgo/gists{/gist_id}","starred_url":"https://api.github.com/users/torgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torgo/subscriptions","organizations_url":"https://api.github.com/users/torgo/orgs","repos_url":"https://api.github.com/users/torgo/repos","events_url":"https://api.github.com/users/torgo/events{/privacy}","received_events_url":"https://api.github.com/users/torgo/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":0,"state":"open","created_at":"2015-04-23T21:33:36Z","updated_at":"2015-04-23T21:58:45Z","due_on":"2015-05-06T07:00:00Z","closed_at":null},"comments":29,"created_at":"2015-04-16T12:49:48Z","updated_at":"2015-04-24T07:47:09Z","closed_at":null,"body":"The Blink team would like a TAG review of document.scrollingElement before LGTM-ing shipping it.\r\nhttps://groups.google.com/a/chromium.org/d/msg/blink-dev/mJ5SlCj3CHc/hkQuqROnwl4J\r\nhttps://groups.google.com/a/chromium.org/d/msg/blink-dev/mJ5SlCj3CHc/SnJ5rNxCiOUJ\r\n\r\nSpec: http://dev.w3.org/csswg/cssom-view/#dom-document-scrollingelement\r\n\r\nBackground/rationale\r\nhttps://github.com/operasoftware/devopera/issues/242\r\nhttps://lists.w3.org/Archives/Public/www-style/2015Apr/0108.html\r\n\r\nTracking bugs\r\nhttps://code.google.com/p/chromium/issues/detail?id=475531\r\nhttps://bugzilla.mozilla.org/show_bug.cgi?id=1153322\r\nhttps://bugs.webkit.org/show_bug.cgi?id=143609"},"comment":{"url":"https://api.github.com/repos/w3ctag/spec-reviews/issues/comments/95837304","html_url":"https://github.com/w3ctag/spec-reviews/issues/51#issuecomment-95837304","issue_url":"https://api.github.com/repos/w3ctag/spec-reviews/issues/51","id":95837304,"user":{"login":"zcorpan","id":244772,"avatar_url":"https://avatars.githubusercontent.com/u/244772?v=3","gravatar_id":"","url":"https://api.github.com/users/zcorpan","html_url":"https://github.com/zcorpan","followers_url":"https://api.github.com/users/zcorpan/followers","following_url":"https://api.github.com/users/zcorpan/following{/other_user}","gists_url":"https://api.github.com/users/zcorpan/gists{/gist_id}","starred_url":"https://api.github.com/users/zcorpan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zcorpan/subscriptions","organizations_url":"https://api.github.com/users/zcorpan/orgs","repos_url":"https://api.github.com/users/zcorpan/repos","events_url":"https://api.github.com/users/zcorpan/events{/privacy}","received_events_url":"https://api.github.com/users/zcorpan/received_events","type":"User","site_admin":false},"created_at":"2015-04-24T07:47:09Z","updated_at":"2015-04-24T07:47:09Z","body":"So in the future, assuming the bug is successfully fixed, and you don't have to worry about current-era browsers, but still worry about quirks mode (like Closure does), with `scrollingElement` it would be like this:\r\n\r\n```js\r\ngoog.dom.getDocumentScrollElement_ = function(doc) {\r\n    return doc.scrollingElement;\r\n}\r\n```\r\n(or scrap the method altogether and use `scrollingElement` directly)\r\n\r\nwith `behavesCorrectly` it would be (assuming it returns `false` in quirks mode?)\r\n\r\n```js\r\ngoog.dom.getDocumentScrollElement_ = function(doc) {\r\n    if (doc.behavesCorrectly) {\r\n        return doc.documentElement;\r\n    }\r\n    return doc.body || doc.documentElement;\r\n}\r\n```\r\nHowever this would not be technically correct (the current Closure script isn't, either), because `document.body` can be a `frameset` element, or the `body` can be independently scrollable (in which case, `scrollTop` should scroll the element, not the viewport, per spec), or if `document.body` is null it would give you the `html` element but that is not the \"scrolling element\" in quirks mode, and so on. Possibly being technically correct is a non-goal for Closure; it was a goal for the polyfill. With `scrollingElement` you get correct behavior \"for free\"."}}