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
I seem unable to simply instantiate an Event and dispatch it. Firefox throws an "Assertion Failed" error. This works fine in Chrome however (where I assume the ShadowDOM Polyfill is an effective no-op as Chrome already implements Shadow DOM).
Detail
I have polymer loaded, but I'm trying to manually instantiate a MouseEvent, and dispatch it to a regular DOM element - not involving Polymer. Because dispatchEvent and all of the event constructors have been overwritten, it goes through Polymer code.
document.createEvent('MouseEvent') creates me a GenericEvent from the ShadowDOM (see ShadowDOM events.js:L508-533. The problem seems to be dispatching the event, where an assertion fails in unwrap. The stack looks something like:
The conclusion of this is that the GenericEvent function does not return instances of the wrappers.* constructors - although I am sure the issue is more nuanced.
The text was updated successfully, but these errors were encountered:
Sorry - the document.body element is actually a red herring in this case. The element I was dispatching the event on was hanging off of my custom elements $ property - but I can't seem to reproduce now. I'll re-open if I can
Abstract
I seem unable to simply instantiate an Event and dispatch it. Firefox throws an "Assertion Failed" error. This works fine in Chrome however (where I assume the ShadowDOM Polyfill is an effective no-op as Chrome already implements Shadow DOM).
Detail
I have polymer loaded, but I'm trying to manually instantiate a MouseEvent, and dispatch it to a regular DOM element - not involving Polymer. Because dispatchEvent and all of the event constructors have been overwritten, it goes through Polymer code.
I have a reduced test case available here.
document.createEvent('MouseEvent') creates me a GenericEvent from the ShadowDOM (see ShadowDOM events.js:L508-533. The problem seems to be dispatching the event, where an assertion fails in unwrap. The stack looks something like:
throw new Error('Assertion failed');
(ShadowDOM wrapper.js:L33)assert()
) (ShadowDOM wrapper.js:L31-34)isWrapper(event)
(ShadowDOM wrapper.js:L326)isWrapper()
) (ShadowDOM wrapper.js:L279-287)unwrap()
) (ShadowDOM wrapper.js:L323-328)unwrap(event)
(ShadowDOM:L763)dispatchEvent(event)
) (ShadowDOM:L752-788).The conclusion of this is that the GenericEvent function does not return instances of the wrappers.* constructors - although I am sure the issue is more nuanced.
The text was updated successfully, but these errors were encountered: