Bug 181002 - overflow:scroll is scrollable when the mouse is over the border, unlike other browsers
Summary: overflow:scroll is scrollable when the mouse is over the border, unlike other...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: Safari 11
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-19 14:39 PST by Simon Fraser (smfr)
Modified: 2018-05-10 01:07 PDT (History)
3 users (show)

See Also:


Attachments
Testcase (3.17 KB, text/html)
2017-12-19 14:41 PST, Simon Fraser (smfr)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2017-12-19 14:39:29 PST
When the mouse is over the border of an overflow:scroll, the content is scrollable. This seems wrong and doesn't match other browsers, or iframes.
Comment 1 Simon Fraser (smfr) 2017-12-19 14:41:00 PST
Created attachment 329832 [details]
Testcase
Comment 2 Simon Fraser (smfr) 2017-12-19 15:01:44 PST
https://codepen.io/anon/pen/ppyQgY
Comment 3 Frédéric Wang (:fredw) 2018-01-10 02:48:00 PST
This quick hack provides the correct behavior for the test case:

diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp
index f2ca0e134c9..781b12343c1 100644
--- a/Source/WebCore/rendering/RenderBlock.cpp
+++ b/Source/WebCore/rendering/RenderBlock.cpp
@@ -2238,3 +2238,4 @@ bool RenderBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu
     if (hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChildBlockBackground) {
-        LayoutRect boundsRect(adjustedLocation, size());
+        LayoutRect boundsRect = paddingBoxRect();
+        boundsRect.moveBy(adjustedLocation);
         if (visibleToHitTesting() && locationInContainer.intersects(boundsRect)) {

However, I'm not sure that's what we want. Do you have any suggestion?
Comment 4 Simon Fraser (smfr) 2018-01-10 11:10:35 PST
Does that affect click behavior as well?
Comment 5 Frédéric Wang (:fredw) 2018-01-11 00:49:23 PST
(In reply to Simon Fraser (smfr) from comment #4)
> Does that affect click behavior as well?

I suspect it does, that's my doubt. My idea was to pass some specific info via the HitAction param in the case of overflow scrolling, so we can distinguish that case. Anyway, I just wanted to check if you already thought about something, I'll try and debug more after I have a patch for review in bug 173833.