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

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

Issue 1782833008: Add paint() function as valid CSS <image> type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 9 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "core/css/CSSPaintValue.h"
6
7 #include "core/css/CSSCustomIdentValue.h"
8 #include "platform/graphics/Image.h"
9 #include "wtf/text/StringBuilder.h"
10
11 namespace blink {
12
13 CSSPaintValue::CSSPaintValue(PassRefPtrWillBeRawPtr<CSSCustomIdentValue> name)
14 : CSSImageGeneratorValue(PaintClass)
15 , m_name(name)
16 {
17 }
18
19 CSSPaintValue::~CSSPaintValue()
20 {
21 }
22
23 String CSSPaintValue::customCSSText() const
24 {
25 StringBuilder result;
26 result.appendLiteral("paint(");
27 result.append(name());
Timothy Loh 2016/03/14 00:45:52 Actually this probably needs to be m_name->customC
ikilpatrick 2016/03/14 17:41:46 Done.
28 result.append(')');
29 return result.toString();
30 }
31
32 String CSSPaintValue::name() const
33 {
34 return m_name->value();
35 }
36
37 PassRefPtr<Image> CSSPaintValue::image(const LayoutObject*, const IntSize&)
38 {
39 // TODO(ikilpatrick): implement.
40 return nullptr;
41 }
42
43 bool CSSPaintValue::equals(const CSSPaintValue& other) const
44 {
45 return name() == other.name();
46 }
47
48 DEFINE_TRACE_AFTER_DISPATCH(CSSPaintValue)
49 {
50 visitor->trace(m_name);
51 CSSImageGeneratorValue::traceAfterDispatch(visitor);
52 }
53
54 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSPaintValue.h ('k') | third_party/WebKit/Source/core/css/CSSValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698