LayoutTests:
authoradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Feb 2007 02:24:14 +0000 (02:24 +0000)
committeradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Feb 2007 02:24:14 +0000 (02:24 +0000)
        Reviewed by Hyatt.

        Test for: <rdar://problem/4963411> Items of SELECT element are incorrectly highlighted when display:block is set

        * fast/forms/select-block-background-expected.checksum: Added.
        * fast/forms/select-block-background-expected.png: Added.
        * fast/forms/select-block-background-expected.txt: Added.
        * fast/forms/select-block-background.html: Added.

WebCore:

        Reviewed by Hyatt.

        Fix for <rdar://problem/4963411> Items of SELECT element are incorrectly highlighted when display:block is set

        Test: fast/forms/select-block-background.html

        * rendering/RenderListBox.cpp: (WebCore::RenderListBox::paintObject):
          Paint the item backgrounds during the PaintPhaseChildBlockBackground or PaintPhaseChildBlockBackgrounds phase.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@19518 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/forms/select-block-background-expected.checksum [new file with mode: 0644]
LayoutTests/fast/forms/select-block-background-expected.png [new file with mode: 0644]
LayoutTests/fast/forms/select-block-background-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/select-block-background.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderListBox.cpp

index dfd4590..6798f00 100644 (file)
@@ -1,3 +1,14 @@
+2007-02-08  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Hyatt.
+
+        Test for: <rdar://problem/4963411> Items of SELECT element are incorrectly highlighted when display:block is set
+
+        * fast/forms/select-block-background-expected.checksum: Added.
+        * fast/forms/select-block-background-expected.png: Added.
+        * fast/forms/select-block-background-expected.txt: Added.
+        * fast/forms/select-block-background.html: Added.
+
 2007-02-08  Mitz Pettel  <mitz@webkit.org>
 
         Reviewed by Adele.
diff --git a/LayoutTests/fast/forms/select-block-background-expected.checksum b/LayoutTests/fast/forms/select-block-background-expected.checksum
new file mode 100644 (file)
index 0000000..0b15fcb
--- /dev/null
@@ -0,0 +1 @@
+ecfc850b2bcc5e25bc1e8310c4eb8cbd
\ No newline at end of file
diff --git a/LayoutTests/fast/forms/select-block-background-expected.png b/LayoutTests/fast/forms/select-block-background-expected.png
new file mode 100644 (file)
index 0000000..ecbbbd5
Binary files /dev/null and b/LayoutTests/fast/forms/select-block-background-expected.png differ
diff --git a/LayoutTests/fast/forms/select-block-background-expected.txt b/LayoutTests/fast/forms/select-block-background-expected.txt
new file mode 100644 (file)
index 0000000..9380ce5
--- /dev/null
@@ -0,0 +1,10 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock (anonymous) at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 539x18
+          text run at (0,0) width 539: "This tests that backgrounds for list box items draw correctly when a list box is a block"
+        RenderBR {BR} at (539,14) size 0x0
+      RenderListBox {SELECT} at (2,20) size 48x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
diff --git a/LayoutTests/fast/forms/select-block-background.html b/LayoutTests/fast/forms/select-block-background.html
new file mode 100644 (file)
index 0000000..d978938
--- /dev/null
@@ -0,0 +1,8 @@
+<html>
+    <body>
+        This tests that backgrounds for list box items draw correctly when a list box is a block<br>
+        <select style="display: block;" multiple>
+                <option selected>Item1</option>
+        </select>
+    </body>
+</html>
index b220964..5e51dcf 100644 (file)
@@ -1,3 +1,14 @@
+2007-02-08  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Hyatt.
+
+        Fix for <rdar://problem/4963411> Items of SELECT element are incorrectly highlighted when display:block is set
+
+        Test: fast/forms/select-block-background.html
+
+        * rendering/RenderListBox.cpp: (WebCore::RenderListBox::paintObject):
+          Paint the item backgrounds during the PaintPhaseChildBlockBackground or PaintPhaseChildBlockBackgrounds phase.
+
 2007-02-08  Mitz Pettel  <mitz@webkit.org>
 
         Reviewed by Adele.
index 9cb2e5c..b24c352 100644 (file)
@@ -261,7 +261,7 @@ void RenderListBox::paintObject(PaintInfo& paintInfo, int tx, int ty)
     // Paint the children.
     RenderBlock::paintObject(paintInfo, tx, ty);
 
-    if (paintInfo.phase == PaintPhaseBlockBackground) {
+    if (paintInfo.phase == PaintPhaseChildBlockBackground || paintInfo.phase == PaintPhaseChildBlockBackgrounds) {
         int index = m_indexOffset;
         while (index < listItemsSize && index <= m_indexOffset + numVisibleItems()) {
             paintItemBackground(paintInfo, tx, ty, index);