PitPik / colorPicker

Advanced javaScript color picker and color conversion / calculation (rgb, hsv, hsl, hex, cmyk, cmy, XYZ, Lab, alpha, WCAG 2.0, ...)
http://www.dematte.at/colorPicker/
MIT License
570 stars 136 forks source link

potential failures with "document" #48

Open aruben-c opened 8 years ago

aruben-c commented 8 years ago

Hi, First of all: thanks for this great color picker.

I think there are some potential failures if using it in an sandbox or across an iframe. Because:

"window" is passed to "ColorPicker", but inside, it uses directly "document" If we look at the code of jquery, it set "document" with: var document = window.document; So, "ColorPicker" must also set it from the beginning of the code. Otherwise, it uses the current "window.document" and not the "document" of the provided "window".

I don't take time to write a test code, I only analyse the code.

Thanks again, ARuben