Update getStyles.js to support when ownerDocument is a shadow dom element

Use case: http://jsbin.com/lirejo/edit