<!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>[175028] 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/175028">175028</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-10-22 02:22:05 -0700 (Wed, 22 Oct 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add relList to the anchor, area and link elements
https://bugs.webkit.org/show_bug.cgi?id=137860
Patch by Dhi Aurrahman <diorahman@rockybars.com> on 2014-10-22
Reviewed by Darin Adler and Chris Dumez.
Source/WebCore:
Add relList to reflect the rel content attribute for anchor[1],
area[2] and link[3] elements.
[1] https://html.spec.whatwg.org/multipage/semantics.html#dom-a-rellist
[2] https://html.spec.whatwg.org/multipage/embedded-content.html#dom-area-rellist
[3] https://html.spec.whatwg.org/multipage/semantics.html#dom-link-rellist
Tests: fast/dom/rel-list-gc.html
fast/dom/rel-list.html
perf/rel-list-remove.html
* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* dom/SpaceSplitString.cpp:
(WebCore::SpaceSplitString::set):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAttribute):
(WebCore::HTMLAnchorElement::relList):
(WebCore::HTMLAnchorElement::setRel): Deleted.
* html/HTMLAnchorElement.h:
* html/HTMLAnchorElement.idl:
* html/HTMLAreaElement.idl:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::parseAttribute):
(WebCore::HTMLLinkElement::relList):
* html/HTMLLinkElement.h:
* html/HTMLLinkElement.idl:
* html/RelList.cpp: Added.
(WebCore::RelList::RelList):
(WebCore::RelList::ref):
(WebCore::RelList::deref):
(WebCore::RelList::length):
(WebCore::RelList::item):
(WebCore::RelList::element):
(WebCore::RelList::updateRelAttribute):
(WebCore::RelList::containsInternal):
(WebCore::RelList::value):
(WebCore::RelList::setValue):
* html/RelList.h: Added.
LayoutTests:
Tests relList aspects for anchor, area and list elements.
Update dom static property for-in iteration test result to include relList.
* fast/dom/rel-list-expected.txt: Added.
* fast/dom/rel-list-gc-expected.txt: Added.
* fast/dom/rel-list-gc.html: Added.
* fast/dom/rel-list.html: Added.
* js/dom/dom-static-property-for-in-iteration-expected.txt: Updated results.
* perf/rel-list-remove-expected.txt: Added.
* perf/rel-list-remove.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsjsdomdomstaticpropertyforiniterationexpectedtxt">trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-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="#trunkSourceWebCoredomSpaceSplitStringcpp">trunk/Source/WebCore/dom/SpaceSplitString.cpp</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="#trunkSourceWebCorehtmlHTMLAnchorElementidl">trunk/Source/WebCore/html/HTMLAnchorElement.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAreaElementidl">trunk/Source/WebCore/html/HTMLAreaElement.idl</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="#trunkSourceWebCorehtmlHTMLLinkElementidl">trunk/Source/WebCore/html/HTMLLinkElement.idl</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomrellistexpectedtxt">trunk/LayoutTests/fast/dom/rel-list-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomrellistgcexpectedtxt">trunk/LayoutTests/fast/dom/rel-list-gc-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomrellistgchtml">trunk/LayoutTests/fast/dom/rel-list-gc.html</a></li>
<li><a href="#trunkLayoutTestsfastdomrellisthtml">trunk/LayoutTests/fast/dom/rel-list.html</a></li>
<li><a href="#trunkLayoutTestsperfrellistremoveexpectedtxt">trunk/LayoutTests/perf/rel-list-remove-expected.txt</a></li>
<li><a href="#trunkLayoutTestsperfrellistremovehtml">trunk/LayoutTests/perf/rel-list-remove.html</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 (175027 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-10-22 07:29:26 UTC (rev 175027)
+++ trunk/LayoutTests/ChangeLog        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2014-10-22 Dhi Aurrahman <diorahman@rockybars.com>
+
+ Add relList to the anchor, area and link elements
+ https://bugs.webkit.org/show_bug.cgi?id=137860
+
+ Reviewed by Darin Adler and Chris Dumez.
+
+ Tests relList aspects for anchor, area and list elements.
+ Update dom static property for-in iteration test result to include relList.
+
+ * fast/dom/rel-list-expected.txt: Added.
+ * fast/dom/rel-list-gc-expected.txt: Added.
+ * fast/dom/rel-list-gc.html: Added.
+ * fast/dom/rel-list.html: Added.
+ * js/dom/dom-static-property-for-in-iteration-expected.txt: Updated results.
+ * perf/rel-list-remove-expected.txt: Added.
+ * perf/rel-list-remove.html: Added.
+
</ins><span class="cx"> 2014-10-21 Brent Fulgham <bfulgham@apple.com>
</span><span class="cx">
</span><span class="cx"> [Win] More rebaselines.
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomrellistexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/rel-list-expected.txt (0 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/rel-list-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/dom/rel-list-expected.txt        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -0,0 +1,378 @@
</span><ins>+Tests that relList works on anchor, area and link elements
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Tests relList for anchor element
+PASS element.relList == null is false
+PASS element.relList == undefined is false
+PASS element.relList instanceof DOMTokenList is true
+PASS element.relList.length is 3
+PASS element.relList.contains("a") is true
+PASS element.relList.contains("b") is true
+PASS element.relList.contains("c") is true
+PASS element.relList.contains("d") is false
+PASS element.relList.length is 3
+PASS element.relList.contains("foo") is true
+PASS element.relList.contains("bar") is true
+PASS element.relList.contains("chocolate") is true
+PASS element.relList.contains("orange") is false
+PASS element.relList.length is 0
+PASS element.relList.length is 0
+PASS element.relList.length is 2
+PASS element.relList.contains("marshmallow") is true
+PASS element.relList.contains("chips") is true
+PASS element.relList.contains("orange") is false
+PASS String(element.relList) is "x"
+PASS element.relList.length is 0
+PASS element.relList.length is 1
+PASS element.relList.length is 2
+PASS element.relList.length is 2
+PASS element.rel is "x"
+PASS element.rel is "x"
+PASS element.rel is "x x"
+PASS element.rel is "y x"
+PASS element.rel is ""
+PASS element.rel is ""
+PASS element.rel is " y y "
+PASS element.rel is "y"
+Ensure that we can handle empty rel correctly
+PASS element.relList.toggle('x') is true
+PASS element.rel is "x"
+PASS element.relList.toggle('x') is false
+PASS element.rel is ""
+PASS element.relList.contains("x") is false
+PASS element.relList[1] is undefined.
+PASS element.relList.contains("x") is false
+PASS element.relList.contains("x") is true
+Test toggle with force argument
+PASS element.relList.toggle('x', true) is true
+PASS element.rel is "x"
+PASS element.relList.toggle('x', true) is true
+PASS element.rel is "x"
+PASS element.relList.toggle('x', false) is false
+PASS element.rel is ""
+PASS element.relList.toggle('x', false) is false
+PASS element.rel is ""
+PASS element.relList.toggle("", true) threw exception Error: SyntaxError: DOM Exception 12.
+PASS element.relList.toggle("x y", false) threw exception Error: InvalidCharacterError: DOM Exception 5.
+Testing add in presence of trailing white spaces.
+PASS element.rel is "x y"
+PASS element.rel is "x\ty"
+PASS element.rel is " y"
+Test invalid tokens
+PASS element.relList.contains("") threw exception Error: SyntaxError: DOM Exception 12.
+PASS element.relList.contains("x y") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS element.relList.add("") threw exception Error: SyntaxError: DOM Exception 12.
+PASS element.relList.add("x y") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS element.relList.remove("") threw exception Error: SyntaxError: DOM Exception 12.
+PASS element.relList.remove("x y") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS element.relList.toggle("") threw exception Error: SyntaxError: DOM Exception 12.
+Indexing
+PASS element.relList[0] is "x"
+PASS element.relList.item(0) is "x"
+PASS element.relList[1] is "x"
+PASS element.relList.item(1) is "x"
+PASS element.relList[1] is "y"
+PASS element.relList.item(1) is "y"
+PASS element.relList[0] is undefined.
+PASS element.relList.item(0) is null
+PASS element.relList[4] is undefined.
+PASS element.relList.item(4) is null
+PASS element.relList[-1] is undefined.
+PASS element.relList.item(-1) is null
+PASS element.relList.item() threw exception TypeError: Not enough arguments.
+Test case since DOMTokenList is case sensitive
+PASS element.relList.contains("x") is true
+PASS element.relList.contains("X") is false
+PASS element.relList[0] is "x"
+PASS element.relList.contains() threw exception TypeError: Not enough arguments.
+PASS element.relList.contains("X") is true
+PASS element.relList.contains("x") is false
+PASS element.relList[0] is "X"
+Testing whitespace
+PASS element.relList.length is 2
+PASS element.relList.length is 2
+PASS element.relList.length is 2
+PASS element.relList.length is 2
+PASS element.relList.length is 2
+DOMTokenList presence and type
+PASS 'undefined' != typeof DOMTokenList is true
+PASS typeof DOMTokenList.prototype is "object"
+PASS typeof element.relList is "object"
+PASS element.relList.constructor is DOMTokenList
+PASS element.relList === element.relList is true
+Variadic calls
+PASS element.rel is "a b"
+PASS element.rel is "a b c"
+PASS element.rel is "a b c null d undefined 0 false"
+PASS element.rel is "a b"
+PASS element.relList.add("a", "b", "") threw exception Error: SyntaxError: DOM Exception 12.
+PASS element.rel is ""
+PASS element.relList.add("a", "b", "c d") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS element.rel is ""
+PASS element.relList.add("a", {toString: function() { throw new Error("user error"); }}, "b") threw exception Error: user error.
+PASS element.rel is ""
+PASS element.relList.add() did not throw exception.
+PASS observer.takeRecords().length is 1
+PASS element.rel is "b d "
+PASS element.rel is "d "
+PASS element.rel is "a b c"
+PASS element.relList.remove("a", "b", "") threw exception Error: SyntaxError: DOM Exception 12.
+PASS element.rel is "a b"
+PASS element.relList.remove("a", {toString: function() { throw new Error("user error"); }}, "b") threw exception Error: user error.
+PASS element.rel is "a b"
+PASS element.relList.remove("a", "b", "c d") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS element.rel is "a b"
+PASS element.relList.remove() did not throw exception.
+PASS observer.takeRecords().length is 1
+Tests relList for area element
+PASS element.relList == null is false
+PASS element.relList == undefined is false
+PASS element.relList instanceof DOMTokenList is true
+PASS element.relList.length is 3
+PASS element.relList.contains("a") is true
+PASS element.relList.contains("b") is true
+PASS element.relList.contains("c") is true
+PASS element.relList.contains("d") is false
+PASS element.relList.length is 3
+PASS element.relList.contains("foo") is true
+PASS element.relList.contains("bar") is true
+PASS element.relList.contains("chocolate") is true
+PASS element.relList.contains("orange") is false
+PASS element.relList.length is 0
+PASS element.relList.length is 0
+PASS element.relList.length is 2
+PASS element.relList.contains("marshmallow") is true
+PASS element.relList.contains("chips") is true
+PASS element.relList.contains("orange") is false
+PASS String(element.relList) is "x"
+PASS element.relList.length is 0
+PASS element.relList.length is 1
+PASS element.relList.length is 2
+PASS element.relList.length is 2
+PASS element.rel is "x"
+PASS element.rel is "x"
+PASS element.rel is "x x"
+PASS element.rel is "y x"
+PASS element.rel is ""
+PASS element.rel is ""
+PASS element.rel is " y y "
+PASS element.rel is "y"
+Ensure that we can handle empty rel correctly
+PASS element.relList.toggle('x') is true
+PASS element.rel is "x"
+PASS element.relList.toggle('x') is false
+PASS element.rel is ""
+PASS element.relList.contains("x") is false
+PASS element.relList[1] is undefined.
+PASS element.relList.contains("x") is false
+PASS element.relList.contains("x") is true
+Test toggle with force argument
+PASS element.relList.toggle('x', true) is true
+PASS element.rel is "x"
+PASS element.relList.toggle('x', true) is true
+PASS element.rel is "x"
+PASS element.relList.toggle('x', false) is false
+PASS element.rel is ""
+PASS element.relList.toggle('x', false) is false
+PASS element.rel is ""
+PASS element.relList.toggle("", true) threw exception Error: SyntaxError: DOM Exception 12.
+PASS element.relList.toggle("x y", false) threw exception Error: InvalidCharacterError: DOM Exception 5.
+Testing add in presence of trailing white spaces.
+PASS element.rel is "x y"
+PASS element.rel is "x\ty"
+PASS element.rel is " y"
+Test invalid tokens
+PASS element.relList.contains("") threw exception Error: SyntaxError: DOM Exception 12.
+PASS element.relList.contains("x y") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS element.relList.add("") threw exception Error: SyntaxError: DOM Exception 12.
+PASS element.relList.add("x y") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS element.relList.remove("") threw exception Error: SyntaxError: DOM Exception 12.
+PASS element.relList.remove("x y") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS element.relList.toggle("") threw exception Error: SyntaxError: DOM Exception 12.
+Indexing
+PASS element.relList[0] is "x"
+PASS element.relList.item(0) is "x"
+PASS element.relList[1] is "x"
+PASS element.relList.item(1) is "x"
+PASS element.relList[1] is "y"
+PASS element.relList.item(1) is "y"
+PASS element.relList[0] is undefined.
+PASS element.relList.item(0) is null
+PASS element.relList[4] is undefined.
+PASS element.relList.item(4) is null
+PASS element.relList[-1] is undefined.
+PASS element.relList.item(-1) is null
+PASS element.relList.item() threw exception TypeError: Not enough arguments.
+Test case since DOMTokenList is case sensitive
+PASS element.relList.contains("x") is true
+PASS element.relList.contains("X") is false
+PASS element.relList[0] is "x"
+PASS element.relList.contains() threw exception TypeError: Not enough arguments.
+PASS element.relList.contains("X") is true
+PASS element.relList.contains("x") is false
+PASS element.relList[0] is "X"
+Testing whitespace
+PASS element.relList.length is 2
+PASS element.relList.length is 2
+PASS element.relList.length is 2
+PASS element.relList.length is 2
+PASS element.relList.length is 2
+DOMTokenList presence and type
+PASS 'undefined' != typeof DOMTokenList is true
+PASS typeof DOMTokenList.prototype is "object"
+PASS typeof element.relList is "object"
+PASS element.relList.constructor is DOMTokenList
+PASS element.relList === element.relList is true
+Variadic calls
+PASS element.rel is "a b"
+PASS element.rel is "a b c"
+PASS element.rel is "a b c null d undefined 0 false"
+PASS element.rel is "a b"
+PASS element.relList.add("a", "b", "") threw exception Error: SyntaxError: DOM Exception 12.
+PASS element.rel is ""
+PASS element.relList.add("a", "b", "c d") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS element.rel is ""
+PASS element.relList.add("a", {toString: function() { throw new Error("user error"); }}, "b") threw exception Error: user error.
+PASS element.rel is ""
+PASS element.relList.add() did not throw exception.
+PASS observer.takeRecords().length is 1
+PASS element.rel is "b d "
+PASS element.rel is "d "
+PASS element.rel is "a b c"
+PASS element.relList.remove("a", "b", "") threw exception Error: SyntaxError: DOM Exception 12.
+PASS element.rel is "a b"
+PASS element.relList.remove("a", {toString: function() { throw new Error("user error"); }}, "b") threw exception Error: user error.
+PASS element.rel is "a b"
+PASS element.relList.remove("a", "b", "c d") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS element.rel is "a b"
+PASS element.relList.remove() did not throw exception.
+PASS observer.takeRecords().length is 1
+Tests relList for link element
+PASS element.relList == null is false
+PASS element.relList == undefined is false
+PASS element.relList instanceof DOMTokenList is true
+PASS element.relList.length is 3
+PASS element.relList.contains("a") is true
+PASS element.relList.contains("b") is true
+PASS element.relList.contains("c") is true
+PASS element.relList.contains("d") is false
+PASS element.relList.length is 3
+PASS element.relList.contains("foo") is true
+PASS element.relList.contains("bar") is true
+PASS element.relList.contains("chocolate") is true
+PASS element.relList.contains("orange") is false
+PASS element.relList.length is 0
+PASS element.relList.length is 0
+PASS element.relList.length is 2
+PASS element.relList.contains("marshmallow") is true
+PASS element.relList.contains("chips") is true
+PASS element.relList.contains("orange") is false
+PASS String(element.relList) is "x"
+PASS element.relList.length is 0
+PASS element.relList.length is 1
+PASS element.relList.length is 2
+PASS element.relList.length is 2
+PASS element.rel is "x"
+PASS element.rel is "x"
+PASS element.rel is "x x"
+PASS element.rel is "y x"
+PASS element.rel is ""
+PASS element.rel is ""
+PASS element.rel is " y y "
+PASS element.rel is "y"
+Ensure that we can handle empty rel correctly
+PASS element.relList.toggle('x') is true
+PASS element.rel is "x"
+PASS element.relList.toggle('x') is false
+PASS element.rel is ""
+PASS element.relList.contains("x") is false
+PASS element.relList[1] is undefined.
+PASS element.relList.contains("x") is false
+PASS element.relList.contains("x") is true
+Test toggle with force argument
+PASS element.relList.toggle('x', true) is true
+PASS element.rel is "x"
+PASS element.relList.toggle('x', true) is true
+PASS element.rel is "x"
+PASS element.relList.toggle('x', false) is false
+PASS element.rel is ""
+PASS element.relList.toggle('x', false) is false
+PASS element.rel is ""
+PASS element.relList.toggle("", true) threw exception Error: SyntaxError: DOM Exception 12.
+PASS element.relList.toggle("x y", false) threw exception Error: InvalidCharacterError: DOM Exception 5.
+Testing add in presence of trailing white spaces.
+PASS element.rel is "x y"
+PASS element.rel is "x\ty"
+PASS element.rel is " y"
+Test invalid tokens
+PASS element.relList.contains("") threw exception Error: SyntaxError: DOM Exception 12.
+PASS element.relList.contains("x y") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS element.relList.add("") threw exception Error: SyntaxError: DOM Exception 12.
+PASS element.relList.add("x y") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS element.relList.remove("") threw exception Error: SyntaxError: DOM Exception 12.
+PASS element.relList.remove("x y") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS element.relList.toggle("") threw exception Error: SyntaxError: DOM Exception 12.
+Indexing
+PASS element.relList[0] is "x"
+PASS element.relList.item(0) is "x"
+PASS element.relList[1] is "x"
+PASS element.relList.item(1) is "x"
+PASS element.relList[1] is "y"
+PASS element.relList.item(1) is "y"
+PASS element.relList[0] is undefined.
+PASS element.relList.item(0) is null
+PASS element.relList[4] is undefined.
+PASS element.relList.item(4) is null
+PASS element.relList[-1] is undefined.
+PASS element.relList.item(-1) is null
+PASS element.relList.item() threw exception TypeError: Not enough arguments.
+Test case since DOMTokenList is case sensitive
+PASS element.relList.contains("x") is true
+PASS element.relList.contains("X") is false
+PASS element.relList[0] is "x"
+PASS element.relList.contains() threw exception TypeError: Not enough arguments.
+PASS element.relList.contains("X") is true
+PASS element.relList.contains("x") is false
+PASS element.relList[0] is "X"
+Testing whitespace
+PASS element.relList.length is 2
+PASS element.relList.length is 2
+PASS element.relList.length is 2
+PASS element.relList.length is 2
+PASS element.relList.length is 2
+DOMTokenList presence and type
+PASS 'undefined' != typeof DOMTokenList is true
+PASS typeof DOMTokenList.prototype is "object"
+PASS typeof element.relList is "object"
+PASS element.relList.constructor is DOMTokenList
+PASS element.relList === element.relList is true
+Variadic calls
+PASS element.rel is "a b"
+PASS element.rel is "a b c"
+PASS element.rel is "a b c null d undefined 0 false"
+PASS element.rel is "a b"
+PASS element.relList.add("a", "b", "") threw exception Error: SyntaxError: DOM Exception 12.
+PASS element.rel is ""
+PASS element.relList.add("a", "b", "c d") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS element.rel is ""
+PASS element.relList.add("a", {toString: function() { throw new Error("user error"); }}, "b") threw exception Error: user error.
+PASS element.rel is ""
+PASS element.relList.add() did not throw exception.
+PASS observer.takeRecords().length is 1
+PASS element.rel is "b d "
+PASS element.rel is "d "
+PASS element.rel is "a b c"
+PASS element.relList.remove("a", "b", "") threw exception Error: SyntaxError: DOM Exception 12.
+PASS element.rel is "a b"
+PASS element.relList.remove("a", {toString: function() { throw new Error("user error"); }}, "b") threw exception Error: user error.
+PASS element.rel is "a b"
+PASS element.relList.remove("a", "b", "c d") threw exception Error: InvalidCharacterError: DOM Exception 5.
+PASS element.rel is "a b"
+PASS element.relList.remove() did not throw exception.
+PASS observer.takeRecords().length is 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomrellistgcexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/rel-list-gc-expected.txt (0 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/rel-list-gc-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/dom/rel-list-gc-expected.txt        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Tests relList gc for anchor element
+PASS element.relList.life is 42
+PASS element.relList.life is 42
+Tests relList gc for area element
+PASS element.relList.life is 42
+PASS element.relList.life is 42
+Tests relList gc for link element
+PASS element.relList.life is 42
+PASS element.relList.life is 42
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomrellistgchtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/rel-list-gc.html (0 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/rel-list-gc.html         (rev 0)
+++ trunk/LayoutTests/fast/dom/rel-list-gc.html        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+</head>
+<script>
+var element;
+
+function test(type)
+{
+ element = document.createElement(type);
+ var relList = element.relList;
+ element.relList.life = 42;
+ shouldEvaluateTo('element.relList.life', 42);
+ relList = null;
+ gc();
+ shouldEvaluateTo('element.relList.life', 42);
+}
+
+debug('Tests relList gc for anchor element');
+test('a');
+debug('Tests relList gc for area element');
+test('area');
+debug('Tests relList gc for link element');
+test('link');
+
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomrellisthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/rel-list.html (0 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/rel-list.html         (rev 0)
+++ trunk/LayoutTests/fast/dom/rel-list.html        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -0,0 +1,303 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+</head>
+<body>
+<a id="a" rel="a b c"></a>
+<area id="area" rel="a b c"></area>
+<link id="link" rel="a b c">
+<script>
+description('Tests that relList works on anchor, area and link elements');
+
+var element;
+var type;
+var observer;
+
+function createElement(rel)
+{
+ element = document.createElement(type);
+ element.rel = rel;
+}
+
+function test()
+{
+ element = document.getElementById(type);
+ shouldBeFalse('element.relList == null');
+ shouldBeFalse('element.relList == undefined');
+ shouldBeTrue('element.relList instanceof DOMTokenList');
+ shouldBe('element.relList.length', '3');
+ shouldBeTrue('element.relList.contains("a")');
+ shouldBeTrue('element.relList.contains("b")');
+ shouldBeTrue('element.relList.contains("c")');
+ shouldBeFalse('element.relList.contains("d")');
+
+ createElement("foo bar chocolate");
+ shouldBe('element.relList.length', '3');
+ shouldBeTrue('element.relList.contains("foo")');
+ shouldBeTrue('element.relList.contains("bar")');
+ shouldBeTrue('element.relList.contains("chocolate")');
+ shouldBeFalse('element.relList.contains("orange")');
+
+ element.removeAttribute('rel');
+ shouldBe('element.relList.length', '0');
+
+ element.setAttribute('rel', '');
+ shouldBe('element.relList.length', '0');
+
+ element.setAttribute('rel', 'marshmallow chips');
+ shouldBe('element.relList.length', '2');
+ shouldBeTrue('element.relList.contains("marshmallow")');
+ shouldBeTrue('element.relList.contains("chips")');
+ shouldBeFalse('element.relList.contains("orange")');
+
+ createElement('x');
+ element.relList = 'y';
+ shouldBeEqualToString('String(element.relList)', 'x');
+
+ createElement('');
+ shouldEvaluateTo('element.relList.length', 0);
+
+ createElement('x');
+ shouldEvaluateTo('element.relList.length', 1);
+
+ createElement('x x');
+ shouldEvaluateTo('element.relList.length', 2);
+
+ createElement('x y');
+ shouldEvaluateTo('element.relList.length', 2);
+
+ createElement('');
+ element.relList.add('x');
+ shouldBeEqualToString('element.rel', 'x');
+
+ createElement('x');
+ element.relList.add('x');
+ shouldBeEqualToString('element.rel', 'x');
+
+ createElement('x x');
+ element.relList.add('x');
+ shouldBeEqualToString('element.rel', 'x x');
+
+ createElement('y');
+ element.relList.add('x');
+ shouldBeEqualToString('element.rel', 'y x');
+
+ createElement('');
+ element.relList.remove('x');
+ shouldBeEqualToString('element.rel', '');
+
+ createElement('x');
+ element.relList.remove('x');
+ shouldBeEqualToString('element.rel', '');
+
+ createElement(' y x y ');
+ element.relList.remove('x');
+ shouldBeEqualToString('element.rel', ' y y ');
+
+ createElement(' x y x ');
+ element.relList.remove('x');
+ shouldBeEqualToString('element.rel', 'y');
+
+ debug('Ensure that we can handle empty rel correctly');
+ element = document.createElement(type);
+ shouldBeTrue("element.relList.toggle('x')");
+ shouldBeEqualToString('element.rel', 'x');
+ shouldBeFalse("element.relList.toggle('x')");
+ shouldBeEqualToString('element.rel', '');
+
+ element = document.createElement(type);
+ shouldBeFalse('element.relList.contains("x")');
+ shouldBeUndefined('element.relList[1]');
+ element.relList.remove('x');
+ shouldBeFalse('element.relList.contains("x")');
+ element.relList.add('x');
+ shouldBeTrue('element.relList.contains("x")');
+
+ debug('Test toggle with force argument');
+ createElement('');
+ shouldBeTrue("element.relList.toggle('x', true)");
+ shouldBeEqualToString('element.rel', 'x');
+ shouldBeTrue("element.relList.toggle('x', true)");
+ shouldBeEqualToString('element.rel', 'x');
+ shouldBeFalse("element.relList.toggle('x', false)");
+ shouldBeEqualToString('element.rel', '');
+ shouldBeFalse("element.relList.toggle('x', false)");
+ shouldBeEqualToString('element.rel', '');
+ shouldThrow('element.relList.toggle("", true)');
+ shouldThrow('element.relList.toggle("x y", false)');
+
+ debug('Testing add in presence of trailing white spaces.');
+ createElement('x ');
+ element.relList.add('y');
+ shouldBeEqualToString('element.rel', 'x y');
+
+ createElement('x\t');
+ element.relList.add('y');
+ shouldBeEqualToString('element.rel', 'x\ty');
+
+ createElement(' ');
+ element.relList.add('y');
+ shouldBeEqualToString('element.rel', ' y');
+
+ debug('Test invalid tokens');
+
+ createElement('x');
+ shouldThrow('element.relList.contains("")');
+
+ createElement('x y');
+ shouldThrow('element.relList.contains("x y")');
+
+ createElement('');
+ shouldThrow('element.relList.add("")');
+
+ createElement('');
+ shouldThrow('element.relList.add("x y")');
+
+ createElement('');
+ shouldThrow('element.relList.remove("")');
+
+ createElement('');
+ shouldThrow('element.relList.remove("x y")');
+
+ createElement('');
+ shouldThrow('element.relList.toggle("")');
+
+ debug('Indexing');
+ createElement('x');
+ shouldBeEqualToString('element.relList[0]', 'x');
+ shouldBeEqualToString('element.relList.item(0)', 'x');
+
+ createElement('x x');
+ shouldBeEqualToString('element.relList[1]', 'x');
+ shouldBeEqualToString('element.relList.item(1)', 'x');
+
+ createElement('x y');
+ shouldBeEqualToString('element.relList[1]', 'y');
+ shouldBeEqualToString('element.relList.item(1)', 'y');
+
+ createElement('');
+ shouldBeUndefined('element.relList[0]');
+ shouldBeNull('element.relList.item(0)');
+
+ createElement('x y z');
+ shouldBeUndefined('element.relList[4]');
+ shouldBeNull('element.relList.item(4)');
+ shouldBeUndefined('element.relList[-1]');
+ shouldBeNull('element.relList.item(-1)');
+ shouldThrow('element.relList.item()');
+
+ debug('Test case since DOMTokenList is case sensitive');
+ createElement('x');
+ shouldBeTrue('element.relList.contains("x")');
+ shouldBeFalse('element.relList.contains("X")');
+ shouldBeEqualToString('element.relList[0]', 'x');
+ shouldThrow('element.relList.contains()');
+
+ createElement('X');
+ shouldBeTrue('element.relList.contains("X")');
+ shouldBeFalse('element.relList.contains("x")');
+ shouldBeEqualToString('element.relList[0]', 'X');
+
+ debug('Testing whitespace');
+ createElement('x\u0020y');
+ shouldEvaluateTo('element.relList.length', 2);
+
+ createElement('x\u0009y');
+ shouldEvaluateTo('element.relList.length', 2);
+
+ createElement('x\u000Ay');
+ shouldEvaluateTo('element.relList.length', 2);
+
+ createElement('x\u000Cy');
+ shouldEvaluateTo('element.relList.length', 2);
+
+ createElement('x\u000Dy');
+ shouldEvaluateTo('element.relList.length', 2);
+
+ debug('DOMTokenList presence and type');
+ shouldBeTrue('\'undefined\' != typeof DOMTokenList');
+
+ shouldBeEqualToString('typeof DOMTokenList.prototype', 'object');
+
+ createElement('x');
+ shouldBeEqualToString('typeof element.relList', 'object');
+ shouldEvaluateTo('element.relList.constructor', 'DOMTokenList');
+ shouldBeTrue('element.relList === element.relList');
+
+ debug('Variadic calls');
+
+ createElement('');
+ element.relList.add('a', 'b');
+ shouldBeEqualToString('element.rel', 'a b');
+
+ element.relList.add('a', 'b', 'c');
+ shouldBeEqualToString('element.rel', 'a b c');
+
+ element.relList.add(null, {toString: function() { return 'd' }}, undefined, 0, false);
+ shouldBeEqualToString('element.rel', 'a b c null d undefined 0 false');
+
+ createElement('');
+ element.relList.add('a', 'b', 'a');
+ shouldBeEqualToString('element.rel', 'a b');
+
+ createElement('');
+ shouldThrow('element.relList.add("a", "b", "")');
+ shouldBeEqualToString('element.rel', '');
+ shouldThrow('element.relList.add("a", "b", "c d")');
+ shouldBeEqualToString('element.rel', '');
+ shouldThrow('element.relList.add("a", {toString: function() { throw new Error("user error"); }}, "b")', '"Error: user error"');
+ shouldBeEqualToString('element.rel', '');
+
+ createElement('');
+ shouldNotThrow('element.relList.add()');
+
+ createElement('');
+ observer = new WebKitMutationObserver(function() {});
+ observer.observe(element, {attributes: true});
+ element.relList.add('a', 'c');
+ shouldBe('observer.takeRecords().length', '1');
+
+ createElement('a b c d ');
+ element.relList.remove('a', 'c');
+ shouldBeEqualToString('element.rel', 'b d ');
+
+ element.relList.remove('b', 'b');
+ shouldBeEqualToString('element.rel', 'd ');
+
+ createElement('a b c null d undefined 0 false');
+ element.relList.remove(null, {toString: function() { return 'd' }}, undefined, 0, false);
+ shouldBeEqualToString('element.rel', 'a b c');
+
+ createElement('a b');
+ shouldThrow('element.relList.remove("a", "b", "")');
+
+ shouldBeEqualToString('element.rel', 'a b');
+ shouldThrow('element.relList.remove("a", {toString: function() { throw new Error("user error"); }}, "b")', '"Error: user error"');
+ shouldBeEqualToString('element.rel', 'a b');
+
+ shouldThrow('element.relList.remove("a", "b", "c d")');
+ shouldBeEqualToString('element.rel', 'a b');
+ shouldNotThrow('element.relList.remove()');
+
+ createElement('a b c');
+ observer = new WebKitMutationObserver(function() {});
+ observer.observe(element, {attributes: true});
+ element.relList.remove('a', 'c');
+ shouldBe('observer.takeRecords().length', '1');
+}
+
+debug('Tests relList for anchor element');
+type = 'a';
+test();
+debug('Tests relList for area element');
+type = 'area';
+test();
+debug('Tests relList for link element');
+type = 'link';
+test();
+
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomdomstaticpropertyforiniterationexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt (175027 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt        2014-10-22 07:29:26 UTC (rev 175027)
+++ trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> PASS a["search"] is
</span><span class="cx"> PASS a["origin"] is file://
</span><span class="cx"> PASS a["text"] is nerget
</span><ins>+PASS a["relList"] is
</ins><span class="cx"> PASS a["title"] is
</span><span class="cx"> PASS a["lang"] is
</span><span class="cx"> PASS a["translate"] is true
</span><span class="lines">@@ -49,7 +50,7 @@
</span><span class="cx"> PASS a["style"] is [object CSSStyleDeclaration]
</span><span class="cx"> PASS a["id"] is foo
</span><span class="cx"> PASS a["offsetLeft"] is 8
</span><del>-PASS a["offsetTop"] is 774
</del><ins>+PASS a["offsetTop"] is 789
</ins><span class="cx"> PASS a["offsetWidth"] is 39
</span><span class="cx"> PASS a["offsetHeight"] is 18
</span><span class="cx"> PASS a["clientLeft"] is 0
</span></span></pre></div>
<a id="trunkLayoutTestsperfrellistremoveexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/perf/rel-list-remove-expected.txt (0 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/perf/rel-list-remove-expected.txt         (rev 0)
+++ trunk/LayoutTests/perf/rel-list-remove-expected.txt        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+Tests that relList remove is linear.
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+
</ins></span></pre></div>
<a id="trunkLayoutTestsperfrellistremovehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/perf/rel-list-remove.html (0 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/perf/rel-list-remove.html         (rev 0)
+++ trunk/LayoutTests/perf/rel-list-remove.html        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+<script src="../resources/magnitude-perf.js"></script>
+<script>
+
+var element, rel, relToRemove, type;
+
+// Test 1 tests that remove is linear when there are N rels.
+
+function setupFunction1(magnitude)
+{
+ element = document.createElement(type);
+ relToRemove = 'b';
+ rel = Array(magnitude).join('a ') + relToRemove;
+}
+
+// Test 2 tests that remove is linear when the length of the rel is N.
+
+function setupFunction2(magnitude)
+{
+ element = document.createElement(type);
+ relToRemove = Array(magnitude + 1).join('a');
+ rel = relToRemove;
+}
+
+function test(magnitude)
+{
+ element.rel = rel;
+ element.relList.remove(relToRemove);
+}
+
+Magnitude.description('Tests that relList remove is linear.');
+type = 'a'
+Magnitude.run(setupFunction1, test, Magnitude.LINEAR);
+Magnitude.run(setupFunction2, test, Magnitude.LINEAR);
+type = 'area'
+Magnitude.run(setupFunction1, test, Magnitude.LINEAR);
+Magnitude.run(setupFunction2, test, Magnitude.LINEAR);
+type = 'link'
+Magnitude.run(setupFunction1, test, Magnitude.LINEAR);
+Magnitude.run(setupFunction2, test, Magnitude.LINEAR);
+
+</script>
+</body>
</ins></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (175027 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-10-22 07:29:26 UTC (rev 175027)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -1647,6 +1647,7 @@
</span><span class="cx"> html/RadioInputType.cpp
</span><span class="cx"> html/RadioNodeList.cpp
</span><span class="cx"> html/RangeInputType.cpp
</span><ins>+ html/RelList.cpp
</ins><span class="cx"> html/ResetInputType.cpp
</span><span class="cx"> html/SearchInputType.cpp
</span><span class="cx"> html/StepRange.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (175027 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-22 07:29:26 UTC (rev 175027)
+++ trunk/Source/WebCore/ChangeLog        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2014-10-22 Dhi Aurrahman <diorahman@rockybars.com>
+
+ Add relList to the anchor, area and link elements
+ https://bugs.webkit.org/show_bug.cgi?id=137860
+
+ Reviewed by Darin Adler and Chris Dumez.
+
+ Add relList to reflect the rel content attribute for anchor[1],
+ area[2] and link[3] elements.
+
+ [1] https://html.spec.whatwg.org/multipage/semantics.html#dom-a-rellist
+ [2] https://html.spec.whatwg.org/multipage/embedded-content.html#dom-area-rellist
+ [3] https://html.spec.whatwg.org/multipage/semantics.html#dom-link-rellist
+
+ Tests: fast/dom/rel-list-gc.html
+ fast/dom/rel-list.html
+ perf/rel-list-remove.html
+
+ * CMakeLists.txt:
+ * WebCore.vcxproj/WebCore.vcxproj:
+ * WebCore.vcxproj/WebCore.vcxproj.filters:
+ * WebCore.xcodeproj/project.pbxproj:
+ * dom/SpaceSplitString.cpp:
+ (WebCore::SpaceSplitString::set):
+ * html/HTMLAnchorElement.cpp:
+ (WebCore::HTMLAnchorElement::parseAttribute):
+ (WebCore::HTMLAnchorElement::relList):
+ (WebCore::HTMLAnchorElement::setRel): Deleted.
+ * html/HTMLAnchorElement.h:
+ * html/HTMLAnchorElement.idl:
+ * html/HTMLAreaElement.idl:
+ * html/HTMLLinkElement.cpp:
+ (WebCore::HTMLLinkElement::parseAttribute):
+ (WebCore::HTMLLinkElement::relList):
+ * html/HTMLLinkElement.h:
+ * html/HTMLLinkElement.idl:
+ * html/RelList.cpp: Added.
+ (WebCore::RelList::RelList):
+ (WebCore::RelList::ref):
+ (WebCore::RelList::deref):
+ (WebCore::RelList::length):
+ (WebCore::RelList::item):
+ (WebCore::RelList::element):
+ (WebCore::RelList::updateRelAttribute):
+ (WebCore::RelList::containsInternal):
+ (WebCore::RelList::value):
+ (WebCore::RelList::setValue):
+ * html/RelList.h: Added.
+
</ins><span class="cx"> 2014-10-21 Andy Estes <aestes@apple.com>
</span><span class="cx">
</span><span class="cx"> One more iOS build fix after r175013.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (175027 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-10-22 07:29:26 UTC (rev 175027)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -16059,6 +16059,7 @@
</span><span class="cx"> <ClCompile Include="..\html\RadioInputType.cpp" />
</span><span class="cx"> <ClCompile Include="..\html\RadioNodeList.cpp" />
</span><span class="cx"> <ClCompile Include="..\html\RangeInputType.cpp" />
</span><ins>+ <ClCompile Include="..\html\RelList.cpp" />
</ins><span class="cx"> <ClCompile Include="..\html\ResetInputType.cpp" />
</span><span class="cx"> <ClCompile Include="..\html\SearchInputType.cpp" />
</span><span class="cx"> <ClCompile Include="..\html\StepRange.cpp" />
</span><span class="lines">@@ -20836,6 +20837,7 @@
</span><span class="cx"> <ClInclude Include="..\html\RadioInputType.h" />
</span><span class="cx"> <ClInclude Include="..\html\RadioNodeList.h" />
</span><span class="cx"> <ClInclude Include="..\html\RangeInputType.h" />
</span><ins>+ <ClInclude Include="..\html\RelList.h" />
</ins><span class="cx"> <ClInclude Include="..\html\ResetInputType.h" />
</span><span class="cx"> <ClInclude Include="..\html\SearchInputType.h" />
</span><span class="cx"> <ClInclude Include="..\html\StepRange.h" />
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (175027 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-10-22 07:29:26 UTC (rev 175027)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -4053,6 +4053,9 @@
</span><span class="cx"> <ClCompile Include="..\html\RangeInputType.cpp">
</span><span class="cx"> <Filter>html</Filter>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\html\RelList.cpp">
+ <Filter>html</Filter>
+ </ClCompile>
</ins><span class="cx"> <ClCompile Include="..\html\ResetInputType.cpp">
</span><span class="cx"> <Filter>html</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -11208,6 +11211,9 @@
</span><span class="cx"> <ClInclude Include="..\html\RangeInputType.h">
</span><span class="cx"> <Filter>html</Filter>
</span><span class="cx"> </ClInclude>
</span><ins>+ <ClInclude Include="..\html\RelList.h">
+ <Filter>html</Filter>
+ </ClInclude>
</ins><span class="cx"> <ClInclude Include="..\html\ResetInputType.h">
</span><span class="cx"> <Filter>html</Filter>
</span><span class="cx"> </ClInclude>
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (175027 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-10-22 07:29:26 UTC (rev 175027)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -4691,6 +4691,8 @@
</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><ins>+                B2F78CFD19F2F02D0049696C /* RelList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2F78CFB19F2F02D0049696C /* RelList.cpp */; };
+                B2F78CFE19F2F02D0049696C /* RelList.h in Headers */ = {isa = PBXBuildFile; fileRef = B2F78CFC19F2F02D0049696C /* RelList.h */; };
</ins><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">@@ -12061,6 +12063,8 @@
</span><span class="cx">                 B2ED97700B1F55CE00257D0F /* GraphicsContextCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContextCG.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 B2F34FE50E82F81400F627CD /* DNS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNS.h; sourceTree = "<group>"; };
</span><span class="cx">                 B2F34FE80E82F82700F627CD /* DNSCFNet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNSCFNet.cpp; sourceTree = "<group>"; };
</span><ins>+                B2F78CFB19F2F02D0049696C /* RelList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RelList.cpp; sourceTree = "<group>"; };
+                B2F78CFC19F2F02D0049696C /* RelList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RelList.h; sourceTree = "<group>"; };
</ins><span class="cx">                 B2FA3C4E0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGAnimateColorElement.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 B2FA3C4F0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSSVGAnimateColorElement.h; sourceTree = "<group>"; };
</span><span class="cx">                 B2FA3C500AB75A6E000E5AC4 /* JSSVGAnimatedAngle.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGAnimatedAngle.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -17914,6 +17918,8 @@
</span><span class="cx">                                 B658FFA41522EFAA00DD5595 /* RadioNodeList.h */,
</span><span class="cx">                                 F55B3D991251F12D003EF269 /* RangeInputType.cpp */,
</span><span class="cx">                                 F55B3D9A1251F12D003EF269 /* RangeInputType.h */,
</span><ins>+                                B2F78CFB19F2F02D0049696C /* RelList.cpp */,
+                                B2F78CFC19F2F02D0049696C /* RelList.h */,
</ins><span class="cx">                                 F55B3D9B1251F12D003EF269 /* ResetInputType.cpp */,
</span><span class="cx">                                 F55B3D9C1251F12D003EF269 /* ResetInputType.h */,
</span><span class="cx">                                 F55B3D9D1251F12D003EF269 /* SearchInputType.cpp */,
</span><span class="lines">@@ -24670,6 +24676,7 @@
</span><span class="cx">                                 E157A8F118185425009F821D /* JSCryptoAlgorithmBuilder.h in Headers */,
</span><span class="cx">                                 E1C657131815F9DD00256CDD /* JSCryptoAlgorithmDictionary.h in Headers */,
</span><span class="cx">                                 E157A8E11817331C009F821D /* JSCryptoKey.h in Headers */,
</span><ins>+                                B2F78CFE19F2F02D0049696C /* RelList.h in Headers */,
</ins><span class="cx">                                 E1F80B8E183172B5007885C3 /* JSCryptoKeyPair.h in Headers */,
</span><span class="cx">                                 E125F85218283A5600D84CD9 /* JSCryptoKeySerializationJWK.h in Headers */,
</span><span class="cx">                                 E125F83E182411E700D84CD9 /* JSCryptoOperationData.h in Headers */,
</span><span class="lines">@@ -27402,6 +27409,7 @@
</span><span class="cx">                                 CECADFC6153778FF00E37068 /* DictationAlternative.cpp in Sources */,
</span><span class="cx">                                 CECADFC8153778FF00E37068 /* DictationCommand.cpp in Sources */,
</span><span class="cx">                                 D0BD4F5C1408850F006839B6 /* DictationCommandIOS.cpp in Sources */,
</span><ins>+                                B2F78CFD19F2F02D0049696C /* RelList.cpp in Sources */,
</ins><span class="cx">                                 312D67B11535691F00563D0D /* Dictionary.cpp in Sources */,
</span><span class="cx">                                 FDAF19981513D131008DB0C3 /* DirectConvolver.cpp in Sources */,
</span><span class="cx">                                 49FC7A501444AF5F00A5D864 /* DisplayRefreshMonitor.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoredomSpaceSplitStringcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/SpaceSplitString.cpp (175027 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/SpaceSplitString.cpp        2014-10-22 07:29:26 UTC (rev 175027)
+++ trunk/Source/WebCore/dom/SpaceSplitString.cpp        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -94,6 +94,10 @@
</span><span class="cx">
</span><span class="cx"> void SpaceSplitString::set(const AtomicString& inputString, bool shouldFoldCase)
</span><span class="cx"> {
</span><ins>+ if (inputString.isNull()) {
+ clear();
+ return;
+ }
</ins><span class="cx"> m_data = SpaceSplitStringData::create(shouldFoldCase ? inputString.convertToASCIILowercase() : inputString);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAnchorElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAnchorElement.cpp (175027 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAnchorElement.cpp        2014-10-22 07:29:26 UTC (rev 175027)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.cpp        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> #include "MouseEvent.h"
</span><span class="cx"> #include "PingLoader.h"
</span><span class="cx"> #include "PlatformMouseEvent.h"
</span><ins>+#include "RelList.h"
</ins><span class="cx"> #include "RenderImage.h"
</span><span class="cx"> #include "ResourceRequest.h"
</span><span class="cx"> #include "SVGImage.h"
</span><span class="lines">@@ -261,8 +262,12 @@
</span><span class="cx"> invalidateCachedVisitedLinkHash();
</span><span class="cx"> } else if (name == nameAttr || name == titleAttr) {
</span><span class="cx"> // Do nothing.
</span><del>- } else if (name == relAttr)
- setRel(value);
</del><ins>+ } else if (name == relAttr) {
+ if (SpaceSplitString::spaceSplitStringContainsValue(value, "noreferrer", true))
+ m_linkRelations |= RelationNoReferrer;
+ if (m_relList)
+ m_relList->updateRelAttribute(value);
+ }
</ins><span class="cx"> else
</span><span class="cx"> HTMLElement::parseAttribute(name, value);
</span><span class="cx"> }
</span><span class="lines">@@ -310,10 +315,11 @@
</span><span class="cx"> return m_linkRelations & relation;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void HTMLAnchorElement::setRel(const String& value)
</del><ins>+DOMTokenList& HTMLAnchorElement::relList()
</ins><span class="cx"> {
</span><del>- if (SpaceSplitString::spaceSplitStringContainsValue(value, "noreferrer", true))
- m_linkRelations |= RelationNoReferrer;
</del><ins>+ if (!m_relList)
+ m_relList = std::make_unique<RelList>(*this);
+ return *m_relList;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const AtomicString& HTMLAnchorElement::name() const
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAnchorElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAnchorElement.h (175027 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAnchorElement.h        2014-10-22 07:29:26 UTC (rev 175027)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.h        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -30,6 +30,8 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+class RelList;
+
</ins><span class="cx"> // Link relation bitmask values.
</span><span class="cx"> // FIXME: Uncomment as the various link relations are implemented.
</span><span class="cx"> enum {
</span><span class="lines">@@ -97,11 +99,12 @@
</span><span class="cx"> virtual bool willRespondToMouseClickEvents() override;
</span><span class="cx">
</span><span class="cx"> bool hasRel(uint32_t relation) const;
</span><del>- void setRel(const String&);
</del><span class="cx">
</span><span class="cx"> LinkHash visitedLinkHash() const;
</span><span class="cx"> void invalidateCachedVisitedLinkHash() { m_cachedVisitedLinkHash = 0; }
</span><span class="cx">
</span><ins>+ DOMTokenList& relList();
+
</ins><span class="cx"> protected:
</span><span class="cx"> HTMLAnchorElement(const QualifiedName&, Document&);
</span><span class="cx">
</span><span class="lines">@@ -140,6 +143,8 @@
</span><span class="cx"> bool m_wasShiftKeyDownOnMouseDown : 1;
</span><span class="cx"> uint32_t m_linkRelations : 30;
</span><span class="cx"> mutable LinkHash m_cachedVisitedLinkHash;
</span><ins>+
+ std::unique_ptr<RelList> 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="trunkSourceWebCorehtmlHTMLAnchorElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAnchorElement.idl (175027 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAnchorElement.idl        2014-10-22 07:29:26 UTC (rev 175027)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.idl        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -66,5 +66,7 @@
</span><span class="cx"> // Objective-C extension:
</span><span class="cx"> readonly attribute URL absoluteLinkURL;
</span><span class="cx"> #endif
</span><ins>+
+ readonly attribute DOMTokenList relList;
</ins><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAreaElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAreaElement.idl (175027 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAreaElement.idl        2014-10-22 07:29:26 UTC (rev 175027)
+++ trunk/Source/WebCore/html/HTMLAreaElement.idl        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> [Reflect, URL] attribute DOMString href;
</span><span class="cx"> [Reflect] attribute boolean noHref;
</span><span class="cx"> [Reflect] attribute DOMString ping;
</span><ins>+ [Reflect] attribute DOMString rel;
</ins><span class="cx"> [Reflect] attribute DOMString shape;
</span><span class="cx"> [Reflect] attribute DOMString target;
</span><span class="cx">
</span><span class="lines">@@ -43,5 +44,7 @@
</span><span class="cx"> // Objective-C extension:
</span><span class="cx"> readonly attribute URL absoluteLinkURL;
</span><span class="cx"> #endif
</span><ins>+
+ readonly attribute DOMTokenList relList;
</ins><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLinkElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLinkElement.cpp (175027 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLinkElement.cpp        2014-10-22 07:29:26 UTC (rev 175027)
+++ trunk/Source/WebCore/html/HTMLLinkElement.cpp        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> #include "MediaQueryEvaluator.h"
</span><span class="cx"> #include "MouseEvent.h"
</span><span class="cx"> #include "Page.h"
</span><ins>+#include "RelList.h"
</ins><span class="cx"> #include "RenderStyle.h"
</span><span class="cx"> #include "SecurityOrigin.h"
</span><span class="cx"> #include "Settings.h"
</span><span class="lines">@@ -139,6 +140,8 @@
</span><span class="cx"> {
</span><span class="cx"> if (name == relAttr) {
</span><span class="cx"> m_relAttribute = LinkRelAttribute(value);
</span><ins>+ if (m_relList)
+ m_relList->updateRelAttribute(value);
</ins><span class="cx"> process();
</span><span class="cx"> } else if (name == hrefAttr) {
</span><span class="cx"> bool wasLink = isLink();
</span><span class="lines">@@ -381,6 +384,13 @@
</span><span class="cx"> linkLoadingErrored();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+DOMTokenList& HTMLLinkElement::relList()
+{
+ if (!m_relList)
+ m_relList = std::make_unique<RelList>(*this);
+ return *m_relList;
+}
+
</ins><span class="cx"> void HTMLLinkElement::notifyLoadedSheetAndAllCriticalSubresources(bool errorOccurred)
</span><span class="cx"> {
</span><span class="cx"> if (m_firedLoad)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLinkElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLinkElement.h (175027 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLinkElement.h        2014-10-22 07:29:26 UTC (rev 175027)
+++ trunk/Source/WebCore/html/HTMLLinkElement.h        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class HTMLLinkElement;
</span><ins>+class RelList;
</ins><span class="cx"> class URL;
</span><span class="cx">
</span><span class="cx"> template<typename T> class EventSender;
</span><span class="lines">@@ -71,6 +72,8 @@
</span><span class="cx"> void dispatchPendingEvent(LinkEventSender*);
</span><span class="cx"> static void dispatchPendingLoadEvents();
</span><span class="cx">
</span><ins>+ DOMTokenList& relList();
+
</ins><span class="cx"> private:
</span><span class="cx"> virtual void parseAttribute(const QualifiedName&, const AtomicString&) override;
</span><span class="cx">
</span><span class="lines">@@ -100,7 +103,6 @@
</span><span class="cx"> virtual void defaultEventHandler(Event*) override;
</span><span class="cx"> void handleClick(Event&);
</span><span class="cx">
</span><del>-private:
</del><span class="cx"> HTMLLinkElement(const QualifiedName&, Document&, bool createdByParser);
</span><span class="cx">
</span><span class="cx"> virtual void addSubresourceAttributeURLs(ListHashSet<URL>&) const override;
</span><span class="lines">@@ -138,6 +140,8 @@
</span><span class="cx"> bool m_loadedSheet;
</span><span class="cx">
</span><span class="cx"> PendingSheetType m_pendingSheetType;
</span><ins>+
+ std::unique_ptr<RelList> m_relList;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } //namespace
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLinkElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLinkElement.idl (175027 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLinkElement.idl        2014-10-22 07:29:26 UTC (rev 175027)
+++ trunk/Source/WebCore/html/HTMLLinkElement.idl        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -40,5 +40,7 @@
</span><span class="cx"> // Objective-C extension:
</span><span class="cx"> readonly attribute URL absoluteLinkURL;
</span><span class="cx"> #endif
</span><ins>+
+ readonly attribute DOMTokenList relList;
</ins><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlRelListcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/html/RelList.cpp (0 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/RelList.cpp         (rev 0)
+++ trunk/Source/WebCore/html/RelList.cpp        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+/*
+ * Copyright (C) 2014 Dhi Aurrahman <diorahman@rockybars.com>
+ *
+ * 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 "config.h"
+#include "RelList.h"
+
+#include "Element.h"
+#include "HTMLNames.h"
+
+namespace WebCore {
+
+RelList::RelList(Element& 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 >= length())
+ return nullAtom;
+ return m_relAttributeValue[index];
+}
+
+Element* RelList::element() const
+{
+ return &m_element;
+}
+
+void RelList::updateRelAttribute(const AtomicString& value)
+{
+ m_relAttributeValue.set(value, false);
+}
+
+bool RelList::containsInternal(const AtomicString& token) const
+{
+ return m_relAttributeValue.contains(token);
+}
+
+AtomicString RelList::value() const
+{
+ return m_element.fastGetAttribute(HTMLNames::relAttr);
+}
+
+void RelList::setValue(const AtomicString& value)
+{
+ m_element.setAttribute(HTMLNames::relAttr, value);
+}
+
+} // namespace WebCore
+
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlRelListh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/html/RelList.h (0 => 175028)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/RelList.h         (rev 0)
+++ trunk/Source/WebCore/html/RelList.h        2014-10-22 09:22:05 UTC (rev 175028)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+/*
+ * Copyright (C) 2014 Dhi Aurrahman <diorahman@rockybars.com>
+ *
+ * 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 "DOMTokenList.h"
+#include "SpaceSplitString.h"
+
+namespace WebCore {
+
+class Element;
+
+class RelList final : public DOMTokenList {
+public:
+ RelList(Element&);
+ void updateRelAttribute(const AtomicString&);
+
+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&) const override;
+ virtual AtomicString value() const override;
+ virtual void setValue(const AtomicString&) override;
+
+ Element& m_element;
+ mutable SpaceSplitString m_relAttributeValue;
+};
+
+} // namespace WebCore
+
+#endif // RelList_h
+
</ins></span></pre>
</div>
</div>
</body>
</html>