CSS: Make sure elem.ownerDocument.defaultView is not null
CSS: Make sure elem.ownerDocument.defaultView is not null

Fixes gh-2866
Close gh-2867

jquery/jquery,roytoo/jquery,jquery/jquery,roytoo/jquery,jquery/jquery,roytoo/jquery