bug 901781: Correct viewport algorithm for marionette and enable visibility tests; r=mdas