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.
Support data-onerror attribute on data-picture
Modified readme.md to document data-onerror
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...
Renamed data-onerror to onerror
@scottjehl True, it's much more intuitive. Doesn't bubble though unfortunately -- it needs to be on the generated img. Made an update.
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?
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.