ausi/Feature-detection-technique-for-pointer-events

Questions

LeaVerou opened this issue · 2 comments

Hi, I have some questions/remarks about your code:

  1. Is there a particular reason you're creating a script element and not something else?
  2. Is there a particular reason you're appending to documentElement and not to body?
  3. I think setting it to none and checking for that would be better, in the hypothetical case a browser has it present but read-only. auto is the default value.
  4. Why getPropertyValue('pointer-events') instead of just .pointerEvents? Are there any browser support issues of the latter?
  5. If getComputedStyle isn't present, undefined will be returned instead of false.
ausi commented
  1. i am using the script element because it is allowed in the head and also in the body, so i thougt no browser should have a problem appending this element to the documentElement. But i didn't test other elements.
  2. document.body does not exist if the script is included in the header
  3. that sounds good, i will change this
  4. i don't think there are any browser support issues, i will change this
  5. i will change the return statement to "return !!supports"
ausi commented
  1. now the element x is used
  2. ...
  3. opera accepts the value none. So i had to use auto.
  4. done
  5. done