googlearchive / polymer-gestures

84 stars 27 forks source link

All Polymer elements in Firefox announce as "clickable" with ShadowDOM Polyfill #4

Closed dfreedm closed 10 years ago

dfreedm commented 10 years ago

Imported from a polymer-dev thread

Oh boy, a three pronged assault!

  1. Polymer calls PolymerGestures.register(element.shadowRoot) for each Polymer element instance to attach gesture event handlers in the ShadowRoot to use target information that would be lost when the event bubbles out of the ShadowRoot.
  2. Under the ShadowDOM Polyfill, these listeners are attached to the host element, and emulate coming from a phantom ShadowRoot.
  3. Firefox treats a mousedown or mouseup handler as an intent to make an element "clickable" and sets the accDefaultAction to "clickable", which is announced for every element in a screen reader environment.

The quick fix should be to disable the "attach event listeners" code path in ShadowDOM Polyfill.

A longer-term solution would be to use the event.path information, if they spec ever changes to not hide information when bubbling past ShadowRoots.

dfreedm commented 10 years ago

cc @stevefaulkner @alice

stevefaulkner commented 10 years ago

thanks!