[Win] Cursor copy constructor does not initialize scale factor
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 24 Jan 2015 05:26:41 +0000 (05:26 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 24 Jan 2015 05:26:41 +0000 (05:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=140849

Reviewed by Antti Koivisto.

Found by fast/events/mouse-cursor-image-set.html

Make sure the scale factor is captured during copy construction. Also make sure
it is properly initialized in the default constructor, since it it used in the
Windows port for some default cursors.

* platform/CursorWin.h:
* platform/win/CursorWin.cpp:
(WebCore::Cursor::Cursor): Make sure copy constructor captures
the scale factor.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@179056 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/Cursor.h
Source/WebCore/platform/win/CursorWin.cpp

index 7e17c42..b3be9fc 100644 (file)
@@ -1,3 +1,21 @@
+2015-01-23  Brent Fulgham  <bfulgham@apple.com>
+
+        [Win] Cursor copy constructor does not initialize scale factor
+        https://bugs.webkit.org/show_bug.cgi?id=140849
+
+        Reviewed by Antti Koivisto.
+
+        Found by fast/events/mouse-cursor-image-set.html
+
+        Make sure the scale factor is captured during copy construction. Also make sure
+        it is properly initialized in the default constructor, since it it used in the
+        Windows port for some default cursors.
+
+        * platform/CursorWin.h:
+        * platform/win/CursorWin.cpp:
+        (WebCore::Cursor::Cursor): Make sure copy constructor captures
+        the scale factor.
+
 2015-01-23  Benjamin Poulain  <bpoulain@apple.com>
 
         Add pointer/hover media queries
index 5c1bd21..c4a3588 100644 (file)
@@ -133,6 +133,9 @@ namespace WebCore {
             // This is an invalid Cursor and should never actually get used.
             : m_type(static_cast<Type>(-1))
             , m_platformCursor(0)
+#if ENABLE(MOUSE_CURSOR_SCALE)
+            , m_imageScaleFactor(1)
+#endif
 #endif // !PLATFORM(IOS)
         {
         }
index a7d9c9f..80e96eb 100644 (file)
@@ -272,6 +272,9 @@ Cursor::Cursor(const Cursor& other)
     : m_type(other.m_type)
     , m_image(other.m_image)
     , m_hotSpot(other.m_hotSpot)
+#if ENABLE(MOUSE_CURSOR_SCALE)
+    , m_imageScaleFactor(other.m_imageScaleFactor)
+#endif
     , m_platformCursor(other.m_platformCursor)
 {
 }