OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef StyleInvalidImage_h | 5 #ifndef StyleInvalidImage_h |
6 #define StyleInvalidImage_h | 6 #define StyleInvalidImage_h |
7 | 7 |
8 #include "core/css/CSSImageValue.h" | 8 #include "core/css/CSSImageValue.h" |
9 #include "core/style/StyleImage.h" | 9 #include "core/style/StyleImage.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class StyleInvalidImage final : public StyleImage { | 13 class StyleInvalidImage final : public StyleImage { |
14 public: | 14 public: |
15 static PassRefPtrWillBeRawPtr<StyleInvalidImage> create(const String& url) | 15 static PassRefPtrWillBeRawPtr<StyleInvalidImage> create(const String& url) |
16 { | 16 { |
17 return adoptRefWillBeNoop(new StyleInvalidImage(url)); | 17 return adoptRefWillBeNoop(new StyleInvalidImage(url)); |
18 } | 18 } |
19 | 19 |
20 WrappedImagePtr data() const override { return m_url.impl(); } | 20 WrappedImagePtr data() const override { return m_url.impl(); } |
21 | 21 |
22 PassRefPtrWillBeRawPtr<CSSValue> cssValue() const override { return CSSImage
Value::create(AtomicString(m_url)); } | 22 PassRefPtrWillBeRawPtr<CSSValue> cssValue() const override { return CSSImage
Value::create(AtomicString(m_url)); } |
23 | 23 |
24 PassRefPtrWillBeRawPtr<CSSValue> computedCSSValue() const override { return
cssValue(); } | 24 PassRefPtrWillBeRawPtr<CSSValue> computedCSSValue() const override { return
cssValue(); } |
25 | 25 |
26 LayoutSize imageSize(const LayoutObject*, float /*multiplier*/) const overri
de { return LayoutSize(); } | 26 LayoutSize concreteObjectSize(const LayoutObject*, const FloatSize& /*defaul
tObjectSize*/, float /*multiplier*/) const override { return LayoutSize(); } |
27 bool imageHasRelativeSize() const override { return false; } | 27 bool imageHasRelativeSize() const override { return false; } |
28 void computeIntrinsicDimensions(const LayoutObject*, FloatSize& /* intrinsic
Size */, FloatSize& /* intrinsicRatio */) override { } | 28 void computeIntrinsicDimensions(const LayoutObject*, FloatSize& /* intrinsic
Size */, FloatSize& /* intrinsicRatio */) override { } |
29 bool usesImageContainerSize() const override { return false; } | 29 bool usesImageContainerSize() const override { return false; } |
30 void addClient(LayoutObject*) override { } | 30 void addClient(LayoutObject*) override { } |
31 void removeClient(LayoutObject*) override { } | 31 void removeClient(LayoutObject*) override { } |
32 PassRefPtr<Image> image(const LayoutObject*, const IntSize&, float) const ov
erride | 32 PassRefPtr<Image> image(const LayoutObject*, const IntSize&, float) const ov
erride |
33 { | 33 { |
34 return nullptr; | 34 return nullptr; |
35 } | 35 } |
36 bool knownToBeOpaque(const LayoutObject*) const override { return false; } | 36 bool knownToBeOpaque(const LayoutObject*) const override { return false; } |
(...skipping 10 matching lines...) Expand all Loading... |
47 m_isInvalidImage = true; | 47 m_isInvalidImage = true; |
48 } | 48 } |
49 | 49 |
50 String m_url; | 50 String m_url; |
51 }; | 51 }; |
52 | 52 |
53 DEFINE_STYLE_IMAGE_TYPE_CASTS(StyleInvalidImage, isInvalidImage()); | 53 DEFINE_STYLE_IMAGE_TYPE_CASTS(StyleInvalidImage, isInvalidImage()); |
54 | 54 |
55 } // namespace blink | 55 } // namespace blink |
56 #endif | 56 #endif |
OLD | NEW |