Enhanced containsPoint method to make use of an optional reference frame dom element.