RESOLVED FIXED 84178
Relax ScrollView::adjustScrollPositionWithinRange in case constrainsScrollingToContentEdge is false
https://bugs.webkit.org/show_bug.cgi?id=84178
Summary Relax ScrollView::adjustScrollPositionWithinRange in case constrainsScrolling...
Antonio Gomes
Reported 2012-04-17 11:56:28 PDT
Right now, when a port has delegatesScrolling set to FALSE, and constrainsScrollingToContentEdge set to FALSE (i.e. it accepts overscrolled position), calling ScrollView::setScrollPosition with an overscrolled position still gets the position clamped to the content size edges. We could relax ::adjustScrollPositionWithinRange in that sense.
Attachments
(wrong patch, please ignore) patch (4.13 KB, patch)
2012-04-17 12:23 PDT, Antonio Gomes
no flags
(committed r114770, r=atreat) patch - the right patch this time (2.91 KB, patch)
2012-04-18 09:37 PDT, Antonio Gomes
no flags
Antonio Gomes
Comment 1 2012-04-17 11:56:44 PDT
*** Bug 84176 has been marked as a duplicate of this bug. ***
Anders Carlsson
Comment 2 2012-04-17 11:58:45 PDT
I think doing so would break a lot of assumptions inside WebCore. I tried doing something like this in ScrollView::updateScrollbars and it did not work well.
Antonio Gomes
Comment 3 2012-04-17 12:12:06 PDT
(In reply to comment #2) > I think doing so would break a lot of assumptions inside WebCore. I tried doing something like this in ScrollView::updateScrollbars and it did not work well. Would you remember what kind of assumptions? We run with this since a while without problems... If we do not have such a "relaxation" if user over scrolls a webpage, say to (0, -20) webcore would be tracking a scroll position of (0, 0).
Antonio Gomes
Comment 4 2012-04-17 12:20:47 PDT
Note that ScrollView::setScrollOffset does something similar already: 340 void ScrollView::setScrollOffset(const IntPoint& offset) 341 { 342 int horizontalOffset = offset.x(); 343 int verticalOffset = offset.y(); 344 if (constrainsScrollingToContentEdge()) { 345 horizontalOffset = max(min(horizontalOffset, contentsWidth() - visibleWidth()), 0); 346 verticalOffset = max(min(verticalOffset, contentsHeight() - visibleHeight()), 0); 347 } ....
Antonio Gomes
Comment 5 2012-04-17 12:23:42 PDT
Created attachment 137582 [details] (wrong patch, please ignore) patch Patch for discussion. Call sites of ScrollView::adjustScrollPositionWithinRange from ::setScrollPosition and ::updateScrollbars.
Antonio Gomes
Comment 6 2012-04-18 09:37:38 PDT
Created attachment 137708 [details] (committed r114770, r=atreat) patch - the right patch this time
Antonio Gomes
Comment 7 2012-04-19 22:15:31 PDT
<tonikitoo> andersca, sir, would you have some minutes to talk about? https://bugs.webkit.org/show_bug.cgi?id=84178 <tonikitoo> (shame we can not talk in person during the summit :( ) <andersca> tonikitoo: yes, I think I was wrong about my assumption <andersca> tonikitoo: if you have a Mac you can test if it breaks things by going to a page with a vertical scrollbar, scroll to the bottom <andersca> tonikitoo: then hit command-f to show the find banner and escape to hide it <tonikitoo> scrollview::setscrollposition calls it I think <andersca> tonikitoo: and make sure that the behavior is the same even with your patch ... <tonikitoo> andersca, just to let you know: I got it tested on a safari build with and without the patch, and behaviour looks the same <andersca> tonikitoo: excellent
Adam Treat
Comment 8 2012-04-20 11:43:33 PDT
Comment on attachment 137708 [details] (committed r114770, r=atreat) patch - the right patch this time lgtm and tested against mac port with no regression so r+
Antonio Gomes
Comment 9 2012-04-20 12:32:40 PDT
Comment on attachment 137708 [details] (committed r114770, r=atreat) patch - the right patch this time Committed http://trac.webkit.org/changeset/114770
Note You need to log in before you can comment on or make changes to this bug.