[Webkit-unassigned] [Bug 74193] typeof Node should be function
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sat Apr 9 22:18:11 PDT 2016
https://bugs.webkit.org/show_bug.cgi?id=74193
Joe Pea <joe at trusktr.io> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |joe at trusktr.io
--- Comment #3 from Joe Pea <joe at trusktr.io> ---
Can you guys please fix this? The reason for following the spec in such a way doesn't outweight the benefit of being able extend from HTMLElement, especially when using the new Custom Element API.
After applying a `document.registerElement` polyfill in Safari, this is what we have to do in order to make a Custom Element that extends from HTMLElement using ES6 classes:
```js
import 'document-register-element' // polyfill
// hack for Safari.
if (typeof window.HTMLElement != 'function') {
const _HTMLElement = function HTMLElement(){}
_HTMLElement.prototype = window.HTMLElement.prototype
window.HTMLElement = _HTMLElement
}
class MyElement extends window.HTMLElement {
createdCallback() { ... }
attachedCallback() { ... }
detachedCallback() { ... }
attributeChangedCallback(attribute, oldValue, newValue) { ... }
}
MyElement = document.registerElement('motor-node', MyElement)
export default MyElement
```
I think it's time to fix this and get Custom Elements working, and in general to be compatible with ES6 classes.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160410/0deaa393/attachment.html>
More information about the webkit-unassigned
mailing list