OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 bool isPending() const { return !m_accessedBestFitImage; } | 57 bool isPending() const { return !m_accessedBestFitImage; } |
58 | 58 |
59 struct ImageWithScale { | 59 struct ImageWithScale { |
60 ALLOW_ONLY_INLINE_ALLOCATION(); | 60 ALLOW_ONLY_INLINE_ALLOCATION(); |
61 String imageURL; | 61 String imageURL; |
62 Referrer referrer; | 62 Referrer referrer; |
63 float scaleFactor; | 63 float scaleFactor; |
64 }; | 64 }; |
65 | 65 |
| 66 PassRefPtrWillBeRawPtr<CSSImageSetValue> valueWithURLsMadeAbsolute(); |
| 67 |
66 bool hasFailedOrCanceledSubresources() const; | 68 bool hasFailedOrCanceledSubresources() const; |
67 | 69 |
68 DECLARE_TRACE_AFTER_DISPATCH(); | 70 DECLARE_TRACE_AFTER_DISPATCH(); |
69 | 71 |
70 protected: | 72 protected: |
71 ImageWithScale bestImageForScaleFactor(); | 73 ImageWithScale bestImageForScaleFactor(); |
72 | 74 |
73 private: | 75 private: |
74 CSSImageSetValue(); | 76 CSSImageSetValue(); |
75 | 77 |
76 void fillImageSet(); | 78 void fillImageSet(); |
77 static inline bool compareByScaleFactor(ImageWithScale first, ImageWithScale
second) { return first.scaleFactor < second.scaleFactor; } | 79 static inline bool compareByScaleFactor(ImageWithScale first, ImageWithScale
second) { return first.scaleFactor < second.scaleFactor; } |
78 | 80 |
79 RefPtrWillBeMember<StyleImage> m_imageSet; | 81 RefPtrWillBeMember<StyleImage> m_imageSet; |
80 bool m_accessedBestFitImage; | 82 bool m_accessedBestFitImage; |
81 | 83 |
82 // This represents the scale factor that we used to find the best fit image.
It does not necessarily | 84 // This represents the scale factor that we used to find the best fit image.
It does not necessarily |
83 // correspond to the scale factor of the best fit image. | 85 // correspond to the scale factor of the best fit image. |
84 float m_scaleFactor; | 86 float m_scaleFactor; |
85 | 87 |
86 Vector<ImageWithScale> m_imagesInSet; | 88 Vector<ImageWithScale> m_imagesInSet; |
87 }; | 89 }; |
88 | 90 |
89 DEFINE_CSS_VALUE_TYPE_CASTS(CSSImageSetValue, isImageSetValue()); | 91 DEFINE_CSS_VALUE_TYPE_CASTS(CSSImageSetValue, isImageSetValue()); |
90 | 92 |
91 } // namespace blink | 93 } // namespace blink |
92 | 94 |
93 #endif // CSSImageSetValue_h | 95 #endif // CSSImageSetValue_h |
OLD | NEW |