/*test visibility
494222
static void normalize(List<AccumulatedValuesBean> values, List<String> names, int limit){
		for (String name : names){
			//System.out.println("normalizing "+name);
			ArrayList<Float> valueCopy = new ArrayList<Float>(values.size());
			//step1 transform everything to float
			float min = Float.MAX_VALUE, max = Float.MIN_VALUE;
			for (AccumulatedValuesBean v : values){
				float val = Float.parseFloat(v.getValue(name));
				if (val>max)
					max = val;
				if (val<min)
					min = val;
				valueCopy.add(val);
			}
			//System.out.println("1: "+valueCopy);
			float range = max - min;
			float multiplier = limit / range;
			//System.out.println("range "+range+", multiplier "+multiplier);

			//step2 recalculate
			for (int i=0; i<values.size(); i++){
				float newValue = (valueCopy.get(i)-min)*multiplier;
				values.get(i).setValue(name, String.valueOf(newValue));
			}
		}
	}
1114118
def assert_visible(tag, element_id)
			if RWebSpec.framework =~ /selenium/i
      	perform_assertion { assert(eval("#{tag}(:id, '#{element_id.to_s}').displayed?"), "Element '#{tag}' with id: '#{element_id}' not visible") }
			else
			  perform_assertion { assert(eval("#{tag}(:id, '#{element_id.to_s}').visible?"), "Element '#{tag}' with id: '#{element_id}' not visible") }
			end
    end
50519
function (container) {
        container.items().filter(':visible').each(function (ctrl) {
          if (ctrl.recalc) {
            ctrl.recalc();
          }
        });
      }
473215
private static boolean checkAnnotation(AnnotationsAttribute invisible, AnnotationsAttribute visible,
            String annotationName) {
        boolean exist1 = false;
        boolean exist2 = false;
        if (invisible != null) {
            exist1 = invisible.getAnnotation(annotationName) != null;
        }
        if (visible != null) {
            exist2 = visible.getAnnotation(annotationName) != null;
        }
        return exist1 || exist2;
    }
606647
private boolean visibilityIsPublicOrProtected(DetailAST constructorToken) {
        DetailAST modifierToken = constructorToken.findFirstToken(TokenTypes.MODIFIERS);

        // No modifiers means package private.
        if (modifierToken == null) {
            return false;
        }

        return TokenUtil.findFirstTokenByPredicate(modifierToken,
            node -> node.getType() == TokenTypes.LITERAL_PUBLIC || node.getType() == TokenTypes.LITERAL_PROTECTED)
            .isPresent();
    }
43298
function _isVisible(start_element, padding) {

	var real_rect,
	    sample,
	    result,
	    rect;

	// Check if the start element is in the document
	if (!elementInDocument(start_element)) {
		return false;
	}

	// Check if the element is explicitly hidden
	if (isHidden(start_element)) {
		return false;
	}

	if (padding == null) {
		padding = 2;
	}

	// Make sure the start element is somewhere on the screen
	real_rect = start_element.getBoundingClientRect();

	rect = {
		bottom : real_rect.bottom + padding,
		right  : real_rect.right  + padding,
		left   : real_rect.left   - padding,
		top    : real_rect.top    - padding
	};

	// Totally underneath the viewport
	if (rect.top > document.documentElement.clientHeight) {
		return false;
	}

	// Totally above the viewport
	if (rect.bottom < 0) {
		return false;
	}

	// Totally left of the viewport
	if (rect.right < 0) {
		return false;
	}

	// Totally right of the viewport
	if (rect.left > document.documentElement.clientWidth) {
		return false;
	}

	result = isElementVisible(start_element);

	if (result) {
		// If no padding is given, we can also check for occlusions
		if (!padding) {
			return elementAtRectPoints(start_element, rect);
		}

		return true;
	} else {
		return false;
	}

	function isElementVisible(element) {

		var context = getViewContext(element),
		    ctx_rect;

		if (!context) {
			return false;
		}

		// Get the context rectangle
		ctx_rect = context.getBoundingClientRect();

		// The current element and the start element
		// both have to collide with the current context rectangle
		// (if the current element equals the start_element we only need
		//  to check the modified rect to the ctx_rect)
		if (   (element == start_element || collides(element, ctx_rect))
			&& collides(rect, ctx_rect)) {

			// If the context element is the document element,
			// no further checks are needed
			if (isDocumentElement(context)) {
				return true;
			}

			// Recursively see if the current context is visible
			return isElementVisible(context);
		}

		return false;
	}
}
1286768
function(test) {
      if (jsl.indexOf(JSLitmus._queue, test) >= 0) return;
      JSLitmus._queue.push(test);
      JSLitmus.renderTest(test);
      JSLitmus._nextTest();
    }
98802
private void checkIfEmpty(){
        if(emptyView != null){
            emptyView.setVisibility(getItemCount() > 0 ? View.GONE : View.VISIBLE);
        }
    }
266575
function setVisible(curEditor, visible) {
        // short-circuit no-ops
        if ((visible && curEditor === editor) || (!visible && !editor)) {
            return;
        }

        if (visible) {
            console.assert(!editor);
            editor = curEditor;

            // Don't support inline editors yet - search inside them is pretty screwy anyway (#2110)
            if (editor.isTextSubset()) {
                return;
            }

            var $sb = _getScrollbar(editor),
                $overlay = $("<div class='tickmark-track'></div>");
            $sb.parent().append($overlay);

            _calcScaling();

            // Update tickmarks during editor resize (whenever resizing has paused/stopped for > 1/3 sec)
            WorkspaceManager.on("workspaceUpdateLayout.ScrollTrackMarkers", _.debounce(function () {
                if (marks.length) {
                    _calcScaling();
                    $(".tickmark-track", editor.getRootElement()).empty();
                    _renderMarks(marks);
                }
            }, 300));

        } else {
            console.assert(editor === curEditor);
            $(".tickmark-track", curEditor.getRootElement()).remove();
            editor = null;
            marks = [];
            WorkspaceManager.off("workspaceUpdateLayout.ScrollTrackMarkers");
        }
    }
996847
function isVisible(elem) {
  return elem && (elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);
}
1052279
function(v, oSelf) {
        var source = this.source;
        if(!this.checked) {
            oSelf.hideSource(source);
        }
        else {
            oSelf.showSource(source);
        }
    }
860604
public static ExpectedCondition<Boolean> invisibilityOfElementLocated(final By locator) {
    return new ExpectedCondition<Boolean>() {
      @Override
      public Boolean apply(WebDriver driver) {
        try {
          return !(driver.findElement(locator).isDisplayed());
        } catch (NoSuchElementException e) {
          // Returns true because the element is not present in DOM. The
          // try block checks if the element is present but is invisible.
          return true;
        } catch (StaleElementReferenceException e) {
          // Returns true because stale element reference implies that element
          // is no longer visible.
          return true;
        }
      }

      @Override
      public String toString() {
        return "element to no longer be visible: " + locator;
      }
    };
  }
816190
public static void setVisible(Element element, boolean visible) {
        if (element != null) {
            element.getStyle().setDisplay(visible ? "" : "none");
        }
    }
454088
function (definition, visibility) {
        var isWScript = _GPF_HOST.WSCRIPT === _gpfHost;
        this._defaultVisibility = visibility;
        _gpfObjectForEach(definition, this._processDefinitionMember, this);
        if (isWScript && definition.hasOwnProperty("toString")) {
            this._processDefinitionMember(definition.toString, "toString");
        }
        this._defaultVisibility = _GPF_VISIBILITY_UNKNOWN;
        if (isWScript && definition.hasOwnProperty("constructor")) {
            this._addConstructor(definition.constructor, this._defaultVisibility);
        }
    }
369608
function( inst ) {
		return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );
	}
34014
function toggleVisibility(dom, show) {
  dom.style.display = show ? '' : 'none';
  dom['hidden'] = show ? false : true;
}
508688
private void checkNameVisibility(Scope scope, Node name) {
    if (!name.isName()) {
      return;
    }

    Var var = scope.getVar(name.getString());
    if (var == null) {
      return;
    }

    Visibility v = checkPrivateNameConvention(
        AccessControlUtils.getEffectiveNameVisibility(
            name, var, defaultVisibilityForFiles), name);

    switch (v) {
      case PACKAGE:
        if (!isPackageAccessAllowed(var, name)) {
          compiler.report(
              JSError.make(
                  name,
                  BAD_PACKAGE_PROPERTY_ACCESS,
                  name.getString(),
                  var.getSourceFile().getName()));
        }
        break;
      case PRIVATE:
        if (!isPrivateAccessAllowed(var, name)) {
          compiler.report(
              JSError.make(
                  name,
                  BAD_PRIVATE_GLOBAL_ACCESS,
                  name.getString(),
                  var.getSourceFile().getName()));
        }
        break;
      default:
        // Nothing to do for PUBLIC and PROTECTED
        // (which is irrelevant for names).
        break;
    }
  }