You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: The HTMLDivElement.align setter can only be used on instances of HTMLDivElement
It seems like calling Object.getPrototypeOf on a DOM element gives HTMLDivElementPrototype which has a slightly different behavior than HtmlDivElement.
Reproducible in Safari Version 10.0 (10602.1.50.0.10)
The text was updated successfully, but these errors were encountered:
btw, Object.create( Object.getPrototypeOf(document.createElement('div'))).align = 'foo' will fail in Chrome (Version 57.0.2987.133 (64-bit)) as well, although with a different error message: Uncaught TypeError: Illegal invocation.
Agree that with document nodes, cloneNode should be used.
There are more cases where Object.create(Object.getPrototypeOf(...)) fails. For example: const url = clone(new URL('http://example.com')) throws the same Uncaught TypeError: Illegal invocation in chrome and TypeError: 'set href' called on an object that does not implement interface URL. in Firefox
When copying a DOM object, following line fails:
child[i] = _clone(parent[i], depth - 1);
clone/clone.js
Line 156 in e3f252d
TypeError: The HTMLDivElement.align setter can only be used on instances of HTMLDivElement
It seems like calling
Object.getPrototypeOf
on a DOM element givesHTMLDivElementPrototype
which has a slightly different behavior thanHtmlDivElement
.Reproducible in Safari Version 10.0 (10602.1.50.0.10)
The text was updated successfully, but these errors were encountered: