WebCore:

2009-04-23  Dimitri Glazkov  <dglazkov@chromium.org>

        Reviewed by Darin Adler.

        https://bugs.webkit.org/show_bug.cgi?id=25313
        Missing scroll bars in GMail.

        Test: fast/overflow/overflow-y-scroll.html

        * platform/ScrollView.cpp:
        (WebCore::ScrollView::updateScrollbars): Added check for the ScrollbarAlwaysOn
        scroll mode.

LayoutTests:

2009-04-23  Dimitri Glazkov  <dglazkov@chromium.org>

        Reviewed by Darin Adler.
        https://bugs.webkit.org/show_bug.cgi?id=25313
        Missing scroll bars in GMail.

        * fast/overflow/overflow-y-scroll-expected.txt: Added.
        * fast/overflow/overflow-y-scroll.html: Added.

WebKit/mac:

2009-04-23  Dimitri Glazkov  <dglazkov@chromium.org>

        Reviewed by Darin Adler.

        https://bugs.webkit.org/show_bug.cgi?id=25313
        Missing scroll bars in GMail.

        * WebView/WebDynamicScrollBarsView.m:
        (-[WebDynamicScrollBarsView updateScrollers]): Added check for the ScrollbarAlwaysOn
            scroll mode.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@42791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/fast/overflow/overflow-y-scroll.html b/LayoutTests/fast/overflow/overflow-y-scroll.html
new file mode 100644
index 0000000..6f430a0
--- /dev/null
+++ b/LayoutTests/fast/overflow/overflow-y-scroll.html
@@ -0,0 +1,39 @@
+<html>
+    <head>
+        <title>Bug 25313 : Missing scrollbars in GMail</title>
+        <script>
+            if (window.layoutTestController)
+                window.layoutTestController.dumpAsText();
+
+            function inject()
+            {
+                var content = '<html><head><style>' + 
+                    'html,body { margin: 0; overflow: hidden; height: 100%; width: 100% } ' +
+                    'html.scroll { overflow-x: auto; overflow-y: scroll; } ' +
+                    '</style><body><div id="offender" style="height: 900px;"></div></body></html>';
+                var injectee = document.getElementById("injectee");
+                var doc = injectee.contentDocument;
+                // inject an iframe
+                doc.open();
+                doc.write(content);
+                doc.close();
+                doc.getElementsByTagName("html")[0].className = "scroll";
+                // tickle ScrollView::updateScrollbars()
+                doc.getElementById("offender").scrollIntoView(false);
+                // trigger resize
+                injectee.style.width = "400px";
+                // measure to see if there is a scrollbar. Pass if there is.
+                document.getElementById("test").innerHTML = doc.body.offsetWidth < 400 ? "TEST PASSED" : "TEST FAILED";
+            }
+        </script>
+    </head>
+    <body>
+        <p>
+            Tests <kbd>ScrollView</kbd>'s behavior when only one of the scrollbars is made <kbd>ScrollbarAlwaysOn</kbd> dynamically.
+            The correct behavior is not to remove this scrollbar, which is what this test checks for.
+        </p>
+        <div id="test">
+             <iframe style="height:100%" id="injectee" onload="inject()">
+        </div>
+    </body>
+</html>