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

Unified Diff: Source/core/css/parser/CSSParserToken.cpp

Issue 646893003: CSS Tokenizer: Comprehensive unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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/parser/CSSParserToken.cpp
diff --git a/Source/core/css/parser/CSSParserToken.cpp b/Source/core/css/parser/CSSParserToken.cpp
index e936c08b66315c490096e117ea8c97638617083c..9c7f39f8455bd9a74e61153c3b36c079a819772b 100644
--- a/Source/core/css/parser/CSSParserToken.cpp
+++ b/Source/core/css/parser/CSSParserToken.cpp
@@ -67,41 +67,6 @@ void CSSParserToken::convertToPercentage()
m_unit = CSSPrimitiveValue::CSS_PERCENTAGE;
}
-// This function is used only for testing
-// FIXME - This doesn't cover all possible Token types, but it's enough for current testing.
-String CSSParserToken::textForUnitTests() const
-{
- if (!m_value.isNull())
- return m_value;
- if (m_type == LeftParenthesisToken)
- return "(";
- if (m_type == RightParenthesisToken)
- return ")";
- if (m_type == ColonToken)
- return ":";
- if (m_type == WhitespaceToken)
- return " ";
- if (m_delimiter)
- return String("'") + m_delimiter + '\'';
-
- if (m_numericValue) {
- String unit;
- if (m_unit == CSSPrimitiveValue::CSS_PERCENTAGE)
- unit = "%";
- else if (m_unit == CSSPrimitiveValue::CSS_PX)
- unit = "px";
- else if (m_unit == CSSPrimitiveValue::CSS_EMS)
- unit = "em";
- else if (m_unit != CSSPrimitiveValue::CSS_NUMBER)
- unit = "other";
- if (m_numericValueType == IntegerValueType)
- return String::number(static_cast<int>(m_numericValue)) + unit;
- const unsigned fractionalDigits = 6;
- return String::numberToStringFixedWidth(m_numericValue, fractionalDigits) + unit;
- }
- return String();
-}
-
UChar CSSParserToken::delimiter() const
{
ASSERT(m_type == DelimiterToken);

Powered by Google App Engine
This is Rietveld 408576698