Changeset 95275 in webkit


Ignore:
Timestamp:
Sep 16, 2011 12:15:57 AM (13 years ago)
Author:
leo.yang@torchmobile.com.cn
Message:

[Qt] Crash when dragging google maps.
https://bugs.webkit.org/show_bug.cgi?id=68223

Source/WebCore:

The custom image for a cursor might not be ready when WebKit trying
to use it to construct the cursor in Qt porting. This patch is using
arrow image to substitute the unready custom image.

Reviewed by Adam Barth.

Test: fast/css/crash-on-custom-cursor-when-loading.html

  • platform/qt/CursorQt.cpp:

(WebCore::createCustomCursor):
(WebCore::Cursor::ensurePlatformCursor):

LayoutTests:

Test case to use an unready custom cursor.

Reviewed by Adam Barth.

  • fast/css/crash-on-custom-cursor-when-loading-expected.txt: Added.
  • fast/css/crash-on-custom-cursor-when-loading.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r95274 r95275  
     12011-09-16  Leo Yang  <leo.yang@torchmobile.com.cn>
     2
     3        [Qt] Crash when dragging google maps.
     4        https://bugs.webkit.org/show_bug.cgi?id=68223
     5
     6        Test case to use an unready custom cursor.
     7
     8        Reviewed by Adam Barth.
     9
     10        * fast/css/crash-on-custom-cursor-when-loading-expected.txt: Added.
     11        * fast/css/crash-on-custom-cursor-when-loading.html: Added.
     12
    1132011-09-15  Keishi Hattori  <keishi@webkit.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r95271 r95275  
     12011-09-16  Leo Yang  <leo.yang@torchmobile.com.cn>
     2
     3        [Qt] Crash when dragging google maps.
     4        https://bugs.webkit.org/show_bug.cgi?id=68223
     5
     6        The custom image for a cursor might not be ready when WebKit trying
     7        to use it to construct the cursor in Qt porting. This patch is using
     8        arrow image to substitute the unready custom image.
     9
     10        Reviewed by Adam Barth.
     11
     12        Test: fast/css/crash-on-custom-cursor-when-loading.html
     13
     14        * platform/qt/CursorQt.cpp:
     15        (WebCore::createCustomCursor):
     16        (WebCore::Cursor::ensurePlatformCursor):
     17
    1182011-09-15  Adam Barth  <abarth@webkit.org>
    219
  • trunk/Source/WebCore/platform/qt/CursorQt.cpp

    r69110 r95275  
    7676static QCursor* createCustomCursor(Image* image, const IntPoint& hotSpot)
    7777{
     78    if (!image->nativeImageForCurrentFrame())
     79        return 0;
    7880    IntPoint effectiveHotSpot = determineHotSpot(image, hotSpot);
    7981    return new QCursor(*(image->nativeImageForCurrentFrame()), effectiveHotSpot.x(), effectiveHotSpot.y());
     
    198200    case Custom:
    199201        m_platformCursor = createCustomCursor(m_image.get(), m_hotSpot);
     202        if (!m_platformCursor)
     203            m_platformCursor = new QCursor(Qt::ArrowCursor);
    200204        break;
    201205    default:
Note: See TracChangeset for help on using the changeset viewer.