PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> BisonCSSParser::parseInlineStyleDeclaration(const String& string, Element* element)
{
    Document& document = element->document();
    CSSParserContext context = CSSParserContext(document.elementSheet().contents()->parserContext(), UseCounter::getFrom(&document));
    context.setMode((element->isHTMLElement() && !document.inQuirksMode()) ? HTMLStandardMode : HTMLQuirksMode);
    return BisonCSSParser(context).parseDeclaration(string, document.elementSheet().contents());
}
PassRefPtrWillBeRawPtr<StyleRuleKeyframe> CSSParser::parseKeyframeRule(const CSSParserContext& context, StyleSheetContents* styleSheet, const String& rule)
{
    if (RuntimeEnabledFeatures::newCSSParserEnabled()) {
        RefPtrWillBeRawPtr<StyleRuleBase> keyframe = CSSParserImpl::parseRule(rule, context, CSSParserImpl::KeyframeRules);
        return toStyleRuleKeyframe(keyframe.get());
    }
    return BisonCSSParser(context).parseKeyframeRule(styleSheet, rule);
}
void CSSParser::parseSheet(const CSSParserContext& context, StyleSheetContents* styleSheet, const String& text, const TextPosition& startPosition, CSSParserObserver* observer, bool logErrors)
{
    if (RuntimeEnabledFeatures::newCSSParserEnabled()) {
        if (observer)
            return CSSParserImpl::parseStyleSheetForInspector(text, context, *observer);
        return CSSParserImpl::parseStyleSheet(text, context, styleSheet);
    }
    BisonCSSParser(context).parseSheet(styleSheet, text, startPosition, observer, logErrors);
}
void CSSParser::parseSelector(const CSSParserContext& context, const String& selector, CSSSelectorList& selectorList)
{
    if (RuntimeEnabledFeatures::newCSSParserEnabled()) {
        CSSTokenizer::Scope scope(selector);
        CSSSelectorParser::parseSelector(scope.tokenRange(), context, starAtom, nullptr, selectorList);
        return;
    }
    BisonCSSParser(context).parseSelector(selector, selectorList);
}
bool CSSParser::parseSupportsCondition(const String& condition)
{
    if (RuntimeEnabledFeatures::newCSSParserEnabled()) {
        CSSTokenizer::Scope scope(condition);
        CSSParserImpl parser(strictCSSParserContext());
        return CSSSupportsParser::supportsCondition(scope.tokenRange(), parser) == CSSSupportsParser::Supported;
    }
    return BisonCSSParser(CSSParserContext(HTMLStandardMode, 0)).parseSupportsCondition(condition);
}
bool CSSParser::parseDeclarationList(const CSSParserContext& context, MutableStylePropertySet* propertySet, const String& declaration, CSSParserObserver* observer, StyleSheetContents* styleSheet)
{
    if (RuntimeEnabledFeatures::newCSSParserEnabled()) {
        if (observer) {
            CSSParserImpl::parseDeclarationListForInspector(declaration, context, *observer);
            return true;
        }
        return CSSParserImpl::parseDeclarationList(propertySet, declaration, context);
    }
    return BisonCSSParser(context).parseDeclaration(propertySet, declaration, observer, styleSheet);
}
const Vector<double>& StyleKeyframe::keys() const
{
    if (!m_keys) {
        // Keys can only be cleared by setting the key text from JavaScript
        // and this can never be null.
        ASSERT(!m_keyText.isNull());
        m_keys = BisonCSSParser(strictCSSParserContext()).parseKeyframeKeyList(m_keyText);
    }
    // If an invalid key string was set, m_keys may be empty.
    ASSERT(m_keys);
    return *m_keys;
}
PassRefPtrWillBeRawPtr<StyleRuleBase> CSSParser::parseRule(const CSSParserContext& context, StyleSheetContents* styleSheet, const String& rule)
{
    if (RuntimeEnabledFeatures::newCSSParserEnabled())
        return CSSParserImpl::parseRule(rule, context, CSSParserImpl::AllowImportRules);
    return BisonCSSParser(context).parseRule(styleSheet, rule);
}
PassOwnPtr<Vector<double>> CSSParser::parseKeyframeKeyList(const String& keyList)
{
    if (RuntimeEnabledFeatures::newCSSParserEnabled())
        return CSSParserImpl::parseKeyframeKeyList(keyList);
    return BisonCSSParser(strictCSSParserContext()).parseKeyframeKeyList(keyList);
}