Bug 1253236 - Remove window argument from element.isVisible; r=automatedtester

MozReview-Commit-ID: ITzY9RXjJCG

--HG--
extra : rebase_source : 7954e5d2891a8d214fdbf00ea1b0b62acc0482b3
This commit is contained in:
Andreas Tolfsen 2016-03-03 14:20:39 +00:00
parent 4a0bcbbee4
commit a1495c253c
4 changed files with 6 additions and 4 deletions

View File

@ -815,7 +815,9 @@ element.inViewport = function(el, x = undefined, y = undefined) {
* Vertical offset relative to target. Defaults to the centre of
* the target's bounding box.
*/
element.isVisible = function(el, win, x = undefined, y = undefined) {
element.isVisible = function(el, x = undefined, y = undefined) {
let win = el.ownerDocument.defaultView;
// Bug 1094246: Webdriver's isShown doesn't work with content xul
let ns = atom.getElementAttribute(el, "namespaceURI", win);
if (ns.indexOf("there.is.only.xul") < 0 &&

View File

@ -933,7 +933,7 @@ function focusElement(element) {
event.sendKeysToElement = function(
keySequence, el, opts = {}, window = undefined) {
if (opts.ignoreVisibility || element.isVisible(el, window)) {
if (opts.ignoreVisibility || element.isVisible(el)) {
focusElement(el);
// make Object.<modifier, false> map

View File

@ -96,7 +96,7 @@ Interactions.prototype = {
*/
clickElement(container, elementManager, id) {
let el = elementManager.getKnownElement(id, container);
let visible = element.isVisible(el, container.frame);
let visible = element.isVisible(el);
if (!visible) {
throw new ElementNotVisibleError('Element is not visible');
}

View File

@ -874,7 +874,7 @@ function coordinates(target, x, y) {
function singleTap(id, corx, cory) {
let el = elementManager.getKnownElement(id, curContainer);
// after this block, the element will be scrolled into view
let visible = element.isVisible(el, curContainer.frame, corx, cory);
let visible = element.isVisible(el, corx, cory);
if (!visible) {
throw new ElementNotVisibleError("Element is not currently visible and may not be manipulated");
}