| Index: Source/core/css/parser/CSSParser.h
|
| diff --git a/Source/core/css/parser/CSSParser.h b/Source/core/css/parser/CSSParser.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b57c63665f7cfa6b0ff1e0752ca1fe4366d406ee
|
| --- /dev/null
|
| +++ b/Source/core/css/parser/CSSParser.h
|
| @@ -0,0 +1,107 @@
|
| +/*
|
| + * Copyright (C) 2013 Google Inc. All rights reserved.
|
| + *
|
| + * Redistribution and use in source and binary forms, with or without
|
| + * modification, are permitted provided that the following conditions are
|
| + * met:
|
| + *
|
| + * * Redistributions of source code must retain the above copyright
|
| + * notice, this list of conditions and the following disclaimer.
|
| + * * 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.
|
| + * * Neither the name of Google Inc. 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 THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
| + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
| + * OWNER OR 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 CSSParser_h
|
| +#define CSSParser_h
|
| +
|
| +// This class serves as the public API for the CSSParser subsystem
|
| +// and should have as few methods as possible.
|
| +
|
| +// Like HTMLDocumentParser is for the HTML Parser subsystem,
|
| +// CSSParser's job is to coordinate between the various objects in
|
| +// the CSS parsing subsystem, but should itself have very little code.
|
| +
|
| +// FIXME: Ideally BisonCSSParser would be an OwnPtr and we could
|
| +// remove this include and make BisonCSSParser private to the
|
| +// subsystem. However, CSSParser is spun up for tiny parses and
|
| +// the extra malloc could be a perf hit.
|
| +#include "core/css/parser/BisonCSSParser.h"
|
| +
|
| +namespace WebCore {
|
| +
|
| +class CSSParser {
|
| + WTF_MAKE_NONCOPYABLE(CSSParser);
|
| +public:
|
| +
|
| + CSSParser(const CSSParserContext&, UseCounter* = 0);
|
| +
|
| + // Only used by StyleSheetContents.cpp and InspectorStyleSheet.cpp
|
| + void parseSheet(StyleSheetContents*, const String&, const TextPosition& startPosition = TextPosition::minimumPosition(), CSSParserObserver* = 0, bool = false);
|
| +
|
| + // Only used by StylePropertySet.cpp
|
| + bool parseDeclaration(MutableStylePropertySet*, const String&, CSSParserObserver*, StyleSheetContents* contextStyleSheet);
|
| +
|
| + // Most CSSParser clients only instantiate a CSSParser just to call parseSelector (once).
|
| + // FIXME: Replace this with a static which does the same thing?
|
| + // Perhaps that static should be on CSSSelectorList itself?
|
| + void parseSelector(const String&, CSSSelectorList&);
|
| +
|
| + PassRefPtr<StyleRuleBase> parseRule(StyleSheetContents*, const String&);
|
| +
|
| + // Only used by CSSKeyframesRule.cpp (plural)
|
| + PassRefPtr<StyleKeyframe> parseKeyframeRule(StyleSheetContents*, const String&);
|
| +
|
| + // Only used by CSSKeyframeRule.cpp (single), always in HTMLStandardMode.
|
| + PassOwnPtr<Vector<double> > parseKeyframeKeyList(const String&);
|
| +
|
| + // Only used by MediaList.cpp, always in HTMLStandardMode.
|
| + PassRefPtr<MediaQuerySet> parseMediaQueryList(const String&);
|
| +
|
| + // Only used by DOMWindowCSS.cpp, always in HTMLStandardMode.
|
| + bool parseSupportsCondition(const String&);
|
| +
|
| + // FIXME: Color parsing should probably be split out into a separate
|
| + // object which is used by CSSParser.
|
| + static bool parseColor(RGBA32& color, const String&, bool strict = false);
|
| +
|
| + // Only for CanvasStyle.cpp
|
| + static bool parseSystemColor(RGBA32& color, const String&, Document*);
|
| +
|
| + static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String&, bool important, CSSParserMode, StyleSheetContents*);
|
| +
|
| + // FIXME: This appears to be a helper only used by StyleBuilderCustom.cpp
|
| + static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String&, bool important, const Document&);
|
| +
|
| + // Only used by Element.cpp
|
| + static PassRefPtr<ImmutableStylePropertySet> parseInlineStyleDeclaration(const String&, Element*);
|
| +
|
| + // Only used by CSSValuePool.cpp.
|
| + static PassRefPtr<CSSValueList> parseFontFaceValue(const AtomicString&);
|
| +
|
| +private:
|
| + BisonCSSParser m_bisonParser;
|
| +};
|
| +
|
| +// FIXME: This has nothing to do with the parser!
|
| +CSSPropertyID cssPropertyID(const String&);
|
| +
|
| +}
|
| +
|
| +#endif // CSSParser_h
|
|
|