MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / func

Function func

javascript/atoms/locators/relative.js:234–252  ·  view source on GitHub ↗
(compareTo)

Source from the content-addressed store, hash-verified

232 * @return {boolean}
233 */
234 var func = function (compareTo) {
235 var element = bot.locators.relative.resolve_(selector);
236
237 if (element === compareTo) {
238 return false;
239 }
240
241 var rect1 = bot.dom.getClientRect(element);
242 var rect2 = bot.dom.getClientRect(compareTo);
243
244 var rect1_bigger = new goog.math.Rect(
245 rect1.left-distance,
246 rect1.top-distance,
247 rect1.width+distance*2,
248 rect1.height+distance*2
249 );
250
251 return rect1_bigger.intersects(rect2);
252 };
253
254 return func;
255};

Callers 4

wrapperFunction · 0.85
wrapperFunction · 0.85
load_pageFunction · 0.85
WaitForMethod · 0.85

Calls

no outgoing calls

Tested by 1

WaitForMethod · 0.68