Polymer/ShadowDOM — pull request #484 by atotic (2014-08-04 07:19:41+00:00)
Title: unwrap(FormData) fails on Firefox

unwrap(FormData) did not unwrap on Firefox. Traced it down to failure of isWrapper function. One line fix above.
I needed to unwrap FormData to pass it to xhr.send()

This fixes one case only. Looking at wrappers, looks like all of these are wrapped on FF, and only a small subset is valid in 'isWrapper'. This might be a bigger fix. I am not familiar with your internals, but it looks like isWrapper could be implemented as:
if ('impl' in object)
testing instanceof walks prototype chain, and doing instanceof for all the wrappers below would be very slow.

wrappers in Firefox:

Audio
BeforeUnloadEvent
CanvasRenderingContext2D
CharacterData
Comment
CustomEvent
DOMImplementation
DOMTokenList
Document
DocumentFragment
Element
Event
EventTarget
FocusEvent
FormData
HTMLAudioElement
HTMLButtonElement
HTMLCanvasElement
HTMLCollection
HTMLContentElement
HTMLElement
HTMLFieldSetElement
HTMLFormElement
HTMLImageElement
HTMLInputElement
HTMLLabelElement
HTMLLegendElement
HTMLMediaElement
HTMLObjectElement
HTMLOptionElement
HTMLOutputElement
HTMLSelectElement
HTMLShadowElement
HTMLTableElement
HTMLTableRowElement
HTMLTableSectionElement
HTMLTemplateElement
HTMLTextAreaElement
HTMLUnknownElement
Image
MouseEvent
MutationObserver
Node
NodeList
Option
Range
SVGElement
SVGUseElement
Selection
ShadowRoot
Text
UIEvent
WebGLRenderingContext
Window