diff options
author | Steve Block <steveblock@google.com> | 2011-05-06 11:45:16 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-05-12 13:44:10 +0100 |
commit | cad810f21b803229eb11403f9209855525a25d57 (patch) | |
tree | 29a6fd0279be608e0fe9ffe9841f722f0f4e4269 /Source/WebCore/css/CSSParserValues.h | |
parent | 121b0cf4517156d0ac5111caf9830c51b69bae8f (diff) | |
download | external_webkit-cad810f21b803229eb11403f9209855525a25d57.zip external_webkit-cad810f21b803229eb11403f9209855525a25d57.tar.gz external_webkit-cad810f21b803229eb11403f9209855525a25d57.tar.bz2 |
Merge WebKit at r75315: Initial merge by git.
Change-Id: I570314b346ce101c935ed22a626b48c2af266b84
Diffstat (limited to 'Source/WebCore/css/CSSParserValues.h')
-rw-r--r-- | Source/WebCore/css/CSSParserValues.h | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/Source/WebCore/css/CSSParserValues.h b/Source/WebCore/css/CSSParserValues.h new file mode 100644 index 0000000..993ae28 --- /dev/null +++ b/Source/WebCore/css/CSSParserValues.h @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2003 Lars Knoll (knoll@kde.org) + * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 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., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef CSSParserValues_h +#define CSSParserValues_h + +#include <wtf/text/AtomicString.h> + +namespace WebCore { + +class CSSValue; + +struct CSSParserString { + UChar* characters; + int length; + + void lower(); + + operator String() const { return String(characters, length); } + operator AtomicString() const { return AtomicString(characters, length); } +}; + +struct CSSParserFunction; + +struct CSSParserValue { + int id; + bool isInt; + union { + double fValue; + int iValue; + CSSParserString string; + CSSParserFunction* function; + }; + enum { + Operator = 0x100000, + Function = 0x100001, + Q_EMS = 0x100002 + }; + int unit; + + + PassRefPtr<CSSValue> createCSSValue(); +}; + +class CSSParserValueList : public FastAllocBase { +public: + CSSParserValueList() + : m_current(0) + { + } + ~CSSParserValueList(); + + void addValue(const CSSParserValue&); + void deleteValueAt(unsigned); + + unsigned size() const { return m_values.size(); } + CSSParserValue* current() { return m_current < m_values.size() ? &m_values[m_current] : 0; } + CSSParserValue* next() { ++m_current; return current(); } + + CSSParserValue* valueAt(unsigned i) { return i < m_values.size() ? &m_values[i] : 0; } + + void clear() { m_values.clear(); } + +private: + unsigned m_current; + Vector<CSSParserValue, 4> m_values; +}; + +struct CSSParserFunction : FastAllocBase { + CSSParserString name; + OwnPtr<CSSParserValueList> args; +}; + +} + +#endif |