Bug 148450 - Wheel Event Not Fired For `body,html { height:100% }`
Summary: Wheel Event Not Fired For `body,html { height:100% }`
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-08-25 16:25 PDT by Brent Fulgham
Modified: 2016-04-29 09:53 PDT (History)
9 users (show)

See Also:


Attachments
Test Case showing the improper behavior (10.09 KB, text/html)
2015-08-25 16:25 PDT, Brent Fulgham
no flags Details
Patch (24.63 KB, patch)
2015-08-25 17:50 PDT, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (5.65 KB, patch)
2016-04-28 22:01 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.