Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Side by Side Diff: third_party/WebKit/Source/core/css/CSSCursorImageValue.h

Issue 2018923002: Fixed cursor hotspot SVG override and made CSSCursorImageValue constant (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Rob Buis <buis@kde.org> 2 * Copyright (C) 2006 Rob Buis <buis@kde.org>
3 * Copyright (C) 2008 Apple Inc. All right reserved. 3 * Copyright (C) 2008 Apple Inc. All right reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details. 13 * Library General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU Library General Public License 15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to 16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA. 18 * Boston, MA 02110-1301, USA.
19 */ 19 */
20 20
21 #ifndef CSSCursorImageValue_h 21 #ifndef CSSCursorImageValue_h
22 #define CSSCursorImageValue_h 22 #define CSSCursorImageValue_h
23 23
24 #include "core/css/CSSImageValue.h" 24 #include "core/css/CSSImageValue.h"
25 #include "core/svg/SVGCursorElement.h"
25 #include "platform/geometry/IntPoint.h" 26 #include "platform/geometry/IntPoint.h"
26 #include "wtf/HashSet.h" 27 #include "wtf/HashSet.h"
27 28
28 namespace blink { 29 namespace blink {
29 30
30 class Element; 31 class Element;
31 class SVGElement; 32 class SVGElement;
32 33
33 class CSSCursorImageValue : public CSSValue { 34 class CSSCursorImageValue : public CSSValue {
34 public: 35 public:
35 static CSSCursorImageValue* create(CSSValue* imageValue, bool hotSpotSpecifi ed, const IntPoint& hotSpot) 36 static CSSCursorImageValue* create(CSSValue* imageValue, bool hotSpotSpecifi ed, const IntPoint& hotSpot)
36 { 37 {
37 return new CSSCursorImageValue(imageValue, hotSpotSpecified, hotSpot); 38 return new CSSCursorImageValue(imageValue, hotSpotSpecified, hotSpot);
38 } 39 }
39 40
40 ~CSSCursorImageValue(); 41 ~CSSCursorImageValue();
41 42
42 bool hotSpotSpecified() const { return m_hotSpotSpecified; } 43 bool hotSpotSpecified() const { return m_hotSpotSpecified; }
43 44
44 IntPoint hotSpot() const { return m_hotSpot; } 45 IntPoint hotSpot() const { return m_hotSpot; }
45 46
46 String customCSSText() const; 47 String customCSSText() const;
47 48
48 bool updateIfSVGCursorIsUsed(Element*); 49 SVGCursorElement* getSVGCursorElement(Element*) const;
50
51 void clearImageResource() const;
49 bool isCachePending(float deviceScaleFactor) const; 52 bool isCachePending(float deviceScaleFactor) const;
53 String cachedImageURL() const;
50 StyleImage* cachedImage(float deviceScaleFactor) const; 54 StyleImage* cachedImage(float deviceScaleFactor) const;
51 StyleImage* cacheImage(Document*, float deviceScaleFactor); 55 StyleImage* cacheImage(Document*, float deviceScaleFactor);
52 56
53 bool equals(const CSSCursorImageValue&) const; 57 bool equals(const CSSCursorImageValue&) const;
54 58
55 DECLARE_TRACE_AFTER_DISPATCH(); 59 DECLARE_TRACE_AFTER_DISPATCH();
56 60
57 private: 61 private:
58 CSSCursorImageValue(CSSValue* imageValue, bool hotSpotSpecified, const IntPo int& hotSpot); 62 CSSCursorImageValue(CSSValue* imageValue, bool hotSpotSpecified, const IntPo int& hotSpot);
59 63
60 bool isSVGCursor() const; 64 bool hasFragmentInURL() const;
61 String cachedImageURL();
62 void clearImageResource();
63 65
64 Member<CSSValue> m_imageValue; 66 Member<CSSValue> m_imageValue;
65 67
66 bool m_hotSpotSpecified; 68 bool m_hotSpotSpecified;
67 IntPoint m_hotSpot; 69 IntPoint m_hotSpot;
68 bool m_isCachePending; 70 mutable bool m_isCachePending;
69 Member<StyleImage> m_cachedImage; 71 mutable Member<StyleImage> m_cachedImage;
70 }; 72 };
71 73
72 DEFINE_CSS_VALUE_TYPE_CASTS(CSSCursorImageValue, isCursorImageValue()); 74 DEFINE_CSS_VALUE_TYPE_CASTS(CSSCursorImageValue, isCursorImageValue());
73 75
74 } // namespace blink 76 } // namespace blink
75 77
76 #endif // CSSCursorImageValue_h 78 #endif // CSSCursorImageValue_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698