Index: trunk/Source/core/css/Pair.h |
=================================================================== |
--- trunk/Source/core/css/Pair.h (revision 157750) |
+++ trunk/Source/core/css/Pair.h (working copy) |
@@ -34,69 +34,52 @@ |
// it (eliminating some extra -webkit- internal properties). |
class Pair : public RefCounted<Pair> { |
public: |
- enum IdenticalValuesPolicy { DropIdenticalValues, KeepIdenticalValues }; |
- |
static PassRefPtr<Pair> create() |
{ |
return adoptRef(new Pair); |
} |
- static PassRefPtr<Pair> create(PassRefPtr<CSSPrimitiveValue> first, PassRefPtr<CSSPrimitiveValue> second, IdenticalValuesPolicy identicalValuesPolicy) |
+ static PassRefPtr<Pair> create(PassRefPtr<CSSPrimitiveValue> first, PassRefPtr<CSSPrimitiveValue> second) |
{ |
- return adoptRef(new Pair(first, second, identicalValuesPolicy)); |
+ return adoptRef(new Pair(first, second)); |
} |
virtual ~Pair() { } |
CSSPrimitiveValue* first() const { return m_first.get(); } |
CSSPrimitiveValue* second() const { return m_second.get(); } |
- IdenticalValuesPolicy identicalValuesPolicy() const { return m_identicalValuesPolicy; } |
void setFirst(PassRefPtr<CSSPrimitiveValue> first) { m_first = first; } |
void setSecond(PassRefPtr<CSSPrimitiveValue> second) { m_second = second; } |
- void setIdenticalValuesPolicy(IdenticalValuesPolicy identicalValuesPolicy) { m_identicalValuesPolicy = identicalValuesPolicy; } |
String cssText() const |
{ |
- return generateCSSString(first()->cssText(), second()->cssText(), m_identicalValuesPolicy); |
- } |
- bool equals(const Pair& other) const |
- { |
- return compareCSSValuePtr(m_first, other.m_first) |
- && compareCSSValuePtr(m_second, other.m_second) |
- && m_identicalValuesPolicy == other.m_identicalValuesPolicy; |
+ return generateCSSString(first()->cssText(), second()->cssText()); |
} |
+ bool equals(const Pair& other) const { return compareCSSValuePtr(m_first, other.m_first) && compareCSSValuePtr(m_second, other.m_second); } |
+ |
String serializeResolvingVariables(const HashMap<AtomicString, String>& variables) const |
{ |
- return generateCSSString( |
- first()->customSerializeResolvingVariables(variables), |
- second()->customSerializeResolvingVariables(variables), |
- m_identicalValuesPolicy); |
+ return generateCSSString(first()->customSerializeResolvingVariables(variables), |
+ second()->customSerializeResolvingVariables(variables)); |
} |
bool hasVariableReference() const { return first()->hasVariableReference() || second()->hasVariableReference(); } |
private: |
- Pair() |
- : m_first(0) |
- , m_second(0) |
- , m_identicalValuesPolicy(DropIdenticalValues) { } |
+ Pair() : m_first(0), m_second(0) { } |
+ Pair(PassRefPtr<CSSPrimitiveValue> first, PassRefPtr<CSSPrimitiveValue> second) |
+ : m_first(first), m_second(second) { } |
- Pair(PassRefPtr<CSSPrimitiveValue> first, PassRefPtr<CSSPrimitiveValue> second, IdenticalValuesPolicy identicalValuesPolicy) |
- : m_first(first) |
- , m_second(second) |
- , m_identicalValuesPolicy(identicalValuesPolicy) { } |
- |
- static String generateCSSString(const String& first, const String& second, IdenticalValuesPolicy identicalValuesPolicy) |
+ static String generateCSSString(const String& first, const String& second) |
{ |
- if (identicalValuesPolicy == DropIdenticalValues && first == second) |
+ if (first == second) |
return first; |
return first + ' ' + second; |
} |
RefPtr<CSSPrimitiveValue> m_first; |
RefPtr<CSSPrimitiveValue> m_second; |
- IdenticalValuesPolicy m_identicalValuesPolicy; |
}; |
} // namespace |