<!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>[190168] 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/190168">190168</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-09-23 07:32:36 -0700 (Wed, 23 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>HTMLOutputElement.htmlFor should be settable
https://bugs.webkit.org/show_bug.cgi?id=149418

Reviewed by Ryosuke Niwa.

Source/WebCore:

HTMLOutputElement.htmlFor should be settable as per the latest HTML
specification:
- https://html.spec.whatwg.org/multipage/forms.html#the-output-element

It is supposed to call DOMSettableTokenList.setValue() with the input
String. This patch adds support for this by adding [PutForwards=value]
IDL extended attribute.

This aligns our behavior with the specification, Firefox and Chrome.

No new tests, already covered by existing test.

* html/AttributeDOMTokenList.cpp:
(WebCore::AttributeDOMTokenList::AttributeDOMTokenList):
(WebCore::AttributeDOMTokenList::attributeValueChanged):
* html/AttributeDOMTokenList.h:
- Have AttributeDOMTokenList subclass DOMSettableTokenList instead of
DOMTokenList so that it can be used in places where the IDL expects
us to return a DOMSettableTokenList (e.g. HTMLOutputElement.htmlFor).
- Mark AttributeDOMTokenList as fast allocated.

* html/DOMSettableTokenList.cpp:
(WebCore::DOMSettableTokenList::setValue):
* html/DOMSettableTokenList.h:
- Move setValue() from DOMTokenList to DOMSettableTokenList
  as it is only needed by DOMSettableTokenList.
- Get rid of the factory function as all call sites are using
  AttributeDOMTokenList now.
- Stop inheriting RefCounted as AttributeDOMTokenList handles its
  own refcounting.

* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::setValueInternal):
* html/DOMTokenList.h:
Rename setValue() to setValueInternal() as this version does not
update the associated attribute value, only the tokens.

* html/HTMLLinkElement.cpp:
* html/HTMLLinkElement.h:
- Have HTMLLinkElement.sizes use an AttributeDOMTokenList instead of
  a DOMSettableTokenList as there is an associated attribute. The
  previous code had a bug has setting HTMLLinkElement.sizes would not
  update the associated 'sizes' attribute. Switching to using
  AttributeDOMTokenList fixes this and a new layout test has been added
  to cover this.
- Create the AttributeDOMTokenList lazily to avoid updating it every
  time the sizes attribute changes until it is actually accessed.

* html/HTMLOutputElement.cpp:
* html/HTMLOutputElement.h:
- Have HTMLLinkElement.htmlFor use an AttributeDOMTokenList instead of
  a DOMSettableTokenList as there is an associated attribute.
- Create the AttributeDOMTokenList lazily to avoid updating it every
  time the sizes attribute changes until it is actually accessed.

* html/HTMLOutputElement.idl:
Add [PutForwards=value] on the htmlFor attribute, as per the
HTML specification.

LayoutTests:

* fast/dom/HTMLLinkElement/sizes-setter.html: Added
* fast/dom/HTMLLinkElement/sizes-setter-expected.txt: Added
Add layout test to make sure that setting HTMLLinkElement.sizes actually
updates the 'sizes' associated attribute.

* fast/dom/HTMLOutputElement/dom-settable-token-list-expected.txt:
* fast/dom/HTMLOutputElement/script-tests/dom-settable-token-list.js:
Update existing layout test now that HTMLOutputElement.htmlFor is
settable.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLOutputElementdomsettabletokenlistexpectedtxt">trunk/LayoutTests/fast/dom/HTMLOutputElement/dom-settable-token-list-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLOutputElementscripttestsdomsettabletokenlistjs">trunk/LayoutTests/fast/dom/HTMLOutputElement/script-tests/dom-settable-token-list.js</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlAttributeDOMTokenListcpp">trunk/Source/WebCore/html/AttributeDOMTokenList.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlAttributeDOMTokenListh">trunk/Source/WebCore/html/AttributeDOMTokenList.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="#trunkSourceWebCorehtmlHTMLLinkElementcpp">trunk/Source/WebCore/html/HTMLLinkElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLLinkElementh">trunk/Source/WebCore/html/HTMLLinkElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLOutputElementcpp">trunk/Source/WebCore/html/HTMLOutputElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLOutputElementh">trunk/Source/WebCore/html/HTMLOutputElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLOutputElementidl">trunk/Source/WebCore/html/HTMLOutputElement.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomHTMLLinkElementsizessetterexpectedtxt">trunk/LayoutTests/fast/dom/HTMLLinkElement/sizes-setter-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLLinkElementsizessetterhtml">trunk/LayoutTests/fast/dom/HTMLLinkElement/sizes-setter.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (190167 => 190168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-09-23 11:33:41 UTC (rev 190167)
+++ trunk/LayoutTests/ChangeLog        2015-09-23 14:32:36 UTC (rev 190168)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2015-09-23  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        HTMLOutputElement.htmlFor should be settable
+        https://bugs.webkit.org/show_bug.cgi?id=149418
+
+        Reviewed by Ryosuke Niwa.
+
+        * fast/dom/HTMLLinkElement/sizes-setter.html: Added
+        * fast/dom/HTMLLinkElement/sizes-setter-expected.txt: Added
+        Add layout test to make sure that setting HTMLLinkElement.sizes actually
+        updates the 'sizes' associated attribute.
+
+        * fast/dom/HTMLOutputElement/dom-settable-token-list-expected.txt:
+        * fast/dom/HTMLOutputElement/script-tests/dom-settable-token-list.js:
+        Update existing layout test now that HTMLOutputElement.htmlFor is
+        settable.
+
</ins><span class="cx"> 2015-09-23  Xabier Rodriguez Calvar  &lt;calvaris@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Streams API] Add transform stream general tests
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLLinkElementsizessetterexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/HTMLLinkElement/sizes-setter-expected.txt (0 => 190168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLLinkElement/sizes-setter-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLLinkElement/sizes-setter-expected.txt        2015-09-23 14:32:36 UTC (rev 190168)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Tests that the HTMLLinkElement.sizes setter updates the associated sizes attribute
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS link.sizes.__proto__ is DOMSettableTokenList.prototype
+link.sizes = '10x10  20x20'
+PASS String(link.sizes) is &quot;10x10 20x20&quot;
+PASS link.getAttribute('sizes') is &quot;10x10 20x20&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLLinkElementsizessetterhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/HTMLLinkElement/sizes-setter.html (0 => 190168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLLinkElement/sizes-setter.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLLinkElement/sizes-setter.html        2015-09-23 14:32:36 UTC (rev 190168)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+description(&quot;Tests that the HTMLLinkElement.sizes setter updates the associated sizes attribute&quot;);
+
+var link = document.createElement(&quot;link&quot;);
+shouldBe(&quot;link.sizes.__proto__&quot;, &quot;DOMSettableTokenList.prototype&quot;);
+evalAndLog(&quot;link.sizes = '10x10  20x20'&quot;);
+shouldBeEqualToString(&quot;String(link.sizes)&quot;, &quot;10x10 20x20&quot;);
+shouldBeEqualToString(&quot;link.getAttribute('sizes')&quot;, &quot;10x10 20x20&quot;);
+&lt;/script&gt;
+&lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLOutputElementdomsettabletokenlistexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/HTMLOutputElement/dom-settable-token-list-expected.txt (190167 => 190168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLOutputElement/dom-settable-token-list-expected.txt        2015-09-23 11:33:41 UTC (rev 190167)
+++ trunk/LayoutTests/fast/dom/HTMLOutputElement/dom-settable-token-list-expected.txt        2015-09-23 14:32:36 UTC (rev 190168)
</span><span class="lines">@@ -4,7 +4,10 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> - Tests from http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/
</span><del>-PASS String(element.htmlFor) is &quot;x&quot;
</del><ins>+PASS element.htmlFor.__proto__ is DOMSettableTokenList.prototype
+PASS String(element.htmlFor) is &quot;y z&quot;
+PASS element.getAttribute(&quot;for&quot;) is &quot;y z&quot;
+PASS String(element.htmlFor) is &quot;r s t&quot;
</ins><span class="cx"> PASS element.htmlFor.length is 0
</span><span class="cx"> PASS element.htmlFor.length is 1
</span><span class="cx"> PASS element.htmlFor.length is 1
</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 (190167 => 190168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLOutputElement/script-tests/dom-settable-token-list.js        2015-09-23 11:33:41 UTC (rev 190167)
+++ trunk/LayoutTests/fast/dom/HTMLOutputElement/script-tests/dom-settable-token-list.js        2015-09-23 14:32:36 UTC (rev 190168)
</span><span class="lines">@@ -14,10 +14,14 @@
</span><span class="cx"> 
</span><span class="cx"> debug('- Tests from http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/');
</span><span class="cx"> 
</span><del>-// HTMLOutputElement::htmlFor is readonly attribute.
</del><ins>+// HTMLOutputElement::htmlFor should be settable.
</ins><span class="cx"> createElement('x');
</span><del>-element.htmlFor = 'y';
-shouldBeEqualToString('String(element.htmlFor)', 'x');
</del><ins>+shouldBe('element.htmlFor.__proto__', 'DOMSettableTokenList.prototype');
+element.htmlFor = 'y  z';
+shouldBeEqualToString('String(element.htmlFor)', 'y z');
+shouldBeEqualToString('element.getAttribute(&quot;for&quot;)', 'y z');
+element.setAttribute('for', 'r s t');
+shouldBeEqualToString('String(element.htmlFor)', 'r s t');
</ins><span class="cx"> 
</span><span class="cx"> // http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/001.htm
</span><span class="cx"> createElement('');
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (190167 => 190168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-09-23 11:33:41 UTC (rev 190167)
+++ trunk/Source/WebCore/ChangeLog        2015-09-23 14:32:36 UTC (rev 190168)
</span><span class="lines">@@ -1,3 +1,69 @@
</span><ins>+2015-09-23  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        HTMLOutputElement.htmlFor should be settable
+        https://bugs.webkit.org/show_bug.cgi?id=149418
+
+        Reviewed by Ryosuke Niwa.
+
+        HTMLOutputElement.htmlFor should be settable as per the latest HTML
+        specification:
+        - https://html.spec.whatwg.org/multipage/forms.html#the-output-element
+
+        It is supposed to call DOMSettableTokenList.setValue() with the input
+        String. This patch adds support for this by adding [PutForwards=value]
+        IDL extended attribute.
+
+        This aligns our behavior with the specification, Firefox and Chrome.
+
+        No new tests, already covered by existing test.
+
+        * html/AttributeDOMTokenList.cpp:
+        (WebCore::AttributeDOMTokenList::AttributeDOMTokenList):
+        (WebCore::AttributeDOMTokenList::attributeValueChanged):
+        * html/AttributeDOMTokenList.h:
+        - Have AttributeDOMTokenList subclass DOMSettableTokenList instead of
+        DOMTokenList so that it can be used in places where the IDL expects
+        us to return a DOMSettableTokenList (e.g. HTMLOutputElement.htmlFor).
+        - Mark AttributeDOMTokenList as fast allocated.
+
+        * html/DOMSettableTokenList.cpp:
+        (WebCore::DOMSettableTokenList::setValue):
+        * html/DOMSettableTokenList.h:
+        - Move setValue() from DOMTokenList to DOMSettableTokenList
+          as it is only needed by DOMSettableTokenList.
+        - Get rid of the factory function as all call sites are using
+          AttributeDOMTokenList now.
+        - Stop inheriting RefCounted as AttributeDOMTokenList handles its
+          own refcounting.
+
+        * html/DOMTokenList.cpp:
+        (WebCore::DOMTokenList::setValueInternal):
+        * html/DOMTokenList.h:
+        Rename setValue() to setValueInternal() as this version does not
+        update the associated attribute value, only the tokens.
+
+        * html/HTMLLinkElement.cpp:
+        * html/HTMLLinkElement.h:
+        - Have HTMLLinkElement.sizes use an AttributeDOMTokenList instead of
+          a DOMSettableTokenList as there is an associated attribute. The
+          previous code had a bug has setting HTMLLinkElement.sizes would not
+          update the associated 'sizes' attribute. Switching to using
+          AttributeDOMTokenList fixes this and a new layout test has been added
+          to cover this.
+        - Create the AttributeDOMTokenList lazily to avoid updating it every
+          time the sizes attribute changes until it is actually accessed.
+
+        * html/HTMLOutputElement.cpp:
+        * html/HTMLOutputElement.h:
+        - Have HTMLLinkElement.htmlFor use an AttributeDOMTokenList instead of
+          a DOMSettableTokenList as there is an associated attribute.
+        - Create the AttributeDOMTokenList lazily to avoid updating it every
+          time the sizes attribute changes until it is actually accessed.
+
+        * html/HTMLOutputElement.idl:
+        Add [PutForwards=value] on the htmlFor attribute, as per the
+        HTML specification.
+
</ins><span class="cx"> 2015-09-23  ChangSeok Oh  &lt;changseok.oh@collabora.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] playbutton in media controls is not changed when it is clicked.
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlAttributeDOMTokenListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/AttributeDOMTokenList.cpp (190167 => 190168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/AttributeDOMTokenList.cpp        2015-09-23 11:33:41 UTC (rev 190167)
+++ trunk/Source/WebCore/html/AttributeDOMTokenList.cpp        2015-09-23 14:32:36 UTC (rev 190168)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx">     : m_element(element)
</span><span class="cx">     , m_attributeName(attributeName)
</span><span class="cx"> {
</span><del>-    setValue(m_element.getAttribute(m_attributeName));
</del><ins>+    setValueInternal(m_element.getAttribute(m_attributeName));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AttributeDOMTokenList::attributeValueChanged(const AtomicString&amp; newValue)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx">     if (m_isUpdatingAttributeValue)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    DOMTokenList::setValue(newValue);
</del><ins>+    setValueInternal(newValue);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AttributeDOMTokenList::updateAfterTokenChange()
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlAttributeDOMTokenListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/AttributeDOMTokenList.h (190167 => 190168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/AttributeDOMTokenList.h        2015-09-23 11:33:41 UTC (rev 190167)
+++ trunk/Source/WebCore/html/AttributeDOMTokenList.h        2015-09-23 14:32:36 UTC (rev 190168)
</span><span class="lines">@@ -26,12 +26,13 @@
</span><span class="cx"> #ifndef AttributeDOMTokenList_h
</span><span class="cx"> #define AttributeDOMTokenList_h
</span><span class="cx"> 
</span><del>-#include &quot;DOMTokenList.h&quot;
</del><ins>+#include &quot;DOMSettableTokenList.h&quot;
</ins><span class="cx"> #include &quot;Element.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class AttributeDOMTokenList final : public DOMTokenList {
</del><ins>+class AttributeDOMTokenList final : public DOMSettableTokenList {
+    WTF_MAKE_FAST_ALLOCATED;
</ins><span class="cx"> public:
</span><span class="cx">     AttributeDOMTokenList(Element&amp;, const QualifiedName&amp; attributeName);
</span><span class="cx">     void attributeValueChanged(const AtomicString&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlDOMSettableTokenListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/DOMSettableTokenList.cpp (190167 => 190168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/DOMSettableTokenList.cpp        2015-09-23 11:33:41 UTC (rev 190167)
+++ trunk/Source/WebCore/html/DOMSettableTokenList.cpp        2015-09-23 14:32:36 UTC (rev 190168)
</span><span class="lines">@@ -28,14 +28,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-void DOMSettableTokenList::ref()
</del><ins>+void DOMSettableTokenList::setValue(const String&amp; value)
</ins><span class="cx"> {
</span><del>-    RefCounted&lt;DOMSettableTokenList&gt;::ref();
</del><ins>+    setValueInternal(value);
+    updateAfterTokenChange();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DOMSettableTokenList::deref()
-{
-    RefCounted&lt;DOMSettableTokenList&gt;::deref();
-}
-
</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 (190167 => 190168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/DOMSettableTokenList.h        2015-09-23 11:33:41 UTC (rev 190167)
+++ trunk/Source/WebCore/html/DOMSettableTokenList.h        2015-09-23 14:32:36 UTC (rev 190168)
</span><span class="lines">@@ -28,24 +28,19 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;DOMTokenList.h&quot;
</span><span class="cx"> #include &quot;SpaceSplitString.h&quot;
</span><del>-#include &lt;wtf/RefCounted.h&gt;
</del><span class="cx"> #include &lt;wtf/text/AtomicString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> typedef int ExceptionCode;
</span><span class="cx"> 
</span><del>-class DOMSettableTokenList final : public DOMTokenList, public RefCounted&lt;DOMSettableTokenList&gt; {
</del><ins>+class DOMSettableTokenList : public DOMTokenList {
</ins><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>-    static Ref&lt;DOMSettableTokenList&gt; create()
-    {
-        return adoptRef(*new DOMSettableTokenList);
-    }
</del><ins>+    void setValue(const String&amp;);
</ins><span class="cx"> 
</span><span class="cx">     // Make public.
</span><span class="cx">     using DOMTokenList::value;
</span><del>-    using DOMTokenList::setValue;
</del><span class="cx"> 
</span><span class="cx">     virtual void ref() override;
</span><span class="cx">     virtual void deref() override;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlDOMTokenListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/DOMTokenList.cpp (190167 => 190168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/DOMTokenList.cpp        2015-09-23 11:33:41 UTC (rev 190167)
+++ trunk/Source/WebCore/html/DOMTokenList.cpp        2015-09-23 14:32:36 UTC (rev 190168)
</span><span class="lines">@@ -158,7 +158,7 @@
</span><span class="cx">     return m_cachedValue;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DOMTokenList::setValue(const String&amp; value)
</del><ins>+void DOMTokenList::setValueInternal(const WTF::String&amp; value)
</ins><span class="cx"> {
</span><span class="cx">     // Clear tokens but not capacity.
</span><span class="cx">     m_tokens.shrink(0);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlDOMTokenListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/DOMTokenList.h (190167 => 190168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/DOMTokenList.h        2015-09-23 11:33:41 UTC (rev 190167)
+++ trunk/Source/WebCore/html/DOMTokenList.h        2015-09-23 14:32:36 UTC (rev 190168)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx"> protected:
</span><span class="cx">     DOMTokenList() = default;
</span><span class="cx">     const AtomicString&amp; value() const;
</span><del>-    void setValue(const String&amp;);
</del><ins>+    void setValueInternal(const String&amp;);
</ins><span class="cx"> 
</span><span class="cx">     virtual void updateAfterTokenChange() { m_cachedValue = nullAtom; }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLinkElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLinkElement.cpp (190167 => 190168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLinkElement.cpp        2015-09-23 11:33:41 UTC (rev 190167)
+++ trunk/Source/WebCore/html/HTMLLinkElement.cpp        2015-09-23 14:32:36 UTC (rev 190168)
</span><span class="lines">@@ -69,7 +69,6 @@
</span><span class="cx"> inline HTMLLinkElement::HTMLLinkElement(const QualifiedName&amp; tagName, Document&amp; document, bool createdByParser)
</span><span class="cx">     : HTMLElement(tagName, document)
</span><span class="cx">     , m_linkLoader(*this)
</span><del>-    , m_sizes(DOMSettableTokenList::create())
</del><span class="cx">     , m_disabledState(Unset)
</span><span class="cx">     , m_loading(false)
</span><span class="cx">     , m_createdByParser(createdByParser)
</span><span class="lines">@@ -159,7 +158,8 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     if (name == sizesAttr) {
</span><del>-        m_sizes-&gt;setValue(value);
</del><ins>+        if (m_sizes)
+            m_sizes-&gt;attributeValueChanged(value);
</ins><span class="cx">         process();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -367,6 +367,13 @@
</span><span class="cx">     return m_sheet-&gt;contents().isLoading();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+DOMSettableTokenList&amp; HTMLLinkElement::sizes()
+{
+    if (!m_sizes)
+        m_sizes = std::make_unique&lt;AttributeDOMTokenList&gt;(*this, sizesAttr);
+    return *m_sizes;
+}
+
</ins><span class="cx"> void HTMLLinkElement::linkLoaded()
</span><span class="cx"> {
</span><span class="cx">     dispatchEvent(Event::create(eventNames().loadEvent, false, false));
</span><span class="lines">@@ -475,9 +482,9 @@
</span><span class="cx">     return m_relAttribute.iconType;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String HTMLLinkElement::iconSizes() const
</del><ins>+String HTMLLinkElement::iconSizes()
</ins><span class="cx"> {
</span><del>-    return m_sizes-&gt;toString();
</del><ins>+    return sizes().toString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLLinkElement::addSubresourceAttributeURLs(ListHashSet&lt;URL&gt;&amp; urls) const
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLinkElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLinkElement.h (190167 => 190168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLinkElement.h        2015-09-23 11:33:41 UTC (rev 190167)
+++ trunk/Source/WebCore/html/HTMLLinkElement.h        2015-09-23 14:32:36 UTC (rev 190168)
</span><span class="lines">@@ -24,10 +24,10 @@
</span><span class="cx"> #ifndef HTMLLinkElement_h
</span><span class="cx"> #define HTMLLinkElement_h
</span><span class="cx"> 
</span><ins>+#include &quot;AttributeDOMTokenList.h&quot;
</ins><span class="cx"> #include &quot;CSSStyleSheet.h&quot;
</span><span class="cx"> #include &quot;CachedStyleSheetClient.h&quot;
</span><span class="cx"> #include &quot;CachedResourceHandle.h&quot;
</span><del>-#include &quot;DOMSettableTokenList.h&quot;
</del><span class="cx"> #include &quot;HTMLElement.h&quot;
</span><span class="cx"> #include &quot;LinkLoader.h&quot;
</span><span class="cx"> #include &quot;LinkLoaderClient.h&quot;
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx">     IconType iconType() const;
</span><span class="cx"> 
</span><span class="cx">     // the icon size string as parsed from the HTML attribute
</span><del>-    String iconSizes() const;
</del><ins>+    String iconSizes();
</ins><span class="cx"> 
</span><span class="cx">     CSSStyleSheet* sheet() const { return m_sheet.get(); }
</span><span class="cx"> 
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool isDisabled() const { return m_disabledState == Disabled; }
</span><span class="cx">     bool isEnabledViaScript() const { return m_disabledState == EnabledViaScript; }
</span><del>-    DOMSettableTokenList&amp; sizes() { return m_sizes.get(); }
</del><ins>+    DOMSettableTokenList&amp; sizes();
</ins><span class="cx"> 
</span><span class="cx">     void dispatchPendingEvent(LinkEventSender*);
</span><span class="cx">     static void dispatchPendingLoadEvents();
</span><span class="lines">@@ -128,7 +128,7 @@
</span><span class="cx"> 
</span><span class="cx">     String m_type;
</span><span class="cx">     String m_media;
</span><del>-    Ref&lt;DOMSettableTokenList&gt; m_sizes;
</del><ins>+    std::unique_ptr&lt;AttributeDOMTokenList&gt; m_sizes;
</ins><span class="cx">     DisabledState m_disabledState;
</span><span class="cx">     LinkRelAttribute m_relAttribute;
</span><span class="cx">     bool m_loading;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLOutputElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLOutputElement.cpp (190167 => 190168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLOutputElement.cpp        2015-09-23 11:33:41 UTC (rev 190167)
+++ trunk/Source/WebCore/html/HTMLOutputElement.cpp        2015-09-23 14:32:36 UTC (rev 190168)
</span><span class="lines">@@ -37,12 +37,13 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+using namespace HTMLNames;
+
</ins><span class="cx"> inline HTMLOutputElement::HTMLOutputElement(const QualifiedName&amp; tagName, Document&amp; document, HTMLFormElement* form)
</span><span class="cx">     : HTMLFormControlElement(tagName, document, form)
</span><span class="cx">     , m_isDefaultValueMode(true)
</span><span class="cx">     , m_isSetTextContentInProgress(false)
</span><span class="cx">     , m_defaultValue(&quot;&quot;)
</span><del>-    , m_tokens(DOMSettableTokenList::create())
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -64,17 +65,13 @@
</span><span class="cx"> 
</span><span class="cx"> void HTMLOutputElement::parseAttribute(const QualifiedName&amp; name, const AtomicString&amp; value)
</span><span class="cx"> {
</span><del>-    if (name == HTMLNames::forAttr)
-        setFor(value);
-    else
</del><ins>+    if (name == forAttr) {
+        if (m_tokens)
+            m_tokens-&gt;attributeValueChanged(value);
+    } else
</ins><span class="cx">         HTMLFormControlElement::parseAttribute(name, value);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLOutputElement::setFor(const String&amp; value)
-{
-    m_tokens-&gt;setValue(value);
-}
-
</del><span class="cx"> void HTMLOutputElement::childrenChanged(const ChildChange&amp; change)
</span><span class="cx"> {
</span><span class="cx">     HTMLFormControlElement::childrenChanged(change);
</span><span class="lines">@@ -129,6 +126,13 @@
</span><span class="cx">         setTextContentInternal(value);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+DOMSettableTokenList&amp; HTMLOutputElement::htmlFor()
+{
+    if (!m_tokens)
+        m_tokens = std::make_unique&lt;AttributeDOMTokenList&gt;(*this, forAttr);
+    return *m_tokens;
+}
+
</ins><span class="cx"> void HTMLOutputElement::setTextContentInternal(const String&amp; value)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!m_isSetTextContentInProgress);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLOutputElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLOutputElement.h (190167 => 190168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLOutputElement.h        2015-09-23 11:33:41 UTC (rev 190167)
+++ trunk/Source/WebCore/html/HTMLOutputElement.h        2015-09-23 14:32:36 UTC (rev 190168)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> #ifndef HTMLOutputElement_h
</span><span class="cx"> #define HTMLOutputElement_h
</span><span class="cx"> 
</span><del>-#include &quot;DOMSettableTokenList.h&quot;
</del><ins>+#include &quot;AttributeDOMTokenList.h&quot;
</ins><span class="cx"> #include &quot;HTMLFormControlElement.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -44,8 +44,7 @@
</span><span class="cx">     void setValue(const String&amp;);
</span><span class="cx">     String defaultValue() const;
</span><span class="cx">     void setDefaultValue(const String&amp;);
</span><del>-    void setFor(const String&amp;);
-    DOMSettableTokenList&amp; htmlFor() { return m_tokens.get(); }
</del><ins>+    DOMSettableTokenList&amp; htmlFor();
</ins><span class="cx">     
</span><span class="cx">     virtual bool canContainRangeEndPoint() const override { return false; }
</span><span class="cx"> 
</span><span class="lines">@@ -66,7 +65,7 @@
</span><span class="cx">     bool m_isDefaultValueMode;
</span><span class="cx">     bool m_isSetTextContentInProgress;
</span><span class="cx">     String m_defaultValue;
</span><del>-    Ref&lt;DOMSettableTokenList&gt; m_tokens;
</del><ins>+    std::unique_ptr&lt;AttributeDOMTokenList&gt; m_tokens;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLOutputElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLOutputElement.idl (190167 => 190168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLOutputElement.idl        2015-09-23 11:33:41 UTC (rev 190167)
+++ trunk/Source/WebCore/html/HTMLOutputElement.idl        2015-09-23 14:32:36 UTC (rev 190168)
</span><span class="lines">@@ -23,9 +23,7 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> interface HTMLOutputElement : HTMLElement {
</span><del>-    // FIXME: This is supposed to be:
-    // [PutForwards=value] readonly attribute DOMSettableTokenList htmlFor;
-    readonly attribute DOMSettableTokenList htmlFor;
</del><ins>+    [PutForwards=value] readonly attribute DOMSettableTokenList htmlFor;
</ins><span class="cx"> 
</span><span class="cx">     readonly attribute HTMLFormElement form;
</span><span class="cx">     [Reflect] attribute DOMString name;
</span></span></pre>
</div>
</div>

</body>
</html>