| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/css/CSSFunctionValue.h" | 5 #include "core/css/CSSFunctionValue.h" |
| 6 | 6 |
| 7 #include "core/css/serializer/CSSDeserializeStream.h" |
| 8 #include "core/css/serializer/CSSSerializeStream.h" |
| 7 #include "wtf/text/StringBuilder.h" | 9 #include "wtf/text/StringBuilder.h" |
| 8 | 10 |
| 9 namespace blink { | 11 namespace blink { |
| 10 | 12 |
| 13 PassRefPtrWillBeRawPtr<CSSFunctionValue> CSSFunctionValue::deserializeAfterDispa
tch(unsigned bitfields, CSSDeserializeStream* stream) |
| 14 { |
| 15 CSSValueID valueID = static_cast<CSSValueID>(stream->readUnsigned()); |
| 16 return adoptRefWillBeNoop(new CSSFunctionValue(bitfields, valueID, stream)); |
| 17 } |
| 18 |
| 19 CSSFunctionValue::CSSFunctionValue(unsigned bitfields, CSSValueID id, CSSDeseria
lizeStream* stream) |
| 20 : CSSValueList(FunctionClass, bitfields, stream) |
| 21 , m_valueID(id) |
| 22 { |
| 23 } |
| 24 |
| 11 String CSSFunctionValue::customCSSText() const | 25 String CSSFunctionValue::customCSSText() const |
| 12 { | 26 { |
| 13 StringBuilder result; | 27 StringBuilder result; |
| 14 result.append(getValueName(m_valueID)); | 28 result.append(getValueName(m_valueID)); |
| 15 result.append('('); | 29 result.append('('); |
| 16 result.append(CSSValueList::customCSSText()); | 30 result.append(CSSValueList::customCSSText()); |
| 17 result.append(')'); | 31 result.append(')'); |
| 18 return result.toString(); | 32 return result.toString(); |
| 19 } | 33 } |
| 20 | 34 |
| 35 void CSSFunctionValue::serializeAfterDispatch(CSSSerializeStream* stream) const |
| 36 { |
| 37 stream->writeUnsigned(m_valueID); |
| 38 CSSValueList::serializeAfterDispatch(stream); |
| 21 } | 39 } |
| 40 } |
| OLD | NEW |