Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Click and touch event listeners on the body don't work
https://bugs.webkit.org/show_bug.cgi?id=191392 <rdar://problem/5844416> Reviewed by Simon Fraser. Source/WebCore: Remove the old quirk of ignoring onclick handlers on the body and beyond. Test: fast/events/click-handler-on-body-simple.html * page/ios/FrameIOS.mm: (WebCore::Frame::nodeRespondingToClickEvents): LayoutTests: * fast/events/click-handler-on-body-simple-expected.txt: Added. * fast/events/click-handler-on-body-simple.html: Added. * fast/events/touch/touch-handler-on-body-simple-expected.txt: Added. * fast/events/touch/touch-handler-on-body-simple.html: Added. Canonical link: https://commits.webkit.org/206200@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237978 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
267b557
commit 67a62d9
Showing
7 changed files
with
104 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
LayoutTests/fast/events/click-handler-on-body-simple-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
clicked |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<html> | ||
<head> | ||
<script src="../../resources/ui-helper.js"></script> | ||
<style> | ||
div { | ||
width: 400px; | ||
height: 400px; | ||
} | ||
</style> | ||
<script> | ||
async function test() { | ||
if (!window.testRunner || !testRunner.runUIScript) | ||
return; | ||
|
||
testRunner.dumpAsText(); | ||
testRunner.waitUntilDone(); | ||
|
||
document.body.addEventListener("click", function( event ) { | ||
result.innerHTML = "clicked"; | ||
}, false); | ||
|
||
let element = document.getElementById("clickme"); | ||
let rect = element.getBoundingClientRect(); | ||
let x = rect.left + rect.width / 2; | ||
let y = rect.top + rect.height / 2; | ||
|
||
await UIHelper.activateAt(x, y); | ||
|
||
testRunner.notifyDone(); | ||
} | ||
</script> | ||
</head> | ||
<body onload="test()"> | ||
<div id=clickme></div> | ||
<pre id=result></pre> | ||
</body> | ||
</html> |
1 change: 1 addition & 0 deletions
1
LayoutTests/fast/events/touch/ios/touch-handler-on-body-simple-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tapped |
37 changes: 37 additions & 0 deletions
37
LayoutTests/fast/events/touch/ios/touch-handler-on-body-simple.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<html> | ||
<head> | ||
<script src="../../../../resources/basic-gestures.js"></script> | ||
<style> | ||
div { | ||
width: 400px; | ||
height: 400px; | ||
} | ||
</style> | ||
<script> | ||
async function test() { | ||
if (!window.testRunner || !testRunner.runUIScript) | ||
return; | ||
|
||
testRunner.dumpAsText(); | ||
testRunner.waitUntilDone(); | ||
|
||
document.body.addEventListener("touchstart", function( event ) { | ||
result.innerHTML = "tapped"; | ||
}, false); | ||
|
||
let element = document.getElementById("tapthis"); | ||
let rect = element.getBoundingClientRect(); | ||
let x = rect.left + rect.width / 2; | ||
let y = rect.top + rect.height / 2; | ||
|
||
await tapAtPoint(x, y); | ||
|
||
testRunner.notifyDone(); | ||
} | ||
</script> | ||
</head> | ||
<body onload="test()"> | ||
<div id=tapthis></div> | ||
<pre id=result></pre> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters