Bug 132612 - "Flash of content without image" when pasting a raw image from the pasteboard
Summary: "Flash of content without image" when pasting a raw image from the pasteboard
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac All
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-05-06 09:54 PDT by Brady Eidson
Modified: 2014-05-06 13:10 PDT (History)
4 users (show)

See Also:


Attachments
Patch v1 (5.26 KB, patch)
2014-05-06 10:15 PDT, Brady Eidson
thorton: review-
thorton: commit-queue-
Details | Formatted Diff | Diff
Patch v2 - Only in the "paste a single raw image" case (5.74 KB, patch)
2014-05-06 12:02 PDT, Brady Eidson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2014-05-06 09:54:15 PDT
"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>
Comment 1 Brady Eidson 2014-05-06 10:15:13 PDT
Created attachment 230916 [details]
Patch v1
Comment 2 Tim Horton 2014-05-06 10:56:45 PDT
It would be good if alexey or someone could peek at this too.
Comment 3 Tim Horton 2014-05-06 10:57:43 PDT
r- because this affects more than just the single image case as discussed on IRC
Comment 4 Brady Eidson 2014-05-06 12:02:59 PDT
Created attachment 230922 [details]
Patch v2 - Only in the "paste a single raw image" case
Comment 5 WebKit Commit Bot 2014-05-06 13:10:30 PDT
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>
Comment 6 WebKit Commit Bot 2014-05-06 13:10:33 PDT
All reviewed patches have been landed.  Closing bug.