Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Side by Side Diff: third_party/WebKit/Source/core/css/StylePropertySerializer.h

Issue 1988013003: Move generic shorthand serialization checks out of specific routines (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shorthand1
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
5 * Copyright (C) 2013 Intel Corporation. All rights reserved. 5 * Copyright (C) 2013 Intel Corporation. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 30 matching lines...) Expand all
41 String getPropertyValue(CSSPropertyID) const; 41 String getPropertyValue(CSSPropertyID) const;
42 private: 42 private:
43 String getCommonValue(const StylePropertyShorthand&) const; 43 String getCommonValue(const StylePropertyShorthand&) const;
44 String borderPropertyValue() const; 44 String borderPropertyValue() const;
45 String getLayeredShorthandValue(const StylePropertyShorthand&) const; 45 String getLayeredShorthandValue(const StylePropertyShorthand&) const;
46 String get4Values(const StylePropertyShorthand&) const; 46 String get4Values(const StylePropertyShorthand&) const;
47 String borderSpacingValue(const StylePropertyShorthand&) const; 47 String borderSpacingValue(const StylePropertyShorthand&) const;
48 String getShorthandValue(const StylePropertyShorthand&, String separator = " ") const; 48 String getShorthandValue(const StylePropertyShorthand&, String separator = " ") const;
49 String fontValue() const; 49 String fontValue() const;
50 String fontVariantValue() const; 50 String fontVariantValue() const;
51 void appendFontLonghandValueIfNotNormal(CSSPropertyID, StringBuilder& result , String& value) const; 51 void appendFontLonghandValueIfNotNormal(CSSPropertyID, StringBuilder& result ) const;
52 String backgroundRepeatPropertyValue() const; 52 String backgroundRepeatPropertyValue() const;
53 String getPropertyText(CSSPropertyID, const String& value, bool isImportant, bool isNotFirstDecl) const; 53 String getPropertyText(CSSPropertyID, const String& value, bool isImportant, bool isNotFirstDecl) const;
54 bool isPropertyShorthandAvailable(const StylePropertyShorthand&) const; 54 bool isPropertyShorthandAvailable(const StylePropertyShorthand&) const;
55 bool shorthandHasOnlyInitialOrInheritedValue(const StylePropertyShorthand&) const; 55 bool shorthandHasOnlyInitialOrInheritedValue(const StylePropertyShorthand&) const;
56 void appendBackgroundPropertyAsText(StringBuilder& result, unsigned& numDecl s) const; 56 void appendBackgroundPropertyAsText(StringBuilder& result, unsigned& numDecl s) const;
57 57
58 // Valid if all we can serialize to just a css-wide keyword.
59 // Invalid if either some longhands are not set, the important flag not set
60 // consistently, or any css-wide keywords are used.
61 // Unknown otherwise.
62 enum CommonCheckResult { Valid, Invalid, Unknown };
63 CommonCheckResult commonShorthandChecks(const StylePropertyShorthand&, Strin g& result) const;
alancutter (OOO until 2018) 2016/05/20 01:57:12 This could return String instead of needing a sepa
Timothy Loh 2016/05/20 06:10:53 Done.
64
58 // Only StylePropertySerializer uses the following two classes. 65 // Only StylePropertySerializer uses the following two classes.
59 class PropertyValueForSerializer { 66 class PropertyValueForSerializer {
60 STACK_ALLOCATED(); 67 STACK_ALLOCATED();
61 public: 68 public:
62 explicit PropertyValueForSerializer(StylePropertySet::PropertyReference property) 69 explicit PropertyValueForSerializer(StylePropertySet::PropertyReference property)
63 : m_value(property.value()) 70 : m_value(property.value())
64 , m_id(property.id()) 71 , m_id(property.id())
65 , m_isImportant(property.isImportant()) 72 , m_isImportant(property.isImportant())
66 , m_isImplicit(property.isImplicit()) 73 , m_isImplicit(property.isImplicit())
67 , m_isInherited(property.isInherited()) { } 74 , m_isInherited(property.isInherited()) { }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 std::bitset<numCSSProperties> m_longhandPropertyUsed; 122 std::bitset<numCSSProperties> m_longhandPropertyUsed;
116 bool m_needToExpandAll; 123 bool m_needToExpandAll;
117 }; 124 };
118 125
119 const StylePropertySetForSerializer m_propertySet; 126 const StylePropertySetForSerializer m_propertySet;
120 }; 127 };
121 128
122 } // namespace blink 129 } // namespace blink
123 130
124 #endif // StylePropertySerializer_h 131 #endif // StylePropertySerializer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698