Bug 148450

Summary: Wheel Event Not Fired For `body,html { height:100% }`
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: Layout and RenderingAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, bfulgham, commit-queue, dbates, dino, simon.fraser, thorton, tonikitoo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Test Case showing the improper behavior
none
Patch
none
Patch none

Description Brent Fulgham 2015-08-25 16:25:44 PDT
Created attachment 259898 [details]
Test Case showing the improper behavior

From Chrome Developers:
This *was* one of the most starred bug for Chromium (800 stars). With the help of the community we got this FIXED in Chrome v45.

https://code.google.com/p/chromium/issues/detail?id=500144

We NEED WebKit to fix it as well!

Wheel event should work like other mouse events (click) and fire in the popular
 `body,html { height:100% }` case.

Steps to Reproduce:
Test page: http://output.jsbin.com/kapogi 
(also attached as a file)

/* 
 * The problem is caused by an element 
 * bigger than viewport, and body,html
 * having 100% height.
 */
html, body {
  height: 100%;
}

#page {
  position: absolute;
  width: 50%;
  height: 1000%;
}

Have an `onwheel` or `onmousewheel` handler on the document.

Expected Results:
Wheel events like all other mouse events should fire on the sides (the test page shows how click fires correctly).

Actual Results:
After passing the html,body { height:100% } limit the wheel events are no longer fired (on the sides).
Comment 1 Brent Fulgham 2015-08-25 16:25:58 PDT
<rdar://problem/22376037>
Comment 2 Brent Fulgham 2015-08-25 17:50:12 PDT
Created attachment 259907 [details]
Patch
Comment 3 Beth Dakin 2015-08-26 14:06:39 PDT
I think we need to understand this fix more. I don't understand why it works, and it seems like an indirect and maybe incorrect way to get the desired behavior.
Comment 4 Sam Weinig 2015-08-30 10:54:45 PDT
Comment on attachment 259907 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=259907&action=review

> Source/WebCore/page/EventHandler.cpp:2717
> +    HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active| HitTestRequest::DisallowShadowContent);

Your changelog says that this will "Fall back to document", but it is unclear why.  Can you explain in a bit more detail what is going on here? Also, you are missing a space after Active.
Comment 5 Simon Fraser (smfr) 2015-09-14 09:14:53 PDT
Comment on attachment 259907 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=259907&action=review

> Source/WebCore/ChangeLog:12
> +        This change was adapted from Blink r198210:
> +        http://src.chromium.org/viewvc/blink?view=rev&rev=198210  

I would like an explanation for why setting Active gives the desired behavior. The Blink code has a FIXME here.
Comment 6 Simon Fraser (smfr) 2015-09-18 16:55:20 PDT
rdar://problem/22756010
Comment 7 Simon Fraser (smfr) 2016-04-28 22:01:59 PDT
Created attachment 277673 [details]
Patch
Comment 8 Brent Fulgham 2016-04-29 09:32:54 PDT
Comment on attachment 277673 [details]
Patch

r=me. \0/
Comment 9 WebKit Commit Bot 2016-04-29 09:53:33 PDT
Comment on attachment 277673 [details]
Patch

Clearing flags on attachment: 277673

Committed r200247: <http://trac.webkit.org/changeset/200247>
Comment 10 WebKit Commit Bot 2016-04-29 09:53:39 PDT
All reviewed patches have been landed.  Closing bug.