If the anchor is centered vertically, would the flyout fit above it?
437115
function fitsVerticallyWithCenteredAnchor(anchorBorderBox, flyoutMeasurements) {
                            // Returns true if the flyout would always fit at least top
                            // or bottom of its anchor, regardless of the position of the anchor,
                            // as long as the anchor never changed its height, nor did the height of
                            // the visualViewport change.
                            return ((_Overlay._Overlay._keyboardInfo._visibleDocHeight - anchorBorderBox.height) / 2) >= flyoutMeasurements.totalHeight;
                        }
1105380
def position_at_end(self, block):
        
        self._block = block
        self._anchor = len(block.instructions)
1011391
function (element) {
            var position = ariaUtilsDom.getOffset(element);
            position.width = element.offsetWidth;
            position.height = element.offsetHeight;
            var style = element.style;
            this._elementInitialPosition = position;
            style.position = "absolute";
            style.left = position.left + "px";
            style.top = position.top + "px";
            style.height = position.height + "px";
            style.width = position.width + "px";
        }
128923
function flyToHeight(surfaceHeight) {
    if (defined(surfaceHeight)) {
      height += surfaceHeight;
    }

    const newPosition = CesiumCartesian3.fromRadians(
      position.longitude,
      position.latitude,
      height
    );
    const pose = that._getCurrentOrientation();
    pose.destination = newPosition;

    if (flyTo) {
      camera.flyTo(pose);
    } else {
      camera.setView(pose);
    }

    // Needed on mobile to make sure that the render is marked as dirty so that once AV mode has been disabled for a
    // while and then is reenabled the .setView() function still has effect (otherwise dispite the call the .setView()
    // the view orientation does not visually update until the user manualy moves the camera position).
    that._terria.currentViewer.notifyRepaintRequired();
  }
423866
function(e)
              {
                container.css({ left: elementStartX - (pageStartX - e.pageX) + 'px', top: elementStartY - (pageStartY - e.pageY) + 'px' });
                if (settings.window.expandable && !$.support.boxModel) container.prev().css({ left: container.css("left"), top: container.css("top") });
                e.stopPropagation();
                e.preventDefault();
                return false;
              }
798336
function() {
      if (!this.openAsModal_) { return; }
      this.openAsModal_ = false;
      this.dialog_.style.zIndex = '';

      // This won't match the native <dialog> exactly because if the user set top on a centered
      // polyfill dialog, that top gets thrown away when the dialog is closed. Not sure it's
      // possible to polyfill this perfectly.
      if (this.replacedStyleTop_) {
        this.dialog_.style.top = '';
        this.replacedStyleTop_ = false;
      }

      // Clear the backdrop and remove from the manager.
      this.backdrop_.parentNode && this.backdrop_.parentNode.removeChild(this.backdrop_);
      dialogPolyfill.dm.removeDialog(this);
    }
533459
public int alignBox(Inline box)
    {
    	if (box instanceof InlineElement)
    	{
	        VerticalAlign va = ((InlineElement) box).getVerticalAlign();
	        if (va == VerticalAlign.TOP || va == VerticalAlign.BOTTOM)
	        {
	            return 0; //top and bottom boxes are aligned to the line box in their absolutePositions()
	        }
	        else
	        {
	            return above + computeBaselineDifference((InlineElement) box) - box.getBaselineOffset() + ((InlineElement) box).getLineboxOffset();
	        }
    	}
    	else
    		return above - box.getBaselineOffset();
    }
76140
function(r) {
			geo.origin.size.height = r.height,
				geo.origin.windowOffset.left = r.left,
				geo.origin.windowOffset.top = r.top,
				geo.origin.size.width = r.width
		}
771843
def iter_for_anchor(self, anchor):
        """"""
        return (subtotal for subtotal in self._subtotals if subtotal.anchor == anchor)
808438
public void configureCamera(CameraPinholeBrown intrinsic ,
								Se3_F64 planeToCamera ) {
		this.planeToCamera = planeToCamera;

		if( !selectOverhead.process(intrinsic,planeToCamera) )
			throw new IllegalArgumentException("Can't find a reasonable overhead map.  Can the camera view the plane?");

		overhead.centerX = selectOverhead.getCenterX();
		overhead.centerY = selectOverhead.getCenterY();

		createOverhead.configure(intrinsic,planeToCamera,overhead.centerX,overhead.centerY,overhead.cellSize,
				selectOverhead.getOverheadWidth(),selectOverhead.getOverheadHeight());

		// used to counter act offset in overhead image
		origToMap.set(overhead.centerX,overhead.centerY,0);
		mapToOrigin.set(-overhead.centerX,-overhead.centerY,0);

		// fill it so there aren't any artifacts in the left over
		overhead.image.reshape(selectOverhead.getOverheadWidth(), selectOverhead.getOverheadHeight());
		GImageMiscOps.fill(overhead.image,0);
	}
208412
private boolean shouldDisplayTooltipAbove() {

        boolean displayAbove;
        if (isSimpleValue()) {
            Direction direction = Direction.none;
            if (m_widget instanceof I_CmsHasDisplayDirection) {
                direction = ((I_CmsHasDisplayDirection)m_widget).getDisplayingDirection();
            }
            switch (direction) {
                case above:
                    displayAbove = true;
                    break;
                case below:
                case none:
                default:
                    displayAbove = true;
                    break;
            }
        } else {
            displayAbove = true;
        }

        m_helpBubble.getStyle().setDisplay(Display.BLOCK);
        int bubbleHeight = m_helpBubble.getOffsetHeight();
        m_helpBubble.getStyle().clearDisplay();

        Element widgetElement = m_widget.asWidget().getElement();
        // Calculate top position for the popup
        int top = widgetElement.getAbsoluteTop();

        int windowTop = Window.getScrollTop();
        int windowBottom = Window.getScrollTop() + Window.getClientHeight();
        CmsDebugLog.consoleLog("window bottom: " + windowBottom + "    window height: " + Window.getClientHeight());

        int distanceFromWindowTop = top - windowTop - TOOLBAR_HEIGHT;

        int distanceToWindowBottom = windowBottom - (top + widgetElement.getOffsetHeight());
        if (displayAbove
            && ((distanceFromWindowTop < bubbleHeight) && (distanceToWindowBottom > distanceFromWindowTop))) {
            // in case there is too little space above, and there is more below, change direction
            displayAbove = false;
        } else if (!displayAbove
            && ((distanceToWindowBottom < bubbleHeight) && (distanceFromWindowTop > distanceToWindowBottom))) {
            // in case there is too little space below, and there is more above, change direction
            displayAbove = true;
        }
        return displayAbove;
    }
1165180
function adjustHeight() {
        var windowHeight = $(window).height();
        var headerHeight = $("#main-nav").height();
        var containerHeight = windowHeight - headerHeight;
        $("#main").css("min-height", "" + containerHeight + "px");
    }
821177
function moveToLocation(surfaceHeight) {
    if (!defined(surfaceHeight)) {
      surfaceHeight = 0;
    }

    let hoverHeight = viewerHeight - surfaceHeight;
    if (defined(maximumHeight) && hoverHeight > maximumHeight) {
      hoverHeight = maximumHeight;
    }

    that.hover(hoverHeight, position, flyTo);
  }
152515
function (opts, obj) {
			var overlay = this.overlay;

			$('.fancybox-overlay').stop(true, true);

			if (!overlay) {
				this.create(opts);
			}

			if (opts.locked && this.fixed && obj.fixed) {
				if (!overlay) {
					this.margin = D.height() > W.height() ? $('html').css('margin-right').replace("px", "") : false;
				}

				obj.locked = this.overlay.append( obj.wrap );
				obj.fixed  = false;
			}

			if (opts.showEarly === true) {
				this.beforeShow.apply(this, arguments);
			}
		}
352750
def _adjust_anchors(anchor_data, ufo, component):
    """"""

    glyph = ufo[component.baseGlyph]
    t = Transform(*component.transformation)
    for anchor in glyph.anchors:
        # only adjust if this anchor has data and the component also contains
        # the associated mark anchor (e.g. "_top" for "top")
        if anchor.name in anchor_data and any(
            a.name == "_" + anchor.name for a in glyph.anchors
        ):
            anchor_data[anchor.name] = t.transformPoint((anchor.x, anchor.y))
1336161
def to_ufo_glyph_anchors(self, glyph, anchors):
    """"""

    for anchor in anchors:
        x, y = anchor.position
        anchor_dict = {"name": anchor.name, "x": x, "y": y}
        glyph.appendAnchor(anchor_dict)
1295060
function(scrollX, scrollY, spaceHeights) {
        var $yInnerBorder, $yOuterBorder, $spaceRightTop, $spaceRightBottom, $frozenBorder;

        if (scrollX) {
            $frozenBorder = createDiv(classNameConst.SCROLLBAR_FROZEN_BORDER, {
                height: dimensionConst.SCROLLBAR_WIDTH
            });
        }

        if (scrollY) {
            // subtract 2px for border-width (top and bottom)
            $spaceRightTop = createDiv(classNameConst.SCROLLBAR_RIGHT_TOP, {
                height: spaceHeights.top - 2
            });
            $yInnerBorder = createDiv(classNameConst.SCROLLBAR_Y_INNER_BORDER, {
                top: spaceHeights.top
            });
            $yOuterBorder = createDiv(classNameConst.SCROLLBAR_Y_OUTER_BORDER);
        }

        if (scrollX || scrollY) {
            $spaceRightBottom = createDiv(classNameConst.SCROLLBAR_RIGHT_BOTTOM, {
                height: spaceHeights.bottom
            });
        }

        this.$el.append(
            $yInnerBorder,
            $yOuterBorder,
            $spaceRightTop,
            $spaceRightBottom,
            $frozenBorder
        );

        this.$scrollBorder = $yInnerBorder;
    }