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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSFunctionValue.cpp

Issue 1481383002: [Experimental] CSSSerializer Proof-of-concept Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: snapshot: top_25 sites ser/dser now works Created 4 years, 11 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 // 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 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSFunctionValue.h ('k') | third_party/WebKit/Source/core/css/CSSGradientValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698