OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 public: | 44 public: |
45 static StylePendingImage* create(const CSSValue& value) { | 45 static StylePendingImage* create(const CSSValue& value) { |
46 return new StylePendingImage(value); | 46 return new StylePendingImage(value); |
47 } | 47 } |
48 | 48 |
49 WrappedImagePtr data() const override { return m_value.get(); } | 49 WrappedImagePtr data() const override { return m_value.get(); } |
50 | 50 |
51 CSSValue* cssValue() const override { return m_value; } | 51 CSSValue* cssValue() const override { return m_value; } |
52 | 52 |
53 CSSValue* computedCSSValue() const override { | 53 CSSValue* computedCSSValue() const override { |
54 ASSERT_NOT_REACHED(); | 54 NOTREACHED(); |
55 return nullptr; | 55 return nullptr; |
56 } | 56 } |
57 | 57 |
58 CSSImageValue* cssImageValue() const { | 58 CSSImageValue* cssImageValue() const { |
59 return m_value->isImageValue() ? toCSSImageValue(m_value.get()) : 0; | 59 return m_value->isImageValue() ? toCSSImageValue(m_value.get()) : 0; |
60 } | 60 } |
61 CSSPaintValue* cssPaintValue() const { | 61 CSSPaintValue* cssPaintValue() const { |
62 return m_value->isPaintValue() ? toCSSPaintValue(m_value.get()) : 0; | 62 return m_value->isPaintValue() ? toCSSPaintValue(m_value.get()) : 0; |
63 } | 63 } |
64 CSSImageGeneratorValue* cssImageGeneratorValue() const { | 64 CSSImageGeneratorValue* cssImageGeneratorValue() const { |
(...skipping 10 matching lines...) Expand all Loading... |
75 const LayoutSize& /*defaultObjectSize*/) const override { | 75 const LayoutSize& /*defaultObjectSize*/) const override { |
76 return LayoutSize(); | 76 return LayoutSize(); |
77 } | 77 } |
78 bool imageHasRelativeSize() const override { return false; } | 78 bool imageHasRelativeSize() const override { return false; } |
79 bool usesImageContainerSize() const override { return false; } | 79 bool usesImageContainerSize() const override { return false; } |
80 void addClient(LayoutObject*) override {} | 80 void addClient(LayoutObject*) override {} |
81 void removeClient(LayoutObject*) override {} | 81 void removeClient(LayoutObject*) override {} |
82 PassRefPtr<Image> image(const LayoutObject&, | 82 PassRefPtr<Image> image(const LayoutObject&, |
83 const IntSize&, | 83 const IntSize&, |
84 float) const override { | 84 float) const override { |
85 ASSERT_NOT_REACHED(); | 85 NOTREACHED(); |
86 return nullptr; | 86 return nullptr; |
87 } | 87 } |
88 bool knownToBeOpaque(const LayoutObject&) const override { return false; } | 88 bool knownToBeOpaque(const LayoutObject&) const override { return false; } |
89 | 89 |
90 DEFINE_INLINE_VIRTUAL_TRACE() { | 90 DEFINE_INLINE_VIRTUAL_TRACE() { |
91 visitor->trace(m_value); | 91 visitor->trace(m_value); |
92 StyleImage::trace(visitor); | 92 StyleImage::trace(visitor); |
93 } | 93 } |
94 | 94 |
95 private: | 95 private: |
96 explicit StylePendingImage(const CSSValue& value) | 96 explicit StylePendingImage(const CSSValue& value) |
97 : m_value(const_cast<CSSValue*>(&value)) { | 97 : m_value(const_cast<CSSValue*>(&value)) { |
98 m_isPendingImage = true; | 98 m_isPendingImage = true; |
99 } | 99 } |
100 | 100 |
101 // TODO(sashab): Replace this with <const CSSValue> once Member<> | 101 // TODO(sashab): Replace this with <const CSSValue> once Member<> |
102 // supports const types. | 102 // supports const types. |
103 Member<CSSValue> m_value; | 103 Member<CSSValue> m_value; |
104 }; | 104 }; |
105 | 105 |
106 DEFINE_STYLE_IMAGE_TYPE_CASTS(StylePendingImage, isPendingImage()); | 106 DEFINE_STYLE_IMAGE_TYPE_CASTS(StylePendingImage, isPendingImage()); |
107 | 107 |
108 } // namespace blink | 108 } // namespace blink |
109 #endif | 109 #endif |
OLD | NEW |