Bug 104730 - [Chromium] Non-fast scrollable region should be scaled
Summary: [Chromium] Non-fast scrollable region should be scaled
Status: RESOLVED DUPLICATE of bug 105075
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tien-Ren Chen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-11 15:38 PST by Xianzhu Wang
Modified: 2012-12-14 17:23 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xianzhu Wang 2012-12-11 15:38:43 PST
Currently all scrollable areas in a page are marked as non-fast scrollable regions of the scroll layer of the containing frame. When calling WebLayer::setNonFastScrollableRegion(), the passed region is in CSS pixels, then Chromium's LayerImpl uses the region to check if a touch point (in logical pixels) is in non-fast scrolling area. This causes incorrect scrolling behavior when the page is scaled. For example, when page scale factor > 1, when trying to scroll an area by starting from the bottom right part of the area, the area is not scrolled but the whole page is scrolled because it falls back to the whole page fast scrolling path.

Though eventually we'll enable fast scrolling for the scrolling areas as many as possible, for now we need to fix the slow scrolling path for them.

Tried the following change and it works:

 void ScrollingCoordinatorChromium::setNonFastScrollableRegion(const Region& region)
 {
     // We won't necessarily get a setScrollLayer() call before this one, so grab the root ourselves.
     setScrollLayer(scrollLayerForFrameView(m_page->mainFrame()->view()));
     if (m_private->scrollLayer()) {
         Vector<IntRect> rects = region.rects();
         WebVector<WebRect> webRects(rects.size());
         for (size_t i = 0; i < rects.size(); ++i) {
+            rects[i].scale(m_page->pageScaleFactor());
             webRects[i] = rects[i];
         }
         m_private->scrollLayer()->setNonFastScrollableRegion(webRects);
     }
 }


Will upload a formal patch containing layout test soon.
Comment 1 Xianzhu Wang 2012-12-11 18:09:52 PST
Discussed with Tien-Ren. Perhaps we should not scale in WebKit, but should apply required scales and transformations when hit-testing the non-fast scrollable region in cc. If yes, we should close this bug and work in Chromium instead.
Comment 2 James Robinson 2012-12-11 18:13:52 PST
(In reply to comment #1)
> Discussed with Tien-Ren. Perhaps we should not scale in WebKit, but should apply required scales and transformations when hit-testing the non-fast scrollable region in cc. If yes, we should close this bug and work in Chromium instead.

That sounds a bit more forward-thinking to me.  The important thing is knowing which space these are in.
Comment 3 Tien-Ren Chen 2012-12-11 18:21:33 PST
(In reply to comment #2)
> (In reply to comment #1)
> > Discussed with Tien-Ren. Perhaps we should not scale in WebKit, but should apply required scales and transformations when hit-testing the non-fast scrollable region in cc. If yes, we should close this bug and work in Chromium instead.
> 
> That sounds a bit more forward-thinking to me.  The important thing is knowing which space these are in.

My opinion is that those should be always in the layer's local coordinate.
WebKit is not supposed to know too much about the page scale factor in the new model. (also WebKit has no way to know the scale delta, so we have to do the scale in the compositor anyway)
Comment 4 Tien-Ren Chen 2012-12-14 17:23:39 PST

*** This bug has been marked as a duplicate of bug 105075 ***