`, etc. For most of them you would need to keep an extra `` wrapper and almost all instances of the SVGGraphicsElement will be out of scope.
* The ResizeObserver spec requires to deliver notifications when a non-empty visible element becomes hidden, i.e. when either this element directly or one of its parent nodes receive the `display: none` state. Same goes for when it's being removed from or added to the DOM. It's not possible to handle these cases merely by using former approaches, so you'd still need to either subscribe for DOM mutations or to continuously check the element's state.
And though every approach has its own limitations, I reckon that it'd be too much of a trade-off to have those constraints when building a polyfill.
## Limitations
* Notifications are delivered ~20ms after actual changes happen.
* Changes caused by dynamic pseudo-classes, e.g. `:hover` and `:focus`, are not tracked. As a workaround you could add a short transition which would trigger the `transitionend` event when an element receives one of the former classes ([example](https://jsfiddle.net/que_etc/7fudzqng/)).
* Delayed transitions will receive only one notification with the latest dimensions of an element.
## Building and Testing
To build polyfill. Creates UMD bundle in the `dist` folder:
```sh
npm run build
```
To run a code style test:
```sh
npm run test:lint
```
Running unit tests:
```sh
npm run test:spec
```
To test in a browser that is not present in karma's config file:
```sh
npm run test:spec:custom
```
Testing against a native implementation:
```sh
npm run test:spec:native
```
**NOTE:** after you invoke `spec:native` and `spec:custom` commands head to the `http://localhost:9876/debug.html` page.
[travis-image]: https://travis-ci.org/que-etc/resize-observer-polyfill.svg?branch=master
[travis-url]: https://travis-ci.org/que-etc/resize-observer-polyfill