Merge everything before "ts.gui" changes...

@nealstewart 
(and in general, since this is a general Element.matches mechanism: https://developer.mozilla.org/en-US/docs/Web/API/Element.matches)