void ViewportStyleResolver::resolve()
{
    if (!m_document)
        return;

    if (!m_propertySet) {
        m_document->setViewportDescription(ViewportDescription(ViewportDescription::UserAgentStyleSheet));
        return;
    }

    ViewportDescription description(m_hasAuthorStyle ? ViewportDescription::AuthorStyleSheet : ViewportDescription::UserAgentStyleSheet);

    description.userZoom = viewportArgumentValue(CSSPropertyUserZoom);
    description.zoom = viewportArgumentValue(CSSPropertyZoom);
    description.minZoom = viewportArgumentValue(CSSPropertyMinZoom);
    description.maxZoom = viewportArgumentValue(CSSPropertyMaxZoom);
    description.minWidth = viewportLengthValue(CSSPropertyMinWidth);
    description.maxWidth = viewportLengthValue(CSSPropertyMaxWidth);
    description.minHeight = viewportLengthValue(CSSPropertyMinHeight);
    description.maxHeight = viewportLengthValue(CSSPropertyMaxHeight);
    description.orientation = viewportArgumentValue(CSSPropertyOrientation);

    m_document->setViewportDescription(description);

    m_propertySet = nullptr;
    m_hasAuthorStyle = false;
}
void ViewportStyleResolver::resolve()
{
    if (!m_document)
        return;

    if (!m_propertySet || (!m_hasAuthorStyle && m_document->hasLegacyViewportTag())) {
        ASSERT(!m_hasAuthorStyle);
        m_propertySet = 0;
        m_document->setViewportArguments(ViewportArguments());
        return;
    }

    ViewportArguments arguments(m_hasAuthorStyle ? ViewportArguments::AuthorStyleSheet : ViewportArguments::UserAgentStyleSheet);

    arguments.userZoom = viewportArgumentValue(CSSPropertyUserZoom);
    arguments.zoom = viewportArgumentValue(CSSPropertyZoom);
    arguments.minZoom = viewportArgumentValue(CSSPropertyMinZoom);
    arguments.maxZoom = viewportArgumentValue(CSSPropertyMaxZoom);
    arguments.minWidth = viewportLengthValue(CSSPropertyMinWidth);
    arguments.maxWidth = viewportLengthValue(CSSPropertyMaxWidth);
    arguments.minHeight = viewportLengthValue(CSSPropertyMinHeight);
    arguments.maxHeight = viewportLengthValue(CSSPropertyMaxHeight);
    arguments.orientation = viewportArgumentValue(CSSPropertyOrientation);

    m_document->setViewportArguments(arguments);

    m_propertySet = 0;
    m_hasAuthorStyle = false;
}