WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
151933
Tapping on <body> doesn't fire click events
https://bugs.webkit.org/show_bug.cgi?id=151933
Summary
Tapping on <body> doesn't fire click events
Chris Rebert
Reported
2015-12-07 00:49:20 PST
Testcases: 1.
http://patrickhlauke.github.io/touch/tests/event-listener-body.html
2.
http://patrickhlauke.github.io/touch/tests/event-listener-body-clickable.html
The 2nd testcase uses an `onclick="void(0)"` attribute (per
https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW6
) and a `cursor:pointer` CSS style (per Internet lore) to try to make the element (in our case, <body>) clickable in iOS Safari. Steps to reproduce: 1. Open one of the testcases in Safari in iOS 9.1. 2. Tap the indicated blue area of the webpage. Expected results: In the gray event log box (located below the text "Events (other than mousemove) targeted at the <body> element:"), there should be a line that says "click", indicating that a `click` event was fired at the <body> element as a result of the tap. (There will be other lines for other events that were also fired, e.g. `touchstart`) Actual results: No `click` event is recorded in the gray log box, indicating that no `click` event was fired at the <body> element as a result of the tap. --- Additional info: Per the specs, <body> isn't special-cased with regard to the `click` event, and should fire clicks just like any other element. Android Chrome follows the expected behavior. I strongly suspect IE/Edge Mobile also follows the expected behavior, but that's awaiting confirmation from a friend with a relevant device. If changing the default behavior isn't feasible, then at a minimum I'd hope for there to be some way (similar to the `onclick="void(0)" / `cursor:pointer` tricks) of requesting that <body> fire click events.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2016-01-16 01:29:14 PST
<
rdar://problem/24219436
>
Chris Rebert
Comment 2
2016-01-18 04:49:59 PST
Relevant W3C web-platform-test:
http://w3c-test.org/uievents/order-of-events/mouse-events/click-on-body-manual.html
Simon Fraser (smfr)
Comment 3
2018-01-04 12:44:53 PST
***
Bug 171105
has been marked as a duplicate of this bug. ***
Simon Fraser (smfr)
Comment 4
2018-01-04 12:45:25 PST
<
rdar://problem/5844416
>
Lucas Forschler
Comment 5
2019-02-06 09:19:08 PST
Mass move bugs into the DOM component.
Brent Fulgham
Comment 6
2022-02-08 23:21:39 PST
Part of this was fixed here: Committed
r237658
: <
https://trac.webkit.org/changeset/237658
> And part here: Committed
r237978
: <
https://trac.webkit.org/changeset/237978
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug