factoring list of vendor prefixes
using multi-line comments for readability
replacing doc variable with more explicit name
use multi-line if
remove spurrious console.log
s/Webkit/WebKit/ for capitalized prefix
throw error on attempting to set prefix on undefined ancestor