1 | /**
|
2 | @license
|
3 | Copyright (c) 2020 The Polymer Project Authors. All rights reserved.
|
4 | This code may only be used under the BSD style license found at
|
5 | http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
|
6 | http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
|
7 | found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
8 | part of the polymer project is also subject to an additional IP rights grant
|
9 | found at http://polymer.github.io/PATENTS.txt
|
10 | */
|
11 | const Element_prototype = window.Element.prototype;
|
12 | const HTMLElement_prototype = window.HTMLElement.prototype;
|
13 | const SVGElement_prototype = window['SVGElement'].prototype;
|
14 | // Thanks to @justinfagnani for finding this:
|
15 | //
|
16 | // In IE11, `classList` is only supported on `HTMLElement` instances: the
|
17 | // descriptor is an own property of `HTMLElement.prototype` and is an accessor
|
18 | // descriptor with `set` as `undefined` and no `get`. However, it seems to be
|
19 | // implemented generically enough such that copying it to something in the
|
20 | // prototype chain of `SVGElement` correctly adds support for `classList` (as
|
21 | // far as `DOMTokenList` implemented in IE11).
|
22 | if (HTMLElement_prototype.hasOwnProperty('classList') &&
|
23 | !Element_prototype.hasOwnProperty('classList') &&
|
24 | !SVGElement_prototype.hasOwnProperty('classList')) {
|
25 | Object.defineProperty(Element_prototype, 'classList', Object.getOwnPropertyDescriptor(HTMLElement_prototype, 'classList'));
|
26 | }
|
27 | //# sourceMappingURL=svg-element-class-list.js.map |
\ | No newline at end of file |