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

Side by Side Diff: Source/core/css/CSSPrimitiveValue.cpp

Issue 1307673003: Made CSSPrimitiveValue::getString() only work for String types (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@split_out_pair
Patch Set: Small fix Created 5 years, 3 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, 2012 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserv ed.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 } 741 }
742 742
743 String CSSPrimitiveValue::getStringValue() const 743 String CSSPrimitiveValue::getStringValue() const
744 { 744 {
745 switch (type()) { 745 switch (type()) {
746 case UnitType::CustomIdentifier: 746 case UnitType::CustomIdentifier:
747 case UnitType::String: 747 case UnitType::String:
748 case UnitType::Attribute: 748 case UnitType::Attribute:
749 case UnitType::URI: 749 case UnitType::URI:
750 return m_value.string; 750 return m_value.string;
751 case UnitType::ValueID:
752 return valueName(m_value.valueID);
753 case UnitType::PropertyID:
754 return propertyName(m_value.propertyID);
755 default: 751 default:
756 break; 752 break;
757 } 753 }
758 754
755 ASSERT_NOT_REACHED();
759 return String(); 756 return String();
760 } 757 }
761 758
762 static String formatNumber(double number, const char* suffix, unsigned suffixLen gth) 759 static String formatNumber(double number, const char* suffix, unsigned suffixLen gth)
763 { 760 {
764 #if OS(WIN) && _MSC_VER < 1900 761 #if OS(WIN) && _MSC_VER < 1900
765 unsigned oldFormat = _set_output_format(_TWO_DIGIT_EXPONENT); 762 unsigned oldFormat = _set_output_format(_TWO_DIGIT_EXPONENT);
766 #endif 763 #endif
767 String result = String::format("%.6g", number); 764 String result = String::format("%.6g", number);
768 #if OS(WIN) && _MSC_VER < 1900 765 #if OS(WIN) && _MSC_VER < 1900
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 visitor->trace(m_value.shape); 1025 visitor->trace(m_value.shape);
1029 break; 1026 break;
1030 default: 1027 default:
1031 break; 1028 break;
1032 } 1029 }
1033 #endif 1030 #endif
1034 CSSValue::traceAfterDispatch(visitor); 1031 CSSValue::traceAfterDispatch(visitor);
1035 } 1032 }
1036 1033
1037 } // namespace blink 1034 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698