[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

darin at apple.com darin at apple.com
Mon Feb 21 00:14:17 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit e322930152fa2059d88deb618162f99a91adb155
Author: darin at apple.com <darin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jan 28 23:12:32 2011 +0000

    Re-land this patch with the missing null check that caused crashes in layout tests.
    
    Reviewed by Dan Bernstein.
    
    Changing cursor style has no effect until the mouse moves
    https://bugs.webkit.org/show_bug.cgi?id=14344
    rdar://problem/7563712
    
    No tests added because we don't have infrastructure for testing actual cursor
    changes (as opposed to cursor style computation) at this time. We might add it later.
    
    * page/EventHandler.cpp:
    (WebCore::EventHandler::dispatchFakeMouseMoveEventSoon): Added.
    * page/EventHandler.h: Ditto.
    
    * rendering/RenderObject.cpp:
    (WebCore::areNonIdenticalCursorListsEqual): Added.
    (WebCore::areCursorsEqual): Added.
    (WebCore::RenderObject::styleDidChange): Call dispatchFakeMouseMoveEventSoon if
    cursor styles changed.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76999 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index a1b94ae..a6ba548 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,26 @@
+2011-01-29  Darin Adler  <darin at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Re-land this patch with the missing null check that caused crashes in layout tests.
+
+        Changing cursor style has no effect until the mouse moves
+        https://bugs.webkit.org/show_bug.cgi?id=14344
+        rdar://problem/7563712
+
+        No tests added because we don't have infrastructure for testing actual cursor
+        changes (as opposed to cursor style computation) at this time. We might add it later.
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::dispatchFakeMouseMoveEventSoon): Added.
+        * page/EventHandler.h: Ditto.
+
+        * rendering/RenderObject.cpp:
+        (WebCore::areNonIdenticalCursorListsEqual): Added.
+        (WebCore::areCursorsEqual): Added.
+        (WebCore::RenderObject::styleDidChange): Call dispatchFakeMouseMoveEventSoon if
+        cursor styles changed.
+
 2011-01-28  Justin Schuh  <jschuh at chromium.org>
 
         Reviewed by Eric Seidel.
diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp
index ac7f60b..2cda1e4 100644
--- a/Source/WebCore/page/EventHandler.cpp
+++ b/Source/WebCore/page/EventHandler.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
  * Copyright (C) 2006 Alexey Proskuryakov (ap at webkit.org)
  *
  * Redistribution and use in source and binary forms, with or without
@@ -2161,6 +2161,15 @@ void EventHandler::scheduleHoverStateUpdate()
         m_hoverTimer.startOneShot(0);
 }
 
+void EventHandler::dispatchFakeMouseMoveEventSoon()
+{
+    if (m_mousePressed)
+        return;
+
+    if (!m_fakeMouseMoveEventTimer.isActive())
+        m_fakeMouseMoveEventTimer.startOneShot(fakeMouseMoveInterval);
+}
+
 void EventHandler::dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad& quad)
 {
     FrameView* view = m_frame->view();
diff --git a/Source/WebCore/page/EventHandler.h b/Source/WebCore/page/EventHandler.h
index 6a7aac9..3e15291 100644
--- a/Source/WebCore/page/EventHandler.h
+++ b/Source/WebCore/page/EventHandler.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007, 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -108,6 +108,7 @@ public:
     RenderObject* autoscrollRenderer() const;
     void updateAutoscrollRenderer();
 
+    void dispatchFakeMouseMoveEventSoon();
     void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&);
 
     HitTestResult hitTestResultAtPoint(const IntPoint&, bool allowShadowContent, bool ignoreClipping = false,
diff --git a/Source/WebCore/rendering/RenderObject.cpp b/Source/WebCore/rendering/RenderObject.cpp
index 4c4ccce..42b747a 100644
--- a/Source/WebCore/rendering/RenderObject.cpp
+++ b/Source/WebCore/rendering/RenderObject.cpp
@@ -3,7 +3,7 @@
  *           (C) 1999 Antti Koivisto (koivisto at kde.org)
  *           (C) 2000 Dirk Mueller (mueller at kde.org)
  *           (C) 2004 Allan Sandfeld Jensen (kde at carewolf.com)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
  * Copyright (C) 2009 Google Inc. All rights reserved.
  * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
  *
@@ -31,6 +31,7 @@
 #include "CSSStyleSelector.h"
 #include "Chrome.h"
 #include "ContentData.h"
+#include "CursorList.h"
 #include "DashArray.h"
 #include "EditingBoundary.h"
 #include "FloatQuad.h"
@@ -1859,6 +1860,17 @@ void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle* newS
     }
 }
 
+static bool areNonIdenticalCursorListsEqual(const RenderStyle* a, const RenderStyle* b)
+{
+    ASSERT(a->cursors() != b->cursors());
+    return a->cursors() && b->cursors() && *a->cursors() == *b->cursors();
+}
+
+static inline bool areCursorsEqual(const RenderStyle* a, const RenderStyle* b)
+{
+    return a->cursor() == b->cursor() && (a->cursors() == b->cursors() || areNonIdenticalCursorListsEqual(a, b));
+}
+
 void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     if (s_affectsParentBlock)
@@ -1884,6 +1896,11 @@ void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
 
     // Don't check for repaint here; we need to wait until the layer has been
     // updated by subclasses before we know if we have to repaint (in setStyle()).
+
+    if (oldStyle && !areCursorsEqual(oldStyle, style())) {
+        if (Frame* frame = this->frame())
+            frame->eventHandler()->dispatchFakeMouseMoveEventSoon();
+    }
 }
 
 void RenderObject::updateFillImages(const FillLayer* oldLayers, const FillLayer* newLayers)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list