RESOLVED FIXED 110811
Draw intermediate snapshots if possible
https://bugs.webkit.org/show_bug.cgi?id=110811
Summary Draw intermediate snapshots if possible
Dean Jackson
Reported 2013-02-25 15:11:28 PST
After http://webkit.org/b/110495 we delayed snapshotting until we've received a nice image, but this makes the page look like it is broken. We should draw any intermediate snapshots that we find, such as progress bars. This is actually a regression on previous behaviour (say from about r139000)
Attachments
Patch (6.81 KB, patch)
2013-02-25 18:18 PST, Dean Jackson
no flags
Patch (7.97 KB, patch)
2013-02-25 18:23 PST, Dean Jackson
no flags
Patch (14.31 KB, patch)
2013-02-25 19:16 PST, Dean Jackson
no flags
Patch (14.32 KB, patch)
2013-02-25 19:39 PST, Dean Jackson
no flags
Patch (14.52 KB, patch)
2013-02-25 19:42 PST, Dean Jackson
simon.fraser: review+
Dean Jackson
Comment 1 2013-02-25 15:12:12 PST
Radar WebKit Bug Importer
Comment 2 2013-02-25 15:12:57 PST
Dean Jackson
Comment 3 2013-02-25 18:18:04 PST
Dean Jackson
Comment 4 2013-02-25 18:23:34 PST
Simon Fraser (smfr)
Comment 5 2013-02-25 18:27:50 PST
Comment on attachment 190176 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=190176&action=review > Source/WebCore/html/HTMLPlugInImageElement.h:69 > + Image* snapshotImage() { return m_snapshotImage.get(); } Can this be const? > Source/WebCore/rendering/RenderEmbeddedObject.cpp:176 > + if (element && element->isPluginElement()) { > + HTMLPlugInImageElement* plugInImageElement = static_cast<HTMLPlugInImageElement*>(element); This cast looks unsafe; you're only testing isPluginElement(), not if it's a HTMLPlugInImageElement. Or are the names confusing? I also think this should be one of those SECURITY_ASSERT-checked casts. > Source/WebCore/rendering/RenderEmbeddedObject.cpp:180 > + if (paintInfo.phase == PaintPhaseForeground) You should bail earlier with this check, since it's cheap.
Dean Jackson
Comment 6 2013-02-25 19:16:34 PST
Dean Jackson
Comment 7 2013-02-25 19:26:48 PST
New patch addresses all of Simon's comments. Main change is that paintContents is called from the typical painting path in RenderWidget, but overridden sometimes by RenderEmbeddedObject.
Jon Lee
Comment 8 2013-02-25 19:31:05 PST
Comment on attachment 190182 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=190182&action=review > Source/WebCore/ChangeLog:25 > + that in RenderSnapshottedPlugIn. I think it would be useful to also mention that if we are not snapshotting we fall back to the default widget painting code, although we should not reach it since we swap renderers. > Source/WebCore/ChangeLog:34 > + of paint() that can be overridden by RenderEmbeddedObject. Mentioning that this was just moved out of paint() would be useful, since in the snapshotting case we don't want to provide the widget an opportunity to paint. > Source/WebCore/html/HTMLPlugInElement.h:77 > + virtual bool isPlugInImageElement() { return false; } const please! > Source/WebCore/html/HTMLPlugInImageElement.h:69 > + Image* snapshotImage() const { return m_snapshotImage.get(); } const Image* would be better. > Source/WebCore/html/HTMLPlugInImageElement.h:115 > + virtual bool isPlugInImageElement() OVERRIDE { return true; } ... and const here.
Dean Jackson
Comment 9 2013-02-25 19:39:00 PST
Dean Jackson
Comment 10 2013-02-25 19:42:01 PST
Jon Lee
Comment 11 2013-02-25 19:46:11 PST
Comment on attachment 190186 [details] Patch Looks good. Unofficial r=me.
Simon Fraser (smfr)
Comment 12 2013-02-25 21:36:04 PST
Comment on attachment 190186 [details] Patch I'm wondering why overriding paintReplaced() isn't more appropriate.
Simon Fraser (smfr)
Comment 13 2013-02-25 21:46:35 PST
Comment on attachment 190186 [details] Patch OK I guess paintReplaced() is never called for RenderWidget subclasses since RenderWidget has its own paint().
Dean Jackson
Comment 14 2013-02-26 09:18:49 PST
Note You need to log in before you can comment on or make changes to this bug.