diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/build/scripts/core/css/templates/style_property_shorthand.h.tmpl')
-rw-r--r-- | chromium/third_party/blink/renderer/build/scripts/core/css/templates/style_property_shorthand.h.tmpl | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/chromium/third_party/blink/renderer/build/scripts/core/css/templates/style_property_shorthand.h.tmpl b/chromium/third_party/blink/renderer/build/scripts/core/css/templates/style_property_shorthand.h.tmpl new file mode 100644 index 00000000000..715ce15bbc8 --- /dev/null +++ b/chromium/third_party/blink/renderer/build/scripts/core/css/templates/style_property_shorthand.h.tmpl @@ -0,0 +1,79 @@ +/* + * (C) 1999-2003 Lars Knoll (knoll@kde.org) + * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2013 Intel Corporation. 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. + */ + +{% from 'templates/macros.tmpl' import source_files_for_generated_file %} +{{source_files_for_generated_file(template_file, input_files)}} + +#ifndef BLINK_CORE_STYLE_PROPERTY_SHORTHAND_H_ +#define BLINK_CORE_STYLE_PROPERTY_SHORTHAND_H_ + +#include "css_property_names.h" +#include "third_party/blink/renderer/core/css/properties/css_property.h" +#include "third_party/blink/renderer/platform/wtf/vector.h" + +namespace blink { + +class StylePropertyShorthand { + USING_FAST_MALLOC(StylePropertyShorthand); + public: + constexpr StylePropertyShorthand() + : m_properties(0), + m_length(0), + m_shorthandID(CSSPropertyInvalid) {} + + constexpr StylePropertyShorthand(CSSPropertyID id, + const CSSProperty** properties, + unsigned numProperties) + : m_properties(properties), + m_length(numProperties), + m_shorthandID(id) {} + + const CSSProperty** properties() const { return m_properties; } + unsigned length() const { return m_length; } + CSSPropertyID id() const { return m_shorthandID; } + + private: + const CSSProperty** m_properties; + unsigned m_length; + CSSPropertyID m_shorthandID; +}; + +{% for property in properties %} +const StylePropertyShorthand& {{property.lower_camel_name}}Shorthand(); +{% endfor %} + +const StylePropertyShorthand& animationShorthandForParsing(); +const StylePropertyShorthand& transitionShorthandForParsing(); + +// Returns an empty list if the property is not a shorthand. +const StylePropertyShorthand& shorthandForProperty(CSSPropertyID); + +// Return the list of shorthands for a given longhand. +// The client must pass in an empty result vector. +void getMatchingShorthandsForLonghand( + CSSPropertyID, Vector<StylePropertyShorthand, 4>* result); + +unsigned indexOfShorthandForLonghand(CSSPropertyID, + const Vector<StylePropertyShorthand, 4>&); + +} // namespace blink + +#endif // BLINK_CORE_STYLE_PROPERTY_SHORTHAND_H_ |