unencessary event listeners reqistered on custom elements?

93 views
Skip to first unread message

Steve Faulkner

unread,
May 8, 2014, 6:16:04 PM5/8/14
to polym...@googlegroups.com
 I have found that on non interactive polymer based custom elements, when using Firefox, a click handler is exposed via accessibility APIs. This causes assistive technology such as a screen reader to announce the custom element as clickable (when it isn't).

Would appreciate some help tracking down the cause, as it is annoying to users.

custom element example where the issue occurs: https://github.com/ThePacielloGroup/w3c-heading demo page http://thepaciellogroup.github.io/w3c-heading/




Daniel Freedman

unread,
May 8, 2014, 6:25:18 PM5/8/14
to Steve Faulkner, polymer-dev
Hi Steve,

Alice and Addy alerted me to this the other day, and I'm going to carve out some time to work on this, probably tomorrow.


Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/d32ad8ac-6a0d-41aa-baeb-492d04e7ed87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Steve Faulkner

unread,
May 9, 2014, 1:46:55 AM5/9/14
to polym...@googlegroups.com, Steve Faulkner


On Thursday, 8 May 2014 23:25:18 UTC+1, Daniel Freedman wrote:
Hi Steve,

Alice and Addy alerted me to this the other day, and I'm going to carve out some time to work on this, probably tomorrow.

great! thank you.

Daniel Freedman

unread,
May 9, 2014, 2:26:57 PM5/9/14
to Steve Faulkner, polymer-dev, Alice Boxhall, Addy Osmani

It looks like any element with a mousedown handler is treated as a clickable element in firefox: http://jsbin.com/vegan/1/quiet

The example only has a div and mousedown handler, no bits of Polymer anywhere.

The Polymer gesture library adds mouse listeners so it doesn't have to wrap addEventListener and keep track of interested elements. However, it does not add a click event listener, and it seems odd to me that only Firefox adds the click default action for this strategy. Chrome and IE both give an accDefaultAction of none.

Alice, Addy, this seems like a FF bug to me. Can one of you reach out to their a11y team to figure out why they made this heuristic?

Daniel Freedman

unread,
May 9, 2014, 2:27:40 PM5/9/14
to Steve Faulkner, Addy Osmani, polymer-dev, Alice Boxhall

Steve Faulkner

unread,
May 10, 2014, 4:54:09 AM5/10/14
to polym...@googlegroups.com, Steve Faulkner, Alice Boxhall, Addy Osmani
I have emailed [1] Marco, Dave and Alex from the Moz acc team to see if they can help. Marco is already aware of the issue.

[1] http://lists.w3.org/Archives/Public/www-archive/2014May/0003.html

Daniel Freedman

unread,
May 10, 2014, 1:34:58 PM5/10/14
to Steve Faulkner, polymer-dev, Alice Boxhall, Addy Osmani
I made a reply to that thread.

In essence, an interaction between the ShadowDOM Polyfill is and Polymer's gesture system is causing the mouse handlers to be set. The gesture system is a bit naive in that it spams all ShadowRoots with mouse handlers to recognize gestures, and the ShadowDOM Polyfill has to put those handlers on the host element and do some event path fixups.

The solution is to keep track of what elements are interested in gesture events, and only set up listeners on those elements. I'll have to do a bit of work to implement this, and add some hooks into Polymer elements, but hopefully that will result in at least limiting the "clickable" action to elements that are interactive.
Perhaps that is not even far from wrong in that case.

Thoughts?


Steve Faulkner

unread,
May 10, 2014, 2:11:04 PM5/10/14
to Daniel Freedman, polymer-dev, Alice Boxhall, Addy Osmani
I made a reply to that thread.

thanks, it would be great to be able at least flag non interactive elements in some way so that event listeners are not assigned, if other methods to achieve the desired outcome are not practical/possible.

--

Regards

SteveF
HTML 5.1
Reply all
Reply to author
Forward
0 new messages