Skip to content

Instantly share code, notes, and snippets.

@AutomatedTester
Created March 9, 2012 20:01
Show Gist options
  • Select an option

  • Save AutomatedTester/2008357 to your computer and use it in GitHub Desktop.

Select an option

Save AutomatedTester/2008357 to your computer and use it in GitHub Desktop.
Index: dom.js
===================================================================
--- dom.js (revision 16201)
+++ dom.js (working copy)
@@ -708,7 +708,27 @@
if (!positiveSize(elem)) {
return false;
}
+ function isOverflowHiding(e){
+ var parent = bot.dom.getParentElement(e);
+ if (bot.dom.getEffectiveStyle(parent, 'overflow') == 'hidden'){
+ var sizeOfParent = bot.dom.getElementSize_(parent);
+ var locOfParent = goog.style.getClientPosition(parent);
+ var locOfElement = goog.style.getClientPosition(e);
+ if (locOfParent.x + sizeOfParent.width < locOfElement.x){
+ return false;
+ }
+ if (locOfParent.y + sizeOfParent.height < locOfElement.y){
+ return false;
+ }
+ return !parent || isOverflowHiding(parent);
+ }
+ return true;
+ }
+ if (!isOverflowHiding(elem)){
+ return false;
+ }
+
return true;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment