Fix 1144

This PR replaces #1144.

Note that it did not seem feasible to separate the issues.  Fixing the :focus ones would be a NOP because the dialog tests still could not be enabled because they would fail on the viewPort issue.  So instead I locally fixed the viewpPort issue by specifying a phantomScript option to qunit and including the (minimally modified) version that supports options.page.

Hopefully this works.