PassRefPtr<CSSVariableData> CSSVariableResolver::resolveCustomProperty(AtomicString name, const CSSVariableData& variableData)
{
    ASSERT(variableData.needsVariableResolution());

    Vector<CSSParserToken> tokens;
    m_variablesSeen.add(name);
    bool success = resolveTokenRange(variableData.tokens(), tokens);
    m_variablesSeen.remove(name);

    // The old variable data holds onto the backing string the new resolved CSSVariableData
    // relies on. Ensure it will live beyond us overwriting the RefPtr in StyleVariableData.
    ASSERT(variableData.refCount() > 1);

    if (!success || !m_cycleStartPoints.isEmpty()) {
        m_cycleStartPoints.remove(name);
        return nullptr;
    }
    return CSSVariableData::createResolved(tokens, variableData);
}