"Flash of content without image" when pasting a raw image from the pasteboard The sequence of events goes like this: -EditorMac has an ArchiveResource for the raw image and puts it in the document loader. -Editor inserts the new document fragment with the <img> element for the raw image -CachedResourceLoader is asked for the CachedImage for the new image -Because a CachedImage doesn't exist yet, a "substitute resource delivery" is scheduled, where the ArchiveResource will be loaded after a zero-delay -But before it is loaded, a layout and paint happens with the image resource missing, causing a radical change in layout and a "flash of content without image" that is quite noticeable. I have a simple patch which lets certain flagged ArchiveResources load into a CachedResource synchronously. It's a little deficient in that the load does not go through ResourceLoader and therefore doesn't get load callbacks. In this case (pasting a raw image from the pasteboard that has a webkit-fake-url: url) the tradeoff seems fine... but going forward we really need a better solution for this type of problem. <rdar://problem/16826199>
Created attachment 230916 [details] Patch v1
It would be good if alexey or someone could peek at this too.
r- because this affects more than just the single image case as discussed on IRC
Created attachment 230922 [details] Patch v2 - Only in the "paste a single raw image" case
Comment on attachment 230922 [details] Patch v2 - Only in the "paste a single raw image" case Clearing flags on attachment: 230922 Committed r168376: <http://trac.webkit.org/changeset/168376>
All reviewed patches have been landed. Closing bug.