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 18 matching lines...) Expand all Loading... |
29 #include "core/css/CSSCursorImageValue.h" | 29 #include "core/css/CSSCursorImageValue.h" |
30 #include "core/css/CSSImageGeneratorValue.h" | 30 #include "core/css/CSSImageGeneratorValue.h" |
31 #include "core/css/CSSImageSetValue.h" | 31 #include "core/css/CSSImageSetValue.h" |
32 #include "core/css/CSSImageValue.h" | 32 #include "core/css/CSSImageValue.h" |
33 #include "core/css/CSSPaintValue.h" | 33 #include "core/css/CSSPaintValue.h" |
34 #include "core/style/StyleImage.h" | 34 #include "core/style/StyleImage.h" |
35 #include "platform/graphics/Image.h" | 35 #include "platform/graphics/Image.h" |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 | 38 |
39 // StylePendingImage is a placeholder StyleImage that is entered into the Comput
edStyle during | 39 // StylePendingImage is a placeholder StyleImage that is entered into the |
40 // style resolution, in order to avoid loading images that are not referenced by
the final style. | 40 // ComputedStyle during style resolution, in order to avoid loading images that |
41 // They should never exist in a ComputedStyle after it has been returned from th
e style selector. | 41 // are not referenced by the final style. They should never exist in a |
| 42 // ComputedStyle after it has been returned from the style selector. |
42 | 43 |
43 class StylePendingImage final : public StyleImage { | 44 class StylePendingImage final : public StyleImage { |
44 public: | 45 public: |
45 static StylePendingImage* create(const CSSValue& value) { | 46 static StylePendingImage* create(const CSSValue& value) { |
46 return new StylePendingImage(value); | 47 return new StylePendingImage(value); |
47 } | 48 } |
48 | 49 |
49 WrappedImagePtr data() const override { return m_value.get(); } | 50 WrappedImagePtr data() const override { return m_value.get(); } |
50 | 51 |
51 CSSValue* cssValue() const override { return m_value; } | 52 CSSValue* cssValue() const override { return m_value; } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 105 |
105 // TODO(sashab): Replace this with <const CSSValue> once Member<> | 106 // TODO(sashab): Replace this with <const CSSValue> once Member<> |
106 // supports const types. | 107 // supports const types. |
107 Member<CSSValue> m_value; | 108 Member<CSSValue> m_value; |
108 }; | 109 }; |
109 | 110 |
110 DEFINE_STYLE_IMAGE_TYPE_CASTS(StylePendingImage, isPendingImage()); | 111 DEFINE_STYLE_IMAGE_TYPE_CASTS(StylePendingImage, isPendingImage()); |
111 | 112 |
112 } // namespace blink | 113 } // namespace blink |
113 #endif | 114 #endif |
OLD | NEW |