Title: [154667] trunk/Source/WebCore
Revision
154667
Author
benja...@webkit.org
Date
2013-08-27 00:43:41 -0700 (Tue, 27 Aug 2013)

Log Message

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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (154666 => 154667)


--- trunk/Source/WebCore/ChangeLog	2013-08-27 07:26:28 UTC (rev 154666)
+++ trunk/Source/WebCore/ChangeLog	2013-08-27 07:43:41 UTC (rev 154667)
@@ -1,3 +1,18 @@
+2013-08-27  Benjamin Poulain  <benja...@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  <calva...@igalia.com>
 
         [GTK] Volume slider shows incorrect track when muted

Modified: trunk/Source/WebCore/html/DOMSettableTokenList.cpp (154666 => 154667)


--- trunk/Source/WebCore/html/DOMSettableTokenList.cpp	2013-08-27 07:26:28 UTC (rev 154666)
+++ trunk/Source/WebCore/html/DOMSettableTokenList.cpp	2013-08-27 07:43:41 UTC (rev 154667)
@@ -49,40 +49,6 @@
     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;

Modified: trunk/Source/WebCore/html/DOMSettableTokenList.h (154666 => 154667)


--- trunk/Source/WebCore/html/DOMSettableTokenList.h	2013-08-27 07:26:28 UTC (rev 154666)
+++ trunk/Source/WebCore/html/DOMSettableTokenList.h	2013-08-27 07:43:41 UTC (rev 154667)
@@ -49,9 +49,6 @@
     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;
 
@@ -61,9 +58,7 @@
     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;

Modified: trunk/Source/WebCore/html/DOMTokenList.h (154666 => 154667)


--- trunk/Source/WebCore/html/DOMTokenList.h	2013-08-27 07:26:28 UTC (rev 154666)
+++ trunk/Source/WebCore/html/DOMTokenList.h	2013-08-27 07:43:41 UTC (rev 154667)
@@ -47,9 +47,9 @@
     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&);
@@ -62,9 +62,9 @@
     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&);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to