<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[189632] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/189632">189632</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-09-11 14:33:16 -0700 (Fri, 11 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>DOMTokenList update steps for classList don't follow the spec
https://bugs.webkit.org/show_bug.cgi?id=148589
&lt;rdar://problem/22547443&gt;

Reviewed by Ryosuke Niwa and Darin Adler.

LayoutTests/imported/w3c:

Rebaseline W3C tests for DOMTokenList now that more checks are passing.

* web-platform-tests/dom/lists/DOMTokenList-stringifier-expected.txt:
* web-platform-tests/dom/nodes/Element-classlist-expected.txt:

Source/WebCore:

Update our DOMTokenList implementation to behave according to
the latest DOM specification:
https://dom.spec.whatwg.org/#interface-domtokenlist

In particular, the following changes were made:
- The stringifier now returns the result of the ordered set serializer
  for tokens. This means that we drop duplicate spaces and extra spaces
  [1][2][3].
- DOMSettableTokenList.value now returns the result of the ordered set
  serializer for tokens [4] as well.
- When the DOMTokenList's tokens are updated and there is an associated
  Element attribute, we set the attribute value to be the the ordered
  set serializer for tokens. This is according to the DOMTokenList
  update steps in the specification [6]. Chrome does not match the
  specification either.

Edge browser behaves according to the specification already. Firefox was
implementing this via [7] but no recent progress. This makes the JS API
nicer to use and interest was shown by jQuery Team.

The following refactoring was done:
- Merge ClassList / RelList into a single AttributeDOMTokenList class
  as their code is mostly duplicated and the only thing that changes
  is which attribute is associated (class vs rel). AttributeDOMTokenList
  now keeps the attribute name as a member so it could be used for any
  attribute. AttributeDOMTokenList overrides DOMTokenList's
  updateAfterTokenChange() to do update the attribute's value as per
  [6].
- We no longer use a SpaceSplitString for the internal representation
  as we need to sanitize the tokens (drop duplicates and extra spaces).
  DOMTokenList now has an internal Vector&lt;AtomicString&gt; containing the
  tokens that is constructed from the algorithm in [2]. As a result,
  most of the logic is now in DOMTokenList instead of its subclasses
  which means that most methods are no longer virtual. We only have
  one virtual function named updateAfterTokenChange() to do the update
  steps as AttributeDOMTokenList needs to update the associated
  attribute.

This change does not seem to impact Dromaeo.

[1] https://dom.spec.whatwg.org/#concept-ordered-set-serializer
[2] https://dom.spec.whatwg.org/#ordered%20sets
[3] https://dom.spec.whatwg.org/#stringification-behavior
[4] https://dom.spec.whatwg.org/#dom-domsettabletokenlist-value
[5] https://dom.spec.whatwg.org/#dom-domtokenlist-contains (step 2)
[6] https://dom.spec.whatwg.org/#concept-DTL-update
[7] https://bugzilla.mozilla.org/show_bug.cgi?id=869788

No new tests, already covered by existing tests.

* dom/Element.cpp:
(WebCore::Element::classAttributeChanged):
When the class attribute changes, make sure to update the associated
classList if there is one. We could do this lazily if it turns out
to be a performance problem. However, chances are this is not as
classList is rarely used and we only need to update the classList if
it was ever accessed by JS for this Element.

(WebCore::Element::insertedInto):
Drop call to clearClassListValueForQuirksMode() as we no longer need
to maintain a separate SpaceSplitString for classes when in quirks
mode. This is because AttributeDOMTokenList now has its own Vector
of classes in their original cases. It therefore no longer relies on
Element::classNames() which has its case folded when in quirks mode.

(WebCore::Element::classList):
Return a AttributeDOMTokenList instead of a ClassList.

* html/AttributeDOMTokenList.h: Added.
* html/AttributeDOMTokenList.cpp: Added.
(WebCore::AttributeDOMTokenList::AttributeDOMTokenList):
Call DOMTokenList::setValue() using the attribute's value so that
DOMTokenList can initialize its token Vector.

(WebCore::AttributeDOMTokenList::attributeValueChanged):
If the attribute value was changed by somebody else that the
AttributeDOMTokenList, call DOMTokenList::setValue() so that it
can update its token Vector.

(WebCore::AttributeDOMTokenList::updateAfterTokenChange):
This is called whenever the token Vector is changed via JS. In
this case, we update the associated attribute's value.

* html/ClassList.cpp: Removed.
* html/ClassList.h: Removed.
Now merged into AttributeDOMTokenList.

* html/DOMSettableTokenList.cpp:
* html/DOMSettableTokenList.h:
Get rid of most of the code as most of the logic is now in
DOMTokenList parent class.

* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::validateToken):
Use a String parameter instead of an AtomicString as this method does
not need the input the be an AtomicString. This avoid atomizing
String unnecessarily.

(WebCore::DOMTokenList::validateTokens):
Use a modern loop.

(WebCore::DOMTokenList::contains):
No longer use containsInternal() virtual function. We can now check
the internal token Vector.

(WebCore::DOMTokenList::add):
Now update the internal Vector. Use a modern loop and try to minimize
Vector capacity reallocation.

(WebCore::DOMTokenList::remove):
Now update the internal Vector.

(WebCore::DOMTokenList::toggle):
Now update the internal Vector and refactor the code so that it is
structured exactly as the algorithm in the specification for
clarity.

(WebCore::DOMTokenList::value):
Now return the result of the ordered set serializer for tokens. This
method is used for:
- The DOMSettableTokenList.value() getter
- The DOMTokenList stringifier
- As attribute value when updating the associated attribute in
  AttributeDOMTokenList.

(WebCore::DOMTokenList::setValue):
Update the internal Vector using the algorithm in [2].

* html/DOMTokenList.h:
(WebCore::DOMTokenList::length):
No longer virtual, now returns the size of the internal token Vector.

(WebCore::DOMTokenList::item):
No longer virtual, now returns the token at the given index in the
internal Vector.

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::relList):
Now return a AttributeDOMTokenList.

* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::relList):
Now return a AttributeDOMTokenList.

* html/RelList.cpp: Removed.
* html/RelList.h: Removed.
Now merged into AttributeDOMTokenList.

LayoutTests:

Update / rebaseline existing tests as our behavior changed.

* fast/dom/HTMLElement/class-list-expected.txt:
* fast/dom/HTMLElement/class-list-quirks-expected.txt:
* fast/dom/HTMLElement/script-tests/class-list.js:
* fast/dom/HTMLOutputElement/dom-settable-token-list-expected.txt:
* fast/dom/HTMLOutputElement/htmloutputelement-expected.txt:
* fast/dom/HTMLOutputElement/htmloutputelement.html:
* fast/dom/HTMLOutputElement/script-tests/dom-settable-token-list.js:
* fast/dom/rel-list-expected.txt:
* fast/dom/rel-list.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLElementclasslistexpectedtxt">trunk/LayoutTests/fast/dom/HTMLElement/class-list-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLElementclasslistquirksexpectedtxt">trunk/LayoutTests/fast/dom/HTMLElement/class-list-quirks-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLElementscripttestsclasslistjs">trunk/LayoutTests/fast/dom/HTMLElement/script-tests/class-list.js</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLOutputElementdomsettabletokenlistexpectedtxt">trunk/LayoutTests/fast/dom/HTMLOutputElement/dom-settable-token-list-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLOutputElementhtmloutputelementexpectedtxt">trunk/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLOutputElementhtmloutputelementhtml">trunk/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement.html</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLOutputElementscripttestsdomsettabletokenlistjs">trunk/LayoutTests/fast/dom/HTMLOutputElement/script-tests/dom-settable-token-list.js</a></li>
<li><a href="#trunkLayoutTestsfastdomrellistexpectedtxt">trunk/LayoutTests/fast/dom/rel-list-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomrellisthtml">trunk/LayoutTests/fast/dom/rel-list.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsdomlistsDOMTokenListstringifierexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/dom/lists/DOMTokenList-stringifier-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsdomnodesElementclasslistexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Element-classlist-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementRareDatah">trunk/Source/WebCore/dom/ElementRareData.h</a></li>
<li><a href="#trunkSourceWebCorehtmlDOMSettableTokenListcpp">trunk/Source/WebCore/html/DOMSettableTokenList.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlDOMSettableTokenListh">trunk/Source/WebCore/html/DOMSettableTokenList.h</a></li>
<li><a href="#trunkSourceWebCorehtmlDOMTokenListcpp">trunk/Source/WebCore/html/DOMTokenList.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlDOMTokenListh">trunk/Source/WebCore/html/DOMTokenList.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAnchorElementcpp">trunk/Source/WebCore/html/HTMLAnchorElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAnchorElementh">trunk/Source/WebCore/html/HTMLAnchorElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLLinkElementcpp">trunk/Source/WebCore/html/HTMLLinkElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLLinkElementh">trunk/Source/WebCore/html/HTMLLinkElement.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorehtmlAttributeDOMTokenListcpp">trunk/Source/WebCore/html/AttributeDOMTokenList.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlAttributeDOMTokenListh">trunk/Source/WebCore/html/AttributeDOMTokenList.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorehtmlClassListcpp">trunk/Source/WebCore/html/ClassList.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlClassListh">trunk/Source/WebCore/html/ClassList.h</a></li>
<li><a href="#trunkSourceWebCorehtmlRelListcpp">trunk/Source/WebCore/html/RelList.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlRelListh">trunk/Source/WebCore/html/RelList.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/LayoutTests/ChangeLog        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2015-09-11  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        DOMTokenList update steps for classList don't follow the spec
+        https://bugs.webkit.org/show_bug.cgi?id=148589
+        &lt;rdar://problem/22547443&gt;
+
+        Reviewed by Ryosuke Niwa and Darin Adler.
+
+        Update / rebaseline existing tests as our behavior changed.
+
+        * fast/dom/HTMLElement/class-list-expected.txt:
+        * fast/dom/HTMLElement/class-list-quirks-expected.txt:
+        * fast/dom/HTMLElement/script-tests/class-list.js:
+        * fast/dom/HTMLOutputElement/dom-settable-token-list-expected.txt:
+        * fast/dom/HTMLOutputElement/htmloutputelement-expected.txt:
+        * fast/dom/HTMLOutputElement/htmloutputelement.html:
+        * fast/dom/HTMLOutputElement/script-tests/dom-settable-token-list.js:
+        * fast/dom/rel-list-expected.txt:
+        * fast/dom/rel-list.html:
+
</ins><span class="cx"> 2015-09-11  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed gardening to make Windows bot green.
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLElementclasslistexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/HTMLElement/class-list-expected.txt (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLElement/class-list-expected.txt        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/LayoutTests/fast/dom/HTMLElement/class-list-expected.txt        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -7,16 +7,16 @@
</span><span class="cx"> PASS String(element.classList) is &quot;x&quot;
</span><span class="cx"> PASS element.classList.length is 0
</span><span class="cx"> PASS element.classList.length is 1
</span><ins>+PASS element.classList.length is 1
</ins><span class="cx"> PASS element.classList.length is 2
</span><del>-PASS element.classList.length is 2
</del><span class="cx"> PASS element.className is &quot;x&quot;
</span><span class="cx"> PASS element.className is &quot;x&quot;
</span><span class="cx"> PASS element.className is &quot;x  x&quot;
</span><span class="cx"> PASS element.className is &quot;y x&quot;
</span><span class="cx"> PASS element.className is &quot;&quot;
</span><span class="cx"> PASS element.className is &quot;&quot;
</span><del>-PASS element.className is &quot; y y &quot;
</del><span class="cx"> PASS element.className is &quot;y&quot;
</span><ins>+PASS element.className is &quot;y&quot;
</ins><span class="cx"> Ensure that we can handle empty class name correctly
</span><span class="cx"> PASS element.classList.toggle('x') is true
</span><span class="cx"> PASS element.className is &quot;x&quot;
</span><span class="lines">@@ -37,8 +37,8 @@
</span><span class="cx"> PASS element.classList.toggle('x y', false) threw expected DOMException with code 5
</span><span class="cx"> Testing add in presence of trailing white spaces.
</span><span class="cx"> PASS element.className is &quot;x y&quot;
</span><del>-PASS element.className is &quot;x\ty&quot;
-PASS element.className is &quot; y&quot;
</del><ins>+PASS element.className is &quot;x y&quot;
+PASS element.className is &quot;y&quot;
</ins><span class="cx"> Test invalid tokens
</span><span class="cx"> PASS element.classList.contains('') threw expected DOMException with code 12
</span><span class="cx"> PASS element.classList.contains('x y') threw expected DOMException with code 5
</span><span class="lines">@@ -52,8 +52,8 @@
</span><span class="cx"> Indexing
</span><span class="cx"> PASS element.classList[0] is &quot;x&quot;
</span><span class="cx"> PASS element.classList.item(0) is &quot;x&quot;
</span><del>-PASS element.classList[1] is &quot;x&quot;
-PASS element.classList.item(1) is &quot;x&quot;
</del><ins>+PASS element.classList[1] is undefined.
+PASS element.classList.item(1) is null
</ins><span class="cx"> PASS element.classList[1] is &quot;y&quot;
</span><span class="cx"> PASS element.classList.item(1) is &quot;y&quot;
</span><span class="cx"> PASS element.classList[0] is undefined.
</span><span class="lines">@@ -98,8 +98,8 @@
</span><span class="cx"> PASS element.className is &quot;&quot;
</span><span class="cx"> PASS element.classList.add() did not throw exception.
</span><span class="cx"> PASS observer.takeRecords().length is 1
</span><del>-PASS element.className is &quot;b d  &quot;
-PASS element.className is &quot;d  &quot;
</del><ins>+PASS element.className is &quot;b d&quot;
+PASS element.className is &quot;d&quot;
</ins><span class="cx"> PASS element.className is &quot;a b c&quot;
</span><span class="cx"> PASS element.classList.remove('a', 'b', '') threw expected DOMException with code 12
</span><span class="cx"> PASS element.className is &quot;a b&quot;
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLElementclasslistquirksexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/HTMLElement/class-list-quirks-expected.txt (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLElement/class-list-quirks-expected.txt        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/LayoutTests/fast/dom/HTMLElement/class-list-quirks-expected.txt        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -7,16 +7,16 @@
</span><span class="cx"> PASS String(element.classList) is &quot;x&quot;
</span><span class="cx"> PASS element.classList.length is 0
</span><span class="cx"> PASS element.classList.length is 1
</span><ins>+PASS element.classList.length is 1
</ins><span class="cx"> PASS element.classList.length is 2
</span><del>-PASS element.classList.length is 2
</del><span class="cx"> PASS element.className is &quot;x&quot;
</span><span class="cx"> PASS element.className is &quot;x&quot;
</span><span class="cx"> PASS element.className is &quot;x  x&quot;
</span><span class="cx"> PASS element.className is &quot;y x&quot;
</span><span class="cx"> PASS element.className is &quot;&quot;
</span><span class="cx"> PASS element.className is &quot;&quot;
</span><del>-PASS element.className is &quot; y y &quot;
</del><span class="cx"> PASS element.className is &quot;y&quot;
</span><ins>+PASS element.className is &quot;y&quot;
</ins><span class="cx"> Ensure that we can handle empty class name correctly
</span><span class="cx"> PASS element.classList.toggle('x') is true
</span><span class="cx"> PASS element.className is &quot;x&quot;
</span><span class="lines">@@ -37,8 +37,8 @@
</span><span class="cx"> PASS element.classList.toggle('x y', false) threw expected DOMException with code 5
</span><span class="cx"> Testing add in presence of trailing white spaces.
</span><span class="cx"> PASS element.className is &quot;x y&quot;
</span><del>-PASS element.className is &quot;x\ty&quot;
-PASS element.className is &quot; y&quot;
</del><ins>+PASS element.className is &quot;x y&quot;
+PASS element.className is &quot;y&quot;
</ins><span class="cx"> Test invalid tokens
</span><span class="cx"> PASS element.classList.contains('') threw expected DOMException with code 12
</span><span class="cx"> PASS element.classList.contains('x y') threw expected DOMException with code 5
</span><span class="lines">@@ -52,8 +52,8 @@
</span><span class="cx"> Indexing
</span><span class="cx"> PASS element.classList[0] is &quot;x&quot;
</span><span class="cx"> PASS element.classList.item(0) is &quot;x&quot;
</span><del>-PASS element.classList[1] is &quot;x&quot;
-PASS element.classList.item(1) is &quot;x&quot;
</del><ins>+PASS element.classList[1] is undefined.
+PASS element.classList.item(1) is null
</ins><span class="cx"> PASS element.classList[1] is &quot;y&quot;
</span><span class="cx"> PASS element.classList.item(1) is &quot;y&quot;
</span><span class="cx"> PASS element.classList[0] is undefined.
</span><span class="lines">@@ -98,8 +98,8 @@
</span><span class="cx"> PASS element.className is &quot;&quot;
</span><span class="cx"> PASS element.classList.add() did not throw exception.
</span><span class="cx"> PASS observer.takeRecords().length is 1
</span><del>-PASS element.className is &quot;b d  &quot;
-PASS element.className is &quot;d  &quot;
</del><ins>+PASS element.className is &quot;b d&quot;
+PASS element.className is &quot;d&quot;
</ins><span class="cx"> PASS element.className is &quot;a b c&quot;
</span><span class="cx"> PASS element.classList.remove('a', 'b', '') threw expected DOMException with code 12
</span><span class="cx"> PASS element.className is &quot;a b&quot;
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLElementscripttestsclasslistjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/HTMLElement/script-tests/class-list.js (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLElement/script-tests/class-list.js        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/LayoutTests/fast/dom/HTMLElement/script-tests/class-list.js        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> 
</span><span class="cx"> // http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/003.htm
</span><span class="cx"> createElement('x x');
</span><del>-shouldEvaluateTo('element.classList.length', 2);
</del><ins>+shouldEvaluateTo('element.classList.length', 1);
</ins><span class="cx"> 
</span><span class="cx"> // http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/004.htm
</span><span class="cx"> createElement('x y');
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx"> // http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/011.htm
</span><span class="cx"> createElement(' y x  y ');
</span><span class="cx"> element.classList.remove('x');
</span><del>-shouldBeEqualToString('element.className', ' y y ');
</del><ins>+shouldBeEqualToString('element.className', 'y');
</ins><span class="cx"> 
</span><span class="cx"> // http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/012.htm
</span><span class="cx"> createElement(' x y  x ');
</span><span class="lines">@@ -121,11 +121,11 @@
</span><span class="cx"> 
</span><span class="cx"> createElement('x\t');
</span><span class="cx"> element.classList.add('y');
</span><del>-shouldBeEqualToString('element.className', 'x\ty');
</del><ins>+shouldBeEqualToString('element.className', 'x y');
</ins><span class="cx"> 
</span><span class="cx"> createElement(' ');
</span><span class="cx"> element.classList.add('y');
</span><del>-shouldBeEqualToString('element.className', ' y');
</del><ins>+shouldBeEqualToString('element.className', 'y');
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> debug('Test invalid tokens');
</span><span class="lines">@@ -206,8 +206,8 @@
</span><span class="cx"> shouldBeEqualToString('element.classList.item(0)', 'x');
</span><span class="cx"> 
</span><span class="cx"> createElement('x x');
</span><del>-shouldBeEqualToString('element.classList[1]', 'x');
-shouldBeEqualToString('element.classList.item(1)', 'x');
</del><ins>+shouldBeUndefined('element.classList[1]');
+shouldBeNull('element.classList.item(1)');
</ins><span class="cx"> 
</span><span class="cx"> createElement('x y');
</span><span class="cx"> shouldBeEqualToString('element.classList[1]', 'y');
</span><span class="lines">@@ -327,10 +327,10 @@
</span><span class="cx"> 
</span><span class="cx"> createElement('a b c d  ');
</span><span class="cx"> element.classList.remove('a', 'c');
</span><del>-shouldBeEqualToString('element.className', 'b d  ');
</del><ins>+shouldBeEqualToString('element.className', 'b d');
</ins><span class="cx"> 
</span><span class="cx"> element.classList.remove('b', 'b');
</span><del>-shouldBeEqualToString('element.className', 'd  ');
</del><ins>+shouldBeEqualToString('element.className', 'd');
</ins><span class="cx"> 
</span><span class="cx"> createElement('a b c null d undefined 0 false');
</span><span class="cx"> element.classList.remove(null, {toString: function() { return 'd' }}, undefined, 0, false);
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLOutputElementdomsettabletokenlistexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/HTMLOutputElement/dom-settable-token-list-expected.txt (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLOutputElement/dom-settable-token-list-expected.txt        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/LayoutTests/fast/dom/HTMLOutputElement/dom-settable-token-list-expected.txt        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -7,16 +7,16 @@
</span><span class="cx"> PASS String(element.htmlFor) is &quot;x&quot;
</span><span class="cx"> PASS element.htmlFor.length is 0
</span><span class="cx"> PASS element.htmlFor.length is 1
</span><ins>+PASS element.htmlFor.length is 1
</ins><span class="cx"> PASS element.htmlFor.length is 2
</span><del>-PASS element.htmlFor.length is 2
</del><span class="cx"> PASS element.htmlFor.toString() is &quot;x&quot;
</span><span class="cx"> PASS element.htmlFor.toString() is &quot;x&quot;
</span><del>-PASS element.htmlFor.toString() is &quot;x  x&quot;
</del><ins>+PASS element.htmlFor.toString() is &quot;x&quot;
</ins><span class="cx"> PASS element.htmlFor.toString() is &quot;y x&quot;
</span><span class="cx"> PASS element.htmlFor.toString() is &quot;&quot;
</span><span class="cx"> PASS element.htmlFor.toString() is &quot;&quot;
</span><del>-PASS element.htmlFor.toString() is &quot; y y &quot;
</del><span class="cx"> PASS element.htmlFor.toString() is &quot;y&quot;
</span><ins>+PASS element.htmlFor.toString() is &quot;y&quot;
</ins><span class="cx"> - Ensure that we can handle empty form attribute correctly
</span><span class="cx"> PASS list.value is &quot;x&quot;
</span><span class="cx"> PASS list.value is &quot;&quot;
</span><span class="lines">@@ -26,8 +26,8 @@
</span><span class="cx"> PASS element.htmlFor[1] is undefined.
</span><span class="cx"> - Testing add in presence of trailing white spaces.
</span><span class="cx"> PASS element.htmlFor.toString() is &quot;x y&quot;
</span><del>-PASS element.htmlFor.toString() is &quot;x\ty&quot;
-PASS element.htmlFor.toString() is &quot; y&quot;
</del><ins>+PASS element.htmlFor.toString() is &quot;x y&quot;
+PASS element.htmlFor.toString() is &quot;y&quot;
</ins><span class="cx"> - Test invalid tokens
</span><span class="cx"> PASS element.htmlFor.contains('') threw expected DOMException with code 12
</span><span class="cx"> PASS element.htmlFor.contains('x y') threw expected DOMException with code 5
</span><span class="lines">@@ -40,8 +40,8 @@
</span><span class="cx"> - Indexing
</span><span class="cx"> PASS element.htmlFor[0] is &quot;x&quot;
</span><span class="cx"> PASS element.htmlFor.item(0) is &quot;x&quot;
</span><del>-PASS element.htmlFor[1] is &quot;x&quot;
-PASS element.htmlFor.item(1) is &quot;x&quot;
</del><ins>+PASS element.htmlFor[1] is undefined.
+PASS element.htmlFor.item(1) is null
</ins><span class="cx"> PASS element.htmlFor[1] is &quot;y&quot;
</span><span class="cx"> PASS element.htmlFor.item(1) is &quot;y&quot;
</span><span class="cx"> PASS element.htmlFor[0] is undefined.
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLOutputElementhtmloutputelementexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-expected.txt (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-expected.txt        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-expected.txt        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -12,7 +12,7 @@
</span><span class="cx"> PASS output3.htmlFor.length is 2
</span><span class="cx"> PASS output3.htmlFor[0] is &quot;for-target1&quot;
</span><span class="cx"> PASS output3.htmlFor[1] is &quot;for-target2&quot;
</span><del>-PASS output3.htmlFor.value is &quot; for-target1 for-target2 &quot;
</del><ins>+PASS output3.htmlFor.value is &quot;for-target1 for-target2&quot;
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLOutputElementhtmloutputelementhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement.html (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement.html        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement.html        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> shouldEvaluateTo('output3.htmlFor.length', 2);
</span><span class="cx"> shouldBeEqualToString('output3.htmlFor[0]', 'for-target1');
</span><span class="cx"> shouldBeEqualToString('output3.htmlFor[1]', 'for-target2');
</span><del>-shouldBeEqualToString('output3.htmlFor.value', ' for-target1 for-target2 ');
</del><ins>+shouldBeEqualToString('output3.htmlFor.value', 'for-target1 for-target2');
</ins><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLOutputElementscripttestsdomsettabletokenlistjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/HTMLOutputElement/script-tests/dom-settable-token-list.js (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLOutputElement/script-tests/dom-settable-token-list.js        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/LayoutTests/fast/dom/HTMLOutputElement/script-tests/dom-settable-token-list.js        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx"> 
</span><span class="cx"> // http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/003.htm
</span><span class="cx"> createElement('x x');
</span><del>-shouldEvaluateTo('element.htmlFor.length', 2);
</del><ins>+shouldEvaluateTo('element.htmlFor.length', 1);
</ins><span class="cx"> 
</span><span class="cx"> // http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/004.htm
</span><span class="cx"> createElement('x y');
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> // http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/007.htm
</span><span class="cx"> createElement('x  x');
</span><span class="cx"> element.htmlFor.add('x');
</span><del>-shouldBeEqualToString('element.htmlFor.toString()', 'x  x');
</del><ins>+shouldBeEqualToString('element.htmlFor.toString()', 'x');
</ins><span class="cx"> 
</span><span class="cx"> // http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/008.htm
</span><span class="cx"> createElement('y');
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx"> // http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/011.htm
</span><span class="cx"> createElement(' y x  y ');
</span><span class="cx"> element.htmlFor.remove('x');
</span><del>-shouldBeEqualToString('element.htmlFor.toString()', ' y y ');
</del><ins>+shouldBeEqualToString('element.htmlFor.toString()', 'y');
</ins><span class="cx"> 
</span><span class="cx"> // http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/012.htm
</span><span class="cx"> createElement(' x y  x ');
</span><span class="lines">@@ -101,11 +101,11 @@
</span><span class="cx"> 
</span><span class="cx"> createElement('x\t');
</span><span class="cx"> element.htmlFor.add('y');
</span><del>-shouldBeEqualToString('element.htmlFor.toString()', 'x\ty');
</del><ins>+shouldBeEqualToString('element.htmlFor.toString()', 'x y');
</ins><span class="cx"> 
</span><span class="cx"> createElement(' ');
</span><span class="cx"> element.htmlFor.add('y');
</span><del>-shouldBeEqualToString('element.htmlFor.toString()', ' y');
</del><ins>+shouldBeEqualToString('element.htmlFor.toString()', 'y');
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> debug('- Test invalid tokens');
</span><span class="lines">@@ -182,8 +182,8 @@
</span><span class="cx"> shouldBeEqualToString('element.htmlFor.item(0)', 'x');
</span><span class="cx"> 
</span><span class="cx"> createElement('x x');
</span><del>-shouldBeEqualToString('element.htmlFor[1]', 'x');
-shouldBeEqualToString('element.htmlFor.item(1)', 'x');
</del><ins>+shouldBeUndefined('element.htmlFor[1]');
+shouldBeNull('element.htmlFor.item(1)');
</ins><span class="cx"> 
</span><span class="cx"> createElement('x y');
</span><span class="cx"> shouldBeEqualToString('element.htmlFor[1]', 'y');
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomrellistexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/rel-list-expected.txt (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/rel-list-expected.txt        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/LayoutTests/fast/dom/rel-list-expected.txt        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -26,16 +26,16 @@
</span><span class="cx"> PASS String(element.relList) is &quot;x&quot;
</span><span class="cx"> PASS element.relList.length is 0
</span><span class="cx"> PASS element.relList.length is 1
</span><ins>+PASS element.relList.length is 1
</ins><span class="cx"> PASS element.relList.length is 2
</span><del>-PASS element.relList.length is 2
</del><span class="cx"> PASS element.rel is &quot;x&quot;
</span><span class="cx"> PASS element.rel is &quot;x&quot;
</span><span class="cx"> PASS element.rel is &quot;x  x&quot;
</span><span class="cx"> PASS element.rel is &quot;y x&quot;
</span><span class="cx"> PASS element.rel is &quot;&quot;
</span><span class="cx"> PASS element.rel is &quot;&quot;
</span><del>-PASS element.rel is &quot; y y &quot;
</del><span class="cx"> PASS element.rel is &quot;y&quot;
</span><ins>+PASS element.rel is &quot;y&quot;
</ins><span class="cx"> Ensure that we can handle empty rel correctly
</span><span class="cx"> PASS element.relList.toggle('x') is true
</span><span class="cx"> PASS element.rel is &quot;x&quot;
</span><span class="lines">@@ -58,8 +58,8 @@
</span><span class="cx"> PASS element.relList.toggle(&quot;x y&quot;, false) threw exception Error: InvalidCharacterError: DOM Exception 5.
</span><span class="cx"> Testing add in presence of trailing white spaces.
</span><span class="cx"> PASS element.rel is &quot;x y&quot;
</span><del>-PASS element.rel is &quot;x\ty&quot;
-PASS element.rel is &quot; y&quot;
</del><ins>+PASS element.rel is &quot;x y&quot;
+PASS element.rel is &quot;y&quot;
</ins><span class="cx"> Test invalid tokens
</span><span class="cx"> PASS element.relList.contains(&quot;&quot;) threw exception Error: SyntaxError: DOM Exception 12.
</span><span class="cx"> PASS element.relList.contains(&quot;x y&quot;) threw exception Error: InvalidCharacterError: DOM Exception 5.
</span><span class="lines">@@ -71,8 +71,8 @@
</span><span class="cx"> Indexing
</span><span class="cx"> PASS element.relList[0] is &quot;x&quot;
</span><span class="cx"> PASS element.relList.item(0) is &quot;x&quot;
</span><del>-PASS element.relList[1] is &quot;x&quot;
-PASS element.relList.item(1) is &quot;x&quot;
</del><ins>+PASS element.relList[1] is undefined.
+PASS element.relList.item(1) is null
</ins><span class="cx"> PASS element.relList[1] is &quot;y&quot;
</span><span class="cx"> PASS element.relList.item(1) is &quot;y&quot;
</span><span class="cx"> PASS element.relList[0] is undefined.
</span><span class="lines">@@ -115,8 +115,8 @@
</span><span class="cx"> PASS element.rel is &quot;&quot;
</span><span class="cx"> PASS element.relList.add() did not throw exception.
</span><span class="cx"> PASS observer.takeRecords().length is 1
</span><del>-PASS element.rel is &quot;b d  &quot;
-PASS element.rel is &quot;d  &quot;
</del><ins>+PASS element.rel is &quot;b d&quot;
+PASS element.rel is &quot;d&quot;
</ins><span class="cx"> PASS element.rel is &quot;a b c&quot;
</span><span class="cx"> PASS element.relList.remove(&quot;a&quot;, &quot;b&quot;, &quot;&quot;) threw exception Error: SyntaxError: DOM Exception 12.
</span><span class="cx"> PASS element.rel is &quot;a b&quot;
</span><span class="lines">@@ -149,16 +149,16 @@
</span><span class="cx"> PASS String(element.relList) is &quot;x&quot;
</span><span class="cx"> PASS element.relList.length is 0
</span><span class="cx"> PASS element.relList.length is 1
</span><ins>+PASS element.relList.length is 1
</ins><span class="cx"> PASS element.relList.length is 2
</span><del>-PASS element.relList.length is 2
</del><span class="cx"> PASS element.rel is &quot;x&quot;
</span><span class="cx"> PASS element.rel is &quot;x&quot;
</span><span class="cx"> PASS element.rel is &quot;x  x&quot;
</span><span class="cx"> PASS element.rel is &quot;y x&quot;
</span><span class="cx"> PASS element.rel is &quot;&quot;
</span><span class="cx"> PASS element.rel is &quot;&quot;
</span><del>-PASS element.rel is &quot; y y &quot;
</del><span class="cx"> PASS element.rel is &quot;y&quot;
</span><ins>+PASS element.rel is &quot;y&quot;
</ins><span class="cx"> Ensure that we can handle empty rel correctly
</span><span class="cx"> PASS element.relList.toggle('x') is true
</span><span class="cx"> PASS element.rel is &quot;x&quot;
</span><span class="lines">@@ -181,8 +181,8 @@
</span><span class="cx"> PASS element.relList.toggle(&quot;x y&quot;, false) threw exception Error: InvalidCharacterError: DOM Exception 5.
</span><span class="cx"> Testing add in presence of trailing white spaces.
</span><span class="cx"> PASS element.rel is &quot;x y&quot;
</span><del>-PASS element.rel is &quot;x\ty&quot;
-PASS element.rel is &quot; y&quot;
</del><ins>+PASS element.rel is &quot;x y&quot;
+PASS element.rel is &quot;y&quot;
</ins><span class="cx"> Test invalid tokens
</span><span class="cx"> PASS element.relList.contains(&quot;&quot;) threw exception Error: SyntaxError: DOM Exception 12.
</span><span class="cx"> PASS element.relList.contains(&quot;x y&quot;) threw exception Error: InvalidCharacterError: DOM Exception 5.
</span><span class="lines">@@ -194,8 +194,8 @@
</span><span class="cx"> Indexing
</span><span class="cx"> PASS element.relList[0] is &quot;x&quot;
</span><span class="cx"> PASS element.relList.item(0) is &quot;x&quot;
</span><del>-PASS element.relList[1] is &quot;x&quot;
-PASS element.relList.item(1) is &quot;x&quot;
</del><ins>+PASS element.relList[1] is undefined.
+PASS element.relList.item(1) is null
</ins><span class="cx"> PASS element.relList[1] is &quot;y&quot;
</span><span class="cx"> PASS element.relList.item(1) is &quot;y&quot;
</span><span class="cx"> PASS element.relList[0] is undefined.
</span><span class="lines">@@ -238,8 +238,8 @@
</span><span class="cx"> PASS element.rel is &quot;&quot;
</span><span class="cx"> PASS element.relList.add() did not throw exception.
</span><span class="cx"> PASS observer.takeRecords().length is 1
</span><del>-PASS element.rel is &quot;b d  &quot;
-PASS element.rel is &quot;d  &quot;
</del><ins>+PASS element.rel is &quot;b d&quot;
+PASS element.rel is &quot;d&quot;
</ins><span class="cx"> PASS element.rel is &quot;a b c&quot;
</span><span class="cx"> PASS element.relList.remove(&quot;a&quot;, &quot;b&quot;, &quot;&quot;) threw exception Error: SyntaxError: DOM Exception 12.
</span><span class="cx"> PASS element.rel is &quot;a b&quot;
</span><span class="lines">@@ -272,16 +272,16 @@
</span><span class="cx"> PASS String(element.relList) is &quot;x&quot;
</span><span class="cx"> PASS element.relList.length is 0
</span><span class="cx"> PASS element.relList.length is 1
</span><ins>+PASS element.relList.length is 1
</ins><span class="cx"> PASS element.relList.length is 2
</span><del>-PASS element.relList.length is 2
</del><span class="cx"> PASS element.rel is &quot;x&quot;
</span><span class="cx"> PASS element.rel is &quot;x&quot;
</span><span class="cx"> PASS element.rel is &quot;x  x&quot;
</span><span class="cx"> PASS element.rel is &quot;y x&quot;
</span><span class="cx"> PASS element.rel is &quot;&quot;
</span><span class="cx"> PASS element.rel is &quot;&quot;
</span><del>-PASS element.rel is &quot; y y &quot;
</del><span class="cx"> PASS element.rel is &quot;y&quot;
</span><ins>+PASS element.rel is &quot;y&quot;
</ins><span class="cx"> Ensure that we can handle empty rel correctly
</span><span class="cx"> PASS element.relList.toggle('x') is true
</span><span class="cx"> PASS element.rel is &quot;x&quot;
</span><span class="lines">@@ -304,8 +304,8 @@
</span><span class="cx"> PASS element.relList.toggle(&quot;x y&quot;, false) threw exception Error: InvalidCharacterError: DOM Exception 5.
</span><span class="cx"> Testing add in presence of trailing white spaces.
</span><span class="cx"> PASS element.rel is &quot;x y&quot;
</span><del>-PASS element.rel is &quot;x\ty&quot;
-PASS element.rel is &quot; y&quot;
</del><ins>+PASS element.rel is &quot;x y&quot;
+PASS element.rel is &quot;y&quot;
</ins><span class="cx"> Test invalid tokens
</span><span class="cx"> PASS element.relList.contains(&quot;&quot;) threw exception Error: SyntaxError: DOM Exception 12.
</span><span class="cx"> PASS element.relList.contains(&quot;x y&quot;) threw exception Error: InvalidCharacterError: DOM Exception 5.
</span><span class="lines">@@ -317,8 +317,8 @@
</span><span class="cx"> Indexing
</span><span class="cx"> PASS element.relList[0] is &quot;x&quot;
</span><span class="cx"> PASS element.relList.item(0) is &quot;x&quot;
</span><del>-PASS element.relList[1] is &quot;x&quot;
-PASS element.relList.item(1) is &quot;x&quot;
</del><ins>+PASS element.relList[1] is undefined.
+PASS element.relList.item(1) is null
</ins><span class="cx"> PASS element.relList[1] is &quot;y&quot;
</span><span class="cx"> PASS element.relList.item(1) is &quot;y&quot;
</span><span class="cx"> PASS element.relList[0] is undefined.
</span><span class="lines">@@ -361,8 +361,8 @@
</span><span class="cx"> PASS element.rel is &quot;&quot;
</span><span class="cx"> PASS element.relList.add() did not throw exception.
</span><span class="cx"> PASS observer.takeRecords().length is 1
</span><del>-PASS element.rel is &quot;b d  &quot;
-PASS element.rel is &quot;d  &quot;
</del><ins>+PASS element.rel is &quot;b d&quot;
+PASS element.rel is &quot;d&quot;
</ins><span class="cx"> PASS element.rel is &quot;a b c&quot;
</span><span class="cx"> PASS element.relList.remove(&quot;a&quot;, &quot;b&quot;, &quot;&quot;) threw exception Error: SyntaxError: DOM Exception 12.
</span><span class="cx"> PASS element.rel is &quot;a b&quot;
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomrellisthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/rel-list.html (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/rel-list.html        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/LayoutTests/fast/dom/rel-list.html        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">     shouldEvaluateTo('element.relList.length', 1);
</span><span class="cx"> 
</span><span class="cx">     createElement('x x');
</span><del>-    shouldEvaluateTo('element.relList.length', 2);
</del><ins>+    shouldEvaluateTo('element.relList.length', 1);
</ins><span class="cx"> 
</span><span class="cx">     createElement('x y');
</span><span class="cx">     shouldEvaluateTo('element.relList.length', 2);
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx"> 
</span><span class="cx">     createElement(' y x  y ');
</span><span class="cx">     element.relList.remove('x');
</span><del>-    shouldBeEqualToString('element.rel', ' y y ');
</del><ins>+    shouldBeEqualToString('element.rel', 'y');
</ins><span class="cx"> 
</span><span class="cx">     createElement(' x y  x ');
</span><span class="cx">     element.relList.remove('x');
</span><span class="lines">@@ -134,11 +134,11 @@
</span><span class="cx"> 
</span><span class="cx">     createElement('x\t');
</span><span class="cx">     element.relList.add('y');
</span><del>-    shouldBeEqualToString('element.rel', 'x\ty');
</del><ins>+    shouldBeEqualToString('element.rel', 'x y');
</ins><span class="cx"> 
</span><span class="cx">     createElement(' ');
</span><span class="cx">     element.relList.add('y');
</span><del>-    shouldBeEqualToString('element.rel', ' y');
</del><ins>+    shouldBeEqualToString('element.rel', 'y');
</ins><span class="cx"> 
</span><span class="cx">     debug('Test invalid tokens');
</span><span class="cx"> 
</span><span class="lines">@@ -169,8 +169,8 @@
</span><span class="cx">     shouldBeEqualToString('element.relList.item(0)', 'x');
</span><span class="cx"> 
</span><span class="cx">     createElement('x x');
</span><del>-    shouldBeEqualToString('element.relList[1]', 'x');
-    shouldBeEqualToString('element.relList.item(1)', 'x');
</del><ins>+    shouldBeUndefined('element.relList[1]');
+    shouldBeNull('element.relList.item(1)');
</ins><span class="cx"> 
</span><span class="cx">     createElement('x y');
</span><span class="cx">     shouldBeEqualToString('element.relList[1]', 'y');
</span><span class="lines">@@ -260,10 +260,10 @@
</span><span class="cx"> 
</span><span class="cx">     createElement('a b c d  ');
</span><span class="cx">     element.relList.remove('a', 'c');
</span><del>-    shouldBeEqualToString('element.rel', 'b d  ');
</del><ins>+    shouldBeEqualToString('element.rel', 'b d');
</ins><span class="cx"> 
</span><span class="cx">     element.relList.remove('b', 'b');
</span><del>-    shouldBeEqualToString('element.rel', 'd  ');
</del><ins>+    shouldBeEqualToString('element.rel', 'd');
</ins><span class="cx"> 
</span><span class="cx">     createElement('a b c null d undefined 0 false');
</span><span class="cx">     element.relList.remove(null, {toString: function() { return 'd' }}, undefined, 0, false);
</span><span class="lines">@@ -300,4 +300,4 @@
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/body&gt;
</span><del>-&lt;/html&gt;
</del><span class="cx">\ No newline at end of file
</span><ins>+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -1,5 +1,18 @@
</span><span class="cx"> 2015-09-11  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        DOMTokenList update steps for classList don't follow the spec
+        https://bugs.webkit.org/show_bug.cgi?id=148589
+        &lt;rdar://problem/22547443&gt;
+
+        Reviewed by Ryosuke Niwa and Darin Adler.
+
+        Rebaseline W3C tests for DOMTokenList now that more checks are passing.
+
+        * web-platform-tests/dom/lists/DOMTokenList-stringifier-expected.txt:
+        * web-platform-tests/dom/nodes/Element-classlist-expected.txt:
+
+2015-09-11  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Element.tagName should be upper-case for HTML elements in HTML documents
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=148843
</span><span class="cx">         &lt;rdar://problem/22559081&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdomlistsDOMTokenListstringifierexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/lists/DOMTokenList-stringifier-expected.txt (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/lists/DOMTokenList-stringifier-expected.txt        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/lists/DOMTokenList-stringifier-expected.txt        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -1,3 +1,3 @@
</span><span class="cx"> 
</span><del>-FAIL DOMTokenList stringifier assert_equals: String(classList) should compress whitespace expected &quot;a b&quot; but got &quot;   a  a b&quot;
</del><ins>+PASS DOMTokenList stringifier 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdomnodesElementclasslistexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Element-classlist-expected.txt (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Element-classlist-expected.txt        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Element-classlist-expected.txt        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx"> PASS prototyping DOMTokenList should work 
</span><span class="cx"> PASS Element.classList must implement DOMTokenList 
</span><span class="cx"> PASS CSS .foo selectors must not match elements without any class 
</span><del>-FAIL classList must be correct for an element that has classes assert_equals: duplicates in initial string should be removed per https://dom.spec.whatwg.org/#concept-class expected 1 but got 2
</del><ins>+PASS classList must be correct for an element that has classes 
</ins><span class="cx"> PASS classList.length must be 0 for an element that has no classes 
</span><span class="cx"> PASS classList must not contain an undefined class 
</span><span class="cx"> PASS classList.item() must return null for out-of-range index 
</span><span class="lines">@@ -13,7 +13,7 @@
</span><span class="cx"> PASS classList[index] must be undefined for out-of-range index 
</span><span class="cx"> PASS classList[index] must be undefined for negative index 
</span><span class="cx"> PASS className should contain initial markup whitespace 
</span><del>-FAIL empty classList should return the empty string since the ordered set parser skip the whitespaces assert_equals: implicit expected &quot;&quot; but got &quot; &quot;
</del><ins>+PASS empty classList should return the empty string since the ordered set parser skip the whitespaces 
</ins><span class="cx"> PASS .contains(empty_string) must throw a SYNTAX_ERR 
</span><span class="cx"> PASS .add(empty_string) must throw a SYNTAX_ERR 
</span><span class="cx"> PASS .remove(empty_string) must throw a SYNTAX_ERR 
</span><span class="lines">@@ -43,10 +43,10 @@
</span><span class="cx"> PASS classList.remove must not break case-sensitive CSS selector matching 
</span><span class="cx"> PASS classList.remove must remove duplicated tokens 
</span><span class="cx"> PASS classList.remove must collapse whitespace around removed tokens 
</span><del>-FAIL classList.remove must collapse whitespaces around each token assert_equals: implicit expected &quot;token1&quot; but got &quot; token1&quot;
-FAIL classList.remove must collapse whitespaces around each token and remove duplicates assert_equals: implicit expected &quot;token1&quot; but got &quot;  token1 token1  &quot;
</del><ins>+PASS classList.remove must collapse whitespaces around each token 
+PASS classList.remove must collapse whitespaces around each token and remove duplicates 
</ins><span class="cx"> PASS classList.remove must collapse whitespace when removing duplicate tokens 
</span><del>-FAIL classList.add must collapse whitespaces and remove duplicates when adding a token that already exists assert_equals: implicit expected &quot;token1&quot; but got &quot;  token1  token1  &quot;
</del><ins>+PASS classList.add must collapse whitespaces and remove duplicates when adding a token that already exists 
</ins><span class="cx"> PASS classList.toggle must toggle tokens case-sensitively when adding 
</span><span class="cx"> PASS classList.toggle must not break case-sensitive CSS selector matching 
</span><span class="cx"> PASS classList.toggle must be able to remove tokens 
</span><span class="lines">@@ -57,10 +57,10 @@
</span><span class="cx"> PASS classList.item(0) must return null when all classes have been removed 
</span><span class="cx"> PASS classList[0] must be undefined when all classes have been removed 
</span><span class="cx"> PASS classList.add should treat &quot; &quot; as a space 
</span><del>-FAIL classList.add should treat \t as a space assert_equals: expected &quot;a b&quot; but got &quot;a\tb&quot;
-FAIL classList.add should treat \r as a space assert_equals: expected &quot;a b&quot; but got &quot;a\rb&quot;
-FAIL classList.add should treat \n as a space assert_equals: expected &quot;a b&quot; but got &quot;a\nb&quot;
-FAIL classList.add should treat \f as a space assert_equals: expected &quot;a b&quot; but got &quot;a\fb&quot;
</del><ins>+PASS classList.add should treat \t as a space 
+PASS classList.add should treat \r as a space 
+PASS classList.add should treat \n as a space 
+PASS classList.add should treat \f as a space 
</ins><span class="cx"> PASS classList.length must be read-only 
</span><span class="cx"> PASS classList must be read-only 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -1573,6 +1573,7 @@
</span><span class="cx">     history/HistoryItem.cpp
</span><span class="cx">     history/PageCache.cpp
</span><span class="cx"> 
</span><ins>+    html/AttributeDOMTokenList.cpp
</ins><span class="cx">     html/BaseButtonInputType.cpp
</span><span class="cx">     html/BaseCheckableInputType.cpp
</span><span class="cx">     html/BaseChooserOnlyDateAndTimeInputType.cpp
</span><span class="lines">@@ -1581,7 +1582,6 @@
</span><span class="cx">     html/BaseTextInputType.cpp
</span><span class="cx">     html/ButtonInputType.cpp
</span><span class="cx">     html/CheckboxInputType.cpp
</span><del>-    html/ClassList.cpp
</del><span class="cx">     html/ColorInputType.cpp
</span><span class="cx">     html/DOMFormData.cpp
</span><span class="cx">     html/DOMSettableTokenList.cpp
</span><span class="lines">@@ -1705,7 +1705,6 @@
</span><span class="cx">     html/RadioInputType.cpp
</span><span class="cx">     html/RadioNodeList.cpp
</span><span class="cx">     html/RangeInputType.cpp
</span><del>-    html/RelList.cpp
</del><span class="cx">     html/ResetInputType.cpp
</span><span class="cx">     html/RubyElement.cpp
</span><span class="cx">     html/RubyTextElement.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/Source/WebCore/ChangeLog        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -1,5 +1,161 @@
</span><span class="cx"> 2015-09-11  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        DOMTokenList update steps for classList don't follow the spec
+        https://bugs.webkit.org/show_bug.cgi?id=148589
+        &lt;rdar://problem/22547443&gt;
+
+        Reviewed by Ryosuke Niwa and Darin Adler.
+
+        Update our DOMTokenList implementation to behave according to
+        the latest DOM specification:
+        https://dom.spec.whatwg.org/#interface-domtokenlist
+
+        In particular, the following changes were made:
+        - The stringifier now returns the result of the ordered set serializer
+          for tokens. This means that we drop duplicate spaces and extra spaces
+          [1][2][3].
+        - DOMSettableTokenList.value now returns the result of the ordered set
+          serializer for tokens [4] as well.
+        - When the DOMTokenList's tokens are updated and there is an associated
+          Element attribute, we set the attribute value to be the the ordered
+          set serializer for tokens. This is according to the DOMTokenList
+          update steps in the specification [6]. Chrome does not match the
+          specification either.
+
+        Edge browser behaves according to the specification already. Firefox was
+        implementing this via [7] but no recent progress. This makes the JS API
+        nicer to use and interest was shown by jQuery Team.
+
+        The following refactoring was done:
+        - Merge ClassList / RelList into a single AttributeDOMTokenList class
+          as their code is mostly duplicated and the only thing that changes
+          is which attribute is associated (class vs rel). AttributeDOMTokenList
+          now keeps the attribute name as a member so it could be used for any
+          attribute. AttributeDOMTokenList overrides DOMTokenList's
+          updateAfterTokenChange() to do update the attribute's value as per
+          [6].
+        - We no longer use a SpaceSplitString for the internal representation
+          as we need to sanitize the tokens (drop duplicates and extra spaces).
+          DOMTokenList now has an internal Vector&lt;AtomicString&gt; containing the
+          tokens that is constructed from the algorithm in [2]. As a result,
+          most of the logic is now in DOMTokenList instead of its subclasses
+          which means that most methods are no longer virtual. We only have
+          one virtual function named updateAfterTokenChange() to do the update
+          steps as AttributeDOMTokenList needs to update the associated
+          attribute.
+
+        This change does not seem to impact Dromaeo.
+
+        [1] https://dom.spec.whatwg.org/#concept-ordered-set-serializer
+        [2] https://dom.spec.whatwg.org/#ordered%20sets
+        [3] https://dom.spec.whatwg.org/#stringification-behavior
+        [4] https://dom.spec.whatwg.org/#dom-domsettabletokenlist-value
+        [5] https://dom.spec.whatwg.org/#dom-domtokenlist-contains (step 2)
+        [6] https://dom.spec.whatwg.org/#concept-DTL-update
+        [7] https://bugzilla.mozilla.org/show_bug.cgi?id=869788
+
+        No new tests, already covered by existing tests.
+
+        * dom/Element.cpp:
+        (WebCore::Element::classAttributeChanged):
+        When the class attribute changes, make sure to update the associated
+        classList if there is one. We could do this lazily if it turns out
+        to be a performance problem. However, chances are this is not as
+        classList is rarely used and we only need to update the classList if
+        it was ever accessed by JS for this Element.
+
+        (WebCore::Element::insertedInto):
+        Drop call to clearClassListValueForQuirksMode() as we no longer need
+        to maintain a separate SpaceSplitString for classes when in quirks
+        mode. This is because AttributeDOMTokenList now has its own Vector
+        of classes in their original cases. It therefore no longer relies on
+        Element::classNames() which has its case folded when in quirks mode.
+
+        (WebCore::Element::classList):
+        Return a AttributeDOMTokenList instead of a ClassList.
+
+        * html/AttributeDOMTokenList.h: Added.
+        * html/AttributeDOMTokenList.cpp: Added.
+        (WebCore::AttributeDOMTokenList::AttributeDOMTokenList):
+        Call DOMTokenList::setValue() using the attribute's value so that
+        DOMTokenList can initialize its token Vector.
+
+        (WebCore::AttributeDOMTokenList::attributeValueChanged):
+        If the attribute value was changed by somebody else that the
+        AttributeDOMTokenList, call DOMTokenList::setValue() so that it
+        can update its token Vector.
+
+        (WebCore::AttributeDOMTokenList::updateAfterTokenChange):
+        This is called whenever the token Vector is changed via JS. In
+        this case, we update the associated attribute's value.
+
+        * html/ClassList.cpp: Removed.
+        * html/ClassList.h: Removed.
+        Now merged into AttributeDOMTokenList.
+
+        * html/DOMSettableTokenList.cpp:
+        * html/DOMSettableTokenList.h:
+        Get rid of most of the code as most of the logic is now in
+        DOMTokenList parent class.
+
+        * html/DOMTokenList.cpp:
+        (WebCore::DOMTokenList::validateToken):
+        Use a String parameter instead of an AtomicString as this method does
+        not need the input the be an AtomicString. This avoid atomizing
+        String unnecessarily.
+
+        (WebCore::DOMTokenList::validateTokens):
+        Use a modern loop.
+
+        (WebCore::DOMTokenList::contains):
+        No longer use containsInternal() virtual function. We can now check
+        the internal token Vector.
+
+        (WebCore::DOMTokenList::add):
+        Now update the internal Vector. Use a modern loop and try to minimize
+        Vector capacity reallocation.
+
+        (WebCore::DOMTokenList::remove):
+        Now update the internal Vector.
+
+        (WebCore::DOMTokenList::toggle):
+        Now update the internal Vector and refactor the code so that it is
+        structured exactly as the algorithm in the specification for
+        clarity.
+
+        (WebCore::DOMTokenList::value):
+        Now return the result of the ordered set serializer for tokens. This
+        method is used for:
+        - The DOMSettableTokenList.value() getter
+        - The DOMTokenList stringifier
+        - As attribute value when updating the associated attribute in
+          AttributeDOMTokenList.
+
+        (WebCore::DOMTokenList::setValue):
+        Update the internal Vector using the algorithm in [2].
+
+        * html/DOMTokenList.h:
+        (WebCore::DOMTokenList::length):
+        No longer virtual, now returns the size of the internal token Vector.
+
+        (WebCore::DOMTokenList::item):
+        No longer virtual, now returns the token at the given index in the
+        internal Vector.
+
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::HTMLAnchorElement::relList):
+        Now return a AttributeDOMTokenList.
+
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::relList):
+        Now return a AttributeDOMTokenList.
+
+        * html/RelList.cpp: Removed.
+        * html/RelList.h: Removed.
+        Now merged into AttributeDOMTokenList.
+
+2015-09-11  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Element.tagName should be upper-case for HTML elements in HTML documents
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=148843
</span><span class="cx">         &lt;rdar://problem/22559081&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -16042,6 +16042,7 @@
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\editing\win\EditorWin.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\fileapi\AsyncFileStream.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\html\AttributeDOMTokenList.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\html\BaseButtonInputType.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\BaseCheckableInputType.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\BaseClickableWithKeyInputType.cpp&quot; /&gt;
</span><span class="lines">@@ -16056,7 +16057,6 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\canvas\CanvasRenderingContext2D.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\canvas\CanvasStyle.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\CheckboxInputType.cpp&quot; /&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\html\ClassList.cpp&quot; /&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\html\ColorInputType.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\DateInputType.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\DateTimeInputType.cpp&quot; /&gt;
</span><span class="lines">@@ -17215,7 +17215,6 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\RadioInputType.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\RadioNodeList.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\RangeInputType.cpp&quot; /&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\html\RelList.cpp&quot; /&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\html\ResetInputType.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\RubyElement.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\RubyTextElement.cpp&quot; /&gt;
</span><span class="lines">@@ -22178,6 +22177,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\editing\VisibleUnits.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\editing\WrapContentsInDummySpanCommand.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\fileapi\AsyncFileStream.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\html\AttributeDOMTokenList.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\html\BaseButtonInputType.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\html\BaseCheckableInputType.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\html\BaseClickableWithKeyInputType.h&quot; /&gt;
</span><span class="lines">@@ -22192,7 +22192,6 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\html\canvas\CanvasRenderingContext2D.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\html\canvas\CanvasStyle.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\html\CheckboxInputType.h&quot; /&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\html\ClassList.h&quot; /&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\html\CollectionType.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\html\ColorInputType.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\html\DateInputType.h&quot; /&gt;
</span><span class="lines">@@ -22325,7 +22324,6 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\html\RadioInputType.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\html\RadioNodeList.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\html\RangeInputType.h&quot; /&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\html\RelList.h&quot; /&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\html\ResetInputType.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\html\RubyElement.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\html\RubyTextElement.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -3591,6 +3591,9 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\fileapi\AsyncFileStream.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;html&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\html\AttributeDOMTokenList.cpp&quot;&gt;
+      &lt;Filter&gt;html&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\html\BaseButtonInputType.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;html&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -3618,9 +3621,6 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\CheckboxInputType.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;html&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\html\ClassList.cpp&quot;&gt;
-      &lt;Filter&gt;html&lt;/Filter&gt;
-    &lt;/ClCompile&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\html\ColorInputType.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;html&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -3999,9 +3999,6 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\RangeInputType.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;html&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\html\RelList.cpp&quot;&gt;
-      &lt;Filter&gt;html&lt;/Filter&gt;
-    &lt;/ClCompile&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\html\ResetInputType.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;html&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -10748,6 +10745,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\fileapi\AsyncFileStream.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;html&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\html\AttributeDOMTokenList.h&quot;&gt;
+      &lt;Filter&gt;html&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\html\BaseButtonInputType.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;html&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><span class="lines">@@ -10775,9 +10775,6 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\html\CheckboxInputType.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;html&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\html\ClassList.h&quot;&gt;
-      &lt;Filter&gt;html&lt;/Filter&gt;
-    &lt;/ClInclude&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\html\CollectionType.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;html&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><span class="lines">@@ -11168,9 +11165,6 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\html\RangeInputType.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;html&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\html\RelList.h&quot;&gt;
-      &lt;Filter&gt;html&lt;/Filter&gt;
-    &lt;/ClInclude&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\html\ResetInputType.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;html&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -1686,6 +1686,8 @@
</span><span class="cx">                 45BAC2B01360BBAB005DA258 /* IconURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 45BAC2AF1360BBAB005DA258 /* IconURL.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 45FEA5CF156DDE8C00654101 /* Decimal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 45FEA5CD156DDE8C00654101 /* Decimal.cpp */; };
</span><span class="cx">                 45FEA5D0156DDE8C00654101 /* Decimal.h in Headers */ = {isa = PBXBuildFile; fileRef = 45FEA5CE156DDE8C00654101 /* Decimal.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                46233EEE1BA0F187000EBEBB /* AttributeDOMTokenList.h in Headers */ = {isa = PBXBuildFile; fileRef = 46233EED1BA0F17A000EBEBB /* AttributeDOMTokenList.h */; };
+                46233EEF1BA0F18B000EBEBB /* AttributeDOMTokenList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46233EEC1BA0F17A000EBEBB /* AttributeDOMTokenList.cpp */; };
</ins><span class="cx">                 4634592C1AC2271000ECB71C /* PowerObserverMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4634592B1AC2271000ECB71C /* PowerObserverMac.cpp */; };
</span><span class="cx">                 4634592E1AC2273C00ECB71C /* SharedTimerCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4634592D1AC2273C00ECB71C /* SharedTimerCF.cpp */; };
</span><span class="cx">                 463EB6221B8789E00096ED51 /* TagCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 463EB6201B8789CB0096ED51 /* TagCollection.cpp */; };
</span><span class="lines">@@ -1853,8 +1855,6 @@
</span><span class="cx">                 4A9CC81816BB9AC600EC645A /* CSSDefaultStyleSheets.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A9CC81616BB9AC600EC645A /* CSSDefaultStyleSheets.h */; };
</span><span class="cx">                 4A9CC82016BF9BB400EC645A /* InspectorCSSOMWrappers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A9CC81E16BF9BB400EC645A /* InspectorCSSOMWrappers.cpp */; };
</span><span class="cx">                 4A9CC82116BF9BB400EC645A /* InspectorCSSOMWrappers.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A9CC81F16BF9BB400EC645A /* InspectorCSSOMWrappers.h */; };
</span><del>-                4ACBC0BE12713CBD0094F9B2 /* ClassList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4ACBC0BC12713CBD0094F9B2 /* ClassList.cpp */; };
-                4ACBC0BF12713CBD0094F9B2 /* ClassList.h in Headers */ = {isa = PBXBuildFile; fileRef = 4ACBC0BD12713CBD0094F9B2 /* ClassList.h */; };
</del><span class="cx">                 4ACBC0C312713CCA0094F9B2 /* DOMSettableTokenList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4ACBC0C012713CCA0094F9B2 /* DOMSettableTokenList.cpp */; };
</span><span class="cx">                 4ACBC0C412713CCA0094F9B2 /* DOMSettableTokenList.h in Headers */ = {isa = PBXBuildFile; fileRef = 4ACBC0C112713CCA0094F9B2 /* DOMSettableTokenList.h */; };
</span><span class="cx">                 4ACBC0CA12713D0A0094F9B2 /* JSDOMSettableTokenList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4ACBC0C812713D0A0094F9B2 /* JSDOMSettableTokenList.cpp */; };
</span><span class="lines">@@ -4892,8 +4892,6 @@
</span><span class="cx">                 B2ED97710B1F55CE00257D0F /* GraphicsContextCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2ED97700B1F55CE00257D0F /* GraphicsContextCG.cpp */; };
</span><span class="cx">                 B2F34FE60E82F81400F627CD /* DNS.h in Headers */ = {isa = PBXBuildFile; fileRef = B2F34FE50E82F81400F627CD /* DNS.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 B2F34FE90E82F82700F627CD /* DNSCFNet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2F34FE80E82F82700F627CD /* DNSCFNet.cpp */; };
</span><del>-                B2F78CFD19F2F02D0049696C /* RelList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2F78CFB19F2F02D0049696C /* RelList.cpp */; };
-                B2F78CFE19F2F02D0049696C /* RelList.h in Headers */ = {isa = PBXBuildFile; fileRef = B2F78CFC19F2F02D0049696C /* RelList.h */; };
</del><span class="cx">                 B2FA3D360AB75A6F000E5AC4 /* JSSVGAnimateColorElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2FA3C4E0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.cpp */; };
</span><span class="cx">                 B2FA3D370AB75A6F000E5AC4 /* JSSVGAnimateColorElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B2FA3C4F0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.h */; };
</span><span class="cx">                 B2FA3D380AB75A6F000E5AC4 /* JSSVGAnimatedAngle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2FA3C500AB75A6E000E5AC4 /* JSSVGAnimatedAngle.cpp */; };
</span><span class="lines">@@ -8934,6 +8932,8 @@
</span><span class="cx">                 45BAC2AF1360BBAB005DA258 /* IconURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IconURL.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 45FEA5CD156DDE8C00654101 /* Decimal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Decimal.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 45FEA5CE156DDE8C00654101 /* Decimal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Decimal.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                46233EEC1BA0F17A000EBEBB /* AttributeDOMTokenList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AttributeDOMTokenList.cpp; path = ../AttributeDOMTokenList.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                46233EED1BA0F17A000EBEBB /* AttributeDOMTokenList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AttributeDOMTokenList.h; path = ../AttributeDOMTokenList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 4634592B1AC2271000ECB71C /* PowerObserverMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PowerObserverMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 4634592D1AC2273C00ECB71C /* SharedTimerCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedTimerCF.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 463EB6201B8789CB0096ED51 /* TagCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TagCollection.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -9117,8 +9117,6 @@
</span><span class="cx">                 4A9CC81616BB9AC600EC645A /* CSSDefaultStyleSheets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSDefaultStyleSheets.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 4A9CC81E16BF9BB400EC645A /* InspectorCSSOMWrappers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorCSSOMWrappers.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 4A9CC81F16BF9BB400EC645A /* InspectorCSSOMWrappers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorCSSOMWrappers.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                4ACBC0BC12713CBD0094F9B2 /* ClassList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ClassList.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                4ACBC0BD12713CBD0094F9B2 /* ClassList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClassList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 4ACBC0C012713CCA0094F9B2 /* DOMSettableTokenList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMSettableTokenList.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 4ACBC0C112713CCA0094F9B2 /* DOMSettableTokenList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMSettableTokenList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 4ACBC0C212713CCA0094F9B2 /* DOMSettableTokenList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMSettableTokenList.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -12472,8 +12470,6 @@
</span><span class="cx">                 B2ED97700B1F55CE00257D0F /* GraphicsContextCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContextCG.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B2F34FE50E82F81400F627CD /* DNS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B2F34FE80E82F82700F627CD /* DNSCFNet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNSCFNet.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                B2F78CFB19F2F02D0049696C /* RelList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RelList.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                B2F78CFC19F2F02D0049696C /* RelList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RelList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 B2FA3C4E0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGAnimateColorElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B2FA3C4F0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSSVGAnimateColorElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B2FA3C500AB75A6E000E5AC4 /* JSSVGAnimatedAngle.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGAnimatedAngle.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -18196,8 +18192,6 @@
</span><span class="cx">                                 830030F71B7D398800ED3AAC /* CachedHTMLCollection.h */,
</span><span class="cx">                                 F55B3D7D1251F12D003EF269 /* CheckboxInputType.cpp */,
</span><span class="cx">                                 F55B3D7E1251F12D003EF269 /* CheckboxInputType.h */,
</span><del>-                                4ACBC0BC12713CBD0094F9B2 /* ClassList.cpp */,
-                                4ACBC0BD12713CBD0094F9B2 /* ClassList.h */,
</del><span class="cx">                                 46EBEA011B7D4D5D00BE4941 /* CollectionTraversal.h */,
</span><span class="cx">                                 93C441FF0F813AE100C1A634 /* CollectionType.h */,
</span><span class="cx">                                 BC29935C17A1DD5800BCE880 /* ColorInputType.cpp */,
</span><span class="lines">@@ -18541,8 +18535,6 @@
</span><span class="cx">                                 B658FFA41522EFAA00DD5595 /* RadioNodeList.h */,
</span><span class="cx">                                 F55B3D991251F12D003EF269 /* RangeInputType.cpp */,
</span><span class="cx">                                 F55B3D9A1251F12D003EF269 /* RangeInputType.h */,
</span><del>-                                B2F78CFB19F2F02D0049696C /* RelList.cpp */,
-                                B2F78CFC19F2F02D0049696C /* RelList.h */,
</del><span class="cx">                                 F55B3D9B1251F12D003EF269 /* ResetInputType.cpp */,
</span><span class="cx">                                 F55B3D9C1251F12D003EF269 /* ResetInputType.h */,
</span><span class="cx">                                 5824ABA01AE81116009074B7 /* RubyElement.cpp */,
</span><span class="lines">@@ -20291,6 +20283,8 @@
</span><span class="cx">                 B1AD4E7713A12A7200846B27 /* track */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                46233EEC1BA0F17A000EBEBB /* AttributeDOMTokenList.cpp */,
+                                46233EED1BA0F17A000EBEBB /* AttributeDOMTokenList.h */,
</ins><span class="cx">                                 BE88E0CC1715D2A200658D98 /* AudioTrack.cpp */,
</span><span class="cx">                                 BE88E0CD1715D2A200658D98 /* AudioTrack.h */,
</span><span class="cx">                                 BE88E0CE1715D2A200658D98 /* AudioTrack.idl */,
</span><span class="lines">@@ -24201,7 +24195,6 @@
</span><span class="cx">                                 A81872200977D3C0005826D9 /* ChildNodeList.h in Headers */,
</span><span class="cx">                                 14D823520AF92A790004F057 /* Chrome.h in Headers */,
</span><span class="cx">                                 14D824080AF93AEB0004F057 /* ChromeClient.h in Headers */,
</span><del>-                                4ACBC0BF12713CBD0094F9B2 /* ClassList.h in Headers */,
</del><span class="cx">                                 BCC0657E0F3CE1B700CD2D87 /* ClientRect.h in Headers */,
</span><span class="cx">                                 BCC065810F3CE1B700CD2D87 /* ClientRectList.h in Headers */,
</span><span class="cx">                                 85031B400A44EFC700F992E0 /* ClipboardEvent.h in Headers */,
</span><span class="lines">@@ -26333,6 +26326,7 @@
</span><span class="cx">                                 97059978107D975200A50A7C /* PolicyCallback.h in Headers */,
</span><span class="cx">                                 9705997A107D975200A50A7C /* PolicyChecker.h in Headers */,
</span><span class="cx">                                 FD45A957175D414C00C21EC8 /* PolygonShape.h in Headers */,
</span><ins>+                                46233EEE1BA0F187000EBEBB /* AttributeDOMTokenList.h in Headers */,
</ins><span class="cx">                                 5174E20A10A1F44F00F95E6F /* PopStateEvent.h in Headers */,
</span><span class="cx">                                 0668E18B0ADD9624004128E0 /* PopupMenu.h in Headers */,
</span><span class="cx">                                 ABC128770B33AA6D00C693D5 /* PopupMenuClient.h in Headers */,
</span><span class="lines">@@ -26395,7 +26389,6 @@
</span><span class="cx">                                 6CDDE8D01770BB220016E072 /* RegionOversetState.h in Headers */,
</span><span class="cx">                                 26B9998F1803AE7200D01121 /* RegisterAllocator.h in Headers */,
</span><span class="cx">                                 85031B4C0A44EFC700F992E0 /* RegisteredEventListener.h in Headers */,
</span><del>-                                B2F78CFE19F2F02D0049696C /* RelList.h in Headers */,
</del><span class="cx">                                 CDFC360618CA61C20026E56F /* RemoteCommandListener.h in Headers */,
</span><span class="cx">                                 93309E01099E64920056E581 /* RemoveCSSPropertyCommand.h in Headers */,
</span><span class="cx">                                 D06C0D8F0CFD11460065F43F /* RemoveFormatCommand.h in Headers */,
</span><span class="lines">@@ -28000,7 +27993,6 @@
</span><span class="cx">                                 A81872250977D3C0005826D9 /* ChildNodeList.cpp in Sources */,
</span><span class="cx">                                 14D8238B0AF92DF60004F057 /* Chrome.cpp in Sources */,
</span><span class="cx">                                 ABAF22080C03B1C700B0BCF0 /* ChromeMac.mm in Sources */,
</span><del>-                                4ACBC0BE12713CBD0094F9B2 /* ClassList.cpp in Sources */,
</del><span class="cx">                                 BCC0657D0F3CE1B700CD2D87 /* ClientRect.cpp in Sources */,
</span><span class="cx">                                 BCC065800F3CE1B700CD2D87 /* ClientRectList.cpp in Sources */,
</span><span class="cx">                                 85031B3F0A44EFC700F992E0 /* ClipboardEvent.cpp in Sources */,
</span><span class="lines">@@ -28875,6 +28867,7 @@
</span><span class="cx">                                 B27535600B053814002CE64F /* IntPointCG.cpp in Sources */,
</span><span class="cx">                                 B275357C0B053814002CE64F /* IntPointMac.mm in Sources */,
</span><span class="cx">                                 B27535730B053814002CE64F /* IntRect.cpp in Sources */,
</span><ins>+                                46233EEF1BA0F18B000EBEBB /* AttributeDOMTokenList.cpp in Sources */,
</ins><span class="cx">                                 B27535610B053814002CE64F /* IntRectCG.cpp in Sources */,
</span><span class="cx">                                 B275357D0B053814002CE64F /* IntRectMac.mm in Sources */,
</span><span class="cx">                                 2D46F05017B96FD2005647F0 /* IntSize.cpp in Sources */,
</span><span class="lines">@@ -29928,7 +29921,6 @@
</span><span class="cx">                                 FD45A95A175D417100C21EC8 /* RectangleShape.cpp in Sources */,
</span><span class="cx">                                 BCAB418113E356E800D8AAF3 /* Region.cpp in Sources */,
</span><span class="cx">                                 85031B4B0A44EFC700F992E0 /* RegisteredEventListener.cpp in Sources */,
</span><del>-                                B2F78CFD19F2F02D0049696C /* RelList.cpp in Sources */,
</del><span class="cx">                                 CDFC360518CA61C20026E56F /* RemoteCommandListener.cpp in Sources */,
</span><span class="cx">                                 CDFC360718CA696C0026E56F /* RemoteCommandListenerIOS.mm in Sources */,
</span><span class="cx">                                 93309E00099E64920056E581 /* RemoveCSSPropertyCommand.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/Source/WebCore/dom/Element.cpp        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -1346,8 +1346,10 @@
</span><span class="cx">         elementData()-&gt;clearClass();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (hasRareData())
-        elementRareData()-&gt;clearClassListValueForQuirksMode();
</del><ins>+    if (hasRareData()) {
+        if (auto* classList = elementRareData()-&gt;classList())
+            classList-&gt;attributeValueChanged(newClassString);
+    }
</ins><span class="cx"> 
</span><span class="cx">     if (shouldInvalidateStyle)
</span><span class="cx">         setNeedsStyleRecalc();
</span><span class="lines">@@ -1515,9 +1517,6 @@
</span><span class="cx">     if (!insertionPoint.isInTreeScope())
</span><span class="cx">         return InsertionDone;
</span><span class="cx"> 
</span><del>-    if (hasRareData())
-        elementRareData()-&gt;clearClassListValueForQuirksMode();
-
</del><span class="cx">     TreeScope* newScope = &amp;insertionPoint.treeScope();
</span><span class="cx">     HTMLDocument* newDocument = !wasInDocument &amp;&amp; inDocument() &amp;&amp; is&lt;HTMLDocument&gt;(newScope-&gt;documentScope()) ? &amp;downcast&lt;HTMLDocument&gt;(newScope-&gt;documentScope()) : nullptr;
</span><span class="cx">     if (newScope != &amp;treeScope())
</span><span class="lines">@@ -2654,7 +2653,7 @@
</span><span class="cx"> {
</span><span class="cx">     ElementRareData&amp; data = ensureElementRareData();
</span><span class="cx">     if (!data.classList())
</span><del>-        data.setClassList(std::make_unique&lt;ClassList&gt;(*this));
</del><ins>+        data.setClassList(std::make_unique&lt;AttributeDOMTokenList&gt;(*this, HTMLNames::classAttr));
</ins><span class="cx">     return *data.classList();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementRareDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ElementRareData.h (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ElementRareData.h        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/Source/WebCore/dom/ElementRareData.h        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> #ifndef ElementRareData_h
</span><span class="cx"> #define ElementRareData_h
</span><span class="cx"> 
</span><del>-#include &quot;ClassList.h&quot;
</del><ins>+#include &quot;AttributeDOMTokenList.h&quot;
</ins><span class="cx"> #include &quot;DatasetDOMStringMap.h&quot;
</span><span class="cx"> #include &quot;NamedNodeMap.h&quot;
</span><span class="cx"> #include &quot;NodeRareData.h&quot;
</span><span class="lines">@@ -92,14 +92,8 @@
</span><span class="cx">     RenderStyle* computedStyle() const { return m_computedStyle.get(); }
</span><span class="cx">     void setComputedStyle(Ref&lt;RenderStyle&gt;&amp;&amp; computedStyle) { m_computedStyle = WTF::move(computedStyle); }
</span><span class="cx"> 
</span><del>-    ClassList* classList() const { return m_classList.get(); }
-    void setClassList(std::unique_ptr&lt;ClassList&gt; classList) { m_classList = WTF::move(classList); }
-    void clearClassListValueForQuirksMode()
-    {
-        if (!m_classList)
-            return;
-        m_classList-&gt;clearValueForQuirksMode();
-    }
</del><ins>+    AttributeDOMTokenList* classList() const { return m_classList.get(); }
+    void setClassList(std::unique_ptr&lt;AttributeDOMTokenList&gt; classList) { m_classList = WTF::move(classList); }
</ins><span class="cx"> 
</span><span class="cx">     DatasetDOMStringMap* dataset() const { return m_dataset.get(); }
</span><span class="cx">     void setDataset(std::unique_ptr&lt;DatasetDOMStringMap&gt; dataset) { m_dataset = WTF::move(dataset); }
</span><span class="lines">@@ -140,7 +134,7 @@
</span><span class="cx">     RefPtr&lt;RenderStyle&gt; m_computedStyle;
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;DatasetDOMStringMap&gt; m_dataset;
</span><del>-    std::unique_ptr&lt;ClassList&gt; m_classList;
</del><ins>+    std::unique_ptr&lt;AttributeDOMTokenList&gt; m_classList;
</ins><span class="cx">     RefPtr&lt;ShadowRoot&gt; m_shadowRoot;
</span><span class="cx">     std::unique_ptr&lt;NamedNodeMap&gt; m_attributeMap;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlAttributeDOMTokenListcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/html/AttributeDOMTokenList.cpp (0 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/AttributeDOMTokenList.cpp                                (rev 0)
+++ trunk/Source/WebCore/html/AttributeDOMTokenList.cpp        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;AttributeDOMTokenList.h&quot;
+
+#include &lt;wtf/TemporaryChange.h&gt;
+
+namespace WebCore {
+
+AttributeDOMTokenList::AttributeDOMTokenList(Element&amp; element, const QualifiedName&amp; attributeName)
+    : m_element(element)
+    , m_attributeName(attributeName)
+{
+    setValue(m_element.getAttribute(m_attributeName));
+}
+
+void AttributeDOMTokenList::attributeValueChanged(const AtomicString&amp; newValue)
+{
+    // Do not reset the DOMTokenList value if the attribute value was changed by us.
+    if (m_isUpdatingAttributeValue)
+        return;
+
+    DOMTokenList::setValue(newValue);
+}
+
+void AttributeDOMTokenList::updateAfterTokenChange()
+{
+    DOMTokenList::updateAfterTokenChange();
+
+    TemporaryChange&lt;bool&gt; inAttributeUpdate(m_isUpdatingAttributeValue, true);
+    m_element.setAttribute(m_attributeName, value());
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlAttributeDOMTokenListh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/html/AttributeDOMTokenList.h (0 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/AttributeDOMTokenList.h                                (rev 0)
+++ trunk/Source/WebCore/html/AttributeDOMTokenList.h        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AttributeDOMTokenList_h
+#define AttributeDOMTokenList_h
+
+#include &quot;DOMTokenList.h&quot;
+#include &quot;Element.h&quot;
+
+namespace WebCore {
+
+class AttributeDOMTokenList final : public DOMTokenList {
+public:
+    AttributeDOMTokenList(Element&amp;, const QualifiedName&amp; attributeName);
+    void attributeValueChanged(const AtomicString&amp;);
+
+private:
+    virtual void ref() override { m_element.ref(); }
+    virtual void deref() override { m_element.deref(); }
+
+    virtual Element* element() const override { return &amp;m_element; }
+    virtual void updateAfterTokenChange() override;
+
+    Element&amp; m_element;
+    const WebCore::QualifiedName&amp; m_attributeName;
+    bool m_isUpdatingAttributeValue { false };
+};
+
+} // namespace WebCore
+
+#endif // AttributeDOMTokenList_h
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlClassListcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/html/ClassList.cpp (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/ClassList.cpp        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/Source/WebCore/html/ClassList.cpp        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -1,88 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;ClassList.h&quot;
-
-#include &quot;Element.h&quot;
-#include &quot;HTMLNames.h&quot;
-#include &quot;HTMLParserIdioms.h&quot;
-
-namespace WebCore {
-
-void ClassList::ref()
-{
-    m_element.ref();
-}
-
-void ClassList::deref()
-{
-    m_element.deref();
-}
-
-unsigned ClassList::length() const
-{
-    return m_element.hasClass() ? classNames().size() : 0;
-}
-
-const AtomicString ClassList::item(unsigned index) const
-{
-    if (index &gt;= length())
-        return AtomicString();
-    return classNames()[index];
-}
-
-Element* ClassList::element() const
-{
-    return &amp;m_element;
-}
-
-bool ClassList::containsInternal(const AtomicString&amp; token) const
-{
-    return m_element.hasClass() &amp;&amp; classNames().contains(token);
-}
-
-AtomicString ClassList::value() const
-{
-    return m_element.getAttribute(HTMLNames::classAttr);
-}
-
-void ClassList::setValue(const AtomicString&amp; value)
-{
-    m_element.setAttribute(HTMLNames::classAttr, value);
-}
-
-const SpaceSplitString&amp; ClassList::classNames() const
-{
-    ASSERT(m_element.hasClass());
-    if (m_element.document().inQuirksMode()) {
-        if (m_classNamesForQuirksMode.isEmpty())
-            m_classNamesForQuirksMode.set(value(), false);
-        return m_classNamesForQuirksMode;
-    }
-    return m_element.elementData()-&gt;classNames();
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlClassListh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/html/ClassList.h (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/ClassList.h        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/Source/WebCore/html/ClassList.h        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -1,66 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ClassList_h
-#define ClassList_h
-
-#include &quot;DOMTokenList.h&quot;
-#include &quot;SpaceSplitString.h&quot;
-
-namespace WebCore {
-
-class Element;
-
-class ClassList final : public DOMTokenList {
-public:
-    ClassList(Element&amp; element)
-        : m_element(element)
-    {
-    }
-
-    virtual void ref() override;
-    virtual void deref() override;
-
-    virtual unsigned length() const override;
-    virtual const AtomicString item(unsigned index) const override;
-
-    virtual Element* element() const override;
-
-    void clearValueForQuirksMode() { m_classNamesForQuirksMode.clear(); }
-
-private:
-    virtual bool containsInternal(const AtomicString&amp;) const override;
-    virtual AtomicString value() const override;
-    virtual void setValue(const AtomicString&amp;) override;
-
-    const SpaceSplitString&amp; classNames() const;
-
-    Element&amp; m_element;
-    mutable SpaceSplitString m_classNamesForQuirksMode;
-};
-
-} // namespace WebCore
-
-#endif // ClassList_h
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlDOMSettableTokenListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/DOMSettableTokenList.cpp (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/DOMSettableTokenList.cpp        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/Source/WebCore/html/DOMSettableTokenList.cpp        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2010 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -38,32 +38,4 @@
</span><span class="cx">     RefCounted&lt;DOMSettableTokenList&gt;::deref();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-unsigned DOMSettableTokenList::length() const
-{
-    return m_tokens.size();
-}
-
-const AtomicString DOMSettableTokenList::item(unsigned index) const
-{
-    if (index &gt;= length())
-        return AtomicString();
-    return m_tokens[index];
-}
-
-bool DOMSettableTokenList::containsInternal(const AtomicString&amp; token) const
-{
-    return m_tokens.contains(token);
-}
-
-AtomicString DOMSettableTokenList::value() const
-{
-    return m_value;
-}
-
-void DOMSettableTokenList::setValue(const AtomicString&amp; value)
-{
-    m_value = value;
-    m_tokens.set(value, false);
-}
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlDOMSettableTokenListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/DOMSettableTokenList.h (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/DOMSettableTokenList.h        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/Source/WebCore/html/DOMSettableTokenList.h        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2010 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -43,20 +43,12 @@
</span><span class="cx">         return adoptRef(*new DOMSettableTokenList);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // Make public.
+    using DOMTokenList::value;
+    using DOMTokenList::setValue;
+
</ins><span class="cx">     virtual void ref() override;
</span><span class="cx">     virtual void deref() override;
</span><del>-
-    virtual unsigned length() const override;
-    virtual const AtomicString item(unsigned index) const override;
-
-    virtual AtomicString value() const override;
-    virtual void setValue(const AtomicString&amp;) override;
-
-private:
-    virtual bool containsInternal(const AtomicString&amp;) const override;
-
-    AtomicString m_value;
-    SpaceSplitString m_tokens;
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlDOMTokenListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/DOMTokenList.cpp (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/DOMTokenList.cpp        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/Source/WebCore/html/DOMTokenList.cpp        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2010 Google Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2015 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -27,11 +28,14 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="cx"> #include &quot;HTMLParserIdioms.h&quot;
</span><ins>+#include &quot;SpaceSplitString.h&quot;
+#include &lt;wtf/HashSet.h&gt;
+#include &lt;wtf/text/AtomicStringHash.h&gt;
</ins><span class="cx"> #include &lt;wtf/text/StringBuilder.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-bool DOMTokenList::validateToken(const AtomicString&amp; token, ExceptionCode&amp; ec)
</del><ins>+bool DOMTokenList::validateToken(const String&amp; token, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     if (token.isEmpty()) {
</span><span class="cx">         ec = SYNTAX_ERR;
</span><span class="lines">@@ -49,13 +53,12 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool DOMTokenList::validateTokens(const Vector&lt;String&gt;&amp; tokens, ExceptionCode&amp; ec)
</del><ins>+bool DOMTokenList::validateTokens(const String* tokens, size_t length, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    for (size_t i = 0; i &lt; tokens.size(); ++i) {
</del><ins>+    for (size_t i = 0; i &lt; length; ++i) {
</ins><span class="cx">         if (!validateToken(tokens[i], ec))
</span><span class="cx">             return false;
</span><span class="cx">     }
</span><del>-
</del><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -63,175 +66,130 @@
</span><span class="cx"> {
</span><span class="cx">     if (!validateToken(token, ec))
</span><span class="cx">         return false;
</span><del>-    return containsInternal(token);
-}
</del><span class="cx"> 
</span><del>-void DOMTokenList::add(const AtomicString&amp; token, ExceptionCode&amp; ec)
-{
-    Vector&lt;String&gt; tokens;
-    tokens.append(token.string());
-    add(tokens, ec);
</del><ins>+    return m_tokens.contains(token);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DOMTokenList::add(const Vector&lt;String&gt;&amp; tokens, ExceptionCode&amp; ec)
</del><ins>+inline void DOMTokenList::addInternal(const String* tokens, size_t length, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    Vector&lt;String&gt; filteredTokens;
-    for (size_t i = 0; i &lt; tokens.size(); ++i) {
</del><ins>+    // This is usually called with a single token.
+    Vector&lt;AtomicString, 1&gt; uniqueTokens;
+    uniqueTokens.reserveInitialCapacity(length);
+
+    for (size_t i = 0; i &lt; length; ++i) {
</ins><span class="cx">         if (!validateToken(tokens[i], ec))
</span><span class="cx">             return;
</span><del>-        if (!containsInternal(tokens[i]) &amp;&amp; !filteredTokens.contains(tokens[i]))
-            filteredTokens.append(tokens[i]);
</del><ins>+        if (!m_tokens.contains(tokens[i]) &amp;&amp; !uniqueTokens.contains(tokens[i]))
+            uniqueTokens.uncheckedAppend(tokens[i]);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (filteredTokens.isEmpty())
</del><ins>+    if (uniqueTokens.isEmpty())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    setValue(addTokens(value(), filteredTokens));
</del><ins>+    m_tokens.appendVector(uniqueTokens);
+    updateAfterTokenChange();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DOMTokenList::remove(const AtomicString&amp; token, ExceptionCode&amp; ec)
</del><ins>+void DOMTokenList::add(const Vector&lt;String&gt;&amp; tokens, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    Vector&lt;String&gt; tokens;
-    tokens.append(token.string());
-    remove(tokens, ec);
</del><ins>+    addInternal(tokens.data(), tokens.size(), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DOMTokenList::remove(const Vector&lt;String&gt;&amp; tokens, ExceptionCode&amp; ec)
</del><ins>+void DOMTokenList::add(const WTF::AtomicString&amp; token, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    if (!validateTokens(tokens, ec))
-        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 &lt; tokens.size(); ++i) {
-        if (containsInternal(tokens[i])) {
-            found = true;
-            break;
-        }
-    }
-
-    if (found)
-        setValue(removeTokens(value(), tokens));
</del><ins>+    addInternal(&amp;token.string(), 1, ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool DOMTokenList::toggle(const AtomicString&amp; token, ExceptionCode&amp; ec)
</del><ins>+inline void DOMTokenList::removeInternal(const String* tokens, size_t length, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    if (!validateToken(token, ec))
-        return false;
</del><ins>+    if (!validateTokens(tokens, length, ec))
+        return;
</ins><span class="cx"> 
</span><del>-    if (containsInternal(token)) {
-        removeInternal(token);
-        return false;
</del><ins>+    bool didRemoveTokens = false;
+    for (size_t i = 0; i &lt; length; ++i) {
+        if (m_tokens.removeFirst(tokens[i]))
+            didRemoveTokens = true;
</ins><span class="cx">     }
</span><del>-    addInternal(token);
-    return true;
-}
</del><span class="cx"> 
</span><del>-bool DOMTokenList::toggle(const AtomicString&amp; token, bool force, ExceptionCode&amp; ec)
-{
-    if (!validateToken(token, ec))
-        return false;
-
-    if (force)
-        addInternal(token);
-    else
-        removeInternal(token);
-
-    return force;
</del><ins>+    if (didRemoveTokens)
+        updateAfterTokenChange();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DOMTokenList::addInternal(const AtomicString&amp; token)
</del><ins>+void DOMTokenList::remove(const Vector&lt;String&gt;&amp; tokens, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    if (!containsInternal(token))
-        setValue(addToken(value(), token));
</del><ins>+    removeInternal(tokens.data(), tokens.size(), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DOMTokenList::removeInternal(const AtomicString&amp; token)
</del><ins>+void DOMTokenList::remove(const WTF::AtomicString&amp; token, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    // Check using contains first since it uses AtomicString comparisons instead
-    // of character by character testing.
-    if (!containsInternal(token))
-        return;
-    setValue(removeToken(value(), token));
</del><ins>+    removeInternal(&amp;token.string(), 1, ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-String DOMTokenList::addToken(const AtomicString&amp; input, const AtomicString&amp; token)
</del><ins>+bool DOMTokenList::toggle(const AtomicString&amp; token, Optional&lt;bool&gt; force, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    Vector&lt;String&gt; tokens;
-    tokens.append(token.string());
-    return addTokens(input, tokens);
-}
</del><ins>+    if (!validateToken(token, ec))
+        return false;
</ins><span class="cx"> 
</span><del>-String DOMTokenList::addTokens(const AtomicString&amp; input, const Vector&lt;String&gt;&amp; tokens)
-{
-    bool needsSpace = false;
-
-    StringBuilder builder;
-    if (!input.isEmpty()) {
-        builder.append(input);
-        needsSpace = !isHTMLSpace(input[input.length() - 1]);
</del><ins>+    if (m_tokens.contains(token)) {
+        if (!force.valueOr(false)) {
+            m_tokens.removeFirst(token);
+            updateAfterTokenChange();
+            return false;
+        }
+        return true;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    for (size_t i = 0; i &lt; tokens.size(); ++i) {
-        if (needsSpace)
-            builder.append(' ');
-        builder.append(tokens[i]);
-        needsSpace = true;
-    }
</del><ins>+    if (force &amp;&amp; !force.value())
+        return false;
</ins><span class="cx"> 
</span><del>-    return builder.toString();
</del><ins>+    m_tokens.append(token);
+    updateAfterTokenChange();
+    return true;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-String DOMTokenList::removeToken(const AtomicString&amp; input, const AtomicString&amp; token)
</del><ins>+const AtomicString&amp; DOMTokenList::value() const
</ins><span class="cx"> {
</span><del>-    Vector&lt;String&gt; tokens;
-    tokens.append(token.string());
-    return removeTokens(input, tokens);
</del><ins>+    if (m_cachedValue.isNull()) {
+        // https://dom.spec.whatwg.org/#concept-ordered-set-serializer
+        StringBuilder builder;
+        for (auto&amp; token : m_tokens) {
+            if (!builder.isEmpty())
+                builder.append(' ');
+            builder.append(token);
+        }
+        m_cachedValue = builder.toAtomicString();
+        ASSERT(!m_cachedValue.isNull());
+    }
+    return m_cachedValue;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-String DOMTokenList::removeTokens(const AtomicString&amp; input, const Vector&lt;String&gt;&amp; tokens)
</del><ins>+void DOMTokenList::setValue(const String&amp; value)
</ins><span class="cx"> {
</span><del>-    // Algorithm defined at http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#remove-a-token-from-a-string
-    // New spec is at http://dom.spec.whatwg.org/#remove-a-token-from-a-string
</del><ins>+    // Clear tokens but not capacity.
+    m_tokens.shrink(0);
</ins><span class="cx"> 
</span><del>-    unsigned inputLength = input.length();
-    StringBuilder output; // 3
-    output.reserveCapacity(inputLength);
-    unsigned position = 0; // 4
</del><ins>+    HashSet&lt;AtomicString&gt; addedTokens;
+    // https://dom.spec.whatwg.org/#ordered%20sets
+    for (unsigned start = 0; ; ) {
+        while (start &lt; value.length() &amp;&amp; isHTMLSpace(value[start]))
+            ++start;
+        if (start &gt;= value.length())
+            break;
+        unsigned end = start + 1;
+        while (end &lt; value.length() &amp;&amp; !isHTMLSpace(value[end]))
+            ++end;
</ins><span class="cx"> 
</span><del>-    // Step 5
-    while (position &lt; inputLength) {
-        if (isHTMLSpace(input[position])) { // 6
-            output.append(input[position++]); // 6.1, 6.2
-            continue; // 6.3
</del><ins>+        AtomicString token = value.substring(start, end - start);
+        if (!addedTokens.contains(token)) {
+            m_tokens.append(token);
+            addedTokens.add(token);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        // Step 7
-        StringBuilder s;
-        while (position &lt; inputLength &amp;&amp; isNotHTMLSpace(input[position]))
-            s.append(input[position++]);
-
-        // Step 8
-        if (tokens.contains(s.toStringPreserveCapacity())) {
-            // Step 8.1
-            while (position &lt; inputLength &amp;&amp; isHTMLSpace(input[position]))
-                ++position;
-
-            // Step 8.2
-            size_t j = output.length();
-            while (j &gt; 0 &amp;&amp; isHTMLSpace(output[j - 1]))
-                --j;
-            output.resize(j);
-
-            // Step 8.3
-            if (position &lt; inputLength &amp;&amp; !output.isEmpty())
-                output.append(' ');
-        } else
-            output.append(s.toStringPreserveCapacity()); // Step 9
</del><ins>+        start = end + 1;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return output.toString();
</del><ins>+    m_tokens.shrinkToFit();
+    m_cachedValue = nullAtom;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlDOMTokenListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/DOMTokenList.h (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/DOMTokenList.h        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/Source/WebCore/html/DOMTokenList.h        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2010 Google Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2015 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -25,8 +26,9 @@
</span><span class="cx"> #ifndef DOMTokenList_h
</span><span class="cx"> #define DOMTokenList_h
</span><span class="cx"> 
</span><ins>+#include &lt;wtf/Optional.h&gt;
+#include &lt;wtf/Vector.h&gt;
</ins><span class="cx"> #include &lt;wtf/text/AtomicString.h&gt;
</span><del>-#include &lt;wtf/Vector.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -37,14 +39,13 @@
</span><span class="cx"> class DOMTokenList {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(DOMTokenList); WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>-    DOMTokenList() { }
-    virtual ~DOMTokenList() {};
</del><ins>+    virtual ~DOMTokenList() { }
</ins><span class="cx"> 
</span><span class="cx">     virtual void ref() = 0;
</span><span class="cx">     virtual void deref() = 0;
</span><span class="cx"> 
</span><del>-    virtual unsigned length() const = 0;
-    virtual const AtomicString item(unsigned index) const = 0;
</del><ins>+    unsigned length() const;
+    const AtomicString&amp; item(unsigned index) const;
</ins><span class="cx"> 
</span><span class="cx">     bool contains(const AtomicString&amp;, ExceptionCode&amp;) const;
</span><span class="cx">     void add(const Vector&lt;String&gt;&amp;, ExceptionCode&amp;);
</span><span class="lines">@@ -52,28 +53,44 @@
</span><span class="cx">     void remove(const Vector&lt;String&gt;&amp;, ExceptionCode&amp;);
</span><span class="cx">     void remove(const AtomicString&amp;, ExceptionCode&amp;);
</span><span class="cx">     bool toggle(const AtomicString&amp;, ExceptionCode&amp;);
</span><del>-    bool toggle(const AtomicString&amp;, bool force, ExceptionCode&amp;);
</del><ins>+    bool toggle(const AtomicString&amp;, Optional&lt;bool&gt; force, ExceptionCode&amp;);
</ins><span class="cx"> 
</span><del>-    AtomicString toString() const { return value(); }
</del><ins>+    const AtomicString&amp; toString() const { return value(); }
</ins><span class="cx"> 
</span><del>-    virtual Element* element() const { return 0; }
</del><ins>+    virtual Element* element() const { return nullptr; }
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    virtual AtomicString value() const = 0;
-    virtual void setValue(const AtomicString&amp;) = 0;
</del><ins>+    DOMTokenList() = default;
+    const AtomicString&amp; value() const;
+    void setValue(const String&amp;);
</ins><span class="cx"> 
</span><del>-    void addInternal(const AtomicString&amp;);
-    virtual bool containsInternal(const AtomicString&amp;) const = 0;
-    void removeInternal(const AtomicString&amp;);
</del><ins>+    virtual void updateAfterTokenChange() { m_cachedValue = nullAtom; }
</ins><span class="cx"> 
</span><del>-    static bool validateToken(const AtomicString&amp;, ExceptionCode&amp;);
-    static bool validateTokens(const Vector&lt;String&gt;&amp;, ExceptionCode&amp;);
-    static String addToken(const AtomicString&amp;, const AtomicString&amp;);
-    static String addTokens(const AtomicString&amp;, const Vector&lt;String&gt;&amp;);
-    static String removeToken(const AtomicString&amp;, const AtomicString&amp;);
-    static String removeTokens(const AtomicString&amp;, const Vector&lt;String&gt;&amp;);
</del><ins>+private:
+    static bool validateToken(const String&amp;, ExceptionCode&amp;);
+    static bool validateTokens(const String* tokens, size_t length, ExceptionCode&amp;);
+    void addInternal(const String* tokens, size_t length, ExceptionCode&amp;);
+    void removeInternal(const String* tokens, size_t length, ExceptionCode&amp;);
+
+    Vector&lt;AtomicString&gt; m_tokens;
+    mutable AtomicString m_cachedValue;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><ins>+inline unsigned DOMTokenList::length() const
+{
+    return m_tokens.size();
+}
+
+inline const AtomicString&amp; DOMTokenList::item(unsigned index) const
+{
+    return index &lt; m_tokens.size() ? m_tokens[index] : nullAtom;
+}
+
+inline bool DOMTokenList::toggle(const AtomicString&amp; token, ExceptionCode&amp; ec)
+{
+    return toggle(token, Nullopt, ec);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // DOMTokenList_h
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAnchorElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAnchorElement.cpp (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAnchorElement.cpp        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.cpp        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;HTMLAnchorElement.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;AttributeDOMTokenList.h&quot;
</ins><span class="cx"> #include &quot;ElementIterator.h&quot;
</span><span class="cx"> #include &quot;EventHandler.h&quot;
</span><span class="cx"> #include &quot;EventNames.h&quot;
</span><span class="lines">@@ -39,7 +40,6 @@
</span><span class="cx"> #include &quot;MouseEvent.h&quot;
</span><span class="cx"> #include &quot;PingLoader.h&quot;
</span><span class="cx"> #include &quot;PlatformMouseEvent.h&quot;
</span><del>-#include &quot;RelList.h&quot;
</del><span class="cx"> #include &quot;RenderImage.h&quot;
</span><span class="cx"> #include &quot;ResourceRequest.h&quot;
</span><span class="cx"> #include &quot;SVGImage.h&quot;
</span><span class="lines">@@ -264,7 +264,7 @@
</span><span class="cx">         if (SpaceSplitString::spaceSplitStringContainsValue(value, &quot;noreferrer&quot;, true))
</span><span class="cx">             m_linkRelations |= RelationNoReferrer;
</span><span class="cx">         if (m_relList)
</span><del>-            m_relList-&gt;updateRelAttribute(value);
</del><ins>+            m_relList-&gt;attributeValueChanged(value);
</ins><span class="cx">     }
</span><span class="cx">     else
</span><span class="cx">         HTMLElement::parseAttribute(name, value);
</span><span class="lines">@@ -316,7 +316,7 @@
</span><span class="cx"> DOMTokenList&amp; HTMLAnchorElement::relList()
</span><span class="cx"> {
</span><span class="cx">     if (!m_relList) 
</span><del>-        m_relList = std::make_unique&lt;RelList&gt;(*this);
</del><ins>+        m_relList = std::make_unique&lt;AttributeDOMTokenList&gt;(*this, HTMLNames::relAttr);
</ins><span class="cx">     return *m_relList;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAnchorElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAnchorElement.h (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAnchorElement.h        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.h        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class RelList;
</del><ins>+class AttributeDOMTokenList;
</ins><span class="cx"> 
</span><span class="cx"> // Link relation bitmask values.
</span><span class="cx"> // FIXME: Uncomment as the various link relations are implemented.
</span><span class="lines">@@ -145,7 +145,7 @@
</span><span class="cx">     uint32_t m_linkRelations : 30;
</span><span class="cx">     mutable LinkHash m_cachedVisitedLinkHash;
</span><span class="cx"> 
</span><del>-    std::unique_ptr&lt;RelList&gt; m_relList;
</del><ins>+    std::unique_ptr&lt;AttributeDOMTokenList&gt; m_relList;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> inline LinkHash HTMLAnchorElement::visitedLinkHash() const
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLinkElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLinkElement.cpp (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLinkElement.cpp        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/Source/WebCore/html/HTMLLinkElement.cpp        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;HTMLLinkElement.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Attribute.h&quot;
</span><ins>+#include &quot;AttributeDOMTokenList.h&quot;
</ins><span class="cx"> #include &quot;CachedCSSStyleSheet.h&quot;
</span><span class="cx"> #include &quot;CachedResource.h&quot;
</span><span class="cx"> #include &quot;CachedResourceLoader.h&quot;
</span><span class="lines">@@ -46,7 +47,6 @@
</span><span class="cx"> #include &quot;MediaQueryEvaluator.h&quot;
</span><span class="cx"> #include &quot;MouseEvent.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><del>-#include &quot;RelList.h&quot;
</del><span class="cx"> #include &quot;RenderStyle.h&quot;
</span><span class="cx"> #include &quot;SecurityOrigin.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="lines">@@ -141,7 +141,7 @@
</span><span class="cx">     if (name == relAttr) {
</span><span class="cx">         m_relAttribute = LinkRelAttribute(value);
</span><span class="cx">         if (m_relList)
</span><del>-            m_relList-&gt;updateRelAttribute(value);
</del><ins>+            m_relList-&gt;attributeValueChanged(value);
</ins><span class="cx">         process();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -403,7 +403,7 @@
</span><span class="cx"> DOMTokenList&amp; HTMLLinkElement::relList()
</span><span class="cx"> {
</span><span class="cx">     if (!m_relList) 
</span><del>-        m_relList = std::make_unique&lt;RelList&gt;(*this);
</del><ins>+        m_relList = std::make_unique&lt;AttributeDOMTokenList&gt;(*this, HTMLNames::relAttr);
</ins><span class="cx">     return *m_relList;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLinkElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLinkElement.h (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLinkElement.h        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/Source/WebCore/html/HTMLLinkElement.h        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -35,8 +35,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class AttributeDOMTokenList;
</ins><span class="cx"> class HTMLLinkElement;
</span><del>-class RelList;
</del><span class="cx"> class URL;
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt; class EventSender;
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx"> 
</span><span class="cx">     PendingSheetType m_pendingSheetType;
</span><span class="cx"> 
</span><del>-    std::unique_ptr&lt;RelList&gt; m_relList;
</del><ins>+    std::unique_ptr&lt;AttributeDOMTokenList&gt; m_relList;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } //namespace
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlRelListcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/html/RelList.cpp (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/RelList.cpp        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/Source/WebCore/html/RelList.cpp        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -1,87 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Dhi Aurrahman &lt;diorahman@rockybars.com&gt;
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;RelList.h&quot;
-
-#include &quot;Element.h&quot;
-#include &quot;HTMLNames.h&quot;
-
-namespace WebCore {
-
-RelList::RelList(Element&amp; element) 
-    : m_element(element)
-    , m_relAttributeValue(SpaceSplitString(element.fastGetAttribute(HTMLNames::relAttr), false))
-{
-}
-
-void RelList::ref()
-{
-    m_element.ref();
-}
-
-void RelList::deref()
-{
-    m_element.deref();
-}
-
-unsigned RelList::length() const
-{
-    return m_relAttributeValue.size();
-}
-
-const AtomicString RelList::item(unsigned index) const
-{
-    if (index &gt;= length())
-        return nullAtom;
-    return m_relAttributeValue[index];
-}
-
-Element* RelList::element() const
-{
-    return &amp;m_element;
-}
-
-void RelList::updateRelAttribute(const AtomicString&amp; value)
-{
-    m_relAttributeValue.set(value, false);
-}
-
-bool RelList::containsInternal(const AtomicString&amp; token) const
-{
-    return m_relAttributeValue.contains(token);
-}
-
-AtomicString RelList::value() const
-{
-    return m_element.fastGetAttribute(HTMLNames::relAttr);
-}
-
-void RelList::setValue(const AtomicString&amp; value)
-{
-    m_element.setAttribute(HTMLNames::relAttr, value);
-}
-
-} // namespace WebCore
-
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlRelListh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/html/RelList.h (189631 => 189632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/RelList.h        2015-09-11 21:28:19 UTC (rev 189631)
+++ trunk/Source/WebCore/html/RelList.h        2015-09-11 21:33:16 UTC (rev 189632)
</span><span class="lines">@@ -1,57 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Dhi Aurrahman &lt;diorahman@rockybars.com&gt;
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef RelList_h
-#define RelList_h
-
-#include &quot;DOMTokenList.h&quot;
-#include &quot;SpaceSplitString.h&quot;
-
-namespace WebCore {
-
-class Element;
-
-class RelList final : public DOMTokenList {
-public:
-    RelList(Element&amp;);
-    void updateRelAttribute(const AtomicString&amp;);
-
-private:
-    virtual void ref() override;
-    virtual void deref() override;
-    virtual unsigned length() const override;
-    virtual const AtomicString item(unsigned index) const override;
-    virtual Element* element() const override;
-    virtual bool containsInternal(const AtomicString&amp;) const override;
-    virtual AtomicString value() const override;
-    virtual void setValue(const AtomicString&amp;) override;
-    
-    Element&amp; m_element;
-    mutable SpaceSplitString m_relAttributeValue;
-};
-
-} // namespace WebCore
-
-#endif // RelList_h
-
</del></span></pre>
</div>
</div>

</body>
</html>