[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

zecke at webkit.org zecke at webkit.org
Wed Apr 7 23:57:47 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit ce8bed67ecb81ef9b322d44219d0b6e9b06794f8
Author: zecke at webkit.org <zecke at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Nov 26 10:31:31 2009 +0000

    [Qt] Call Widget::setSelfVisible from hide/show
    
    https://bugs.webkit.org/show_bug.cgi?id=31203
    
    Call Widget::setSelfVisible from Widget::show and
    Widget::hide and use isParentVisible to decide
    if the widget should be shown. This way client
    code can rely on isVisible.
    
    Change PluginViewQt::show, PluginViewQt::hide to
    call the base class as it is doing the right thing
    now. Add an assert verify that platfomWidget and
    platformPluginWidget are the same.
    
    * manual-tests/qt/qtplugin.html: Modify manual test
    * platform/qt/WidgetQt.cpp:
    (WebCore::Widget::show):
    (WebCore::Widget::hide):
    
    [Qt] Do not show the QWidget when the WebCore::Widget is hidden
    
    https://bugs.webkit.org/show_bug.cgi?id=31203
    
    The clipping code was making a QWidget visible even if the
    WebCore::Widget was hidden. Fix the bug by calling setVisible
    only if the WebCore::Widget Widget::isSelfVisible.
    
    * WebCoreSupport/FrameLoaderClientQt.cpp:
    (WebCore::QtPluginWidget::show): Override WebCore::Widget::show to call handleVisibility
    (WebCore::QtPluginWidget::handleVisibility): New method to call setVisible when we are visible
    (FrameLoaderClientQt::createPlugin): Hide the QWidget by default
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51409 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 120f288..60e0fdb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,28 @@
+2009-11-17  Holger Hans Peter Freyther  <zecke at selfish.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Call Widget::setSelfVisible from hide/show
+        https://bugs.webkit.org/show_bug.cgi?id=31203
+
+        Call Widget::setSelfVisible from Widget::show and
+        Widget::hide and use isParentVisible to decide
+        if the widget should be shown. This way client
+        code can rely on isVisible.
+
+        Change PluginViewQt::show, PluginViewQt::hide to
+        call the base class as it is doing the right thing
+        now. Add an assert verify that platfomWidget and
+        platformPluginWidget are the same.
+
+        * manual-tests/qt/qtplugin.html: Modify manual test
+        * platform/qt/WidgetQt.cpp:
+        (WebCore::Widget::show):
+        (WebCore::Widget::hide):
+        * plugins/qt/PluginViewQt.cpp:
+        (WebCore::PluginView::show):
+        (WebCore::PluginView::hide):
+
 2009-11-24  Holger Hans Peter Freyther  <zecke at selfish.org>
 
         Reviewed by Alexey Proskuryakov.
diff --git a/WebCore/manual-tests/qt/qtplugin.html b/WebCore/manual-tests/qt/qtplugin.html
index b2dbf3c..631ce63 100644
--- a/WebCore/manual-tests/qt/qtplugin.html
+++ b/WebCore/manual-tests/qt/qtplugin.html
@@ -1,14 +1,24 @@
 <html>
 <body>
 Image:<br/>
- <img src="http://labs.trolltech.com/skins/trolltech_labs/categories/internet.png" width="80" height="80"/>
+ <img src="qrc:/webkit/inspector/Images/largerResourcesButtonGlyph.png" width="80" height="80"/>
  <br/>
+
+<!-- visible progressbar -->
+<div>
 QT progress bar:
-<br/>
-<object type="application/x-qt-plugin" classid="QProgressBar" name="progressbar" height=30></object>
+<object type="application/x-qt-plugin" classid="QProgressBar" name="progressbar1" height=30></object>
+</div>
+
+<!-- should not be visible -->
+<div style="visibility: hidden;">
+You should not see this:
+<object type="application/x-qt-plugin" classid="QProgressBar" name="progressbar2" height=30></object>
+</div>
+
 <script>
 function display(){
- if (++document.progressbar.value != 100)
+ if (++document.progressbar1.value != 100)
 setTimeout("display()", 50)
 }
 display();
diff --git a/WebCore/platform/qt/WidgetQt.cpp b/WebCore/platform/qt/WidgetQt.cpp
index e9c99a4..252bdb4 100644
--- a/WebCore/platform/qt/WidgetQt.cpp
+++ b/WebCore/platform/qt/WidgetQt.cpp
@@ -91,13 +91,17 @@ void Widget::setCursor(const Cursor& cursor)
 
 void Widget::show()
 {
-    if (platformWidget())
+    setSelfVisible(true);
+
+    if (isParentVisible() && platformWidget())
         platformWidget()->show();
 }
 
 void Widget::hide()
 {
-    if (platformWidget())
+    setSelfVisible(false);
+
+    if (isParentVisible() && platformWidget())
         platformWidget()->hide();
 }
 
diff --git a/WebCore/plugins/qt/PluginViewQt.cpp b/WebCore/plugins/qt/PluginViewQt.cpp
index e61736b..063a7e5 100644
--- a/WebCore/plugins/qt/PluginViewQt.cpp
+++ b/WebCore/plugins/qt/PluginViewQt.cpp
@@ -138,26 +138,14 @@ void PluginView::setFocus()
 
 void PluginView::show()
 {
-    setSelfVisible(true);
-
-    if (isParentVisible() && platformPluginWidget())
-        platformPluginWidget()->setVisible(true);
-
-    // do not call parent impl. here as it will set the platformWidget
-    // (same as platformPluginWidget in the Qt port) to visible, even
-    // when parent isn't visible.
+    Q_ASSERT(platformPluginWidget() == platformWidget());
+    Widget::show();
 }
 
 void PluginView::hide()
 {
-    setSelfVisible(false);
-
-    if (isParentVisible() && platformPluginWidget())
-        platformPluginWidget()->setVisible(false);
-
-    // do not call parent impl. here as it will set the platformWidget
-    // (same as platformPluginWidget in the Qt port) to invisible, even
-    // when parent isn't visible.
+    Q_ASSERT(platformPluginWidget() == platformWidget());
+    Widget::hide();
 }
 
 void PluginView::paint(GraphicsContext* context, const IntRect& rect)
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index ad423e8..debce3d 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,19 @@
+2009-11-12  Holger Hans Peter Freyther  <zecke at selfish.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Do not show the QWidget when the WebCore::Widget is hidden
+        https://bugs.webkit.org/show_bug.cgi?id=31203
+
+        The clipping code was making a QWidget visible even if the
+        WebCore::Widget was hidden. Fix the bug by calling setVisible
+        only if the WebCore::Widget Widget::isSelfVisible.
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::QtPluginWidget::show): Override WebCore::Widget::show to call handleVisibility
+        (WebCore::QtPluginWidget::handleVisibility): New method to call setVisible when we are visible
+        (FrameLoaderClientQt::createPlugin): Hide the QWidget by default
+
 2009-11-23  David Boddie  <dboddie at trolltech.com>
 
         Reviewed by Simon Hausmann.
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 63b830c..94fafd1 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2006 Zack Rusin <zack at kde.org>
  * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
  * Copyright (C) 2008 Collabora Ltd. All rights reserved.
  * Coypright (C) 2008 Holger Hans Peter Freyther
  *
@@ -1107,9 +1107,25 @@ public:
         QRegion clipRegion = QRegion(clipRect);
         platformWidget()->setMask(clipRegion);
 
+        handleVisibility();
+    }
+
+    virtual void show()
+    {
+        Widget::show();
+        handleVisibility();
+    }
+
+private:
+    void handleVisibility()
+    {
+        if (!isVisible())
+            return;
+
         // if setMask is set with an empty QRegion, no clipping will
         // be performed, so in that case we hide the platformWidget
-        platformWidget()->setVisible(!clipRegion.isEmpty());
+        QRegion mask = platformWidget()->mask();
+        platformWidget()->setVisible(!mask.isEmpty());
     }
 };
 
@@ -1224,6 +1240,7 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
                     parentWidget = qobject_cast<QWidget*>(m_webFrame->page()->d->client->pluginParent());
                 if (parentWidget) // don't reparent to nothing (i.e. keep whatever parent QWebPage::createPlugin() chose.
                     widget->setParent(parentWidget);
+                widget->hide();
                 RefPtr<QtPluginWidget> w = adoptRef(new QtPluginWidget());
                 w->setPlatformWidget(widget);
                 // Make sure it's invisible until properly placed into the layout

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list