The test attached to https://bugs.webkit.org/show_bug.cgi?id=54685 relies on 'load' and 'error' events being fired when a poster loads or fails to load. As per the spec a <video> element should not fire any events for poster loading or failing, WebKit does so as a side effect of using HTMLImageLoader to load the poster.
Created attachment 83418 [details] proposed patch
<rdar://problem/9039962>
Comment on attachment 83418 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=83418&action=review > Source/WebCore/html/HTMLImageLoader.cpp:54 > + // HTMLVideoElement uses this class to load the poster image, but it should not fire events for loading or failure. > + if (element()->hasTagName(HTMLNames::videoTag)) > + return; Should it just use a subclass of this class? dispatchLoadEvent can't be too hot, so making it virtual should be easy.
I'm not sure what the correct design here. I'm not sure it makes sense to bake this knowledge into HTMLImageLoader, but I also don't think it's that bad either.
http://trac.webkit.org/changeset/79718