Skip to content

Instantly share code, notes, and snippets.

@hansmaad
Created July 10, 2015 08:00
Show Gist options
  • Save hansmaad/02165649496193bdb4b7 to your computer and use it in GitHub Desktop.
Save hansmaad/02165649496193bdb4b7 to your computer and use it in GitHub Desktop.
test file for Issue 506664: window.onpointerdown is null in version 45, was undefined before, breaks polyfills
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<div id="test" style="width:300px; height:300px; background:red;">
</div>
<script>
var hasPointerEvents = 'onpointerdown' in window;
var e = hasPointerEvents ? 'pointerdown' : 'mousedown';
var element = document.getElementById('test');
element.addEventListener(e, function(event) {
element.innerHTML = e + ' @ ' + event.pageX;
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment