Ejemplo n.º 1
0
inline void DOMTokenList::removeInternal(const String* tokens, size_t length, ExceptionCode& ec)
{
    if (!validateTokens(tokens, length, ec))
        return;

    for (size_t i = 0; i < length; ++i)
        m_tokens.removeFirst(tokens[i]);

    updateAfterTokenChange();
}
Ejemplo n.º 2
0
// Optimally, this should take a Vector<AtomicString> const ref in argument but the
// bindings generator does not handle that.
void DOMTokenList::remove(const Vector<String>& tokens, ExceptionState& exceptionState)
{
    if (!validateTokens(tokens, exceptionState))
        return;

    // Check using containsInternal first since it is a lot faster than going
    // through the string character by character.
    bool found = false;
    for (size_t i = 0; i < tokens.size(); ++i) {
        if (containsInternal(AtomicString(tokens[i]))) {
            found = true;
            break;
        }
    }

    if (found)
        setValue(removeTokens(value(), tokens));
}