Wait until an element is no longer attached to the DOM.

@param element The element to wait for.
@return false if the element is still attached to the DOM, true otherwise.
559952
public static ExpectedCondition<Boolean> stalenessOf(final WebElement element) {
    return new ExpectedCondition<Boolean>() {
      @Override
      public Boolean apply(WebDriver ignored) {
        try {
          // Calling any method forces a staleness check
          element.isEnabled();
          return false;
        } catch (StaleElementReferenceException expected) {
          return true;
        }
      }

      @Override
      public String toString() {
        return String.format("element (%s) to become stale", element);
      }
    };
  }
548034
function(element) {
    element = $(element);
    var node = element.firstChild;
    while (node) {
      var nextNode = node.nextSibling;
      if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
        element.removeChild(node);
      node = nextNode;
    }
    return element;
  }
509989
@Override
  public boolean contains(int element)
  {
    if (element < 0) {
      throw new IndexOutOfBoundsException("element < 0: " + element);
    }
    if (isEmpty()) {
      return false;
    }
    return findElementOrEmpty(element) >= 0;
  }
542336
public boolean isEndedBy(final T element) {
        if (element == null) {
            return false;
        }

        return upperEndpoint.isClosed && upperEndpoint.compareTo(element) == 0;
    }
258180
public static boolean hasBorder(Element element) {

        String borderStyle = CmsDomUtil.getCurrentStyle(element, Style.borderStyle);
        if ((borderStyle == null) || borderStyle.equals(StyleValue.none.toString()) || (borderStyle.length() == 0)) {
            return false;
        }
        return true;

    }
1234756
@Override
    protected boolean isAcceptable(Element element) {
        if (element.getKind() == ElementKind.METHOD) {
            Set<Modifier> modifiers = element.getModifiers();
            return modifiers.contains(Modifier.PUBLIC) && !modifiers.contains(Modifier.FINAL) && !modifiers.contains(Modifier.STATIC);
        } else {
            return false;
        }
    }
486566
public static WebElement isElementPresentAndGetFirstOne(By element) {

        final WebDriver webDriver = Context.getDriver();

        webDriver.manage().timeouts().implicitlyWait(DriverFactory.IMPLICIT_WAIT * 2, TimeUnit.MICROSECONDS);

        final List<WebElement> foundElements = webDriver.findElements(element);
        final boolean exists = !foundElements.isEmpty();

        webDriver.manage().timeouts().implicitlyWait(DriverFactory.IMPLICIT_WAIT, TimeUnit.MICROSECONDS);

        if (exists) {
            return foundElements.get(0);
        } else {
            return null;
        }

    }
245560
public boolean removeElement(P element) {
		boolean changed = false;
		if (element != null) {
			GridCellElement<P> gridElement;
			for (final GridCell<P> cell : getGridCellsOn(element.getGeoLocation().toBounds2D())) {
				gridElement = cell.removeElement(element);
				if (gridElement != null) {
					if (cell.isEmpty()) {
						this.cells[cell.row()][cell.column()] = null;
						--this.cellCount;
					}
					for (final GridCell<P> otherCell : gridElement.consumeCells()) {
						assert otherCell != cell;
						otherCell.removeElement(element);
						if (otherCell.isEmpty()) {
							this.cells[otherCell.row()][otherCell.column()] = null;
							--this.cellCount;
						}
					}
					changed = true;
				}
			}
		}
		if (changed) {
			--this.elementCount;
		}
		return changed;
	}
793980
public void waitForNotVisible(final long time) throws WidgetException {
		try {
			waitForCommand(new ITimerCallback() {

				@Override
				public boolean execute() throws WidgetException {
					return !isVisible();
				}

				@Override
				public String toString() {
					return "Waiting for element with locator: " + locator + " to not be visible";
				}
			}, time);
		} catch (Exception e) {
			throw new WidgetException("Error while waiting for element to be not visible", locator, e);
		}
	}
877184
public void release(T element) {
    try {
      if (recycle(element)) {
        elements.add(element);
      }
    } finally {
      semaphore.release();
    }
  }
459062
protected boolean addElem(final T element) {
    // validate element
    if (element == null) {
      throw new IllegalArgumentException("Null element is not supported.");
    }
    // find hashCode & index
    final int hashCode = element.hashCode();
    final int index = getIndex(hashCode);
    // return false if already present
    if (containsElem(index, element, hashCode)) {
      return false;
    }

    modification++;
    size++;

    // update bucket linked list
    DoubleLinkedElement<T> le = new DoubleLinkedElement<T>(element, hashCode);
    le.next = entries[index];
    entries[index] = le;

    // insert to the end of the all-element linked list
    le.after = null;
    le.before = tail;
    if (tail != null) {
      tail.after = le;
    }
    tail = le;
    if (head == null) {
      head = le;
    }
    return true;
  }
140207
public void waitForElementNotPresent(final long time) throws WidgetException {
		try {
			waitForCommand(new ITimerCallback() {

				@Override
				public boolean execute() throws WidgetException {
					return !isElementPresent();
				}

				@Override
				public String toString() {
					return "Waiting for element with locator " + locator + " to not be present";
				}
			}, time);
		} catch (Exception e) {
			throw new WidgetException("Error while waiting for element to be not present", locator, e);
		}
	}
459145
def wait_for(element)
      case element
        when :page_load
          browser.wait_for(:wait_for => :page)
        when :ajax
          browser.wait_for(:wait_for => :ajax, :javascript_framework => Pyrite.js_framework)
        else
          browser.wait_for(:element => "jquery=#{element}")
      end
    end
522408
private void ensureId(final Element element) {
        final String id = element.getId();
        if (id == null || id.isEmpty()) {
            element.setId(Document.get().createUniqueId());
        }
    }
556342
public void remove(T element) {
      lock.writeLock().lock();
      try {
         if (outgoingEdges.remove(element) != null) {
            for (Set<T> values : outgoingEdges.values()) {
               values.remove(element);
            }
         }
         if (incomingEdges.remove(element) != null) {
            for (Set<T> values : incomingEdges.values()) {
               values.remove(element);
            }
         }
      } finally {
         lock.writeLock().unlock();
      }
   }
945191
public void waitAndAssertForExpectedCondition(ExpectedCondition<?> condition, int timeout) {
        if (!waitForExpectedCondition(condition, timeout)) {
            fail(String.format("Element does not meet condition %1$s", condition.toString()));
        }
    }
842251
def wait_for_element(self, selector, by=By.CSS_SELECTOR,
                         timeout=settings.LARGE_TIMEOUT):
        
        if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
            timeout = self.__get_new_timeout(timeout)
        return self.wait_for_element_visible(selector, by=by, timeout=timeout)