Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove DOMSettableTokenList's overload of add() and remove()
https://bugs.webkit.org/show_bug.cgi?id=120341

Reviewed by Ryosuke Niwa.

Little refactoring to make other cleanups easier. Instead of modifying
SpaceSplitString directly, rely on DOMTokenList ultimately changing
the value, which in turn updates the tokens.

* html/DOMSettableTokenList.cpp:
* html/DOMSettableTokenList.h:
* html/DOMTokenList.h:


Canonical link: https://commits.webkit.org/138315@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154667 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
BenjaminPoulain committed Aug 27, 2013
1 parent f7440f7 commit 1a44ee7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 43 deletions.
15 changes: 15 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,18 @@
2013-08-27 Benjamin Poulain <benjamin@webkit.org>

Remove DOMSettableTokenList's overload of add() and remove()
https://bugs.webkit.org/show_bug.cgi?id=120341

Reviewed by Ryosuke Niwa.

Little refactoring to make other cleanups easier. Instead of modifying
SpaceSplitString directly, rely on DOMTokenList ultimately changing
the value, which in turn updates the tokens.

* html/DOMSettableTokenList.cpp:
* html/DOMSettableTokenList.h:
* html/DOMTokenList.h:

2013-08-27 Xabier Rodriguez Calvar <calvaris@igalia.com>

[GTK] Volume slider shows incorrect track when muted
Expand Down
34 changes: 0 additions & 34 deletions Source/WebCore/html/DOMSettableTokenList.cpp
Expand Up @@ -49,40 +49,6 @@ bool DOMSettableTokenList::containsInternal(const AtomicString& token) const
return m_tokens.contains(token);
}

void DOMSettableTokenList::add(const Vector<String>& tokens, ExceptionCode& ec)
{
DOMTokenList::add(tokens, ec);

for (size_t i = 0; i < tokens.size(); ++i) {
if (m_tokens.isNull())
m_tokens.set(tokens[i], false);
else
m_tokens.add(tokens[i]);
}
}

void DOMSettableTokenList::addInternal(const AtomicString& token)
{
DOMTokenList::addInternal(token);
if (m_tokens.isNull())
m_tokens.set(token, false);
else
m_tokens.add(token);
}

void DOMSettableTokenList::remove(const Vector<String>& tokens, ExceptionCode& ec)
{
DOMTokenList::remove(tokens, ec);
for (size_t i = 0; i < tokens.size(); ++i)
m_tokens.remove(tokens[i]);
}

void DOMSettableTokenList::removeInternal(const AtomicString& token)
{
DOMTokenList::removeInternal(token);
m_tokens.remove(token);
}

void DOMSettableTokenList::setValue(const AtomicString& value)
{
m_value = value;
Expand Down
5 changes: 0 additions & 5 deletions Source/WebCore/html/DOMSettableTokenList.h
Expand Up @@ -49,9 +49,6 @@ class DOMSettableTokenList : public DOMTokenList, public RefCounted<DOMSettableT
virtual unsigned length() const OVERRIDE { return m_tokens.size(); }
virtual const AtomicString item(unsigned index) const OVERRIDE;

virtual void add(const Vector<String>&, ExceptionCode&) OVERRIDE;
virtual void remove(const Vector<String>&, ExceptionCode&) OVERRIDE;

virtual AtomicString value() const OVERRIDE { return m_value; }
virtual void setValue(const AtomicString&) OVERRIDE;

Expand All @@ -61,9 +58,7 @@ class DOMSettableTokenList : public DOMTokenList, public RefCounted<DOMSettableT
DOMSettableTokenList();

private:
virtual void addInternal(const AtomicString&) OVERRIDE;
virtual bool containsInternal(const AtomicString&) const OVERRIDE;
virtual void removeInternal(const AtomicString&) OVERRIDE;

AtomicString m_value;
SpaceSplitString m_tokens;
Expand Down
8 changes: 4 additions & 4 deletions Source/WebCore/html/DOMTokenList.h
Expand Up @@ -47,9 +47,9 @@ class DOMTokenList {
virtual const AtomicString item(unsigned index) const = 0;

bool contains(const AtomicString&, ExceptionCode&) const;
virtual void add(const Vector<String>&, ExceptionCode&);
void add(const Vector<String>&, ExceptionCode&);
void add(const AtomicString&, ExceptionCode&);
virtual void remove(const Vector<String>&, ExceptionCode&);
void remove(const Vector<String>&, ExceptionCode&);
void remove(const AtomicString&, ExceptionCode&);
bool toggle(const AtomicString&, ExceptionCode&);
bool toggle(const AtomicString&, bool force, ExceptionCode&);
Expand All @@ -62,9 +62,9 @@ class DOMTokenList {
virtual AtomicString value() const = 0;
virtual void setValue(const AtomicString&) = 0;

virtual void addInternal(const AtomicString&);
void addInternal(const AtomicString&);
virtual bool containsInternal(const AtomicString&) const = 0;
virtual void removeInternal(const AtomicString&);
void removeInternal(const AtomicString&);

static bool validateToken(const AtomicString&, ExceptionCode&);
static bool validateTokens(const Vector<String>&, ExceptionCode&);
Expand Down

0 comments on commit 1a44ee7

Please sign in to comment.