Bug 23707 - [gtk] resizing plugins does not work, because the plugin never gets informed
Summary: [gtk] resizing plugins does not work, because the plugin never gets informed
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-03 07:54 PST by Onne Gorter
Modified: 2009-05-25 08:57 PDT (History)
5 users (show)

See Also:


Attachments
plugin-resize example (624 bytes, text/html)
2009-02-03 07:55 PST, Onne Gorter
no flags Details
inform plugin of window resize (8.05 KB, patch)
2009-02-03 07:56 PST, Onne Gorter
no flags Details | Formatted Diff | Diff
inform plugin of window resize v2 (8.83 KB, patch)
2009-02-06 02:54 PST, Onne Gorter
no flags Details | Formatted Diff | Diff
resize patch v3 (9.82 KB, patch)
2009-03-02 02:39 PST, Onne Gorter
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Onne Gorter 2009-02-03 07:54:38 PST
a plugin with non-fixed sized layout, or resized using javascript, never informs the plugin of the new size.

attached is a simple html that triggers the issue
als attached is a patch that fixes it

basically copied some more code from PluginViewMac.cpp
Comment 1 Onne Gorter 2009-02-03 07:55:40 PST
Created attachment 27278 [details]
plugin-resize example
Comment 2 Onne Gorter 2009-02-03 07:56:48 PST
Created attachment 27279 [details]
inform plugin of window resize
Comment 3 Onne Gorter 2009-02-03 08:14:51 PST
(adding two cc-s from svn praise)
Comment 4 Onne Gorter 2009-02-06 02:54:17 PST
Created attachment 27385 [details]
inform plugin of window resize v2

adding manual testcase
fixed issue in scrolling plugin window off page, that should also be in original code since that is the reason the removed check was there in the first place
Comment 5 Xan Lopez 2009-03-01 04:24:10 PST
(In reply to comment #4)

Hi, there's a few style issues in your patch:

- No ChangeLog: you need to generate one using the script ot WebKitTools/Scripts/prepare-ChangeLog.

- It seems the patch does at least two more or less unrelated cleanups/fixes, maybe it would be nice to split it...

+    // sanity check
+    if (! m_plugin->pluginFuncs()->event)
+        return false;

No space between '!' and m_plugin...

 void PluginView::setNPWindowRect(const IntRect& rect)
 {
-    if (!m_isStarted || !parent())
-        return;
-
-    IntPoint p = static_cast<FrameView*>(parent())->contentsToWindow(rect.location());
-    m_npWindow.x = p.x();
-    m_npWindow.y = p.y();
-
-    m_npWindow.width = rect.width();
-    m_npWindow.height = rect.height();
-
-    m_npWindow.clipRect.left = 0;
-    m_npWindow.clipRect.top = 0;
-    m_npWindow.clipRect.right = rect.width();
-    m_npWindow.clipRect.bottom = rect.height();
+    setNPWindowIfNeeded();
+}

Since this does not use the parameter anymore you should change it to 'const IntRect&', lose the name.

-    } else if (m_isWindowed)
+    } else if (m_isWindowed) {
         setPlatformWidget(gtk_xtbin_new(m_parentFrame->view()->hostWindow()->platformWindow()->window, 0));
+    }

No braces for one-line control clauses.

If you can update it and mark it for review (select '?' in the review combobox when uploading the patch), I'll try to get someone familiar with this to have a look at it. Thanks!
Comment 6 Onne Gorter 2009-03-02 02:39:12 PST
Created attachment 28160 [details]
resize patch v3

updated style issues, added ChangeLog

Doing the NPEvents in right order is somewhat secondairy issue, but required to event the window correctly too. So still one patch.
Comment 7 Anders Carlsson 2009-03-03 08:41:37 PST
Comment on attachment 28160 [details]
resize patch v3

r=me
Comment 8 Gustavo Noronha (kov) 2009-03-03 09:27:36 PST
Landed as r41383.