Title: [167411] trunk/Source
Revision
167411
Author
benja...@webkit.org
Date
2014-04-16 20:26:53 -0700 (Wed, 16 Apr 2014)

Log Message

[iOS][WK2] Fix annoying scrolling bugs
https://bugs.webkit.org/show_bug.cgi?id=131722

Patch by Benjamin Poulain <bpoul...@apple.com> on 2014-04-16
Reviewed by Simon Fraser.


Source/WebCore: 
* platform/ScrollView.cpp:
(WebCore::ScrollView::updateScrollbars):
Since ScrollingStateScrollingNode::setRequestedScrollPosition() was added, we see ScrollView::updateScrollbars()
keep changing the scroll position to incorrect values.

On iOS, the scrollbars are handled by the native UI, the code just compute incorrect scroll position. On WebKit1,
the code does not run because there is a platformWidget().

Just #ifdef the whole useless code.

Source/WebKit2: 
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _scrollToContentOffset:WebCore::]):
We are scrolling at the wrong position when we have the "small obscured insets".

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (167410 => 167411)


--- trunk/Source/WebCore/ChangeLog	2014-04-17 01:40:04 UTC (rev 167410)
+++ trunk/Source/WebCore/ChangeLog	2014-04-17 03:26:53 UTC (rev 167411)
@@ -1,3 +1,20 @@
+2014-04-16  Benjamin Poulain  <bpoul...@apple.com>
+
+        [iOS][WK2] Fix annoying scrolling bugs
+        https://bugs.webkit.org/show_bug.cgi?id=131722
+
+        Reviewed by Simon Fraser.
+
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::updateScrollbars):
+        Since ScrollingStateScrollingNode::setRequestedScrollPosition() was added, we see ScrollView::updateScrollbars()
+        keep changing the scroll position to incorrect values.
+
+        On iOS, the scrollbars are handled by the native UI, the code just compute incorrect scroll position. On WebKit1,
+        the code does not run because there is a platformWidget().
+
+        Just #ifdef the whole useless code.
+
 2014-04-16  Alexandru Chiculita  <ach...@adobe.com>
 
         Improve performance of the RenderLayerCompositor::OverlapMap

Modified: trunk/Source/WebCore/platform/ScrollView.cpp (167410 => 167411)


--- trunk/Source/WebCore/platform/ScrollView.cpp	2014-04-17 01:40:04 UTC (rev 167410)
+++ trunk/Source/WebCore/platform/ScrollView.cpp	2014-04-17 03:26:53 UTC (rev 167411)
@@ -537,11 +537,9 @@
     updateScrollbars(scrollOffset());
 }
 
-static const unsigned cMaxUpdateScrollbarsPass = 2;
-
 void ScrollView::updateScrollbars(const IntSize& desiredOffset)
 {
-    if (m_inUpdateScrollbars || prohibitsScrolling() || platformWidget())
+    if (m_inUpdateScrollbars || prohibitsScrolling() || platformWidget() || delegatesScrolling())
         return;
 
     bool hasOverlayScrollbars = (!m_horizontalScrollbar || m_horizontalScrollbar->isOverlayScrollbar()) && (!m_verticalScrollbar || m_verticalScrollbar->isOverlayScrollbar());
@@ -640,6 +638,7 @@
             }
         }
 
+        const unsigned cMaxUpdateScrollbarsPass = 2;
         if ((sendContentResizedNotification || needAnotherPass) && m_updateScrollbarsPass < cMaxUpdateScrollbarsPass) {
             m_updateScrollbarsPass++;
             contentsResized();
@@ -732,6 +731,7 @@
         m_verticalScrollbar->offsetDidChange();
 
     m_inUpdateScrollbars = false;
+#endif
 }
 
 const int panIconSizeLength = 16;

Modified: trunk/Source/WebKit2/ChangeLog (167410 => 167411)


--- trunk/Source/WebKit2/ChangeLog	2014-04-17 01:40:04 UTC (rev 167410)
+++ trunk/Source/WebKit2/ChangeLog	2014-04-17 03:26:53 UTC (rev 167411)
@@ -1,3 +1,14 @@
+2014-04-16  Benjamin Poulain  <bpoul...@apple.com>
+
+        [iOS][WK2] Fix annoying scrolling bugs
+        https://bugs.webkit.org/show_bug.cgi?id=131722
+
+        Reviewed by Simon Fraser.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _scrollToContentOffset:WebCore::]):
+        We are scrolling at the wrong position when we have the "small obscured insets".
+
 2014-04-16  Gavin Barraclough  <baraclo...@apple.com>
 
         On iOS keep network process running using a process assertion rather than a boost

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (167410 => 167411)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-04-17 01:40:04 UTC (rev 167410)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-04-17 03:26:53 UTC (rev 167411)
@@ -556,10 +556,7 @@
     CGFloat zoomScale = contentZoomScale(self);
     scaledOffset.scale(zoomScale, zoomScale);
 
-    // FIXME: the offset is relative to the unobscured rect top, not the content insets!
-    UIEdgeInsets inset = [_scrollView contentInset];
-    scaledOffset += WebCore::FloatSize(-inset.left, -inset.top);
-
+    scaledOffset -= WebCore::FloatSize(_obscuredInsets.left, _obscuredInsets.top);
     [_scrollView setContentOffset:scaledOffset];
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to