OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/style/BorderEdge.h" | 5 #include "core/style/BorderEdge.h" |
6 | 6 |
7 namespace blink { | 7 namespace blink { |
8 | 8 |
9 BorderEdge::BorderEdge(float edgeWidth, | 9 BorderEdge::BorderEdge(float edgeWidth, |
10 const Color& edgeColor, | 10 const Color& edgeColor, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 return false; | 51 return false; |
52 | 52 |
53 return true; | 53 return true; |
54 } | 54 } |
55 | 55 |
56 float BorderEdge::usedWidth() const { | 56 float BorderEdge::usedWidth() const { |
57 return isPresent ? m_width : 0; | 57 return isPresent ? m_width : 0; |
58 } | 58 } |
59 | 59 |
60 float BorderEdge::getDoubleBorderStripeWidth(DoubleBorderStripe stripe) const { | 60 float BorderEdge::getDoubleBorderStripeWidth(DoubleBorderStripe stripe) const { |
61 ASSERT(stripe == DoubleBorderStripeOuter || | 61 DCHECK(stripe == DoubleBorderStripeOuter || |
62 stripe == DoubleBorderStripeInner); | 62 stripe == DoubleBorderStripeInner); |
63 | 63 |
64 return roundf(stripe == DoubleBorderStripeOuter ? usedWidth() / 3 | 64 return roundf(stripe == DoubleBorderStripeOuter ? usedWidth() / 3 |
65 : (usedWidth() * 2) / 3); | 65 : (usedWidth() * 2) / 3); |
66 } | 66 } |
67 | 67 |
68 bool BorderEdge::sharesColorWith(const BorderEdge& other) const { | 68 bool BorderEdge::sharesColorWith(const BorderEdge& other) const { |
69 return color == other.color; | 69 return color == other.color; |
70 } | 70 } |
71 | 71 |
72 } // namespace blink | 72 } // namespace blink |
OLD | NEW |