Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |