bool CSSVariableParser::isValidVariableName(const CSSParserToken& token) { if (token.type() != IdentToken) return false; CSSParserString value = token.value(); return value.length() >= 2 && value[0] == '-' && value[1] == '-'; }
void BisonCSSParser::tokenToLowerCase(CSSParserString& token) { // Since it's our internal token, we know that we created it out // of our writable work buffers. Therefore the const_cast is just // ugly and not a potential crash. size_t length = token.length(); if (token.is8Bit()) { makeLower(token.characters8(), const_cast<LChar*>(token.characters8()), length); } else { makeLower(token.characters16(), const_cast<UChar*>(token.characters16()), length); } }
void CSSVariableData::consumeAndUpdateTokens(const CSSParserTokenRange& range) { StringBuilder stringBuilder; CSSParserTokenRange localRange = range; while (!localRange.atEnd()) { CSSParserToken token = localRange.consume(); if (token.hasStringBacking()) { CSSParserString value = token.value(); if (value.is8Bit()) stringBuilder.append(value.characters8(), value.length()); else stringBuilder.append(value.characters16(), value.length()); } } m_backingString = stringBuilder.toString(); if (m_backingString.is8Bit()) updateTokens<LChar>(range); else updateTokens<UChar>(range); }