| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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/CSSRayValue.h" |
| 6 |
| 7 #include "core/css/CSSIdentifierValue.h" |
| 8 #include "core/css/CSSPrimitiveValue.h" |
| 9 #include "platform/wtf/text/StringBuilder.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 CSSRayValue* CSSRayValue::Create(const CSSPrimitiveValue& angle, |
| 14 const CSSIdentifierValue& size, |
| 15 const CSSIdentifierValue* contain) { |
| 16 return new CSSRayValue(angle, size, contain); |
| 17 } |
| 18 |
| 19 CSSRayValue::CSSRayValue(const CSSPrimitiveValue& angle, |
| 20 const CSSIdentifierValue& size, |
| 21 const CSSIdentifierValue* contain) |
| 22 : CSSValue(kRayClass), angle_(&angle), size_(&size), contain_(contain) {} |
| 23 |
| 24 String CSSRayValue::CustomCSSText() const { |
| 25 StringBuilder result; |
| 26 result.Append("ray("); |
| 27 result.Append(angle_->CssText()); |
| 28 result.Append(' '); |
| 29 result.Append(size_->CssText()); |
| 30 if (contain_) { |
| 31 result.Append(' '); |
| 32 result.Append(contain_->CssText()); |
| 33 } |
| 34 result.Append(')'); |
| 35 return result.ToString(); |
| 36 } |
| 37 |
| 38 bool CSSRayValue::Equals(const CSSRayValue& other) const { |
| 39 return DataEquivalent(angle_, other.angle_) && |
| 40 DataEquivalent(size_, other.size_) && |
| 41 DataEquivalent(contain_, other.contain_); |
| 42 } |
| 43 |
| 44 DEFINE_TRACE_AFTER_DISPATCH(CSSRayValue) { |
| 45 visitor->Trace(angle_); |
| 46 visitor->Trace(size_); |
| 47 visitor->Trace(contain_); |
| 48 CSSValue::TraceAfterDispatch(visitor); |
| 49 } |
| 50 |
| 51 } // namespace blink |
| OLD | NEW |