Bug 37769 - [Gtk] Flash item placed on wrong location right after load
Summary: [Gtk] Flash item placed on wrong location right after load
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL: http://www.demorgen.be
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2010-04-18 02:15 PDT by Frederik Himpe
Modified: 2011-02-23 15:07 PST (History)
3 users (show)

See Also:


Attachments
Patch (6.58 KB, patch)
2011-02-23 13:42 PST, Martin Robinson
no flags Details | Formatted Diff | Diff
Patch with a manual-test (7.76 KB, patch)
2011-02-23 14:22 PST, Martin Robinson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frederik Himpe 2010-04-18 02:15:10 PDT
Visit http://www.demorgen using Epiphany or Midori with webkitgtk 1.2.0. After load, a Flash item will be placed on top of the page. when scrolling, the element is moved to the correct place neare the bottom of the page. It should have been on this location automatically from the beginning.
Comment 1 Frederik Himpe 2010-04-18 02:15:52 PDT
URL should be http://www.demorgen.be
Comment 2 Nicolas Dufresne 2010-12-10 11:56:23 PST
So far on current trunk I get an assertion (ASSERTION FAILED: m_state == ParsingState). Might be related, I'll comment it out, so see how far I'll get.
Comment 3 Nicolas Dufresne 2010-12-10 12:11:24 PST
I've commented that assertion and bug cannot be reproduced on latest trunk. Will file another bug for this assertion with proper information.
Comment 4 Martin Robinson 2011-02-23 12:56:23 PST
The issue here seems to be http://trac.webkit.org/changeset/55238. Flash content is somehow getting an incorrect allocation when the plugin is added. Possibly the frameRect and the m_windowRect have diverged at this point.

Here is a page that reproduces the original Java issue: http://download.oracle.com/javase/tutorial/deployment/applet/getStarted.html

Removing the work around results in the Java applet not rendering until a scroll, focus change or resize.
Comment 5 Martin Robinson 2011-02-23 13:42:15 PST
Created attachment 83539 [details]
Patch
Comment 6 Xan Lopez 2011-02-23 13:57:20 PST
Comment on attachment 83539 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=83539&action=review

Since the patch seems to clearly improve some broken cases I guess we can go for it, but honestly we should either improve our tests or stop messing with this code.

> Source/WebCore/plugins/gtk/PluginViewGtk.cpp:534
> +        *(m_delayedAllocation.get()) = allocation;

Can't we just store a 'GtkAllocation' in the struct and copy the values? Seems more straightforward.
Comment 7 Martin Robinson 2011-02-23 14:22:56 PST
Created attachment 83551 [details]
Patch with a manual-test
Comment 8 Martin Robinson 2011-02-23 14:23:27 PST
I've managed to make a manual-test for this issue. It seems that it only appears when the Flash content is in an iframe. Uploaded a new patch.
Comment 9 Xan Lopez 2011-02-23 14:31:11 PST
Comment on attachment 83551 [details]
Patch with a manual-test

View in context: https://bugs.webkit.org/attachment.cgi?id=83551&action=review

Thank you for making a test!

> Source/WebCore/plugins/gtk/PluginViewGtk.cpp:534
> +        *(m_delayedAllocation.get()) = allocation;

g_memdup?
Comment 10 Martin Robinson 2011-02-23 15:07:16 PST
Committed r79495: <http://trac.webkit.org/changeset/79495>
Comment 11 Martin Robinson 2011-02-23 15:07:41 PST
Comment on attachment 83551 [details]
Patch with a manual-test

Thanks for the review! Landed with the g_memdup change.