Don't use the document object for flip mask.

Now we can use masks.js without any DOM.