2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
24 #include "misc/AtomicString.h"
25 #include <wtf/Vector.h>
26 #include <wtf/OwnPtr.h>
28 using khtml::AtomicString
;
33 typedef Vector
<khtml::AtomicString
, 8> ClassNameVector
;
39 bool contains(const khtml::AtomicString
& str
) const
44 size_t size
= m_nameVector
->size();
45 for (size_t i
= 0; i
< size
; ++i
) {
46 if (m_nameVector
->at(i
) == str
)
53 void parseClassAttribute(const DOMString
&, bool inCompatMode
);
55 size_t size() const { return m_nameVector
? m_nameVector
->size() : 0; }
56 void clear() { if (m_nameVector
) m_nameVector
->clear(); }
57 const khtml::AtomicString
& operator[](size_t i
) const { ASSERT(m_nameVector
); return m_nameVector
->at(i
); }
60 OwnPtr
<ClassNameVector
> m_nameVector
;
63 inline static bool isClassWhitespace(QChar c
)
65 return c
== ' ' || c
== '\r' || c
== '\n' || c
== '\t' || c
== '\f';
70 #endif // ClassNames_h