Selects don't scroll at some aspect ratios
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 12 Apr 2015 20:18:01 +0000 (20:18 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 12 Apr 2015 20:18:01 +0000 (20:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143649
rdar://problem/19365694

Reviewed by Darin Adler.
Source/WebCore:

Fix width/height flip in RenderListBox which caused us to fail to scroll when
the list was wider than the scroll height.

We're generally confused about RenderListBox scroll offsets (webkit.org/b/143648)
but this fixes the immediate problem.

Test: fast/forms/listbox-visible-size.html

* rendering/RenderListBox.h:

LayoutTests:

* fast/forms/listbox-visible-size-expected.txt: Added.
* fast/forms/listbox-visible-size.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/forms/listbox-visible-size-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/listbox-visible-size.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderListBox.h

index 9d318f2..784da76 100644 (file)
@@ -1,5 +1,16 @@
 2015-04-12  Simon Fraser  <simon.fraser@apple.com>
 
+        Selects don't scroll at some aspect ratios
+        https://bugs.webkit.org/show_bug.cgi?id=143649
+        rdar://problem/19365694
+
+        Reviewed by Darin Adler.
+
+        * fast/forms/listbox-visible-size-expected.txt: Added.
+        * fast/forms/listbox-visible-size.html: Added.
+
+2015-04-12  Simon Fraser  <simon.fraser@apple.com>
+
         Too much repainting on scrolling with fixed backgrounds
         https://bugs.webkit.org/show_bug.cgi?id=143637
         rdar://problem/20245243
diff --git a/LayoutTests/fast/forms/listbox-visible-size-expected.txt b/LayoutTests/fast/forms/listbox-visible-size-expected.txt
new file mode 100644 (file)
index 0000000..02be829
--- /dev/null
@@ -0,0 +1,5 @@
+PASS select.scrollTop is targetTop
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/forms/listbox-visible-size.html b/LayoutTests/fast/forms/listbox-visible-size.html
new file mode 100644 (file)
index 0000000..b0e8e50
--- /dev/null
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        select {
+            width: 12em;
+        }
+    </style>
+    <script src="../../resources/js-test-pre.js"></script>
+</head>
+<body>
+    <select id="select" size="5">
+        <option>Monday</option>
+        <option>Tuesday</option>
+        <option>Wednesday</option>
+        <option>Thursday</option>
+        <option>Friday</option>
+        <option>Saturday</option>
+        <option>Sunday</option>
+    </select>
+    <script>
+    const targetTop = 28;
+    var select;
+    function scrollSelect(newTop)
+    {
+        var select = document.getElementById('select');
+        select.scrollTop = newTop;
+    }
+
+    scrollSelect(targetTop);
+    shouldBe('select.scrollTop', 'targetTop');
+    </script>
+    <script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
index caf8e31..b283e9f 100644 (file)
@@ -1,5 +1,23 @@
 2015-04-12  Simon Fraser  <simon.fraser@apple.com>
 
+        Selects don't scroll at some aspect ratios
+        https://bugs.webkit.org/show_bug.cgi?id=143649
+        rdar://problem/19365694
+
+        Reviewed by Darin Adler.
+        
+        Fix width/height flip in RenderListBox which caused us to fail to scroll when
+        the list was wider than the scroll height.
+        
+        We're generally confused about RenderListBox scroll offsets (webkit.org/b/143648)
+        but this fixes the immediate problem.
+
+        Test: fast/forms/listbox-visible-size.html
+
+        * rendering/RenderListBox.h:
+
+2015-04-12  Simon Fraser  <simon.fraser@apple.com>
+
         Too much repainting on scrolling with fixed backgrounds
         https://bugs.webkit.org/show_bug.cgi?id=143637
         rdar://problem/20245243
index 0ffc2c9..5d5a0bd 100644 (file)
@@ -123,7 +123,7 @@ private:
     virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoint&) const override;
     virtual Scrollbar* verticalScrollbar() const override { return m_vBar.get(); }
     virtual IntSize contentsSize() const override;
-    virtual IntSize visibleSize() const override { return IntSize(height(), width()); }
+    virtual IntSize visibleSize() const override { return IntSize(width(), height()); }
     virtual IntPoint lastKnownMousePosition() const override;
     virtual bool isHandlingWheelEvent() const override;
     virtual bool shouldSuspendScrollAnimations() const override;