http://demos.hacks.mozilla.org/openweb/pointer-events/ is great for opacity gradients on top of trailing-off content without swallowing up mouse events, but on browsers not handling pointer-events: none, it hampers functionality. Could we get a test for this support?
good call. in the meantime, here's how you can have it:
return document.documentElement.style.pointerEvents === '';
Or the slightly shorter:
return 'pointerEvents' in document.documentElement.style;
Yeah in general i see the in test succeeding the same as the === '' test, but IE9 had a few things that in tests passed but failed in reality..
So ... i prefer in but I'll be watching for where the results differ. :)
closing this ticket for now.. we're linking it up on the wiki:
thanks everyone. this'll go into the Modernizr 2.0 ecosystem of tests... somehow. :)
mr @ryanseddon pointed out that @ausi has written a pointer-events test that doesnt false positive (i think its because of SVG pointer-events support but lacking the CSS side of things)
I'd love to get this added to /feature-detects/ and I'm also curious if we could also change document.defaultView to a window reference.
i replaced the document.defaultView with a window reference, but my script is currently only tested in a few browsers (see https://github.com/ausi/Feature-detection-technique-for-pointer-events/wiki )
maybe you should wait until it's tested better.
ausi it turns out you can use window's getCompuedStyle except when going cross-frame in ff3.6
that's the only time you need to use d.dV
but luckily we dont have that problem here.
just FYI.. anyway closed this issue as I merged ausi's PR. cheers.
remove pointer events test as it's not reliable. ref #80
pointer-events needs more testing. It's false positiving in IE9 due to pointer-events on SVG support (I believe).
I've removed the existing test from the repo.
We've tried to do p-e tests in #386 and #556. And #519 pointed out the naive test will false positive in Opera.
Does someone want to take on defining the best test here? This needs a more thorough look. cc @helgri @ausi
IE10 also renders false positives as pointer-events are present, and even retain valid values, yet don't function on HTML elements. Support is there for SVG, as Paul suggested.
I can not confirm false positives in IE9 or Opera. Both browsers do not support pointer-events for CSS/HTML.
On this page you can test the support by clicking the box in the middle:
it will also tell you if my test detected it correctly.
A list of browsers where i tested my script: https://github.com/ausi/Feature-detection-technique-for-pointer-events/wiki
should we rename the test to pointerevents-html to make clear this test is for testing the html support?
@paulirish what can i do to get this test back to the Modernizr feature-detects?
I don't see any problems with my test in any browser.
Yeah I'm not sure why I got so confused here. my bad, ausi.
Revert "remove pointer events test as it's not reliable. ref #80"
It's totally fine.
This reverts commit 284a859.
i tested with HTC TITAN (windows phone 7.5) and give me an INCOMPATIBILITY with pointer-events. But i think it's a false positive, because it worked in my website. How can i solve this issue?
@patavinus - Could you open a new issue and provide a Codepen (or similar) which reproduces the problem?
Apart from the the false positive result in browsers, the detection code using getComputedStyle().pointerEvents which will cause JS error because getComputedStyle() return null in Firefox for some reason due to the bug https://bugzilla.mozilla.org/show_bug.cgi?id=795520 and https://bugzilla.mozilla.org/show_bug.cgi?id=548397