Title: [178424] trunk/Source/WebCore
Revision
178424
Author
[email protected]
Date
2015-01-14 10:25:44 -0800 (Wed, 14 Jan 2015)

Log Message

[Win] Layout Test fast/css/crash-on-custom-cursor-when-loading.html is failing
https://bugs.webkit.org/show_bug.cgi?id=140425

Reviewed by Anders Carlsson.

* platform/win/CursorWin.cpp:
(WebCore::createSharedCursor): Return nullptr when operating system
cannot support the requested icon specification.
(WebCore::Cursor::ensurePlatformCursor): Check for 'createSharedCursor'
returning nullptr, and fall back to the default icon construction.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (178423 => 178424)


--- trunk/Source/WebCore/ChangeLog	2015-01-14 18:01:45 UTC (rev 178423)
+++ trunk/Source/WebCore/ChangeLog	2015-01-14 18:25:44 UTC (rev 178424)
@@ -1,3 +1,16 @@
+2015-01-14  Brent Fulgham  <[email protected]>
+
+        [Win] Layout Test fast/css/crash-on-custom-cursor-when-loading.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=140425
+
+        Reviewed by Anders Carlsson.
+
+        * platform/win/CursorWin.cpp:
+        (WebCore::createSharedCursor): Return nullptr when operating system
+        cannot support the requested icon specification.
+        (WebCore::Cursor::ensurePlatformCursor): Check for 'createSharedCursor'
+        returning nullptr, and fall back to the default icon construction.
+
 2015-01-14  Carlos Garcia Campos  <[email protected]>
 
         REGRESSION(r178367): [GStreamer] Several media tests time out after r178367

Modified: trunk/Source/WebCore/platform/win/CursorWin.cpp (178423 => 178424)


--- trunk/Source/WebCore/platform/win/CursorWin.cpp	2015-01-14 18:01:45 UTC (rev 178423)
+++ trunk/Source/WebCore/platform/win/CursorWin.cpp	2015-01-14 18:25:44 UTC (rev 178424)
@@ -53,8 +53,9 @@
     HWndDC dc(0);
     auto workingDC = adoptGDIObject(::CreateCompatibleDC(dc));
     if (doAlpha) {
-        auto hCursor = adoptGDIObject(::CreateDIBSection(dc, (BITMAPINFO *)&cursorImage, DIB_RGB_COLORS, 0, 0, 0));
-        ASSERT(hCursor);
+        auto hCursor = adoptGDIObject(::CreateDIBSection(dc, &cursorImage, DIB_RGB_COLORS, nullptr, 0, 0));
+        if (!hCursor)
+            return nullptr;
 
         img->getHBITMAP(hCursor.get()); 
         HBITMAP hOldBitmap = (HBITMAP)SelectObject(workingDC.get(), hCursor.get());
@@ -78,8 +79,10 @@
         // to create the mask manually
         auto andMaskDC = adoptGDIObject(::CreateCompatibleDC(dc));
         auto xorMaskDC = adoptGDIObject(::CreateCompatibleDC(dc));
-        auto hCursor = adoptGDIObject(::CreateDIBSection(dc, &cursorImage, DIB_RGB_COLORS, 0, 0, 0));
-        ASSERT(hCursor);
+        auto hCursor = adoptGDIObject(::CreateDIBSection(dc, &cursorImage, DIB_RGB_COLORS, nullptr, 0, 0));
+        if (!hCursor)
+            return nullptr;
+
         img->getHBITMAP(hCursor.get()); 
         BITMAP cursor;
         GetObject(hCursor.get(), sizeof(BITMAP), &cursor);
@@ -250,6 +253,8 @@
         break;
     case Cursor::Custom:
         m_platformCursor = createSharedCursor(m_image.get(), m_hotSpot);
+        if (!m_platformCursor)
+            m_platformCursor = loadSharedCursor(0, IDC_ARROW);
         break;
     default:
         ASSERT_NOT_REACHED();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to