| 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 RawPtr<StyleInvalidImage> create(const String& url) |
| 16 { | 16 { |
| 17 return adoptRefWillBeNoop(new StyleInvalidImage(url)); | 17 return 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 RawPtr<CSSValue> cssValue() const override { return CSSImageValue::create(At
omicString(m_url)); } |
| 23 | 23 |
| 24 PassRefPtrWillBeRawPtr<CSSValue> computedCSSValue() const override { return
cssValue(); } | 24 RawPtr<CSSValue> computedCSSValue() const override { return cssValue(); } |
| 25 | 25 |
| 26 LayoutSize imageSize(const LayoutObject&, float /*multiplier*/, const Layout
Size& /*defaultObjectSize*/) const override { return LayoutSize(); } | 26 LayoutSize imageSize(const LayoutObject&, float /*multiplier*/, const Layout
Size& /*defaultObjectSize*/) const override { return LayoutSize(); } |
| 27 bool imageHasRelativeSize() const override { return false; } | 27 bool imageHasRelativeSize() const override { return false; } |
| 28 bool usesImageContainerSize() const override { return false; } | 28 bool usesImageContainerSize() const override { return false; } |
| 29 void addClient(LayoutObject*) override { } | 29 void addClient(LayoutObject*) override { } |
| 30 void removeClient(LayoutObject*) override { } | 30 void removeClient(LayoutObject*) override { } |
| 31 PassRefPtr<Image> image(const LayoutObject&, const IntSize&, float) const ov
erride | 31 PassRefPtr<Image> image(const LayoutObject&, const IntSize&, float) const ov
erride |
| 32 { | 32 { |
| 33 return nullptr; | 33 return nullptr; |
| 34 } | 34 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 46 m_isInvalidImage = true; | 46 m_isInvalidImage = true; |
| 47 } | 47 } |
| 48 | 48 |
| 49 String m_url; | 49 String m_url; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 DEFINE_STYLE_IMAGE_TYPE_CASTS(StyleInvalidImage, isInvalidImage()); | 52 DEFINE_STYLE_IMAGE_TYPE_CASTS(StyleInvalidImage, isInvalidImage()); |
| 53 | 53 |
| 54 } // namespace blink | 54 } // namespace blink |
| 55 #endif | 55 #endif |
| OLD | NEW |