<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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, #msg p { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul { overflow: auto; }
#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>
<title>[28722] trunk</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/28722">28722</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2007-12-14 13:48:20 -0800 (Fri, 14 Dec 2007)</dd>
</dl>

<h3>Log Message</h3>
<pre>WebCore:

        Reviewed by Mitz.

        - fix http://bugs.webkit.org/show_bug.cgi?id=14955
          Implement getElementsByClassName.

        This patch also renames AtomicStringList to ClassNames to better reflect its actual use,
        and takes advantage of admitting that it's class-specific to encapsulate class attribute 
        parsing so it can be shared.  It also changes the class to use a Vector, rather than a linked
        list to store the class names.

        Tests: fast/dom/getElementsByClassName/001.html
               fast/dom/getElementsByClassName/002.html
               fast/dom/getElementsByClassName/003.html
               fast/dom/getElementsByClassName/004.html
               fast/dom/getElementsByClassName/005.html
               fast/dom/getElementsByClassName/006.html
               fast/dom/getElementsByClassName/007.html
               fast/dom/getElementsByClassName/008.html
               fast/dom/getElementsByClassName/009.html
               fast/dom/getElementsByClassName/010.xml
               fast/dom/getElementsByClassName/011.xml
               fast/dom/getElementsByClassName/012.html
               fast/dom/getElementsByClassName/013.html
               fast/dom/getElementsByClassName/014.html
               fast/dom/getElementsByClassName/array/001.html
               fast/dom/getElementsByClassName/array/002.html
               fast/dom/getElementsByClassName/array/003.html
               fast/dom/getElementsByClassName/array/004.html
               fast/dom/getElementsByClassName/dumpNodeList.html

        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::matchRules):
        (WebCore::CSSStyleSelector::checkOneSelector):
        * dom/AtomicStringList.h: Removed.
        * dom/ClassNames.cpp: Added.
        (WebCore::ClassNames::contains):
        (WebCore::ClassNames::parseClassAttribute):
        * dom/ClassNames.h: Copied from WebCore/dom/AtomicStringList.h.
        (WebCore::ClassNames::ClassNames):
        (WebCore::ClassNames::size):
        (WebCore::ClassNames::clear):
        (WebCore::ClassNames::operator[]):
        (WebCore::isClassWhitespace):
        * dom/ClassNodeList.cpp: Added.
        (WebCore::ClassNodeList::ClassNodeList):
        (WebCore::ClassNodeList::length):
        (WebCore::ClassNodeList::item):
        (WebCore::ClassNodeList::nodeMatches):
        * dom/ClassNodeList.h: Added.
        * dom/Document.cpp:
        (WebCore::Document::getElementsByName):
        (WebCore::Document::getElementsByClassName):
        * dom/Document.h:
        * dom/Document.idl:
        * dom/Element.cpp:
        (WebCore::Element::getClassNames):
        (WebCore::Element::getElementsByClassName):
        * dom/Element.h:
        * dom/Element.idl:
        * dom/NameNodeList.cpp:
        (WebCore::NameNodeList::NameNodeList):
        (WebCore::NameNodeList::item):
        (WebCore::NameNodeList::nodeMatches):
        * dom/NameNodeList.h:
        * dom/NamedMappedAttrMap.cpp:
        (WebCore::NamedMappedAttrMap::clearAttributes):
        (WebCore::NamedMappedAttrMap::parseClassAttribute):
        * dom/NamedMappedAttrMap.h:
        (WebCore::NamedMappedAttrMap::getClassNames):
        * dom/StyledElement.cpp:
        (WebCore::StyledElement::getClassNames):
        * dom/StyledElement.h:

LayoutTests:

        Reviewed by Mitz.

        - test for http://bugs.webkit.org/show_bug.cgi?id=14955
          Implement getElementsByClassName

        Tests added from http://tc.labs.opera.com/apis/getElementsByClassName/

        * fast/dom/Window/window-properties-expected.txt:
        * fast/dom/getElementsByClassName: Added.
        * fast/dom/getElementsByClassName/001-expected.txt: Added.
        * fast/dom/getElementsByClassName/001.html: Added.
        * fast/dom/getElementsByClassName/002-expected.txt: Added.
        * fast/dom/getElementsByClassName/002.html: Added.
        * fast/dom/getElementsByClassName/003-expected.txt: Added.
        * fast/dom/getElementsByClassName/003.html: Added.
        * fast/dom/getElementsByClassName/004-expected.txt: Added.
        * fast/dom/getElementsByClassName/004.html: Added.
        * fast/dom/getElementsByClassName/005-expected.txt: Added.
        * fast/dom/getElementsByClassName/005.html: Added.
        * fast/dom/getElementsByClassName/006-expected.txt: Added.
        * fast/dom/getElementsByClassName/006.html: Added.
        * fast/dom/getElementsByClassName/007-expected.txt: Added.
        * fast/dom/getElementsByClassName/007.html: Added.
        * fast/dom/getElementsByClassName/008-expected.txt: Added.
        * fast/dom/getElementsByClassName/008.html: Added.
        * fast/dom/getElementsByClassName/009-expected.txt: Added.
        * fast/dom/getElementsByClassName/009.html: Added.
        * fast/dom/getElementsByClassName/010-expected.txt: Added.
        * fast/dom/getElementsByClassName/010.xml: Added.
        * fast/dom/getElementsByClassName/011-expected.txt: Added.
        * fast/dom/getElementsByClassName/011.xml: Added.
        * fast/dom/getElementsByClassName/012-expected.txt: Added.
        * fast/dom/getElementsByClassName/012.html: Added.
        * fast/dom/getElementsByClassName/013-expected.txt: Added.
        * fast/dom/getElementsByClassName/013.html: Added.
        * fast/dom/getElementsByClassName/014-expected.txt: Added.
        * fast/dom/getElementsByClassName/014.html: Added.
        * fast/dom/getElementsByClassName/array: Added.
        * fast/dom/getElementsByClassName/array/001-expected.txt: Added.
        * fast/dom/getElementsByClassName/array/001.html: Added.
        * fast/dom/getElementsByClassName/array/002-expected.txt: Added.
        * fast/dom/getElementsByClassName/array/002.html: Added.
        * fast/dom/getElementsByClassName/array/003-expected.txt: Added.
        * fast/dom/getElementsByClassName/array/003.html: Added.
        * fast/dom/getElementsByClassName/array/004-expected.txt: Added.
        * fast/dom/getElementsByClassName/array/004.html: Added.
        * fast/dom/getElementsByClassName/dumpNodeList-expected.txt: Added.
        * fast/dom/getElementsByClassName/dumpNodeList.html: Added.
        * fast/dom/getElementsByClassName/resources: Added.
        * fast/dom/getElementsByClassName/resources/common.js: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomWindowwindowpropertiesexpectedtxt">trunk/LayoutTests/fast/dom/Window/window-properties-expected.txt</a></li>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCoreWebCorexcodeprojprojectpbxproj">trunk/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkWebCorecssCSSStyleSelectorcpp">trunk/WebCore/css/CSSStyleSelector.cpp</a></li>
<li><a href="#trunkWebCoredomDocumentcpp">trunk/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkWebCoredomDocumenth">trunk/WebCore/dom/Document.h</a></li>
<li><a href="#trunkWebCoredomDocumentidl">trunk/WebCore/dom/Document.idl</a></li>
<li><a href="#trunkWebCoredomElementcpp">trunk/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkWebCoredomElementh">trunk/WebCore/dom/Element.h</a></li>
<li><a href="#trunkWebCoredomElementidl">trunk/WebCore/dom/Element.idl</a></li>
<li><a href="#trunkWebCoredomNameNodeListcpp">trunk/WebCore/dom/NameNodeList.cpp</a></li>
<li><a href="#trunkWebCoredomNameNodeListh">trunk/WebCore/dom/NameNodeList.h</a></li>
<li><a href="#trunkWebCoredomNamedMappedAttrMapcpp">trunk/WebCore/dom/NamedMappedAttrMap.cpp</a></li>
<li><a href="#trunkWebCoredomNamedMappedAttrMaph">trunk/WebCore/dom/NamedMappedAttrMap.h</a></li>
<li><a href="#trunkWebCoredomStyledElementcpp">trunk/WebCore/dom/StyledElement.cpp</a></li>
<li><a href="#trunkWebCoredomStyledElementh">trunk/WebCore/dom/StyledElement.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/fast/dom/getElementsByClassName/</li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName001expectedtxt">trunk/LayoutTests/fast/dom/getElementsByClassName/001-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName001html">trunk/LayoutTests/fast/dom/getElementsByClassName/001.html</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName002expectedtxt">trunk/LayoutTests/fast/dom/getElementsByClassName/002-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName002html">trunk/LayoutTests/fast/dom/getElementsByClassName/002.html</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName003expectedtxt">trunk/LayoutTests/fast/dom/getElementsByClassName/003-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName003html">trunk/LayoutTests/fast/dom/getElementsByClassName/003.html</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName004expectedtxt">trunk/LayoutTests/fast/dom/getElementsByClassName/004-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName004html">trunk/LayoutTests/fast/dom/getElementsByClassName/004.html</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName005expectedtxt">trunk/LayoutTests/fast/dom/getElementsByClassName/005-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName005html">trunk/LayoutTests/fast/dom/getElementsByClassName/005.html</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName006expectedtxt">trunk/LayoutTests/fast/dom/getElementsByClassName/006-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName006html">trunk/LayoutTests/fast/dom/getElementsByClassName/006.html</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName007expectedtxt">trunk/LayoutTests/fast/dom/getElementsByClassName/007-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName007html">trunk/LayoutTests/fast/dom/getElementsByClassName/007.html</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName008expectedtxt">trunk/LayoutTests/fast/dom/getElementsByClassName/008-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName008html">trunk/LayoutTests/fast/dom/getElementsByClassName/008.html</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName009expectedtxt">trunk/LayoutTests/fast/dom/getElementsByClassName/009-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName009html">trunk/LayoutTests/fast/dom/getElementsByClassName/009.html</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName010expectedtxt">trunk/LayoutTests/fast/dom/getElementsByClassName/010-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName010xml">trunk/LayoutTests/fast/dom/getElementsByClassName/010.xml</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName011expectedtxt">trunk/LayoutTests/fast/dom/getElementsByClassName/011-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName011xml">trunk/LayoutTests/fast/dom/getElementsByClassName/011.xml</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName012expectedtxt">trunk/LayoutTests/fast/dom/getElementsByClassName/012-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName012html">trunk/LayoutTests/fast/dom/getElementsByClassName/012.html</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName013expectedtxt">trunk/LayoutTests/fast/dom/getElementsByClassName/013-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName013html">trunk/LayoutTests/fast/dom/getElementsByClassName/013.html</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName014expectedtxt">trunk/LayoutTests/fast/dom/getElementsByClassName/014-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassName014html">trunk/LayoutTests/fast/dom/getElementsByClassName/014.html</a></li>
<li>trunk/LayoutTests/fast/dom/getElementsByClassName/array/</li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassNamearray001expectedtxt">trunk/LayoutTests/fast/dom/getElementsByClassName/array/001-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassNamearray001html">trunk/LayoutTests/fast/dom/getElementsByClassName/array/001.html</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassNamearray002expectedtxt">trunk/LayoutTests/fast/dom/getElementsByClassName/array/002-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassNamearray002html">trunk/LayoutTests/fast/dom/getElementsByClassName/array/002.html</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassNamearray003expectedtxt">trunk/LayoutTests/fast/dom/getElementsByClassName/array/003-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassNamearray003html">trunk/LayoutTests/fast/dom/getElementsByClassName/array/003.html</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassNamearray004expectedtxt">trunk/LayoutTests/fast/dom/getElementsByClassName/array/004-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassNamearray004html">trunk/LayoutTests/fast/dom/getElementsByClassName/array/004.html</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassNamedumpNodeListexpectedtxt">trunk/LayoutTests/fast/dom/getElementsByClassName/dumpNodeList-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassNamedumpNodeListhtml">trunk/LayoutTests/fast/dom/getElementsByClassName/dumpNodeList.html</a></li>
<li>trunk/LayoutTests/fast/dom/getElementsByClassName/resources/</li>
<li><a href="#trunkLayoutTestsfastdomgetElementsByClassNameresourcescommonjs">trunk/LayoutTests/fast/dom/getElementsByClassName/resources/common.js</a></li>
<li><a href="#trunkWebCoredomClassNamescpp">trunk/WebCore/dom/ClassNames.cpp</a></li>
<li><a href="#trunkWebCoredomClassNamesh">trunk/WebCore/dom/ClassNames.h</a></li>
<li><a href="#trunkWebCoredomClassNodeListcpp">trunk/WebCore/dom/ClassNodeList.cpp</a></li>
<li><a href="#trunkWebCoredomClassNodeListh">trunk/WebCore/dom/ClassNodeList.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkWebCoredomAtomicStringListh">trunk/WebCore/dom/AtomicStringList.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (28721 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2007-12-14 20:50:30 UTC (rev 28721)
+++ trunk/LayoutTests/ChangeLog        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -1,3 +1,56 @@
</span><ins>+2007-12-14  David Smith  &lt;catfish.man@gmail.com&gt;
+
+        Reviewed by Mitz.
+
+        - test for http://bugs.webkit.org/show_bug.cgi?id=14955
+          Implement getElementsByClassName
+
+        Tests added from http://tc.labs.opera.com/apis/getElementsByClassName/
+
+        * fast/dom/Window/window-properties-expected.txt:
+        * fast/dom/getElementsByClassName: Added.
+        * fast/dom/getElementsByClassName/001-expected.txt: Added.
+        * fast/dom/getElementsByClassName/001.html: Added.
+        * fast/dom/getElementsByClassName/002-expected.txt: Added.
+        * fast/dom/getElementsByClassName/002.html: Added.
+        * fast/dom/getElementsByClassName/003-expected.txt: Added.
+        * fast/dom/getElementsByClassName/003.html: Added.
+        * fast/dom/getElementsByClassName/004-expected.txt: Added.
+        * fast/dom/getElementsByClassName/004.html: Added.
+        * fast/dom/getElementsByClassName/005-expected.txt: Added.
+        * fast/dom/getElementsByClassName/005.html: Added.
+        * fast/dom/getElementsByClassName/006-expected.txt: Added.
+        * fast/dom/getElementsByClassName/006.html: Added.
+        * fast/dom/getElementsByClassName/007-expected.txt: Added.
+        * fast/dom/getElementsByClassName/007.html: Added.
+        * fast/dom/getElementsByClassName/008-expected.txt: Added.
+        * fast/dom/getElementsByClassName/008.html: Added.
+        * fast/dom/getElementsByClassName/009-expected.txt: Added.
+        * fast/dom/getElementsByClassName/009.html: Added.
+        * fast/dom/getElementsByClassName/010-expected.txt: Added.
+        * fast/dom/getElementsByClassName/010.xml: Added.
+        * fast/dom/getElementsByClassName/011-expected.txt: Added.
+        * fast/dom/getElementsByClassName/011.xml: Added.
+        * fast/dom/getElementsByClassName/012-expected.txt: Added.
+        * fast/dom/getElementsByClassName/012.html: Added.
+        * fast/dom/getElementsByClassName/013-expected.txt: Added.
+        * fast/dom/getElementsByClassName/013.html: Added.
+        * fast/dom/getElementsByClassName/014-expected.txt: Added.
+        * fast/dom/getElementsByClassName/014.html: Added.
+        * fast/dom/getElementsByClassName/array: Added.
+        * fast/dom/getElementsByClassName/array/001-expected.txt: Added.
+        * fast/dom/getElementsByClassName/array/001.html: Added.
+        * fast/dom/getElementsByClassName/array/002-expected.txt: Added.
+        * fast/dom/getElementsByClassName/array/002.html: Added.
+        * fast/dom/getElementsByClassName/array/003-expected.txt: Added.
+        * fast/dom/getElementsByClassName/array/003.html: Added.
+        * fast/dom/getElementsByClassName/array/004-expected.txt: Added.
+        * fast/dom/getElementsByClassName/array/004.html: Added.
+        * fast/dom/getElementsByClassName/dumpNodeList-expected.txt: Added.
+        * fast/dom/getElementsByClassName/dumpNodeList.html: Added.
+        * fast/dom/getElementsByClassName/resources: Added.
+        * fast/dom/getElementsByClassName/resources/common.js: Added.
+
</ins><span class="cx"> 2007-12-14  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Alexey.
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomWindowwindowpropertiesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/Window/window-properties-expected.txt (28721 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/Window/window-properties-expected.txt        2007-12-14 20:50:30 UTC (rev 28721)
+++ trunk/LayoutTests/fast/dom/Window/window-properties-expected.txt        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -317,6 +317,7 @@
</span><span class="cx"> window.Document.prototype.evaluate [function]
</span><span class="cx"> window.Document.prototype.execCommand [function]
</span><span class="cx"> window.Document.prototype.getElementById [function]
</span><ins>+window.Document.prototype.getElementsByClassName [function]
</ins><span class="cx"> window.Document.prototype.getElementsByName [function]
</span><span class="cx"> window.Document.prototype.getElementsByTagName [function]
</span><span class="cx"> window.Document.prototype.getElementsByTagNameNS [function]
</span><span class="lines">@@ -424,6 +425,7 @@
</span><span class="cx"> window.Element.prototype.getAttributeNS [function]
</span><span class="cx"> window.Element.prototype.getAttributeNode [function]
</span><span class="cx"> window.Element.prototype.getAttributeNodeNS [function]
</span><ins>+window.Element.prototype.getElementsByClassName [function]
</ins><span class="cx"> window.Element.prototype.getElementsByTagName [function]
</span><span class="cx"> window.Element.prototype.getElementsByTagNameNS [function]
</span><span class="cx"> window.Element.prototype.hasAttribute [function]
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName001expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/001-expected.txt (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/001-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/001-expected.txt        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName001html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/001.html (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/001.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/001.html        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html class=&quot;a&quot;&gt;
+ &lt;head&gt;
+  &lt;title&gt;document.getElementsByClassName(): simple&lt;/title&gt;
+  &lt;script src=&quot;resources/common.js&quot;&gt;&lt;/script&gt;
+ &lt;/head&gt;
+ &lt;body class=&quot;a&quot;&gt;
+  &lt;p id=&quot;r&quot;&gt;FAIL (script did not run)&lt;/p&gt;
+  &lt;script&gt; t(document.getElementsByClassName(&quot;\ta\n&quot;), [document.documentElement, document.body]) &lt;/script&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName002expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/002-expected.txt (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/002-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/002-expected.txt        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName002html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/002.html (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/002.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/002.html        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html class=&quot;a
+b&quot;&gt;
+ &lt;head&gt;
+  &lt;title&gt;document.getElementsByClassName(): also simple&lt;/title&gt;
+  &lt;script src=&quot;resources/common.js&quot;&gt;&lt;/script&gt;
+ &lt;/head&gt;
+ &lt;body class=&quot;a
+&quot;&gt;
+  &lt;p id=&quot;r&quot;&gt;FAIL (script did not run)&lt;/p&gt;
+  &lt;script&gt; t(document.getElementsByClassName(&quot;a\n&quot;), [document.documentElement, document.body]) &lt;/script&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName003expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/003-expected.txt (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/003-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/003-expected.txt        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName003html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/003.html (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/003.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/003.html        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html class=&quot;a&quot;&gt;
+ &lt;head&gt;
+  &lt;title&gt;document.getElementsByClassName(): changing classes&lt;/title&gt;
+  &lt;script src=&quot;resources/common.js&quot;&gt;&lt;/script&gt;
+ &lt;/head&gt;
+ &lt;body class=&quot;a&quot;&gt;
+  &lt;p id=&quot;r&quot;&gt;FAIL (script did not run)&lt;/p&gt;
+  &lt;script&gt;
+   var collection = document.getElementsByClassName(&quot;a&quot;)
+   document.body.className = &quot;b&quot;
+   t(collection, [document.documentElement])
+  &lt;/script&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName004expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/004-expected.txt (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/004-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/004-expected.txt        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName004html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/004.html (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/004.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/004.html        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html class=&quot;a&quot;&gt;
+ &lt;head&gt;
+  &lt;title&gt;document.getElementsByClassName(): changing classes&lt;/title&gt;
+  &lt;script src=&quot;resources/common.js&quot;&gt;&lt;/script&gt;
+ &lt;/head&gt;
+ &lt;body class=&quot;a&quot;&gt;
+  &lt;p id=&quot;r&quot;&gt;FAIL (script did not run)&lt;/p&gt;
+  &lt;script&gt;
+   var collection = document.getElementsByClassName(&quot;a&quot;)
+   document.body.className += &quot;\tb&quot;
+   t(collection, [document.documentElement, document.body])
+  &lt;/script&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName005expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/005-expected.txt (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/005-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/005-expected.txt        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName005html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/005.html (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/005.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/005.html        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html class=&quot;a&quot;&gt;
+ &lt;head&gt;
+  &lt;title&gt;document.getElementsByClassName(): changing classes&lt;/title&gt;
+  &lt;script src=&quot;resources/common.js&quot;&gt;&lt;/script&gt;
+ &lt;/head&gt;
+ &lt;body class=&quot;a&quot;&gt;
+  &lt;p id=&quot;r&quot;&gt;FAIL (script did not run)&lt;/p&gt;
+  &lt;script&gt;
+   var collection = document.getElementsByClassName(&quot;a&quot;)
+   document.body.removeAttribute(&quot;class&quot;)
+   t(collection, [document.documentElement])
+  &lt;/script&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName006expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/006-expected.txt (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/006-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/006-expected.txt        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+PASS
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName006html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/006.html (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/006.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/006.html        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+ &lt;head&gt;
+  &lt;title&gt;document.getElementsByClassName(): adding element with class&lt;/title&gt;
+  &lt;script src=&quot;resources/common.js&quot;&gt;&lt;/script&gt;
+ &lt;/head&gt;
+ &lt;body class=&quot;a&quot;&gt;
+  &lt;p id=&quot;r&quot;&gt;FAIL (script did not run)&lt;/p&gt;
+  &lt;script&gt;
+   var collection = document.getElementsByClassName(&quot;a&quot;),
+       ele = document.createElement(&quot;foo&quot;);
+   ele.setAttribute(&quot;class&quot;, &quot;a&quot;);
+   document.body.appendChild(ele)
+   t(collection, [document.body, ele])
+  &lt;/script&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName007expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/007-expected.txt (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/007-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/007-expected.txt        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName007html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/007.html (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/007.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/007.html        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+ &lt;head&gt;
+  &lt;title&gt;document.getElementsByClassName(): multiple classes&lt;/title&gt;
+  &lt;script src=&quot;resources/common.js&quot;&gt;&lt;/script&gt;
+ &lt;/head&gt;
+ &lt;body class=&quot;a b&quot;&gt;
+  &lt;p id=&quot;r&quot;&gt;FAIL (script did not run)&lt;/p&gt;
+  &lt;script&gt; t(document.getElementsByClassName(&quot;b\t\f\n\na\rb&quot;), [document.body]) &lt;/script&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName008expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/008-expected.txt (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/008-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/008-expected.txt        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName008html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/008.html (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/008.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/008.html        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+ &lt;head&gt;
+  &lt;title&gt;document.getElementsByClassName(): multiple classes&lt;/title&gt;
+  &lt;script src=&quot;resources/common.js&quot;&gt;&lt;/script&gt;
+ &lt;/head&gt;
+ &lt;body class=&quot;a&quot;&gt;
+  &lt;p id=&quot;r&quot;&gt;FAIL (script did not run)&lt;/p&gt;
+  &lt;script&gt; t(document.getElementsByClassName(&quot;a\fa&quot;), [document.body]) &lt;/script&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName009expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/009-expected.txt (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/009-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/009-expected.txt        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName009html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/009.html (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/009.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/009.html        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html class=&quot;a A&quot;&gt;
+ &lt;head&gt;
+  &lt;title&gt;document.getElementsByClassName(): case sensitive&lt;/title&gt;
+  &lt;script src=&quot;resources/common.js&quot;&gt;&lt;/script&gt;
+ &lt;/head&gt;
+ &lt;body class=&quot;a a&quot;&gt;
+  &lt;p id=&quot;r&quot;&gt;FAIL (script did not run)&lt;/p&gt;
+  &lt;script&gt; t(document.getElementsByClassName(&quot;A a&quot;), [document.documentElement]) &lt;/script&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName010expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/010-expected.txt (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/010-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/010-expected.txt        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+PASS
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName010xml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/010.xml (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/010.xml                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/010.xml        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:g=&quot;http://www.w3.org/2000/svg&quot;&gt;
+ &lt;head&gt;
+  &lt;title&gt;document.getElementsByClassName(): compound&lt;/title&gt;
+  &lt;script src=&quot;resources/common.js&quot;&gt;&lt;/script&gt;
+ &lt;/head&gt;
+ &lt;body&gt;
+  &lt;p id=&quot;r&quot;&gt;FAIL (script did not run)&lt;/p&gt;  
+  &lt;x class=&quot;a&quot;/&gt;
+  &lt;g:x class=&quot;a&quot;/&gt;
+  &lt;script&gt; t(document.getElementsByClassName(&quot;a&quot;), document.getElementsByTagName(&quot;x&quot;)) &lt;/script&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName011expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/011-expected.txt (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/011-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/011-expected.txt        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+This page contains the following errors:
+
+error on line 12 at column 200: Namespaced Attribute class in 'http://www.w3.org/1999/xhtml' redefined
+Below is a rendering of the page up to the first error.
+
+PASS
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName011xml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/011.xml (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/011.xml                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/011.xml        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:g=&quot;http://www.w3.org/2000/svg&quot; xmlns:h=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:t=&quot;http://tc.labs.opera.com/#test&quot;&gt;
+ &lt;head&gt;
+  &lt;title&gt;document.getElementsByClassName(): &quot;tricky&quot; compound&lt;/title&gt;
+  &lt;script src=&quot;resources/common.js&quot;&gt;&lt;/script&gt;
+ &lt;/head&gt;
+ &lt;body&gt;
+  &lt;p id=&quot;r&quot;&gt;FAIL (script did not run)&lt;/p&gt;  
+  &lt;x class=&quot;a&quot;/&gt;
+  &lt;g:x class=&quot;a&quot;/&gt;
+  &lt;x t:class=&quot;a&quot; h:class=&quot;a&quot; g:class=&quot;a&quot;/&gt;
+  &lt;g:x t:class=&quot;a&quot; h:class=&quot;a&quot; g:class=&quot;a&quot;/&gt;
+  &lt;t:x class=&quot;a&quot; t:class=&quot;a&quot; h:class=&quot;a&quot; g:class=&quot;a&quot;/&gt;
+  &lt;script&gt;
+   var collection = document.getElementsByClassName(&quot;a&quot;),
+       test = document.getElementsByTagName(&quot;x&quot;)
+   t(collection, [test[0], test[1]])
+  &lt;/script&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName012expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/012-expected.txt (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/012-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/012-expected.txt        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName012html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/012.html (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/012.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/012.html        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html class=&quot;a&quot;&gt;
+ &lt;head&gt;
+  &lt;title&gt;element.getElementsByClassName(): simple&lt;/title&gt;
+  &lt;script src=&quot;resources/common.js&quot;&gt;&lt;/script&gt;
+ &lt;/head&gt;
+ &lt;body class=&quot;a&quot;&gt;
+  &lt;p id=&quot;r&quot;&gt;FAIL (script did not run)&lt;/p&gt;
+  &lt;script&gt; t(document.body.getElementsByClassName(&quot;a&quot;), []) &lt;/script&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName013expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/013-expected.txt (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/013-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/013-expected.txt        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+PASS
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName013html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/013.html (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/013.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/013.html        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html class=&quot;a&quot;&gt;
+ &lt;head&gt;
+  &lt;title&gt;element.getElementsByClassName(): adding an element&lt;/title&gt;
+  &lt;script src=&quot;resources/common.js&quot;&gt;&lt;/script&gt;
+ &lt;/head&gt;
+ &lt;body class=&quot;a&quot;&gt;
+  &lt;p id=&quot;r&quot;&gt;FAIL (script did not run)&lt;/p&gt;
+  &lt;script&gt;
+   var collection = document.body.getElementsByClassName(&quot;a&quot;),
+       ele = document.createElement(&quot;x-y-z&quot;)
+   ele.className = &quot;a&quot;
+   document.body.appendChild(ele) 
+   t(collection, [ele])
+  &lt;/script&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName014expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/014-expected.txt (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/014-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/014-expected.txt        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassName014html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/014.html (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/014.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/014.html        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+&lt;html class=&quot;a A&quot;&gt;
+ &lt;head&gt;
+  &lt;title&gt;document.getElementsByClassName(): case sensitive (quirks mode)&lt;/title&gt;
+  &lt;script src=&quot;resources/common.js&quot;&gt;&lt;/script&gt;
+ &lt;/head&gt;
+ &lt;body class=&quot;a a&quot;&gt;
+  &lt;p id=&quot;r&quot;&gt;FAIL (script did not run)&lt;/p&gt;
+  &lt;script&gt;
+    // We differ from Opera's implementation here.  We are case-insensitive in quirks mode.
+    // t(document.getElementsByClassName(&quot;A a&quot;), [document.documentElement])
+    t(document.getElementsByClassName(&quot;A a&quot;), [document.documentElement, document.body])
+  &lt;/script&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassNamearray001expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/array/001-expected.txt (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/array/001-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/array/001-expected.txt        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassNamearray001html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/array/001.html (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/array/001.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/array/001.html        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html class=&quot;a
+b&quot;&gt;
+ &lt;head&gt;
+  &lt;title&gt;document.getElementsByClassName(array): &quot;a\n&quot;&lt;/title&gt;
+  &lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
+ &lt;/head&gt;
+ &lt;body class=&quot;a
+&quot;&gt;
+  &lt;p id=&quot;r&quot;&gt;FAIL (script did not run)&lt;/p&gt;
+  &lt;script&gt; t(document.getElementsByClassName([&quot;a\n&quot;]), [document.documentElement, document.body]) &lt;/script&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassNamearray002expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/array/002-expected.txt (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/array/002-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/array/002-expected.txt        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassNamearray002html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/array/002.html (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/array/002.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/array/002.html        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html class=&quot;a
+b&quot;&gt;
+ &lt;head&gt;
+  &lt;title&gt;document.getElementsByClassName(array): &quot;b&quot;,&quot;a&quot;&lt;/title&gt;
+  &lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
+ &lt;/head&gt;
+ &lt;body class=&quot;b,a&quot;&gt;
+  &lt;p id=&quot;r&quot;&gt;FAIL (script did not run)&lt;/p&gt;
+  &lt;script&gt; t(document.getElementsByClassName([&quot;b&quot;, &quot;a&quot;]), [document.body]) &lt;/script&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassNamearray003expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/array/003-expected.txt (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/array/003-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/array/003-expected.txt        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassNamearray003html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/array/003.html (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/array/003.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/array/003.html        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+ &lt;head&gt;
+  &lt;title&gt;document.getElementsByClassName(array): &quot;b a&quot;&lt;/title&gt;
+  &lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
+ &lt;/head&gt;
+ &lt;body class=&quot;a b&quot;&gt;
+  &lt;p id=&quot;r&quot;&gt;FAIL (script did not run)&lt;/p&gt;
+  &lt;script&gt; t(document.getElementsByClassName([&quot;b a&quot;]), [document.body]) &lt;/script&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassNamearray004expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/array/004-expected.txt (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/array/004-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/array/004-expected.txt        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassNamearray004html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/array/004.html (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/array/004.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/array/004.html        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html class=&quot;a,b&quot;&gt;
+ &lt;head&gt;
+  &lt;title&gt;element.getElementsByClassName(array): &quot;a&quot;, &quot;b&quot;&lt;/title&gt;
+  &lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
+ &lt;/head&gt;
+ &lt;body class=&quot;a,b x&quot;&gt;
+  &lt;p id=&quot;r&quot; class=&quot;a,bx&quot;&gt;FAIL (script did not run)&lt;/p&gt;
+  &lt;script class=&quot;xa,b&quot;&gt; t(document.documentElement.getElementsByClassName([&quot;\fa&quot;,&quot;b\n&quot;]), [document.body]) &lt;/script&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassNamedumpNodeListexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/dumpNodeList-expected.txt (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/dumpNodeList-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/dumpNodeList-expected.txt        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+Line 1
+Line 2
+Line 3
+
+line 4
+line 5
+
+[object HTMLDivElement], [object HTMLDivElement], [object HTMLDivElement], length: 3
+[object HTMLDivElement], [object HTMLDivElement], [object HTMLDivElement], [object HTMLParagraphElement], length: 4
+[object HTMLDivElement], [object HTMLDivElement], length: 2
+[object HTMLDivElement], [object HTMLDivElement], length: 2
+length: 0
+length: 0
+length: 0
+length: 0
+length: 0
+[object HTMLDivElement], length: 1
+[object HTMLDivElement], [object HTMLParagraphElement], length: 2
+[object HTMLDivElement], length: 1
+[object HTMLDivElement], length: 1
+length: 0
+length: 0
+length: 0
+length: 0
+length: 0
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassNamedumpNodeListhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/dumpNodeList.html (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/dumpNodeList.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/dumpNodeList.html        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+&lt;html&gt;
+&lt;body&gt;
+&lt;div class=&quot;one&quot;&gt;Line 1&lt;div class=&quot;two&quot;&gt;Line 2&lt;/div&gt;&lt;p&gt;Line &lt;i&gt;3&lt;/i&gt;&lt;/p&gt;&lt;/div&gt;
+&lt;div id=&quot;test&quot; class=&quot;one two&quot;&gt;&lt;div class=&quot;one two&quot;&gt;line 4&lt;/div&gt;&lt;p class=&quot;two&quot;&gt;line 5&lt;/p&gt;&lt;/div&gt;
+&lt;p&gt;&lt;ol id=&quot;console&quot;&gt;&lt;/ol&gt;&lt;/p&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    function log(message)
+    {
+        var item = document.createElement(&quot;li&quot;);
+        item.appendChild(document.createTextNode(message));
+        document.getElementById(&quot;console&quot;).appendChild(item);
+    }
+    
+    NodeList.prototype.dump = function()
+    {
+        var result = &quot;&quot;;
+        var i = 0;
+        for (; i &lt; this.length; i++)
+            result += this[i] + &quot;, &quot;;
+        result += &quot;length: &quot; + i;
+        return result;
+    }
+
+    try {
+        var elm = document.getElementById(&quot;test&quot;);
+
+        log(document.getElementsByClassName(&quot;one&quot;).dump());
+        log(document.getElementsByClassName(&quot;two&quot;).dump());
+        log(document.getElementsByClassName(&quot;one two&quot;).dump());
+        log(document.getElementsByClassName(&quot;one\t\t\n \ftwo&quot;).dump());
+        log(document.getElementsByClassName(&quot;&quot;).dump());
+        log(document.getElementsByClassName(&quot;onetwo&quot;).dump());
+        log(document.getElementsByClassName().dump());
+        log(document.getElementsByClassName(null).dump());
+        log(document.getElementsByClassName(undefined).dump());
+
+        log(elm.getElementsByClassName(&quot;one&quot;).dump());
+        log(elm.getElementsByClassName(&quot;two&quot;).dump());
+        log(elm.getElementsByClassName(&quot;one two&quot;).dump());
+        log(elm.getElementsByClassName(&quot;one\t\t\n \ftwo&quot;).dump());
+        log(elm.getElementsByClassName(&quot;&quot;).dump());
+        log(elm.getElementsByClassName(&quot;onetwo&quot;).dump());
+        log(elm.getElementsByClassName().dump());
+        log(elm.getElementsByClassName(null).dump());
+        log(elm.getElementsByClassName(undefined).dump());
+    } catch (ex) {
+        log(&quot;Exception: &quot; + ex.description);
+    }
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomgetElementsByClassNameresourcescommonjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/getElementsByClassName/resources/common.js (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/getElementsByClassName/resources/common.js                                (rev 0)
+++ trunk/LayoutTests/fast/dom/getElementsByClassName/resources/common.js        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+// runs a test and writes a log
+function t(collection, elements) {
+  if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
+  var log = &quot;&quot;,
+      r = document.getElementById(&quot;r&quot;),
+      pass = true
+  if(collection.length != elements.length) {
+    pass = false
+    log += &quot;Got &quot; + collection.length + &quot; elements, expected &quot; + elements.length + &quot;. &quot;
+  }
+  for(var i = 0, max = collection.length &gt; elements.length ? elements.length : collection.length; i &lt; max; i++) {
+    if(collection[i] != elements[i]) {
+      pass = false
+      log += &quot;Got element `&quot; + collection[i].tagName + &quot;` (&quot; + collection[i].namespaceURI + &quot;)&quot;
+      log += &quot;, expected element `&quot; + elements[i].tagName + &quot;` (&quot; + elements[i].namespaceURI + &quot;). &quot;
+    }
+  }
+  r.textContent = pass ? &quot;PASS&quot; : &quot;FAIL (&quot; + log + &quot;)&quot;
+}
</ins></span></pre></div>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (28721 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2007-12-14 20:50:30 UTC (rev 28721)
+++ trunk/WebCore/ChangeLog        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -1,3 +1,79 @@
</span><ins>+2007-12-14  David Smith  &lt;catfish.man@gmail.com&gt;
+
+        Reviewed by Mitz.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=14955
+          Implement getElementsByClassName.
+
+        This patch also renames AtomicStringList to ClassNames to better reflect its actual use,
+        and takes advantage of admitting that it's class-specific to encapsulate class attribute 
+        parsing so it can be shared.  It also changes the class to use a Vector, rather than a linked
+        list to store the class names.
+
+        Tests: fast/dom/getElementsByClassName/001.html
+               fast/dom/getElementsByClassName/002.html
+               fast/dom/getElementsByClassName/003.html
+               fast/dom/getElementsByClassName/004.html
+               fast/dom/getElementsByClassName/005.html
+               fast/dom/getElementsByClassName/006.html
+               fast/dom/getElementsByClassName/007.html
+               fast/dom/getElementsByClassName/008.html
+               fast/dom/getElementsByClassName/009.html
+               fast/dom/getElementsByClassName/010.xml
+               fast/dom/getElementsByClassName/011.xml
+               fast/dom/getElementsByClassName/012.html
+               fast/dom/getElementsByClassName/013.html
+               fast/dom/getElementsByClassName/014.html
+               fast/dom/getElementsByClassName/array/001.html
+               fast/dom/getElementsByClassName/array/002.html
+               fast/dom/getElementsByClassName/array/003.html
+               fast/dom/getElementsByClassName/array/004.html
+               fast/dom/getElementsByClassName/dumpNodeList.html
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::matchRules):
+        (WebCore::CSSStyleSelector::checkOneSelector):
+        * dom/AtomicStringList.h: Removed.
+        * dom/ClassNames.cpp: Added.
+        (WebCore::ClassNames::contains):
+        (WebCore::ClassNames::parseClassAttribute):
+        * dom/ClassNames.h: Copied from WebCore/dom/AtomicStringList.h.
+        (WebCore::ClassNames::ClassNames):
+        (WebCore::ClassNames::size):
+        (WebCore::ClassNames::clear):
+        (WebCore::ClassNames::operator[]):
+        (WebCore::isClassWhitespace):
+        * dom/ClassNodeList.cpp: Added.
+        (WebCore::ClassNodeList::ClassNodeList):
+        (WebCore::ClassNodeList::length):
+        (WebCore::ClassNodeList::item):
+        (WebCore::ClassNodeList::nodeMatches):
+        * dom/ClassNodeList.h: Added.
+        * dom/Document.cpp:
+        (WebCore::Document::getElementsByName):
+        (WebCore::Document::getElementsByClassName):
+        * dom/Document.h:
+        * dom/Document.idl:
+        * dom/Element.cpp:
+        (WebCore::Element::getClassNames):
+        (WebCore::Element::getElementsByClassName):
+        * dom/Element.h:
+        * dom/Element.idl:
+        * dom/NameNodeList.cpp:
+        (WebCore::NameNodeList::NameNodeList):
+        (WebCore::NameNodeList::item):
+        (WebCore::NameNodeList::nodeMatches):
+        * dom/NameNodeList.h:
+        * dom/NamedMappedAttrMap.cpp:
+        (WebCore::NamedMappedAttrMap::clearAttributes):
+        (WebCore::NamedMappedAttrMap::parseClassAttribute):
+        * dom/NamedMappedAttrMap.h:
+        (WebCore::NamedMappedAttrMap::getClassNames):
+        * dom/StyledElement.cpp:
+        (WebCore::StyledElement::getClassNames):
+        * dom/StyledElement.h:
+
</ins><span class="cx"> 2007-12-14  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Sam.
</span></span></pre></div>
<a id="trunkWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.xcodeproj/project.pbxproj (28721 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.xcodeproj/project.pbxproj        2007-12-14 20:50:30 UTC (rev 28721)
+++ trunk/WebCore/WebCore.xcodeproj/project.pbxproj        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -1640,7 +1640,6 @@
</span><span class="cx">                 93F199BD08245E59001E9ABC /* AXObjectCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 55998A5C052B59CC0017A6C1 /* AXObjectCache.h */; };
</span><span class="cx">                 93F199BE08245E59001E9ABC /* BlockExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 65A640F00533BB1F0085E777 /* BlockExceptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 93F199C208245E59001E9ABC /* WebCoreKeyGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 84B2B1F7056BEF3A00D2B771 /* WebCoreKeyGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                93F199CF08245E59001E9ABC /* AtomicStringList.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3B364705C9D5E200E42902 /* AtomicStringList.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx">                 93F199DE08245E59001E9ABC /* Position.h in Headers */ = {isa = PBXBuildFile; fileRef = BE91FC8B06133666005E3790 /* Position.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 93F199E508245E59001E9ABC /* HTMLCanvasElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F6A3D60663BF04004D2919 /* HTMLCanvasElement.h */; };
</span><span class="cx">                 93F199E708245E59001E9ABC /* ClipboardMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D90660B0665D937006B6F1A /* ClipboardMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -3563,6 +3562,8 @@
</span><span class="cx">                 BC4918C90BFEA050009D6316 /* JSHTMLIFrameElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4918C30BFEA050009D6316 /* JSHTMLIFrameElement.h */; };
</span><span class="cx">                 BC491B780C023EFD009D6316 /* JSHTMLMarqueeElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC491B760C023EFD009D6316 /* JSHTMLMarqueeElement.cpp */; };
</span><span class="cx">                 BC491B790C023EFD009D6316 /* JSHTMLMarqueeElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC491B770C023EFD009D6316 /* JSHTMLMarqueeElement.h */; };
</span><ins>+                BC4BF9E40D11E133007D247F /* ClassNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC4BF9E20D11E133007D247F /* ClassNames.cpp */; };
+                BC4BF9E50D11E133007D247F /* ClassNames.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4BF9E30D11E133007D247F /* ClassNames.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 BC4EDEF40C08F3FB007EDD49 /* JSHTMLAppletElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC4EDEF30C08F3FB007EDD49 /* JSHTMLAppletElementCustom.cpp */; };
</span><span class="cx">                 BC5156E80C03B741008BB0EE /* DOMHTMLMarqueeElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = BC5156E50C03B741008BB0EE /* DOMHTMLMarqueeElement.h */; };
</span><span class="cx">                 BC5156E90C03B741008BB0EE /* DOMHTMLMarqueeElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC5156E60C03B741008BB0EE /* DOMHTMLMarqueeElement.mm */; };
</span><span class="lines">@@ -3620,6 +3621,8 @@
</span><span class="cx">                 BC82432C0D0CE8A200460C8F /* JSVoidCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8243280D0CE8A200460C8F /* JSVoidCallback.h */; };
</span><span class="cx">                 BC8243E80D0CFD7500460C8F /* WindowFeatures.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8243E60D0CFD7500460C8F /* WindowFeatures.cpp */; };
</span><span class="cx">                 BC8243E90D0CFD7500460C8F /* WindowFeatures.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8243E70D0CFD7500460C8F /* WindowFeatures.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                BC904B760D10998F00680D32 /* ClassNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC904B720D10998F00680D32 /* ClassNodeList.cpp */; };
+                BC904B770D10998F00680D32 /* ClassNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = BC904B730D10998F00680D32 /* ClassNodeList.h */; };
</ins><span class="cx">                 BC926F800C0552470082776B /* JSHTMLFrameSetElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC926F7E0C0552470082776B /* JSHTMLFrameSetElement.cpp */; };
</span><span class="cx">                 BC926F810C0552470082776B /* JSHTMLFrameSetElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC926F7F0C0552470082776B /* JSHTMLFrameSetElement.h */; };
</span><span class="cx">                 BC94D1080C274F88006BC617 /* PlatformScreenMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC94D1070C274F88006BC617 /* PlatformScreenMac.mm */; };
</span><span class="lines">@@ -7540,7 +7543,6 @@
</span><span class="cx">                 BC305C770C076BB300CD20F0 /* JSHTMLObjectElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLObjectElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BC305C780C076BB300CD20F0 /* JSHTMLObjectElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLObjectElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BC305CA30C0781BB00CD20F0 /* JSHTMLObjectElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLObjectElementCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                BC3B364705C9D5E200E42902 /* AtomicStringList.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = AtomicStringList.h; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</del><span class="cx">                 BC3C39B40C0D3D8D005F4D7A /* JSMediaList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaList.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BC3C39B50C0D3D8D005F4D7A /* JSMediaList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSMediaList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BC3FCAA80AC3DB5800BA54AD /* PlatformScrollBar.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PlatformScrollBar.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -7565,6 +7567,8 @@
</span><span class="cx">                 BC491B4E0C023E2D009D6316 /* HTMLMarqueeElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLMarqueeElement.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BC491B760C023EFD009D6316 /* JSHTMLMarqueeElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLMarqueeElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BC491B770C023EFD009D6316 /* JSHTMLMarqueeElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLMarqueeElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                BC4BF9E20D11E133007D247F /* ClassNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ClassNames.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                BC4BF9E30D11E133007D247F /* ClassNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClassNames.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 BC4EDEF30C08F3FB007EDD49 /* JSHTMLAppletElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLAppletElementCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BC5156E50C03B741008BB0EE /* DOMHTMLMarqueeElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMHTMLMarqueeElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BC5156E60C03B741008BB0EE /* DOMHTMLMarqueeElement.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMHTMLMarqueeElement.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -7623,6 +7627,8 @@
</span><span class="cx">                 BC8243280D0CE8A200460C8F /* JSVoidCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVoidCallback.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BC8243E60D0CFD7500460C8F /* WindowFeatures.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowFeatures.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BC8243E70D0CFD7500460C8F /* WindowFeatures.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowFeatures.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                BC904B720D10998F00680D32 /* ClassNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ClassNodeList.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                BC904B730D10998F00680D32 /* ClassNodeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClassNodeList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 BC926F7E0C0552470082776B /* JSHTMLFrameSetElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLFrameSetElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BC926F7F0C0552470082776B /* JSHTMLFrameSetElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLFrameSetElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BC94D1070C274F88006BC617 /* PlatformScreenMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformScreenMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -12092,7 +12098,6 @@
</span><span class="cx">                 F523D32402DE4478018635CA /* dom */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><del>-                                BC3B364705C9D5E200E42902 /* AtomicStringList.h */,
</del><span class="cx">                                 A8C4A7FC09D563270003AC8D /* Attr.cpp */,
</span><span class="cx">                                 A8C4A7FB09D563270003AC8D /* Attr.h */,
</span><span class="cx">                                 93EEC1E509C2877700C515D1 /* Attr.idl */,
</span><span class="lines">@@ -12110,6 +12115,10 @@
</span><span class="cx">                                 93EEC1E609C2877700C515D1 /* CharacterData.idl */,
</span><span class="cx">                                 A818721A0977D3C0005826D9 /* ChildNodeList.cpp */,
</span><span class="cx">                                 A81872150977D3C0005826D9 /* ChildNodeList.h */,
</span><ins>+                                BC4BF9E20D11E133007D247F /* ClassNames.cpp */,
+                                BC4BF9E30D11E133007D247F /* ClassNames.h */,
+                                BC904B720D10998F00680D32 /* ClassNodeList.cpp */,
+                                BC904B730D10998F00680D32 /* ClassNodeList.h */,
</ins><span class="cx">                                 A784941A0B5FE507001E237A /* Clipboard.cpp */,
</span><span class="cx">                                 85031B280A44EFC700F992E0 /* Clipboard.h */,
</span><span class="cx">                                 4B8AF4A90B1CE02B00687690 /* ClipboardAccessPolicy.h */,
</span><span class="lines">@@ -12270,7 +12279,6 @@
</span><span class="cx">                                 BCB16B8D0979B01400467741 /* ArrayImpl.h in Headers */,
</span><span class="cx">                                 B2C3DA1F0D006C1D00EF6F26 /* AtomicString.h in Headers */,
</span><span class="cx">                                 B2C3DA200D006C1D00EF6F26 /* AtomicStringImpl.h in Headers */,
</span><del>-                                93F199CF08245E59001E9ABC /* AtomicStringList.h in Headers */,
</del><span class="cx">                                 A8C4A80D09D563270003AC8D /* Attr.h in Headers */,
</span><span class="cx">                                 A8C4A80B09D563270003AC8D /* Attribute.h in Headers */,
</span><span class="cx">                                 514C766C0CE923A1007EF3CD /* AuthenticationChallenge.h in Headers */,
</span><span class="lines">@@ -14083,6 +14091,8 @@
</span><span class="cx">                                 93309DF8099E64920056E581 /* markup.h in Headers */,
</span><span class="cx">                                 93309E1E099E64920056E581 /* visible_units.h in Headers */,
</span><span class="cx">                                 51CBFC990D10E483002DBF51 /* CachedPagePlatformData.h in Headers */,
</span><ins>+                                BC904B770D10998F00680D32 /* ClassNodeList.h in Headers */,
+                                BC4BF9E50D11E133007D247F /* ClassNames.h in Headers */,
</ins><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span><span class="lines">@@ -15792,6 +15802,8 @@
</span><span class="cx">                                 93309DF7099E64920056E581 /* markup.cpp in Sources */,
</span><span class="cx">                                 93309E1D099E64920056E581 /* visible_units.cpp in Sources */,
</span><span class="cx">                                 93A38B4B0D0E5808006872C2 /* EditorCommand.cpp in Sources */,
</span><ins>+                                BC904B760D10998F00680D32 /* ClassNodeList.cpp in Sources */,
+                                BC4BF9E40D11E133007D247F /* ClassNames.cpp in Sources */,
</ins><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span></span></pre></div>
<a id="trunkWebCorecssCSSStyleSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/css/CSSStyleSelector.cpp (28721 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/css/CSSStyleSelector.cpp        2007-12-14 20:50:30 UTC (rev 28721)
+++ trunk/WebCore/css/CSSStyleSelector.cpp        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -390,8 +390,9 @@
</span><span class="cx">     if (element-&gt;hasID())
</span><span class="cx">         matchRulesForList(rules-&gt;getIDRules(element-&gt;getIDAttribute().impl()), firstRuleIndex, lastRuleIndex);
</span><span class="cx">     if (element-&gt;hasClass()) {
</span><del>-        for (const AtomicStringList* singleClass = element-&gt;getClassList(); singleClass; singleClass = singleClass-&gt;next())
-            matchRulesForList(rules-&gt;getClassRules(singleClass-&gt;string().impl()), firstRuleIndex, lastRuleIndex);
</del><ins>+        const ClassNames&amp; classNames = *element-&gt;getClassNames();
+        for (size_t i = 0; i &lt; classNames.size(); ++i)
+            matchRulesForList(rules-&gt;getClassRules(classNames[i].impl()), firstRuleIndex, lastRuleIndex);
</ins><span class="cx">     }
</span><span class="cx">     matchRulesForList(rules-&gt;getTagRules(element-&gt;localName().impl()), firstRuleIndex, lastRuleIndex);
</span><span class="cx">     matchRulesForList(rules-&gt;getUniversalRules(), firstRuleIndex, lastRuleIndex);
</span><span class="lines">@@ -1431,12 +1432,13 @@
</span><span class="cx">         if (sel-&gt;m_match == CSSSelector::Class) {
</span><span class="cx">             if (!e-&gt;hasClass())
</span><span class="cx">                 return false;
</span><del>-            for (const AtomicStringList* c = e-&gt;getClassList(); c; c = c-&gt;next())
-                if (c-&gt;string() == sel-&gt;m_value)
</del><ins>+            const ClassNames&amp; classNames = *e-&gt;getClassNames();
+            for (size_t i = 0; i &lt; classNames.size(); ++i) {
+                if (classNames[i] == sel-&gt;m_value)
</ins><span class="cx">                     return true;
</span><ins>+            }
</ins><span class="cx">             return false;
</span><del>-        }
-        else if (sel-&gt;m_match == CSSSelector::Id)
</del><ins>+        } else if (sel-&gt;m_match == CSSSelector::Id)
</ins><span class="cx">             return e-&gt;hasID() &amp;&amp; e-&gt;getIDAttribute() == sel-&gt;m_value;
</span><span class="cx">         else if (style &amp;&amp; (e != element || !styledElement || (!styledElement-&gt;isMappedAttribute(sel-&gt;m_attr) &amp;&amp; sel-&gt;m_attr != typeAttr &amp;&amp; sel-&gt;m_attr != readonlyAttr))) {
</span><span class="cx">             style-&gt;setAffectedByAttributeSelectors(); // Special-case the &quot;type&quot; and &quot;readonly&quot; attributes so input form controls can share style.
</span></span></pre></div>
<a id="trunkWebCoredomAtomicStringListh"></a>
<div class="delfile"><h4>Deleted: trunk/WebCore/dom/AtomicStringList.h (28721 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/dom/AtomicStringList.h        2007-12-14 20:50:30 UTC (rev 28721)
+++ trunk/WebCore/dom/AtomicStringList.h        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -1,51 +0,0 @@
</span><del>-/*
- * This file is part of the DOM implementation for KDE.
- *
- * Copyright (C) 2004 Apple Computer, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef AtomicStringList_h
-#define AtomicStringList_h
-
-#include &quot;AtomicString.h&quot;
-
-namespace WebCore {
-
-class AtomicStringList {
-public:
-    AtomicStringList() : m_next(0) {}
-    AtomicStringList(const AtomicString&amp; str, AtomicStringList* n = 0) : m_string(str), m_next(n) {}
-    ~AtomicStringList() { delete m_next; }
-    
-    AtomicStringList* next() const { return m_next; }
-    void setNext(AtomicStringList* n) { m_next = n; }
-    const AtomicString&amp; string() const { return m_string; }
-    void setString(const AtomicString&amp; str) { m_string = str; }
-
-    AtomicStringList* clone() { return new AtomicStringList(m_string, m_next ? m_next-&gt;clone() : 0); }
-    void clear() { m_string = nullAtom; delete m_next; m_next = 0; }
-    
-private:
-    AtomicString m_string;
-    AtomicStringList* m_next;
-};
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkWebCoredomClassNamescpp"></a>
<div class="addfile"><h4>Added: trunk/WebCore/dom/ClassNames.cpp (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/dom/ClassNames.cpp                                (rev 0)
+++ trunk/WebCore/dom/ClassNames.cpp        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,69 @@
</span><ins>+/*
+ * Copyright (C) 2007 David Smith (catfish.man@gmail.com)
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;ClassNames.h&quot;
+
+namespace WebCore {
+    
+bool ClassNames::contains(const AtomicString&amp; str) const 
+{
+    if (!m_nameVector)
+        return false;
+
+    for (size_t i = 0; i &lt; m_nameVector-&gt;size(); ++i) {
+        if ((*m_nameVector)[i] == str)
+            return true;
+    }
+
+    return false;
+}
+
+void ClassNames::parseClassAttribute(const String&amp; classStr, const bool inCompatMode)
+{
+    if (!m_nameVector)
+        m_nameVector.set(new Vector&lt;AtomicString&gt;);
+    else
+        m_nameVector-&gt;clear();
+
+    if (classStr.isEmpty())
+        return;
+
+    String classAttr = inCompatMode ? classStr.foldCase() : classStr;
+
+    const UChar* str = classAttr.characters();
+    const int length = classAttr.length();
+    int start = 0;
+    while (true) {
+        while (start &lt; length &amp;&amp; isClassWhitespace(str[start]))
+            ++start;
+        if (start &gt;= length)
+            break;
+        int end = start + 1;
+        while (end &lt; length &amp;&amp; !isClassWhitespace(str[end]))
+            ++end;
+
+        m_nameVector-&gt;append(AtomicString(str + start, end - start));
+
+        start = end + 1;
+    }
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkWebCoredomClassNameshfromrev28676trunkWebCoredomAtomicStringListh"></a>
<div class="copfile"><h4>Copied: trunk/WebCore/dom/ClassNames.h (from rev 28676, trunk/WebCore/dom/AtomicStringList.h) (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/dom/ClassNames.h                                (rev 0)
+++ trunk/WebCore/dom/ClassNames.h        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+/*
+ * Copyright (C) 2007 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef ClassNames_h
+#define ClassNames_h
+
+#include &quot;AtomicString.h&quot;
+#include &lt;wtf/Vector.h&gt;
+#include &lt;wtf/OwnPtr.h&gt;
+
+namespace WebCore {
+
+    class ClassNames {
+    public:
+        ClassNames()
+        {
+        }
+
+        bool contains(const AtomicString&amp;) const;
+        void parseClassAttribute(const String&amp;, const bool inCompatMode);
+
+        size_t size() const { return m_nameVector ? m_nameVector-&gt;size() : 0; }
+        void clear() { if (m_nameVector) m_nameVector-&gt;clear(); }
+        const AtomicString&amp; operator[](size_t i) const { return m_nameVector ? (*m_nameVector)[i] : nullAtom; }
+
+    private:
+        OwnPtr&lt;Vector&lt;AtomicString&gt; &gt; m_nameVector;
+    };
+
+    inline static bool isClassWhitespace(UChar c)
+    {
+        return c == ' ' || c == '\r' || c == '\n' || c == '\t' || c == '\f';
+    }
+
+} // namespace WebCore
+
+#endif // ClassNames_h
</ins></span></pre></div>
<a id="trunkWebCoredomClassNodeListcpp"></a>
<div class="addfile"><h4>Added: trunk/WebCore/dom/ClassNodeList.cpp (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/dom/ClassNodeList.cpp                                (rev 0)
+++ trunk/WebCore/dom/ClassNodeList.cpp        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,75 @@
</span><ins>+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 David Smith (catfish.man@gmail.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.
+ * 3.  Neither the name of Apple Computer, Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; 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 OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;ClassNodeList.h&quot;
+
+#include &quot;Document.h&quot;
+#include &quot;Element.h&quot;
+#include &quot;Node.h&quot;
+
+namespace WebCore {
+
+ClassNodeList::ClassNodeList(PassRefPtr&lt;Node&gt; rootNode, const AtomicString&amp; className)
+    : NodeList(rootNode)
+{
+    m_classNames.parseClassAttribute(className, m_rootNode-&gt;document()-&gt;inCompatMode());
+}
+
+unsigned ClassNodeList::length() const
+{
+    return recursiveLength();
+}
+
+Node* ClassNodeList::item(unsigned index) const
+{
+    return recursiveItem(index);
+}
+
+bool ClassNodeList::nodeMatches(Node* testNode) const
+{
+    if (!testNode-&gt;isElementNode())
+        return false;
+
+    if (!testNode-&gt;hasClass())
+        return false;
+
+    if (!m_classNames.size())
+        return false;
+
+    const ClassNames&amp; classes = *static_cast&lt;Element*&gt;(testNode)-&gt;getClassNames();
+    for (size_t i = 0; i &lt; m_classNames.size(); ++i) {
+        if (!classes.contains(m_classNames[i]))
+            return false;
+    }
+
+    return true;
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkWebCoredomClassNodeListh"></a>
<div class="addfile"><h4>Added: trunk/WebCore/dom/ClassNodeList.h (0 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/dom/ClassNodeList.h                                (rev 0)
+++ trunk/WebCore/dom/ClassNodeList.h        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 David Smith (catfish.man@gmail.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.
+ * 3.  Neither the name of Apple Computer, Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; 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 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 ClassNodeList_h
+#define ClassNodeList_h
+
+#include &quot;AtomicString.h&quot;
+#include &quot;ClassNames.h&quot;
+#include &quot;NodeList.h&quot;
+
+namespace WebCore {
+
+    class ClassNodeList : public NodeList {
+    public:
+        ClassNodeList(PassRefPtr&lt;Node&gt; rootNode, const AtomicString&amp; className);
+
+        virtual unsigned length() const;
+        virtual Node* item(unsigned index) const;
+
+    private:
+        virtual bool nodeMatches(Node*) const;
+
+        ClassNames m_classNames;
+    };
+
+} // namespace WebCore
+
+#endif // ClassNodeList_h
</ins></span></pre></div>
<a id="trunkWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/dom/Document.cpp (28721 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/dom/Document.cpp        2007-12-14 20:50:30 UTC (rev 28721)
+++ trunk/WebCore/dom/Document.cpp        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -30,10 +30,11 @@
</span><span class="cx"> #include &quot;CSSStyleSelector.h&quot;
</span><span class="cx"> #include &quot;CSSStyleSheet.h&quot;
</span><span class="cx"> #include &quot;CSSValueKeywords.h&quot;
</span><ins>+#include &quot;ClassNodeList.h&quot;
</ins><span class="cx"> #include &quot;Comment.h&quot;
</span><span class="cx"> #include &quot;CookieJar.h&quot;
</span><ins>+#include &quot;DOMImplementation.h&quot;
</ins><span class="cx"> #include &quot;DatabaseThread.h&quot;
</span><del>-#include &quot;DOMImplementation.h&quot;
</del><span class="cx"> #include &quot;DocLoader.h&quot;
</span><span class="cx"> #include &quot;DocumentFragment.h&quot;
</span><span class="cx"> #include &quot;DocumentLoader.h&quot;
</span><span class="lines">@@ -3494,11 +3495,16 @@
</span><span class="cx">     return iter-&gt;second;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;NameNodeList&gt; Document::getElementsByName(const String &amp;elementName)
</del><ins>+PassRefPtr&lt;NameNodeList&gt; Document::getElementsByName(const String&amp; elementName)
</ins><span class="cx"> {
</span><span class="cx">     return new NameNodeList(this, elementName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+PassRefPtr&lt;NodeList&gt; Document::getElementsByClassName(const String&amp; className)
+{
+    return new ClassNodeList(this, className);
+}
+
</ins><span class="cx"> void Document::finishedParsing()
</span><span class="cx"> {
</span><span class="cx">     setParsing(false);
</span></span></pre></div>
<a id="trunkWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/dom/Document.h (28721 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/dom/Document.h        2007-12-14 20:50:30 UTC (rev 28721)
+++ trunk/WebCore/dom/Document.h        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -213,6 +213,7 @@
</span><span class="cx">     PassRefPtr&lt;Node&gt; adoptNode(PassRefPtr&lt;Node&gt; source, ExceptionCode&amp;);
</span><span class="cx">     
</span><span class="cx">     PassRefPtr&lt;NameNodeList&gt; getElementsByName(const String&amp; elementName);
</span><ins>+    PassRefPtr&lt;NodeList&gt; getElementsByClassName(const String&amp; className);
</ins><span class="cx"> 
</span><span class="cx">     PassRefPtr&lt;HTMLCollection&gt; images();
</span><span class="cx">     PassRefPtr&lt;HTMLCollection&gt; embeds();
</span></span></pre></div>
<a id="trunkWebCoredomDocumentidl"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/dom/Document.idl (28721 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/dom/Document.idl        2007-12-14 20:50:30 UTC (rev 28721)
+++ trunk/WebCore/dom/Document.idl        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -220,6 +220,8 @@
</span><span class="cx">                                                   in [Optional] boolean authorOnly);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+        // HTML 5
+        NodeList            getElementsByClassName(in DOMString tagname);
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/dom/Element.cpp (28721 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/dom/Element.cpp        2007-12-14 20:50:30 UTC (rev 28721)
+++ trunk/WebCore/dom/Element.cpp        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -3,6 +3,7 @@
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Peter Kelly (pmk@post.com)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><ins>+ *           (C) 2007 David Smith (catfish.man@gmail.com)
</ins><span class="cx">  * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
</span><span class="cx">  *           (C) 2007 Eric Seidel (eric@webkit.org)
</span><span class="cx">  *
</span><span class="lines">@@ -26,6 +27,8 @@
</span><span class="cx"> #include &quot;Element.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CSSStyleSelector.h&quot;
</span><ins>+#include &quot;ClassNames.h&quot;
+#include &quot;ClassNodeList.h&quot;
</ins><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;Editor.h&quot;
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="lines">@@ -36,6 +39,7 @@
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;KURL.h&quot;
</span><span class="cx"> #include &quot;NamedAttrMap.h&quot;
</span><ins>+#include &quot;NodeList.h&quot;
</ins><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;RenderBlock.h&quot;
</span><span class="cx"> #include &quot;SelectionController.h&quot;
</span><span class="lines">@@ -196,7 +200,7 @@
</span><span class="cx">     return ELEMENT_NODE;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-const AtomicStringList* Element::getClassList() const
</del><ins>+const ClassNames* Element::getClassNames() const
</ins><span class="cx"> {
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -1119,6 +1123,11 @@
</span><span class="cx">     return rd-&gt;m_computedStyle;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+PassRefPtr&lt;NodeList&gt; Element::getElementsByClassName(const String&amp; className)
+{
+    return new ClassNodeList(this, className);
+}
+
</ins><span class="cx"> void Element::cancelFocusAppearanceUpdate()
</span><span class="cx"> {
</span><span class="cx">     if (ElementRareData* rd = rareData())
</span></span></pre></div>
<a id="trunkWebCoredomElementh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/dom/Element.h (28721 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/dom/Element.h        2007-12-14 20:50:30 UTC (rev 28721)
+++ trunk/WebCore/dom/Element.h        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -31,10 +31,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class AtomicStringList;
</del><span class="cx"> class Attr;
</span><span class="cx"> class Attribute;
</span><span class="cx"> class CSSStyleDeclaration;
</span><ins>+class ClassNames;
</ins><span class="cx"> class ElementRareData;
</span><span class="cx"> class IntSize;
</span><span class="cx"> 
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx">     ~Element();
</span><span class="cx"> 
</span><span class="cx">     // Used to quickly determine whether or not an element has a given CSS class.
</span><del>-    virtual const AtomicStringList* getClassList() const;
</del><ins>+    virtual const ClassNames* getClassNames() const;
</ins><span class="cx">     const AtomicString&amp; getIDAttribute() const;
</span><span class="cx">     bool hasAttribute(const QualifiedName&amp;) const;
</span><span class="cx">     const AtomicString&amp; getAttribute(const QualifiedName&amp;) const;
</span><span class="lines">@@ -162,6 +162,8 @@
</span><span class="cx">     virtual void focus(bool restorePreviousSelection = true);
</span><span class="cx">     virtual void updateFocusAppearance(bool restorePreviousSelection);
</span><span class="cx">     void blur();
</span><ins>+    
+    PassRefPtr&lt;NodeList&gt; getElementsByClassName(const String&amp;);
</ins><span class="cx"> 
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx">     virtual void dump(TextStream* , DeprecatedString ind = &quot;&quot;) const;
</span></span></pre></div>
<a id="trunkWebCoredomElementidl"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/dom/Element.idl (28721 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/dom/Element.idl        2007-12-14 20:50:30 UTC (rev 28721)
+++ trunk/WebCore/dom/Element.idl        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -102,6 +102,9 @@
</span><span class="cx">         void scrollByLines(in long lines);
</span><span class="cx">         void scrollByPages(in long pages);
</span><span class="cx"> 
</span><ins>+        // HTML 5
+        NodeList getElementsByClassName(in DOMString name);
+
</ins><span class="cx"> #if defined(LANGUAGE_OBJECTIVE_C)
</span><span class="cx">         // Objective-C extensions
</span><span class="cx">         readonly attribute DOMString innerText;
</span></span></pre></div>
<a id="trunkWebCoredomNameNodeListcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/dom/NameNodeList.cpp (28721 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/dom/NameNodeList.cpp        2007-12-14 20:50:30 UTC (rev 28721)
+++ trunk/WebCore/dom/NameNodeList.cpp        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -1,10 +1,8 @@
</span><span class="cx"> /**
</span><del>- * This file is part of the DOM implementation for KDE.
- *
</del><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2004 Apple Computer, Inc.
</del><ins>+ * Copyright (C) 2004, 2007 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -28,14 +26,13 @@
</span><span class="cx"> #include &quot;Element.h&quot;
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> 
</span><del>-using namespace WebCore;
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> using namespace HTMLNames;
</span><span class="cx"> 
</span><del>-NameNodeList::NameNodeList(Node *n, const String &amp;t)
-  : NodeList(n), nodeName(t)
</del><ins>+NameNodeList::NameNodeList(Node* root, const String&amp; name)
+    : NodeList(root)
+    , m_nodeName(name)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -44,14 +41,14 @@
</span><span class="cx">     return recursiveLength();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Node *NameNodeList::item (unsigned index) const
</del><ins>+Node* NameNodeList::item (unsigned index) const
</ins><span class="cx"> {
</span><span class="cx">     return recursiveItem(index);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool NameNodeList::nodeMatches(Node *testNode) const
</del><ins>+bool NameNodeList::nodeMatches(Node* testNode) const
</ins><span class="cx"> {
</span><del>-    return static_cast&lt;Element*&gt;(testNode)-&gt;getAttribute(nameAttr) == nodeName;
</del><ins>+    return static_cast&lt;Element*&gt;(testNode)-&gt;getAttribute(nameAttr) == m_nodeName;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-}
</del><ins>+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkWebCoredomNameNodeListh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/dom/NameNodeList.h (28721 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/dom/NameNodeList.h        2007-12-14 20:50:30 UTC (rev 28721)
+++ trunk/WebCore/dom/NameNodeList.h        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -1,10 +1,8 @@
</span><span class="cx"> /*
</span><del>- * This file is part of the DOM implementation for KDE.
- *
</del><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2004 Apple Computer, Inc.
</del><ins>+ * Copyright (C) 2004, 2007 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -35,7 +33,7 @@
</span><span class="cx">  */
</span><span class="cx"> class NameNodeList : public NodeList {
</span><span class="cx"> public:
</span><del>-    NameNodeList(Node* doc, const String&amp; name);
</del><ins>+    NameNodeList(Node* root, const String&amp; name);
</ins><span class="cx"> 
</span><span class="cx">     // DOM methods overridden from  parent classes
</span><span class="cx"> 
</span><span class="lines">@@ -48,7 +46,8 @@
</span><span class="cx"> protected:
</span><span class="cx">     virtual bool nodeMatches(Node* testNode) const;
</span><span class="cx"> 
</span><del>-    String nodeName;
</del><ins>+private:
+    String m_nodeName;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkWebCoredomNamedMappedAttrMapcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/dom/NamedMappedAttrMap.cpp (28721 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/dom/NamedMappedAttrMap.cpp        2007-12-14 20:50:30 UTC (rev 28721)
+++ trunk/WebCore/dom/NamedMappedAttrMap.cpp        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -3,6 +3,7 @@
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Peter Kelly (pmk@post.com)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><ins>+ *           (C) 2007 David Smith (catfish.man@gmail.com)
</ins><span class="cx">  * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -37,7 +38,7 @@
</span><span class="cx"> 
</span><span class="cx"> void NamedMappedAttrMap::clearAttributes()
</span><span class="cx"> {
</span><del>-    m_classList.clear();
</del><ins>+    m_classNames.clear();
</ins><span class="cx">     m_mappedAttributeCount = 0;
</span><span class="cx">     NamedAttrMap::clearAttributes();
</span><span class="cx"> }
</span><span class="lines">@@ -76,48 +77,15 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline static bool isClassWhitespace(UChar c)
-{
-    return c == ' ' || c == '\r' || c == '\n' || c == '\t';
-}
-
-void NamedMappedAttrMap::parseClassAttribute(const String&amp; classStr)
-{
-    m_classList.clear();
-    if (!element-&gt;hasClass())
</del><ins>+void NamedMappedAttrMap::parseClassAttribute(const String&amp; classStr) 
+{ 
+    if (!element-&gt;hasClass()) { 
+        m_classNames.clear(); 
</ins><span class="cx">         return;
</span><del>-    
-    String classAttr = element-&gt;document()-&gt;inCompatMode() ? 
-        (classStr.impl()-&gt;isLower() ? classStr : String(classStr.impl()-&gt;lower())) :
-        classStr;
-    
-    AtomicStringList* curr = 0;
-    
-    const UChar* str = classAttr.characters();
-    int length = classAttr.length();
-    int sPos = 0;
-
-    while (true) {
-        while (sPos &lt; length &amp;&amp; isClassWhitespace(str[sPos]))
-            ++sPos;
-        if (sPos &gt;= length)
-            break;
-        int ePos = sPos + 1;
-        while (ePos &lt; length &amp;&amp; !isClassWhitespace(str[ePos]))
-            ++ePos;
-        if (curr) {
-            curr-&gt;setNext(new AtomicStringList(AtomicString(str + sPos, ePos - sPos)));
-            curr = curr-&gt;next();
-        } else {
-            if (sPos == 0 &amp;&amp; ePos == length) {
-                m_classList.setString(AtomicString(classAttr));
-                break;
-            }
-            m_classList.setString(AtomicString(str + sPos, ePos - sPos));
-            curr = &amp;m_classList;
-        }
-        sPos = ePos + 1;
</del><span class="cx">     }
</span><ins>+
+    m_classNames.parseClassAttribute(classStr, element-&gt;document()-&gt;inCompatMode()); 
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkWebCoredomNamedMappedAttrMaph"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/dom/NamedMappedAttrMap.h (28721 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/dom/NamedMappedAttrMap.h        2007-12-14 20:50:30 UTC (rev 28721)
+++ trunk/WebCore/dom/NamedMappedAttrMap.h        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -5,6 +5,7 @@
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Peter Kelly (pmk@post.com)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><ins>+ *           (C) 2007 David Smith (catfish.man@gmail.com)
</ins><span class="cx">  * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -27,9 +28,9 @@
</span><span class="cx"> #ifndef NamedMappedAttrMap_h
</span><span class="cx"> #define NamedMappedAttrMap_h
</span><span class="cx"> 
</span><ins>+#include &quot;ClassNames.h&quot;
+#include &quot;MappedAttribute.h&quot;
</ins><span class="cx"> #include &quot;NamedAttrMap.h&quot;
</span><del>-#include &quot;AtomicStringList.h&quot;
-#include &quot;MappedAttribute.h&quot;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -42,8 +43,9 @@
</span><span class="cx">     
</span><span class="cx">     virtual bool isMappedAttributeMap() const;
</span><span class="cx">     
</span><del>-    virtual void parseClassAttribute(const String&amp; classAttr);
-    const AtomicStringList* getClassList() const { return &amp;m_classList; }
</del><ins>+    void parseClassAttribute(const String&amp;);
+
+    const ClassNames* getClassNames() const { return &amp;m_classNames; }
</ins><span class="cx">     
</span><span class="cx">     virtual bool hasMappedAttributes() const { return m_mappedAttributeCount &gt; 0; }
</span><span class="cx">     void declRemoved() { m_mappedAttributeCount--; }
</span><span class="lines">@@ -60,7 +62,7 @@
</span><span class="cx">         { return static_cast&lt;MappedAttribute*&gt;(NamedAttrMap::getAttributeItem(name)); }
</span><span class="cx">     
</span><span class="cx"> private:
</span><del>-    AtomicStringList m_classList;
</del><ins>+    ClassNames m_classNames;
</ins><span class="cx">     int m_mappedAttributeCount;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCoredomStyledElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/dom/StyledElement.cpp (28721 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/dom/StyledElement.cpp        2007-12-14 20:50:30 UTC (rev 28721)
+++ trunk/WebCore/dom/StyledElement.cpp        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include &quot;CSSStyleSelector.h&quot;
</span><span class="cx"> #include &quot;CSSStyleSheet.h&quot;
</span><span class="cx"> #include &quot;CSSValueKeywords.h&quot;
</span><ins>+#include &quot;ClassNames.h&quot;
</ins><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -103,11 +104,6 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline static bool isClassWhitespace(UChar c)
-{
-    return c == ' ' || c == '\r' || c == '\n' || c == '\t';
-}
-
</del><span class="cx"> StyledElement::StyledElement(const QualifiedName&amp; name, Document *doc)
</span><span class="cx">     : Element(name, doc)
</span><span class="cx"> {
</span><span class="lines">@@ -263,9 +259,9 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-const AtomicStringList* StyledElement::getClassList() const
</del><ins>+const ClassNames* StyledElement::getClassNames() const
</ins><span class="cx"> {
</span><del>-    return namedAttrMap ? mappedAttributes()-&gt;getClassList() : 0;
</del><ins>+    return namedAttrMap ? mappedAttributes()-&gt;getClassNames() : 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline int toHex(UChar c) {
</span></span></pre></div>
<a id="trunkWebCoredomStyledElementh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/dom/StyledElement.h (28721 => 28722)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/dom/StyledElement.h        2007-12-14 20:50:30 UTC (rev 28721)
+++ trunk/WebCore/dom/StyledElement.h        2007-12-14 21:48:20 UTC (rev 28722)
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx">     void invalidateStyleAttribute();
</span><span class="cx">     virtual void updateStyleAttributeIfNeeded() const;
</span><span class="cx">     
</span><del>-    virtual const AtomicStringList* getClassList() const;
</del><ins>+    virtual const ClassNames* getClassNames() const;
</ins><span class="cx">     virtual void attributeChanged(Attribute* attr, bool preserveDecls = false);
</span><span class="cx">     virtual void parseMappedAttribute(MappedAttribute* attr);
</span><span class="cx">     virtual bool mapToEntry(const QualifiedName&amp; attrName, MappedAttributeEntry&amp; result) const;
</span></span></pre>
</div>
</div>

</body>
</html>