Determine the value of the viewport meta-tag
178780
def getViewportValues(self, view=None):
        
        values = {
            'width': 'device-width',
            'initial-scale': '1.0',
        }

        return ','.join('%s=%s' % (k, v) for k, v in values.items())
425963
function (needle, haystack) {
            needle.width = needle.width || 0;
            needle.height = needle.height || 0;
            if (haystack == this.VIEWPORT) {
                return this.isInViewport({
                    left : needle.x,
                    top : needle.y
                }, {
                    width : needle.width,
                    height : needle.height
                });
            }
            haystack.width = haystack.width || 0;
            haystack.height = haystack.height || 0;
            if (needle.x < haystack.x || needle.y < haystack.y || needle.x + needle.width > haystack.x + haystack.width
                    || needle.y + needle.height > haystack.y + haystack.height) {
                return false;
            }
            return true;
        }
163311
public function getViewportLabel($viewport)
    {
        switch ($viewport) {
            case self::VIEWPORT_TINY:
                return _t(__CLASS__ . '.TINY', 'Tiny');
            case self::VIEWPORT_SMALL:
                return _t(__CLASS__ . '.SMALL', 'Small');
            case self::VIEWPORT_MEDIUM:
                return _t(__CLASS__ . '.MEDIUM', 'Medium');
            case self::VIEWPORT_LARGE:
                return _t(__CLASS__ . '.LARGE', 'Large');
            case self::VIEWPORT_HUGE:
                return _t(__CLASS__ . '.HUGE', 'Huge');
        }
    }
330388
protected void viewportChanged (int pixelWidth, int pixelHeight) {
    viewPixelWidth = pixelWidth;
    viewPixelHeight = pixelHeight;
    viewSizeM.width = scale.invScaled(pixelWidth);
    viewSizeM.height = scale.invScaled(pixelHeight);
    plat.log().info("viewPortChanged " + pixelWidth + "x" + pixelHeight + " / " + scale.factor +
                    " -> " + viewSize);
  }
234526
function _Browser_getViewportOf(id) {
    return _Browser_withNode(id, function(node) {
      return {
        scene: {
          width: node.scrollWidth,
          height: node.scrollHeight
        },
        viewport: {
          x: node.scrollLeft,
          y: node.scrollTop,
          width: node.clientWidth,
          height: node.clientHeight
        }
      };
    });
  }
494219
function( viewport ) {

        var viewerSize,
            newWidth,
            newHeight,
            bounds,
            topleft,
            bottomright;

        viewerSize = $.getElementSize( this.viewer.element );
        if ( this._resizeWithViewer && viewerSize.x && viewerSize.y && !viewerSize.equals( this.oldViewerSize ) ) {
            this.oldViewerSize = viewerSize;

            if ( this.maintainSizeRatio || !this.elementArea) {
                newWidth  = viewerSize.x * this.sizeRatio;
                newHeight = viewerSize.y * this.sizeRatio;
            } else {
                newWidth = Math.sqrt(this.elementArea * (viewerSize.x / viewerSize.y));
                newHeight = this.elementArea / newWidth;
            }

            this.element.style.width  = Math.round( newWidth ) + 'px';
            this.element.style.height = Math.round( newHeight ) + 'px';

            if (!this.elementArea) {
                this.elementArea = newWidth * newHeight;
            }

            this.updateSize();
        }

        if (viewport && this.viewport) {
            bounds      = viewport.getBoundsNoRotate(true);
            topleft     = this.viewport.pixelFromPointNoRotate(bounds.getTopLeft(), false);
            bottomright = this.viewport.pixelFromPointNoRotate(bounds.getBottomRight(), false)
                .minus( this.totalBorderWidths );

            //update style for navigator-box
            var style = this.displayRegion.style;
            style.display = this.world.getItemCount() ? 'block' : 'none';

            style.top    = Math.round( topleft.y ) + 'px';
            style.left   = Math.round( topleft.x ) + 'px';

            var width = Math.abs( topleft.x - bottomright.x );
            var height = Math.abs( topleft.y - bottomright.y );
            // make sure width and height are non-negative so IE doesn't throw
            style.width  = Math.round( Math.max( width, 0 ) ) + 'px';
            style.height = Math.round( Math.max( height, 0 ) ) + 'px';
        }

    }
696261
def wf_point_tag?(key, val)
      if key && val && (key.size + val.size < 254) &&
         key =~ /^[\w\-\.:]+$/ && val !~ /\\$/
        return
      end

      raise Wavefront::Exception::InvalidTag
    end
702687
function() {
            if ( initialized ) { return; }
            execPreInitPlugins( root );

            // First we set up the viewport for mobile devices.
            // For some reason iPad goes nuts when it is not done properly.
            var meta = lib.util.$( "meta[name='viewport']" ) || document.createElement( "meta" );
            meta.content = "width=device-width, minimum-scale=1, maximum-scale=1, user-scalable=no";
            if ( meta.parentNode !== document.head ) {
                meta.name = "viewport";
                document.head.appendChild( meta );
            }

            // Initialize configuration object
            var rootData = root.dataset;
            config = {
                width: lib.util.toNumber( rootData.width, defaults.width ),
                height: lib.util.toNumber( rootData.height, defaults.height ),
                maxScale: lib.util.toNumber( rootData.maxScale, defaults.maxScale ),
                minScale: lib.util.toNumber( rootData.minScale, defaults.minScale ),
                perspective: lib.util.toNumber( rootData.perspective, defaults.perspective ),
                transitionDuration: lib.util.toNumber(
                    rootData.transitionDuration, defaults.transitionDuration
                )
            };

            windowScale = computeWindowScale( config );

            // Wrap steps with "canvas" element
            lib.util.arrayify( root.childNodes ).forEach( function( el ) {
                canvas.appendChild( el );
            } );
            root.appendChild( canvas );

            // Set initial styles
            document.documentElement.style.height = "100%";

            css( body, {
                height: "100%",
                overflow: "hidden"
            } );

            var rootStyles = {
                position: "absolute",
                transformOrigin: "top left",
                transition: "all 0s ease-in-out",
                transformStyle: "preserve-3d"
            };

            css( root, rootStyles );
            css( root, {
                top: "50%",
                left: "50%",
                perspective: ( config.perspective / windowScale ) + "px",
                transform: scale( windowScale )
            } );
            css( canvas, rootStyles );

            body.classList.remove( "impress-disabled" );
            body.classList.add( "impress-enabled" );

            // Get and init steps
            initAllSteps();

            // Set a default initial state of the canvas
            currentState = {
                translate: { x: 0, y: 0, z: 0 },
                rotate:    { x: 0, y: 0, z: 0, order: "xyz" },
                scale:     1
            };

            initialized = true;

            lib.util.triggerEvent( root, "impress:init",
                                   { api: roots[ "impress-root-" + rootId ] } );
        }
386284
def viewport(self) -> Tuple[int, int, int, int]:
        '''
            
        '''

        return self.wnd.viewport
1029878
function (t) {
        var o_p = this.offsetParent(),
            o = o_p.offset(),
            p = t.offset();

        p.top -= o.top;
        p.left -= o.left;

        //set some flags on the p object to pass along
        p.missRight = false;
        p.missTop = false;
        p.missLeft = false;
        p.leftRightFlag = false;

        //lets see if the panel will be off the screen
        //get the actual width of the page and store it
        var actualBodyWidth;
        if (document.getElementsByClassName('row')[0]) {
          actualBodyWidth = document.getElementsByClassName('row')[0].clientWidth;
        } else {
          actualBodyWidth = window.outerWidth;
        }

        var actualMarginWidth = (window.outerWidth - actualBodyWidth) / 2;
        var actualBoundary = actualBodyWidth;

        if (!this.hasClass('mega')) {
          //miss top
          if (t.offset().top <= this.outerHeight()) {
            p.missTop = true;
            actualBoundary = window.outerWidth - actualMarginWidth;
            p.leftRightFlag = true;
          }

          //miss right
          if (t.offset().left + this.outerWidth() > t.offset().left + actualMarginWidth && t.offset().left - actualMarginWidth > this.outerWidth()) {
            p.missRight = true;
            p.missLeft = false;
          }

          //miss left
          if (t.offset().left - this.outerWidth() <= 0) {
            p.missLeft = true;
            p.missRight = false;
          }
        }

        return p;
      }
690973
public function viewport($content = null)
    {
        if (empty($content)) {
            $content = 'width=device-width, initial-scale=1.0';
        }
        if (is_array($content)) {
            $content = implode(', ', $content);
        }
        return $this->meta(array('name' => 'viewport', 'content' => $content));
    }
1035028
function (inst, offset, isFixed) {
            var tpWidth = inst.tpDiv.outerWidth();
            var tpHeight = inst.tpDiv.outerHeight();
            var inputWidth = inst.input ? inst.input.outerWidth() : 0;
            var inputHeight = inst.input ? inst.input.outerHeight() : 0;
            var viewWidth = document.documentElement.clientWidth + $(document).scrollLeft();
            var viewHeight = document.documentElement.clientHeight + $(document).scrollTop();

            offset.left -= (this._get(inst, 'isRTL') ? (tpWidth - inputWidth) : 0);
            offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0;
            offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;

            // now check if timepicker is showing outside window viewport - move to a better place if so.
            offset.left -= Math.min(offset.left, (offset.left + tpWidth > viewWidth && viewWidth > tpWidth) ?
                Math.abs(offset.left + tpWidth - viewWidth) : 0);
            offset.top -= Math.min(offset.top, (offset.top + tpHeight > viewHeight && viewHeight > tpHeight) ?
                Math.abs(tpHeight + inputHeight) : 0);

            return offset;
        }
1184184
function getBoundingVisibleRect(el) {
    // Get the element bounding rect in the layout viewport.
    const rect = getBoundingRect(el);

    // Apply the visual viewport transform (i.e. pinch-zoom) to the bounding
    // rect. The viewportX|Y values are in CSS pixels so they don't change
    // with page scale. We first translate so that the viewport offset is
    // at the origin and then we apply the scaling factor.
    const scale = getPageScaleFactor();
    const visualViewportX = chrome.gpuBenchmarking.visualViewportX();
    const visualViewportY = chrome.gpuBenchmarking.visualViewportY();
    rect.top = (rect.top - visualViewportY) * scale;
    rect.left = (rect.left - visualViewportX) * scale;
    rect.width *= scale;
    rect.height *= scale;

    // Get the window dimensions.
    const windowHeight = getWindowHeight();
    const windowWidth = getWindowWidth();

    // Then clip the rect to the screen size.
    rect.top = clamp(0, rect.top, windowHeight);
    rect.left = clamp(0, rect.left, windowWidth);
    rect.height = clamp(0, rect.height, windowHeight - rect.top);
    rect.width = clamp(0, rect.width, windowWidth - rect.left);

    return rect;
  }
754657
function(pixel) {
        $.console.assert(this.viewer,
            "[Viewport.imageToWindowCoordinates] the viewport must have a viewer.");
        var viewerCoordinates = this.imageToViewerElementCoordinates(pixel);
        return viewerCoordinates.plus(
                $.getElementPosition(this.viewer.element));
    }
725483
def match_aspect_to_viewport(self):
        """"""
        viewport = self.viewport
        self.aspect = float(viewport.width) / viewport.height
1163839
function (vnode, callback) {
    const info = { result: false }

    if (vnode && vnode === 'viewport') {
      info.result = true
      info.size = {
        width: document.documentElement.clientWidth,
        height: document.documentElement.clientHeight,
        top: 0,
        left: 0,
        right: document.documentElement.clientWidth,
        bottom: document.documentElement.clientHeight
      }
    }
    else if (vnode && vnode.$el) {
      info.result = true
      info.size = vnode.$el.getBoundingClientRect()
    }

    const message = info.result ? info : {
      result: false,
      errMsg: 'Illegal parameter'
    }

    callback && callback(message)
    return message
  }
1056074
function () {
            var state = this.state,
                zoomState = state.zoomState,
                zoom = zoomState.zoom,
                zoomedWidth = state.sumWidths,
                zoomedHeight = Math.floor(state.tallestPage.totalActualHeight * zoom),
                docWidth = Math.max(zoomedWidth, state.viewportDimensions.clientWidth),
                docHeight = Math.max(zoomedHeight, state.viewportDimensions.clientHeight);

            this.$doc.css({
                height: docHeight,
                lineHeight: docHeight + 'px',
                width: docWidth
            });
        }