Title: [87246] branches/safari-534-branch

Diff

Modified: branches/safari-534-branch/LayoutTests/ChangeLog (87245 => 87246)


--- branches/safari-534-branch/LayoutTests/ChangeLog	2011-05-25 00:56:44 UTC (rev 87245)
+++ branches/safari-534-branch/LayoutTests/ChangeLog	2011-05-25 00:59:56 UTC (rev 87246)
@@ -1,5 +1,20 @@
 2011-05-24  Lucas Forschler  <[email protected]>
 
+    Merged r87187.
+
+    2011-05-24  Sam Weinig  <[email protected]>
+
+        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  Lucas Forschler  <[email protected]>
+
     Merged r87179.
 
     2011-05-24  Adam Roben  <[email protected]>

Copied: branches/safari-534-branch/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden-expected.txt (from rev 87187, trunk/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden-expected.txt) (0 => 87246)


--- branches/safari-534-branch/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden-expected.txt	                        (rev 0)
+++ branches/safari-534-branch/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden-expected.txt	2011-05-25 00:59:56 UTC (rev 87246)
@@ -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
+

Copied: branches/safari-534-branch/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden.html (from rev 87187, trunk/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden.html) (0 => 87246)


--- branches/safari-534-branch/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden.html	                        (rev 0)
+++ branches/safari-534-branch/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden.html	2011-05-25 00:59:56 UTC (rev 87246)
@@ -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: branches/safari-534-branch/Source/WebCore/ChangeLog (87245 => 87246)


--- branches/safari-534-branch/Source/WebCore/ChangeLog	2011-05-25 00:56:44 UTC (rev 87245)
+++ branches/safari-534-branch/Source/WebCore/ChangeLog	2011-05-25 00:59:56 UTC (rev 87246)
@@ -1,3 +1,18 @@
+2011-05-24  Sam Weinig  <[email protected]>
+
+        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  <[email protected]>
 
         Leopard build fix

Modified: branches/safari-534-branch/Source/WebCore/page/FrameView.cpp (87245 => 87246)


--- branches/safari-534-branch/Source/WebCore/page/FrameView.cpp	2011-05-25 00:56:44 UTC (rev 87245)
+++ branches/safari-534-branch/Source/WebCore/page/FrameView.cpp	2011-05-25 00:59:56 UTC (rev 87246)
@@ -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
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to