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

Unified Diff: Source/core/css/CSSPrimitiveValue.cpp

Issue 1317523002: Changed Pair to be a CSSValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@add_const_to_primvalue
Patch Set: Fixed some callsites from bad rebase Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/css/CSSPrimitiveValue.cpp
diff --git a/Source/core/css/CSSPrimitiveValue.cpp b/Source/core/css/CSSPrimitiveValue.cpp
index 58e3b9caee0064ebca5136018d6f6753c7990788..95e9b3b0bbeebe21c38c7dcc41bac05f23bd0d1a 100644
--- a/Source/core/css/CSSPrimitiveValue.cpp
+++ b/Source/core/css/CSSPrimitiveValue.cpp
@@ -26,7 +26,6 @@
#include "core/css/CSSHelper.h"
#include "core/css/CSSMarkup.h"
#include "core/css/CSSToLengthConversionData.h"
-#include "core/css/Pair.h"
#include "core/css/StyleSheetContents.h"
#include "core/dom/Node.h"
#include "core/style/ComputedStyle.h"
@@ -243,12 +242,6 @@ CSSPrimitiveValue::CSSPrimitiveValue(const String& str, UnitType type)
m_value.string->ref();
}
-CSSPrimitiveValue::CSSPrimitiveValue(const LengthSize& lengthSize, const ComputedStyle& style)
- : CSSValue(PrimitiveClass)
-{
- init(lengthSize, style);
-}
-
CSSPrimitiveValue::CSSPrimitiveValue(RGBA32 color)
: CSSValue(PrimitiveClass)
{
@@ -333,20 +326,6 @@ void CSSPrimitiveValue::init(UnitType type)
m_primitiveUnitType = static_cast<unsigned>(type);
}
-void CSSPrimitiveValue::init(const LengthSize& lengthSize, const ComputedStyle& style)
-{
- init(UnitType::Pair);
- m_hasCachedCSSText = false;
- m_value.pair = Pair::create(create(lengthSize.width(), style.effectiveZoom()), create(lengthSize.height(), style.effectiveZoom()), Pair::KeepIdenticalValues).leakRef();
-}
-
-void CSSPrimitiveValue::init(PassRefPtrWillBeRawPtr<Pair> p)
-{
- init(UnitType::Pair);
- m_hasCachedCSSText = false;
- m_value.pair = p.leakRef();
-}
-
void CSSPrimitiveValue::init(PassRefPtrWillBeRawPtr<CSSCalcValue> c)
{
init(UnitType::Calc);
@@ -376,12 +355,6 @@ void CSSPrimitiveValue::cleanup()
if (m_value.string)
m_value.string->deref();
break;
- case UnitType::Pair:
- // We must not call deref() when oilpan is enabled because m_value.pair is traced.
-#if !ENABLE(OILPAN)
- m_value.pair->deref();
-#endif
- break;
case UnitType::Calc:
// We must not call deref() when oilpan is enabled because m_value.calc is traced.
#if !ENABLE(OILPAN)
@@ -878,7 +851,6 @@ const char* CSSPrimitiveValue::unitTypeToString(UnitType type)
case UnitType::PropertyID:
case UnitType::Attribute:
case UnitType::RGBColor:
- case UnitType::Pair:
case UnitType::Calc:
case UnitType::Shape:
case UnitType::CalcPercentageWithNumber:
@@ -965,9 +937,6 @@ String CSSPrimitiveValue::customCSSText() const
text = Color(m_value.rgbcolor).serializedAsCSSComponentValue();
break;
}
- case UnitType::Pair:
- text = getPairValue()->cssText();
- break;
case UnitType::Calc:
text = m_value.calc->customCSSText();
break;
@@ -1034,8 +1003,6 @@ bool CSSPrimitiveValue::equals(const CSSPrimitiveValue& other) const
return equal(m_value.string, other.m_value.string);
case UnitType::RGBColor:
return m_value.rgbcolor == other.m_value.rgbcolor;
- case UnitType::Pair:
- return m_value.pair && other.m_value.pair && m_value.pair->equals(*other.m_value.pair);
case UnitType::Calc:
return m_value.calc && other.m_value.calc && m_value.calc->equals(*other.m_value.calc);
case UnitType::Shape:
@@ -1054,9 +1021,6 @@ DEFINE_TRACE_AFTER_DISPATCH(CSSPrimitiveValue)
{
#if ENABLE(OILPAN)
switch (type()) {
- case UnitType::Pair:
- visitor->trace(m_value.pair);
- break;
case UnitType::Calc:
visitor->trace(m_value.calc);
break;

Powered by Google App Engine
This is Rietveld 408576698