Title: [87187] trunk
Revision
87187
Author
wei...@apple.com
Date
2011-05-24 12:23:17 -0700 (Tue, 24 May 2011)

Log Message

2011-05-24  Sam Weinig  <s...@webkit.org>

        Reviewed by Beth Dakin.

        Can't scroll scaled page that has overflow:hidden on its root
        <rdar://problem/9029189>
        https://bugs.webkit.org/show_bug.cgi?id=61339

        Test: fast/events/scroll-in-scaled-page-with-overflow-hidden.html

        * page/FrameView.cpp:
        (WebCore::FrameView::applyOverflowToViewport):
        Scrollbars should be enabled for the viewport when scaled, even if overflow:hidden
        is specified.
2011-05-24  Sam Weinig  <s...@webkit.org>

        Reviewed by Beth Dakin.

        Can't scroll scaled page that has overflow:hidden on its root
        <rdar://problem/9029189>
        https://bugs.webkit.org/show_bug.cgi?id=61339

        * fast/events/scroll-in-scaled-page-with-overflow-hidden-expected.txt: Added.
        * fast/events/scroll-in-scaled-page-with-overflow-hidden.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (87186 => 87187)


--- trunk/LayoutTests/ChangeLog	2011-05-24 19:22:22 UTC (rev 87186)
+++ trunk/LayoutTests/ChangeLog	2011-05-24 19:23:17 UTC (rev 87187)
@@ -1,3 +1,14 @@
+2011-05-24  Sam Weinig  <s...@webkit.org>
+
+        Reviewed by Beth Dakin.
+
+        Can't scroll scaled page that has overflow:hidden on its root
+        <rdar://problem/9029189>
+        https://bugs.webkit.org/show_bug.cgi?id=61339
+
+        * fast/events/scroll-in-scaled-page-with-overflow-hidden-expected.txt: Added.
+        * fast/events/scroll-in-scaled-page-with-overflow-hidden.html: Added.
+
 2011-05-24  Jian Li  <jia...@chromium.org>
 
         Reviewed by Kenneth Russell.

Added: trunk/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden-expected.txt (0 => 87187)


--- trunk/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden-expected.txt	2011-05-24 19:23:17 UTC (rev 87187)
@@ -0,0 +1,4 @@
+This tests that a usually overflow: hidden viewport should be scrollable when scaled. Otherwise, you can't get to content you would have been able to get to had you not been zoomed it.
+PASS window.document.body.scrollTop is 0
+PASS window.document.body.scrollTop is 100
+

Added: trunk/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden.html (0 => 87187)


--- trunk/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden.html	2011-05-24 19:23:17 UTC (rev 87187)
@@ -0,0 +1,38 @@
+<head>
+    <style>
+        html, body { margin:0; overflow: hidden; }
+    </style>
+    <link rel="stylesheet" href=""
+    <script src=""
+</head>
+
+<div>This tests that a usually overflow: hidden viewport should be scrollable when scaled. Otherwise, you can't get to content
+    you would have been able to get to had you not been zoomed it.</div>
+<div id="console"></div>
+
+<div style='font-size:40px; height: 1000px;'>
+</div>
+
+<script>
+    (function() {
+        if (!window.layoutTestController) {
+            debug("This test only works in the test runner.");
+            return;
+        }
+        
+        // Force a layout.
+        document.body.offsetLeft;
+
+        if (window.eventSender)
+            eventSender.scalePageBy(2, 0, 0);
+
+        shouldBe("window.document.body.scrollTop", "0");
+
+        if (window.eventSender) {
+            eventSender.mouseMoveTo(100, 100);
+            eventSender.mouseScrollBy(0, -5);
+        }
+
+        shouldBe("window.document.body.scrollTop", "100");
+    })();
+</script>

Modified: trunk/Source/WebCore/ChangeLog (87186 => 87187)


--- trunk/Source/WebCore/ChangeLog	2011-05-24 19:22:22 UTC (rev 87186)
+++ trunk/Source/WebCore/ChangeLog	2011-05-24 19:23:17 UTC (rev 87187)
@@ -1,3 +1,18 @@
+2011-05-24  Sam Weinig  <s...@webkit.org>
+
+        Reviewed by Beth Dakin.
+
+        Can't scroll scaled page that has overflow:hidden on its root
+        <rdar://problem/9029189>
+        https://bugs.webkit.org/show_bug.cgi?id=61339
+
+        Test: fast/events/scroll-in-scaled-page-with-overflow-hidden.html
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::applyOverflowToViewport):
+        Scrollbars should be enabled for the viewport when scaled, even if overflow:hidden
+        is specified.
+
 2011-05-24  Adam Roben  <aro...@apple.com>
 
         Leopard build fix

Modified: trunk/Source/WebCore/page/FrameView.cpp (87186 => 87187)


--- trunk/Source/WebCore/page/FrameView.cpp	2011-05-24 19:22:22 UTC (rev 87186)
+++ trunk/Source/WebCore/page/FrameView.cpp	2011-05-24 19:23:17 UTC (rev 87187)
@@ -515,9 +515,18 @@
     // overflow:hidden and overflow:scroll on <body> as applying to the document's
     // scrollbars.  The CSS2.1 draft states that HTML UAs should use the <html> or <body> element and XML/XHTML UAs should
     // use the root element.
+
+    // To combat the inability to scroll on a page with overflow:hidden on the root when scaled, disregard hidden when
+    // there is a pageScaleFactor that is greater than one on the main frame.
+
+    bool overrideHidden = m_frame->page() && m_frame->page()->mainFrame() == m_frame && m_frame->pageScaleFactor() > 1;
+
     switch (o->style()->overflowX()) {
         case OHIDDEN:
-            hMode = ScrollbarAlwaysOff;
+            if (overrideHidden)
+                hMode = ScrollbarAuto;
+            else
+                hMode = ScrollbarAlwaysOff;
             break;
         case OSCROLL:
             hMode = ScrollbarAlwaysOn;
@@ -532,7 +541,10 @@
     
      switch (o->style()->overflowY()) {
         case OHIDDEN:
-            vMode = ScrollbarAlwaysOff;
+            if (overrideHidden)
+                vMode = ScrollbarAuto;
+            else
+                vMode = ScrollbarAlwaysOff;
             break;
         case OSCROLL:
             vMode = ScrollbarAlwaysOn;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to