[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

hyatt hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:04:15 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 1796882165cab0ca8c318debf4428e75611c8845
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 22 22:36:27 2003 +0000

    	Fix visibility to be done when widgets are added or when styles are set rather than at paint time.  Fixes
    	the ads painting on top of content at tvguide.com.
    
            Reviewed by cblu
    
            * khtml/rendering/render_replaced.cpp:
            (RenderWidget::setQWidget):
            (RenderWidget::setStyle):
            (RenderWidget::paintObject):
            * kwq/KWQWidget.h:
            * kwq/KWQWidget.mm:
            (QWidget::QWidget):
            (QWidget::show):
            (QWidget::hide):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5240 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index de85d86..881c0af 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,20 @@
+2003-10-22  David Hyatt  <hyatt at apple.com>
+
+	Fix visibility to be done when widgets are added or when styles are set rather than at paint time.  Fixes
+	the ads painting on top of content at tvguide.com.
+	
+        Reviewed by cblu
+
+        * khtml/rendering/render_replaced.cpp:
+        (RenderWidget::setQWidget):
+        (RenderWidget::setStyle):
+        (RenderWidget::paintObject):
+        * kwq/KWQWidget.h:
+        * kwq/KWQWidget.mm:
+        (QWidget::QWidget):
+        (QWidget::show):
+        (QWidget::hide):
+
 2003-10-21  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Dave.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index de85d86..881c0af 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,20 @@
+2003-10-22  David Hyatt  <hyatt at apple.com>
+
+	Fix visibility to be done when widgets are added or when styles are set rather than at paint time.  Fixes
+	the ads painting on top of content at tvguide.com.
+	
+        Reviewed by cblu
+
+        * khtml/rendering/render_replaced.cpp:
+        (RenderWidget::setQWidget):
+        (RenderWidget::setStyle):
+        (RenderWidget::paintObject):
+        * kwq/KWQWidget.h:
+        * kwq/KWQWidget.mm:
+        (QWidget::QWidget):
+        (QWidget::show):
+        (QWidget::hide):
+
 2003-10-21  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Dave.
diff --git a/WebCore/khtml/rendering/render_replaced.cpp b/WebCore/khtml/rendering/render_replaced.cpp
index b4b9f82..ad60e66 100644
--- a/WebCore/khtml/rendering/render_replaced.cpp
+++ b/WebCore/khtml/rendering/render_replaced.cpp
@@ -199,6 +199,15 @@ void RenderWidget::setQWidget(QWidget *widget, bool deleteWidget)
             }
             else
                 setPos(xPos(), -500000);
+
+#if APPLE_CHANGES
+	    if (style()) {
+	        if (style()->visibility() != VISIBLE)
+                    m_widget->hide();
+		else
+		    m_widget->show();
+	    }
+#endif
         }
 	m_view->addChild( m_widget, -500000, 0 );
     }
@@ -239,21 +248,34 @@ void RenderWidget::slotWidgetDestructed()
 void RenderWidget::setStyle(RenderStyle *_style)
 {
     RenderReplaced::setStyle(_style);
-    if(m_widget)
+    if (m_widget)
     {
         m_widget->setFont(style()->font());
-        if (style()->visibility() != VISIBLE) {
+        if (style()->visibility() != VISIBLE)
             m_widget->hide();
-        }
+#if APPLE_CHANGES
+        else
+            m_widget->show();
+#endif
     }
 }
 
 void RenderWidget::paintObject(QPainter *p, int x, int y, int width, int height, int _tx, int _ty,
                                PaintAction paintAction)
 {
-    if (!m_widget || !m_view || paintAction != PaintActionForeground)
+#if APPLE_CHANGES
+    if (!m_widget || !m_view || paintAction != PaintActionForeground ||
+        style()->visibility() != VISIBLE)
         return;
 
+    // Tell the widget to paint now.  This is the only time the widget is allowed
+    // to paint itself.  That way it will composite properly with z-indexed layers.
+    m_widget->paint(p, QRect(x, y, width, height));
+    
+#else
+    if (!m_widget || !m_view || paintAction != PaintActionForeground)
+        return;
+    
     if (style()->visibility() != VISIBLE) {
         m_widget->hide();
         return;
@@ -262,7 +284,6 @@ void RenderWidget::paintObject(QPainter *p, int x, int y, int width, int height,
     int xPos = _tx+borderLeft()+paddingLeft();
     int yPos = _ty+borderTop()+paddingTop();
 
-#if !APPLE_CHANGES
     int childw = m_widget->width();
     int childh = m_widget->height();
     if ( (childw == 2000 || childh == 3072) && m_widget->inherits( "KHTMLView" ) ) {
@@ -296,15 +317,9 @@ void RenderWidget::paintObject(QPainter *p, int x, int y, int width, int height,
 	xPos = xNew;
 	yPos = yNew;
     }
-#endif
 
     m_view->addChild(m_widget, xPos, yPos );
     m_widget->show();
-    
-#if APPLE_CHANGES
-    // Tell the widget to paint now.  This is the only time the widget is allowed
-    // to paint itself.  That way it will composite properly with z-indexed layers.
-    m_widget->paint(p, QRect(x, y, width, height));
 #endif
 }
 
diff --git a/WebCore/kwq/KWQWidget.h b/WebCore/kwq/KWQWidget.h
index 08d9fe1..48c9cf2 100644
--- a/WebCore/kwq/KWQWidget.h
+++ b/WebCore/kwq/KWQWidget.h
@@ -126,8 +126,8 @@ public:
     bool focusNextPrevChild(bool);
     bool hasMouseTracking() const;
 
-    void show() { }
-    void hide() { }
+    void show();
+    void hide();
 
     void showEvent(QShowEvent *) { }
     void hideEvent(QHideEvent *) { }
diff --git a/WebCore/kwq/KWQWidget.mm b/WebCore/kwq/KWQWidget.mm
index 54a3c4d..1ddf95a 100644
--- a/WebCore/kwq/KWQWidget.mm
+++ b/WebCore/kwq/KWQWidget.mm
@@ -53,6 +53,7 @@ public:
     QFont font;
     QPalette pal;
     NSView *view;
+    bool visible;
 };
 
 QWidget::QWidget() 
@@ -66,6 +67,8 @@ QWidget::QWidget()
 
     static QStyle defaultStyle;
     data->style = &defaultStyle;
+
+    data->visible = true;
 }
 
 QWidget::QWidget(NSView *view)
@@ -75,6 +78,7 @@ QWidget::QWidget(NSView *view)
 
     static QStyle defaultStyle;
     data->style = &defaultStyle;
+    data->visible = true;
 }
 
 QWidget::~QWidget() 
@@ -401,6 +405,30 @@ bool QWidget::hasMouseTracking() const
     return true;
 }
 
+void QWidget::show()
+{
+    if (!data || data->visible)
+        return;
+
+    data->visible = true;
+
+    KWQ_BLOCK_NS_EXCEPTIONS;
+    [getOuterView() setHidden: NO];
+    KWQ_UNBLOCK_NS_EXCEPTIONS;
+}
+
+void QWidget::hide()
+{
+    if (!data || !data->visible)
+        return;
+
+    data->visible = false;
+
+    KWQ_BLOCK_NS_EXCEPTIONS;
+    [getOuterView() setHidden: YES];
+    KWQ_UNBLOCK_NS_EXCEPTIONS;
+}
+
 void QWidget::setFrameGeometry(const QRect &rect)
 {
     KWQ_BLOCK_NS_EXCEPTIONS;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list