2007-03-06 Mitz Pettel <mitz@webkit.org>
authorbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Mar 2007 03:40:57 +0000 (03:40 +0000)
committerbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Mar 2007 03:40:57 +0000 (03:40 +0000)
        Reviewed by Adele.

        - fix http://bugs.webkit.org/show_bug.cgi?id=12986
          REGRESSION(NativeListBox): Listboxes not updated when resized dynamically

        Test: fast/forms/select-change-listbox-size.html

        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::parseMappedAttribute): Reattach on list box size change.

2007-03-06  Mitz Pettel  <mitz@webkit.org>

        Reviewed by Adele.

        - test for http://bugs.webkit.org/show_bug.cgi?id=12986
          REGRESSION(NativeListBox): Listboxes not updated when resized dynamically

        * fast/forms/select-change-listbox-size-expected.checksum: Added.
        * fast/forms/select-change-listbox-size-expected.png: Added.
        * fast/forms/select-change-listbox-size-expected.txt: Added.
        * fast/forms/select-change-listbox-size.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/forms/select-change-listbox-size-expected.checksum [new file with mode: 0644]
LayoutTests/fast/forms/select-change-listbox-size-expected.png [new file with mode: 0644]
LayoutTests/fast/forms/select-change-listbox-size-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/select-change-listbox-size.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/html/HTMLSelectElement.cpp

index 9fcb0d075a835bd1ebda793ceb253a0c5c30bf94..b4c1eade9e3b4d15de49e2b1832a913dfd15b96d 100644 (file)
@@ -1,3 +1,15 @@
+2007-03-06  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Adele.
+
+        - test for http://bugs.webkit.org/show_bug.cgi?id=12986
+          REGRESSION(NativeListBox): Listboxes not updated when resized dynamically
+
+        * fast/forms/select-change-listbox-size-expected.checksum: Added.
+        * fast/forms/select-change-listbox-size-expected.png: Added.
+        * fast/forms/select-change-listbox-size-expected.txt: Added.
+        * fast/forms/select-change-listbox-size.html: Added.
+
 2007-03-06  Mitz Pettel  <mitz@webkit.org>
 
         Reviewed by Dave Hyatt.
diff --git a/LayoutTests/fast/forms/select-change-listbox-size-expected.checksum b/LayoutTests/fast/forms/select-change-listbox-size-expected.checksum
new file mode 100644 (file)
index 0000000..e9d3bd8
--- /dev/null
@@ -0,0 +1 @@
+f3c816b9af45994ead4a6fdbf540dc4a
\ No newline at end of file
diff --git a/LayoutTests/fast/forms/select-change-listbox-size-expected.png b/LayoutTests/fast/forms/select-change-listbox-size-expected.png
new file mode 100644 (file)
index 0000000..8d99178
Binary files /dev/null and b/LayoutTests/fast/forms/select-change-listbox-size-expected.png differ
diff --git a/LayoutTests/fast/forms/select-change-listbox-size-expected.txt b/LayoutTests/fast/forms/select-change-listbox-size-expected.txt
new file mode 100644 (file)
index 0000000..f16dfc6
--- /dev/null
@@ -0,0 +1,27 @@
+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 {P} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 53x18
+          text run at (0,0) width 53: "Test for "
+        RenderInline {I} at (0,0) size 738x36
+          RenderInline {A} at (0,0) size 301x18 [color=#0000EE]
+            RenderText {#text} at (53,0) size 301x18
+              text run at (53,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=12986"
+          RenderText {#text} at (354,0) size 738x36
+            text run at (354,0) width 4: " "
+            text run at (358,0) width 380: "REGRESSION(NativeListBox): Listboxes not updated when"
+            text run at (0,18) width 125: "resized dynamically"
+        RenderText {#text} at (125,18) size 4x18
+          text run at (125,18) width 4: "."
+      RenderBlock {P} at (0,52) size 784x18
+        RenderText {#text} at (0,0) size 316x18
+          text run at (0,0) width 316: "This list box should be tall enough to fit 6 options."
+      RenderBlock (anonymous) at (0,86) size 784x89
+        RenderListBox {SELECT} at (2,2) size 48x85 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
+        RenderText {#text} at (0,0) size 0x0
+        RenderText {#text} at (0,0) size 0x0
+        RenderText {#text} at (0,0) size 0x0
+        RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/fast/forms/select-change-listbox-size.html b/LayoutTests/fast/forms/select-change-listbox-size.html
new file mode 100644 (file)
index 0000000..afc70c1
--- /dev/null
@@ -0,0 +1,26 @@
+<html>
+<head>
+    <title></title>
+</head>
+<body>
+    <p>
+        Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=12986">http://bugs.webkit.org/show_bug.cgi?id=12986</a>
+        REGRESSION(NativeListBox): Listboxes not updated when resized dynamically</i>.
+    </p>
+    <p>
+        This list box should be tall enough to fit 6 options.
+    </p>
+    <select id="target" size="4">
+        <option>One</option>
+        <option>Two</option>
+        <option>Three</option>
+        <option>Four</option>
+        <option>Five</option>
+        <option>Six</option>
+    </select>
+    <script>
+        document.body.offsetTop;
+        document.getElementById("target").size = 6;
+    </script>
+</body>
+</html>
index bfbad80e945b7346e0abe901d0ab5db6dede9ffc..8d77a390e0db309b0c8ab1eb919b98a60689dbf2 100644 (file)
@@ -1,3 +1,15 @@
+2007-03-06  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Adele.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=12986
+          REGRESSION(NativeListBox): Listboxes not updated when resized dynamically
+
+        Test: fast/forms/select-change-listbox-size.html
+
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::parseMappedAttribute): Reattach on list box size change.
+
 2007-03-06  Mitz Pettel  <mitz@webkit.org>
 
         Reviewed by Dave Hyatt.
index 0e9968b36c96e1493cad29faa5906736cb62b810..ce5c8083d1d4f9b40e70a1e4b8aef223c690d924 100644 (file)
@@ -344,6 +344,7 @@ void HTMLSelectElement::parseMappedAttribute(MappedAttribute *attr)
 {
     bool oldUsesMenuList = usesMenuList();
     if (attr->name() == sizeAttr) {
+        int oldSize = m_size;
         // Set the attribute value to a number.
         // This is important since the style rules for this attribute can determine the appearance property.
         int size = attr->value().toInt();
@@ -352,7 +353,7 @@ void HTMLSelectElement::parseMappedAttribute(MappedAttribute *attr)
             attr->setValue(attrSize);
 
         m_size = max(size, 1);
-        if (oldUsesMenuList != usesMenuList() && attached()) {
+        if ((oldUsesMenuList != usesMenuList() || !oldUsesMenuList && m_size != oldSize) && attached()) {
             detach();
             attach();
         }