Bug 57179 - [Qt] PluginViewQt needs to update geometry of plugin widget before scheduling a repaint
Summary: [Qt] PluginViewQt needs to update geometry of plugin widget before scheduling...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Robert Hogan
URL: www.blognone.com
Keywords:
Depends on:
Blocks: 56130
  Show dependency treegraph
 
Reported: 2011-03-27 06:55 PDT by Robert Hogan
Modified: 2011-05-04 12:59 PDT (History)
3 users (show)

See Also:


Attachments
Patch (3.09 KB, patch)
2011-03-28 12:15 PDT, Robert Hogan
no flags Details | Formatted Diff | Diff
Patch (3.29 KB, patch)
2011-03-28 12:41 PDT, Robert Hogan
no flags Details | Formatted Diff | Diff
Patch (7.29 KB, patch)
2011-03-29 12:51 PDT, Robert Hogan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Hogan 2011-03-27 06:55:35 PDT
[Qt] Invalidate relative and absolute co-ords in PluginView
Comment 1 Robert Hogan 2011-03-28 11:00:28 PDT
http://trac.webkit.org/changeset/79397
Comment 2 Robert Hogan 2011-03-28 11:10:06 PDT
http://trac.webkit.org/changeset/79397 uses frameView->invalidateRect(m_windowRect); to dirty the appropriate region on the screen, so that QWebFrame::renderRelativeCoords() will repaint the correct location of the plugin.

This works well except when the plugin is contained in an iframe, such as at www.blognone.com. In that situation, invalidating the location of the plugin has no effect - putting some debug statements in renderRelativeCoords() shows that the plugin's rect does not even show up in the list of dirty rects in 'clip'. The result is that the plugin does not move when you scroll the page, except when the area it is contained in is about to get clipped by the viewport.

The simple solution is to just reinstate invalidate() so that we call that in addition to frameView->invalidateRect(m_windowRect);.
Comment 3 Robert Hogan 2011-03-28 12:15:11 PDT
Created attachment 87178 [details]
Patch
Comment 4 Robert Hogan 2011-03-28 12:24:43 PDT
The iframe plugin in blognone.com is:

<iframe id='a400cc05' name='a400cc05' src='http://solid.lightdynamic.com/www/delivery/afr.php?zoneid=16&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='300' height='250'><a href='http://solid.lightdynamic.com/www/delivery/ck.phpn=af511631&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://solid.lightdynamic.com/www/delivery/avw.php?zoneid=16&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=af511631' border='0' alt='' /></a></iframe>
Comment 5 Robert Hogan 2011-03-28 12:41:26 PDT
Created attachment 87181 [details]
Patch
Comment 6 Robert Hogan 2011-03-29 12:51:59 PDT
Created attachment 87397 [details]
Patch
Comment 7 Robert Hogan 2011-03-29 12:53:47 PDT
OK, all my analysis up to now was wrong: the issue r79397 was trying to solve is properly solved by the new patch. PluginViewQt was getting the plugin widget repainted before it had updated the widget's knowledge of its position on the page. As a result, QWebView got a paint event from the widget with the wrong rects for painting.
Comment 8 Andreas Kling 2011-04-08 10:54:31 PDT
Comment on attachment 87397 [details]
Patch

This might be the most sane-looking Qt plugin patch I've seen. r=me :)
Comment 9 Ademar Reis 2011-04-13 11:05:05 PDT
Blocking 2.2 (bug 56130, which fixes the problem on symbian has been added to 2.1.x, so it makes sense to fix the problem on all platforms on 2.2).
Comment 10 WebKit Commit Bot 2011-04-18 11:29:25 PDT
Comment on attachment 87397 [details]
Patch

Rejecting attachment 87397 [details] from commit-queue.

Failed to run "['./Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=cr-jail-8', 'land-a..." exit_code: 1

Last 500 characters of output:
autoinstalled/mechanize/_urllib2_fork.py", line 332, in _call_chain
    result = func(*args)
  File "/mnt/git/webkit-commit-queue/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py", line 1170, in https_open
    return self.do_open(conn_factory, req)
  File "/mnt/git/webkit-commit-queue/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py", line 1118, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 60] Operation timed out>

Full output: http://queues.webkit.org/results/8469040
Comment 11 WebKit Commit Bot 2011-04-18 14:48:59 PDT
Comment on attachment 87397 [details]
Patch

Clearing flags on attachment: 87397

Committed r84187: <http://trac.webkit.org/changeset/84187>
Comment 12 WebKit Commit Bot 2011-04-18 14:49:05 PDT
All reviewed patches have been landed.  Closing bug.