示例#1
0
void setViewportFeature(const String& keyString, const String& valueString, Document* document, void* data)
{
    ViewportArguments* arguments = static_cast<ViewportArguments*>(data);

    if (keyString == "width")
        arguments->width = findSizeValue(keyString, valueString, document);
    else if (keyString == "height")
        arguments->height = findSizeValue(keyString, valueString, document);
    else if (keyString == "initial-scale")
        arguments->zoom = findScaleValue(keyString, valueString, document);
    else if (keyString == "minimum-scale")
        arguments->minZoom = findScaleValue(keyString, valueString, document);
    else if (keyString == "maximum-scale")
        arguments->maxZoom = findScaleValue(keyString, valueString, document);
    else if (keyString == "user-scalable")
        arguments->userZoom = findBooleanValue(keyString, valueString, document);
#if PLATFORM(IOS)
    else if (keyString == "minimal-ui")
        // FIXME: Ignore silently for now. This should eventually fall back to the warning.
        { }
#endif
    else if (keyString == "shrink-to-fit")
        arguments->shrinkToFit = findBooleanValue(keyString, valueString, document);
    else
        reportViewportWarning(document, UnrecognizedViewportArgumentKeyError, keyString, String());
}
示例#2
0
void setViewportFeature(const String& keyString, const String& valueString, Document* document, void* data)
{
    ViewportArguments* arguments = static_cast<ViewportArguments*>(data);

    if (keyString == "width")
        arguments->width = findSizeValue(keyString, valueString, document);
    else if (keyString == "height")
        arguments->height = findSizeValue(keyString, valueString, document);
    else if (keyString == "initial-scale")
        arguments->zoom = findScaleValue(keyString, valueString, document);
    else if (keyString == "minimum-scale")
        arguments->minZoom = findScaleValue(keyString, valueString, document);
    else if (keyString == "maximum-scale")
        arguments->maxZoom = findScaleValue(keyString, valueString, document);
    else if (keyString == "user-scalable")
        arguments->userZoom = findUserScalableValue(keyString, valueString, document);
    else
        reportViewportWarning(document, UnrecognizedViewportArgumentKeyError, keyString, String());
}
示例#3
0
void setViewportFeature(const String& keyString, const String& valueString, Document* document, void* data)
{
    ViewportArguments* arguments = static_cast<ViewportArguments*>(data);

    if (keyString == "width")
        arguments->width = findSizeValue(keyString, valueString, document);
    else if (keyString == "height")
        arguments->height = findSizeValue(keyString, valueString, document);
    else if (keyString == "initial-scale")
        arguments->initialScale = findScaleValue(keyString, valueString, document);
    else if (keyString == "minimum-scale")
        arguments->minimumScale = findScaleValue(keyString, valueString, document);
    else if (keyString == "maximum-scale")
        arguments->maximumScale = findScaleValue(keyString, valueString, document);
    else if (keyString == "user-scalable")
        arguments->userScalable = findUserScalableValue(keyString, valueString, document);
    else if (keyString == "target-densitydpi")
        arguments->targetDensityDpi = findTargetDensityDPIValue(keyString, valueString, document);
}