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

cblu cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:10:55 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit eaaa1d9fc72fbbdba77ec9d5e32408ca79297111
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 11 00:00:54 2003 +0000

    	Fixed: <rdar://problem/3479266>: selected images don't obey CSS3 selection background-color attribute
    
            Reviewed by dave.
    
            * khtml/rendering/render_image.cpp:
            (RenderImage::selectionTintColor): new, takes style into account
            (RenderImage::paintObject): use selectionTintColor
            * khtml/rendering/render_image.h:
            * kwq/KWQPainter.h: removed selectedImageTintColor
            * kwq/KWQPainter.mm:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5448 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 3e55b3b..9a1f75b 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,16 @@
+2003-11-10  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed: <rdar://problem/3479266>: selected images don't obey CSS3 selection background-color attribute
+	
+        Reviewed by dave.
+
+        * khtml/rendering/render_image.cpp:
+        (RenderImage::selectionTintColor): new, takes style into account
+        (RenderImage::paintObject): use selectionTintColor
+        * khtml/rendering/render_image.h:
+        * kwq/KWQPainter.h: removed selectedImageTintColor
+        * kwq/KWQPainter.mm:
+
 2003-11-10  David Hyatt  <hyatt at apple.com>
 
 	Fix for 3479287, macro-ize the handling of the CSS 'inherit' value.  This patch is preparation for
diff --git a/WebCore/khtml/rendering/render_image.cpp b/WebCore/khtml/rendering/render_image.cpp
index ed7bdb9..b6f9a2e 100644
--- a/WebCore/khtml/rendering/render_image.cpp
+++ b/WebCore/khtml/rendering/render_image.cpp
@@ -193,6 +193,20 @@ void RenderImage::setPixmap( const QPixmap &p, const QRect& r, CachedImage *o)
     }
 }
 
+#if APPLE_CHANGES
+QColor RenderImage::selectionTintColor(QPainter *p) const
+{
+    QColor color;
+    RenderStyle* pseudoStyle = getPseudoStyle(RenderStyle::SELECTION);
+    if (pseudoStyle && pseudoStyle->backgroundColor().isValid()) {
+        color = pseudoStyle->backgroundColor();
+    } else {
+        color = p->selectedTextBackgroundColor();
+    }
+    return QColor(qRgba(color.red(), color.green(), color.blue(), 160));
+}
+#endif
+
 void RenderImage::paintObject(QPainter *p, int /*_x*/, int /*_y*/, int /*_w*/, int /*_h*/, int _tx, int _ty, PaintAction paintAction)
 {
     if (paintAction == PaintActionOutline && style()->outlineWidth() && style()->visibility() == VISIBLE)
@@ -349,7 +363,7 @@ void RenderImage::paintObject(QPainter *p, int /*_x*/, int /*_y*/, int /*_w*/, i
             }
 #if APPLE_CHANGES
             if (drawSelectionTint) {
-                p->fillRect(_tx + leftBorder + leftPad, _ty + topBorder + topPad, tintSize.width(), tintSize.height(), QBrush(p->selectedImageTintColor()));
+                p->fillRect(_tx + leftBorder + leftPad, _ty + topBorder + topPad, tintSize.width(), tintSize.height(), QBrush(selectionTintColor(p)));
             }
 #endif
         }
@@ -377,7 +391,7 @@ void RenderImage::paintObject(QPainter *p, int /*_x*/, int /*_y*/, int /*_w*/, i
              p->drawPixmap(offs, pix, rect);
 #if APPLE_CHANGES
              if (drawSelectionTint) {
-                 p->fillRect(offs.x() + rect.x(), offs.y() + rect.y(), rect.width(), rect.height(), QBrush(p->selectedImageTintColor()));
+                 p->fillRect(offs.x() + rect.x(), offs.y() + rect.y(), rect.width(), rect.height(), QBrush(selectionTintColor(p)));
              }
 #endif
         }
diff --git a/WebCore/khtml/rendering/render_image.h b/WebCore/khtml/rendering/render_image.h
index bf7754f..8dd3ae8 100644
--- a/WebCore/khtml/rendering/render_image.h
+++ b/WebCore/khtml/rendering/render_image.h
@@ -83,6 +83,7 @@ public:
 private:
     bool isWidthSpecified() const;
     bool isHeightSpecified() const;
+    QColor selectionTintColor(QPainter *p) const;
 
     /*
      * Pointer to the image
diff --git a/WebCore/kwq/KWQPainter.h b/WebCore/kwq/KWQPainter.h
index 595f299..14256fb 100644
--- a/WebCore/kwq/KWQPainter.h
+++ b/WebCore/kwq/KWQPainter.h
@@ -105,8 +105,6 @@ public:
     QColor selectedTextBackgroundColor() const;
     void setUsesInactiveTextBackgroundColor(bool u) { _usesInactiveTextBackgroundColor = u; }
     
-    QColor selectedImageTintColor() const;
-
     bool paintingDisabled() const;
     void setPaintingDisabled(bool);
         
diff --git a/WebCore/kwq/KWQPainter.mm b/WebCore/kwq/KWQPainter.mm
index e36514c..c711e9d 100644
--- a/WebCore/kwq/KWQPainter.mm
+++ b/WebCore/kwq/KWQPainter.mm
@@ -592,12 +592,6 @@ QColor QPainter::selectedTextBackgroundColor() const
     return QColor((int)(255 * [color redComponent]), (int)(255 * [color greenComponent]), (int)(255 * [color blueComponent]));
 }
 
-QColor QPainter::selectedImageTintColor() const
-{
-    QColor color = selectedTextBackgroundColor();
-    return QColor(qRgba(color.red(), color.green(), color.blue(), 160));
-}
-
 void QPainter::_fillRect(float x, float y, float w, float h, const QColor& col)
 {
     [col.getNSColor() set];

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list