├── .gitattributes ├── .gitignore ├── tests ├── standards-mode-frameset.html ├── quirks-mode-frameset.html ├── standards-mode.html ├── quirks-mode.html └── tests.js ├── package.json ├── LICENSE-MIT.txt ├── README.md └── scrollingelement.js /.gitattributes: -------------------------------------------------------------------------------- 1 | # Automatically normalize line endings for all text-based files 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Installed npm modules 2 | node_modules 3 | 4 | # Folder view configuration files 5 | .DS_Store 6 | Desktop.ini 7 | 8 | # Thumbnail cache files 9 | ._* 10 | Thumbs.db 11 | 12 | # Files that might appear on external disks 13 | .Spotlight-V100 14 | .Trashes 15 | -------------------------------------------------------------------------------- /tests/standards-mode-frameset.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/quirks-mode-frameset.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/standards-mode.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | document.scrollingElement in standards mode test 6 | 7 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/quirks-mode.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | document.scrollingElement in quirks mode test 6 | 7 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "scrollingelement", 3 | "version": "1.5.2", 4 | "description": "A `document.scrollingElement` polyfill.", 5 | "homepage": "https://mths.be/scrollingelement", 6 | "main": "scrollingelement.js", 7 | "keywords": [ 8 | "cssom", 9 | "dom", 10 | "scrolling", 11 | "scrollingelement" 12 | ], 13 | "license": "MIT", 14 | "author": { 15 | "name": "Mathias Bynens", 16 | "url": "https://mathiasbynens.be/" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "https://github.com/mathiasbynens/document.scrollingElement.git" 21 | }, 22 | "bugs": "https://github.com/mathiasbynens/document.scrollingElement/issues", 23 | "files": [ 24 | "LICENSE-MIT.txt", 25 | "scrollingelement.js" 26 | ], 27 | "directories": { 28 | "test": "tests" 29 | }, 30 | "scripts": { 31 | "test": "http-server & sleep 1; open 'http://0.0.0.0:8080/tests/standards-mode.html'; open 'http://0.0.0.0:8080/tests/quirks-mode.html'; wait; killall node" 32 | }, 33 | "devDependencies": { 34 | "qunitjs": "^1.18.0" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /LICENSE-MIT.txt: -------------------------------------------------------------------------------- 1 | Copyright 2 | Diego Perini 3 | Mathias Bynens 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # `document.scrollingElement` 2 | 3 | A polyfill for [`document.scrollingElement` as defined in the CSSOM specification](http://dev.w3.org/csswg/cssom-view/#dom-document-scrollingelement). 4 | 5 | ## Installation 6 | 7 | In an HTML document: 8 | 9 | ```html 10 | 11 | ``` 12 | 13 | It’s recommended to place this right before the closing `` tag. 14 | 15 | The polyfill can be used in `frameset` HTML documents (in that case, place the `