Added onerror support #59

Closed
wants to merge 3 commits into
from

Projects

None yet

2 participants

@keithchu

It's a pain to diagnose broken images without an onerror state. So added the data-onerror attribute to [data-picture]. It just passes an onerror function to picImg.

@scottjehl
Owner

Hmm. Good idea but maybe it'd be cleaner to make sure one can bind an onerror listener to the data-picture element itself, without using attributes? if the onerror event doesn't bubble already, maybe that's the part to fix here...

@keithchu

@scottjehl True, it's much more intuitive. Doesn't bubble though unfortunately -- it needs to be on the generated img. Made an update.

@scottjehl
Owner

Hey Keith,
If this one is still needed, it might work best to trigger a custom event on the image or data-picture element and let it bubble up. Thoughts?

@scottjehl
Owner

Okay, the new standardized markup approach will include an img element in the source, and picture merely controls its src selection. So.. onerror support should naturally come with that img without us having to add anything to support it. If the spec changes to offer events on the picture element itself, we can reopen this one. Thanks again.

@scottjehl scottjehl closed this Apr 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment