NavigationAction does not need to hold initiating DOM Event
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 May 2018 23:30:09 +0000 (23:30 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 May 2018 23:30:09 +0000 (23:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=185958
<rdar://problem/40531539>

Reviewed by Simon Fraser.

Source/WebCore:

Take a similar approach as was done in <https://bugs.webkit.org/show_bug.cgi?id=185712>
and have NavigationAction hold only as many details of the initiating DOM Event as
necessary to support WebKit functionality. Retaining a DOM Event effectively retains
the document that associated with the event. And DocumentLoader always keeps around
the NavigationAction of the last navigation for the "benefit of the various policy handlers".
Therefore, having NavigationAction hold only the relevant details of the DOM Event
instead of the DOM Event itself we avoid keeping the document we navigated from alive
longer than necessary.

* dom/MouseRelatedEvent.h:
* dom/UIEventWithKeyState.h:
* loader/NavigationAction.cpp:
(WebCore::NavigationAction::UIEventWithKeyStateData::UIEventWithKeyStateData): Added.
(WebCore::NavigationAction::MouseEventData::MouseEventData): Added.
(WebCore::keyStateDataForFirstEventWithKeyState): Added.
(WebCore::mouseEventDataForFirstMouseEvent): Added.
* loader/NavigationAction.h:
(WebCore::NavigationAction::keyStateEventData const): Added.
(WebCore::NavigationAction::mouseEventData const): Added
(WebCore::NavigationAction::event const): Deleted.

Source/WebKit:

Write in terms of NavigationAction::{keyStateEventData, mouseEventDataForFirstMouseEvent}().

* WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
(WebKit::mouseButtonForMouseEventData):
(WebKit::syntheticClickTypeForMouseEventData):
(WebKit::clickLocationInRootViewCoordinatesForMouseEventData):
(WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):
(WebKit::InjectedBundleNavigationAction::mouseButtonForNavigationAction):
(WebKit::InjectedBundleNavigationAction::syntheticClickTypeForNavigationAction):
(WebKit::InjectedBundleNavigationAction::clickLocationInRootViewCoordinatesForNavigationAction):
(WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
(WebKit::mouseEventForNavigationAction): Deleted.
(WebKit::mouseButtonForMouseEvent): Deleted.
(WebKit::syntheticClickTypeForMouseEvent): Deleted.
(WebKit::clickLocationInRootViewCoordinatesForMouseEvent): Deleted.

Source/WebKitLegacy/mac:

Write in terms of NavigationAction::{keyStateEventData, mouseEventDataForFirstMouseEvent}().

* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::actionDictionary const):
(findMouseEvent): Deleted.

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

Source/WebCore/ChangeLog
Source/WebCore/dom/MouseRelatedEvent.h
Source/WebCore/dom/UIEventWithKeyState.h
Source/WebCore/loader/NavigationAction.cpp
Source/WebCore/loader/NavigationAction.h
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm

index 4645072..04dbb47 100644 (file)
@@ -1,3 +1,32 @@
+2018-05-30  Daniel Bates  <dabates@apple.com>
+
+        NavigationAction does not need to hold initiating DOM Event
+        https://bugs.webkit.org/show_bug.cgi?id=185958
+        <rdar://problem/40531539>
+
+        Reviewed by Simon Fraser.
+
+        Take a similar approach as was done in <https://bugs.webkit.org/show_bug.cgi?id=185712>
+        and have NavigationAction hold only as many details of the initiating DOM Event as
+        necessary to support WebKit functionality. Retaining a DOM Event effectively retains
+        the document that associated with the event. And DocumentLoader always keeps around
+        the NavigationAction of the last navigation for the "benefit of the various policy handlers".
+        Therefore, having NavigationAction hold only the relevant details of the DOM Event
+        instead of the DOM Event itself we avoid keeping the document we navigated from alive
+        longer than necessary. 
+
+        * dom/MouseRelatedEvent.h:
+        * dom/UIEventWithKeyState.h:
+        * loader/NavigationAction.cpp:
+        (WebCore::NavigationAction::UIEventWithKeyStateData::UIEventWithKeyStateData): Added.
+        (WebCore::NavigationAction::MouseEventData::MouseEventData): Added.
+        (WebCore::keyStateDataForFirstEventWithKeyState): Added.
+        (WebCore::mouseEventDataForFirstMouseEvent): Added.
+        * loader/NavigationAction.h:
+        (WebCore::NavigationAction::keyStateEventData const): Added.
+        (WebCore::NavigationAction::mouseEventData const): Added
+        (WebCore::NavigationAction::event const): Deleted.
+
 2018-05-30  Youenn Fablet  <youenn@apple.com>
 
         Revert changes made to URLWithUserTypedString made in https://trac.webkit.org/changeset/232281
index ad4e5d0..2e8e27b 100644 (file)
@@ -58,7 +58,7 @@ public:
     void setIsSimulated(bool value) { m_isSimulated = value; }
     int pageX() const final;
     int pageY() const final;
-    WEBCORE_EXPORT FloatPoint locationInRootViewCoordinates() const;
+    FloatPoint locationInRootViewCoordinates() const;
     virtual const LayoutPoint& pageLocation() const;
     WEBCORE_EXPORT int x() const;
     WEBCORE_EXPORT int y() const;
index 085a031..295c15b 100644 (file)
@@ -81,6 +81,6 @@ protected:
     bool m_capsLockKey { false };
 };
 
-WEBCORE_EXPORT UIEventWithKeyState* findEventWithKeyState(Event*);
+UIEventWithKeyState* findEventWithKeyState(Event*);
 
 } // namespace WebCore
index 54ff77f..b2db006 100644 (file)
 #include "NavigationAction.h"
 
 #include "Document.h"
-#include "Event.h"
 #include "FrameLoader.h"
 #include "FrameLoaderClient.h"
 #include "HistoryItem.h"
+#include "MouseEvent.h"
 
 namespace WebCore {
 
@@ -44,6 +44,25 @@ NavigationAction::Requester::Requester(const Document& document)
 {
 }
 
+NavigationAction::UIEventWithKeyStateData::UIEventWithKeyStateData(const UIEventWithKeyState& uiEvent)
+    : isTrusted { uiEvent.isTrusted() }
+    , shiftKey { uiEvent.shiftKey() }
+    , ctrlKey { uiEvent.ctrlKey() }
+    , altKey { uiEvent.altKey() }
+    , metaKey { uiEvent.metaKey() }
+{
+}
+
+NavigationAction::MouseEventData::MouseEventData(const MouseEvent& mouseEvent)
+    : UIEventWithKeyStateData { mouseEvent }
+    , absoluteLocation { mouseEvent.absoluteLocation() }
+    , locationInRootViewCoordinates { mouseEvent.locationInRootViewCoordinates() }
+    , button { mouseEvent.button() }
+    , syntheticClickType { mouseEvent.syntheticClickType() }
+    , buttonDown { mouseEvent.buttonDown() }
+{
+}
+
 NavigationAction::NavigationAction() = default;
 NavigationAction::~NavigationAction() = default;
 
@@ -58,13 +77,30 @@ static bool shouldTreatAsSameOriginNavigation(const Document& document, const UR
     return url.isBlankURL() || url.protocolIsData() || (url.protocolIsBlob() && document.securityOrigin().canRequest(url));
 }
 
+static std::optional<NavigationAction::UIEventWithKeyStateData> keyStateDataForFirstEventWithKeyState(Event* event)
+{
+    if (UIEventWithKeyState* uiEvent = findEventWithKeyState(event))
+        return NavigationAction::UIEventWithKeyStateData { *uiEvent };
+    return std::nullopt;
+}
+
+static std::optional<NavigationAction::MouseEventData> mouseEventDataForFirstMouseEvent(Event* event)
+{
+    for (Event* e = event; e; e = e->underlyingEvent()) {
+        if (e->isMouseEvent())
+            return NavigationAction::MouseEventData { static_cast<const MouseEvent&>(*e) };
+    }
+    return std::nullopt;
+}
+
 NavigationAction::NavigationAction(Document& requester, const ResourceRequest& resourceRequest, InitiatedByMainFrame initiatedByMainFrame, NavigationType type, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, Event* event, const AtomicString& downloadAttribute)
     : m_requester { requester }
     , m_resourceRequest { resourceRequest }
     , m_type { type }
     , m_shouldOpenExternalURLsPolicy { shouldOpenExternalURLsPolicy }
     , m_initiatedByMainFrame { initiatedByMainFrame }
-    , m_event { event }
+    , m_keyStateEventData { keyStateDataForFirstEventWithKeyState(event) }
+    , m_mouseEventData { mouseEventDataForFirstMouseEvent(event) }
     , m_downloadAttribute { downloadAttribute }
     , m_treatAsSameOriginNavigation { shouldTreatAsSameOriginNavigation(requester, resourceRequest.url()) }
 {
@@ -89,7 +125,8 @@ NavigationAction::NavigationAction(Document& requester, const ResourceRequest& r
     , m_type { navigationType(frameLoadType, isFormSubmission, !!event) }
     , m_shouldOpenExternalURLsPolicy { shouldOpenExternalURLsPolicy }
     , m_initiatedByMainFrame { initiatedByMainFrame }
-    , m_event { event }
+    , m_keyStateEventData { keyStateDataForFirstEventWithKeyState(event) }
+    , m_mouseEventData { mouseEventDataForFirstMouseEvent(event) }
     , m_downloadAttribute { downloadAttribute }
     , m_treatAsSameOriginNavigation { shouldTreatAsSameOriginNavigation(requester, resourceRequest.url()) }
 {
index 9e868f3..7ec2da3 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "BackForwardItemIdentifier.h"
 #include "FrameLoaderTypes.h"
+#include "LayoutPoint.h"
 #include "ResourceRequest.h"
 #include "SecurityOrigin.h"
 #include "UserGestureIndicator.h"
@@ -40,7 +41,12 @@ namespace WebCore {
 class Document;
 class Event;
 class HistoryItem;
+class MouseEvent;
+class UIEventWithKeyState;
 
+// NavigationAction should never hold a strong reference to the originating document either directly
+// or indirectly as doing so prevents its destruction even after navigating away from it because
+// DocumentLoader keeps around the NavigationAction for the last navigation.
 class NavigationAction {
 public:
     NavigationAction();
@@ -71,6 +77,27 @@ public:
     };
     const std::optional<Requester>& requester() const { return m_requester; }
 
+    struct UIEventWithKeyStateData {
+        UIEventWithKeyStateData(const UIEventWithKeyState&);
+
+        bool isTrusted;
+        bool shiftKey;
+        bool ctrlKey;
+        bool altKey;
+        bool metaKey;
+    };
+    struct MouseEventData : UIEventWithKeyStateData {
+        MouseEventData(const MouseEvent&);
+
+        LayoutPoint absoluteLocation;
+        FloatPoint locationInRootViewCoordinates;
+        unsigned short button;
+        unsigned short syntheticClickType;
+        bool buttonDown;
+    };
+    const std::optional<UIEventWithKeyStateData>& keyStateEventData() const { return m_keyStateEventData; }
+    const std::optional<MouseEventData>& mouseEventData() const { return m_mouseEventData; }
+
     NavigationAction copyWithShouldOpenExternalURLsPolicy(ShouldOpenExternalURLsPolicy) const;
 
     bool isEmpty() const { return !m_requester || m_requester->url().isEmpty() || m_resourceRequest.url().isEmpty(); }
@@ -79,7 +106,6 @@ public:
     const ResourceRequest& resourceRequest() const { return m_resourceRequest; }
 
     NavigationType type() const { return m_type; }
-    const Event* event() const { return m_event.get(); }
 
     bool processingUserGesture() const { return m_userGestureToken ? m_userGestureToken->processingUserGesture() : false; }
     RefPtr<UserGestureToken> userGestureToken() const { return m_userGestureToken; }
@@ -101,12 +127,15 @@ public:
     const std::optional<BackForwardItemIdentifier>& targetBackForwardItemIdentifier() const { return m_targetBackForwardItemIdentifier; }
 
 private:
+    // Do not add a strong reference to the originating document or a subobject that holds the
+    // originating document. See comment above the class for more details.
     std::optional<Requester> m_requester;
     ResourceRequest m_resourceRequest;
     NavigationType m_type;
     ShouldOpenExternalURLsPolicy m_shouldOpenExternalURLsPolicy;
     InitiatedByMainFrame m_initiatedByMainFrame;
-    RefPtr<Event> m_event;
+    std::optional<UIEventWithKeyStateData> m_keyStateEventData;
+    std::optional<MouseEventData> m_mouseEventData;
     RefPtr<UserGestureToken> m_userGestureToken { UserGestureIndicator::currentUserGesture() };
     AtomicString m_downloadAttribute;
     bool m_treatAsSameOriginNavigation;
index 9e6520d..08ffe42 100644 (file)
@@ -1,3 +1,27 @@
+2018-05-30  Daniel Bates  <dabates@apple.com>
+
+        NavigationAction does not need to hold initiating DOM Event
+        https://bugs.webkit.org/show_bug.cgi?id=185958
+        <rdar://problem/40531539>
+
+        Reviewed by Simon Fraser.
+
+        Write in terms of NavigationAction::{keyStateEventData, mouseEventDataForFirstMouseEvent}().
+
+        * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
+        (WebKit::mouseButtonForMouseEventData):
+        (WebKit::syntheticClickTypeForMouseEventData):
+        (WebKit::clickLocationInRootViewCoordinatesForMouseEventData):
+        (WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):
+        (WebKit::InjectedBundleNavigationAction::mouseButtonForNavigationAction):
+        (WebKit::InjectedBundleNavigationAction::syntheticClickTypeForNavigationAction):
+        (WebKit::InjectedBundleNavigationAction::clickLocationInRootViewCoordinatesForNavigationAction):
+        (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
+        (WebKit::mouseEventForNavigationAction): Deleted.
+        (WebKit::mouseButtonForMouseEvent): Deleted.
+        (WebKit::syntheticClickTypeForMouseEvent): Deleted.
+        (WebKit::clickLocationInRootViewCoordinatesForMouseEvent): Deleted.
+
 2018-05-30  Andy Estes  <aestes@apple.com>
 
         [Cocoa] Add an SPI to suppress connection termination errors from CFNetwork when network interfaces change
index 90b3cde..000471c 100644 (file)
@@ -38,79 +38,57 @@ using namespace WebCore;
 
 namespace WebKit {
 
-static const MouseEvent* mouseEventForNavigationAction(const NavigationAction& navigationAction)
+static WebMouseEvent::Button mouseButtonForMouseEventData(const std::optional<NavigationAction::MouseEventData>& mouseEventData)
 {
-    for (const Event* e = navigationAction.event(); e; e = e->underlyingEvent()) {
-        if (e->isMouseEvent())
-            return static_cast<const MouseEvent*>(e);
-    }
-    return 0;
+    if (mouseEventData && mouseEventData->buttonDown && mouseEventData->isTrusted)
+        return static_cast<WebMouseEvent::Button>(mouseEventData->button);
+    return WebMouseEvent::NoButton;
 }
 
-static WebMouseEvent::Button mouseButtonForMouseEvent(const MouseEvent* mouseEvent)
+static WebMouseEvent::SyntheticClickType syntheticClickTypeForMouseEventData(const std::optional<NavigationAction::MouseEventData>& mouseEventData)
 {
-    if (!mouseEvent)
-        return WebMouseEvent::NoButton;
-
-    if (!mouseEvent->buttonDown() || !mouseEvent->isTrusted())
-        return WebMouseEvent::NoButton;
-
-    return static_cast<WebMouseEvent::Button>(mouseEvent->button());
+    if (mouseEventData && mouseEventData->buttonDown && mouseEventData->isTrusted)
+        return static_cast<WebMouseEvent::SyntheticClickType>(mouseEventData->syntheticClickType);
+    return WebMouseEvent::NoTap;
 }
-
-static WebMouseEvent::SyntheticClickType syntheticClickTypeForMouseEvent(const MouseEvent* mouseEvent)
-{
-    if (!mouseEvent)
-        return WebMouseEvent::NoTap;
-    
-    if (!mouseEvent->buttonDown() || !mouseEvent->isTrusted())
-        return WebMouseEvent::NoTap;
     
-    return static_cast<WebMouseEvent::SyntheticClickType>(mouseEvent->syntheticClickType());
-}
-    
-static FloatPoint clickLocationInRootViewCoordinatesForMouseEvent(const MouseEvent* mouseEvent)
+static FloatPoint clickLocationInRootViewCoordinatesForMouseEventData(const std::optional<NavigationAction::MouseEventData>& mouseEventData)
 {
-    if (!mouseEvent)
-        return { };
-    
-    if (!mouseEvent->buttonDown() || !mouseEvent->isTrusted())
-        return { };
-    
-    return mouseEvent->locationInRootViewCoordinates();
+    if (mouseEventData && mouseEventData->buttonDown && mouseEventData->isTrusted)
+        return mouseEventData->locationInRootViewCoordinates;
+    return { };
 }
 
 WebEvent::Modifiers InjectedBundleNavigationAction::modifiersForNavigationAction(const NavigationAction& navigationAction)
 {
     uint32_t modifiers = 0;
-    const UIEventWithKeyState* keyStateEvent = findEventWithKeyState(const_cast<Event*>(navigationAction.event()));
-    if (keyStateEvent && keyStateEvent->isTrusted()) {
-        if (keyStateEvent->shiftKey())
+    auto keyStateEventData = navigationAction.keyStateEventData();
+    if (keyStateEventData && keyStateEventData->isTrusted) {
+        if (keyStateEventData->shiftKey)
             modifiers |= WebEvent::ShiftKey;
-        if (keyStateEvent->ctrlKey())
+        if (keyStateEventData->ctrlKey)
             modifiers |= WebEvent::ControlKey;
-        if (keyStateEvent->altKey())
+        if (keyStateEventData->altKey)
             modifiers |= WebEvent::AltKey;
-        if (keyStateEvent->metaKey())
+        if (keyStateEventData->metaKey)
             modifiers |= WebEvent::MetaKey;
     }
-
     return static_cast<WebEvent::Modifiers>(modifiers);
 }
 
 WebMouseEvent::Button InjectedBundleNavigationAction::mouseButtonForNavigationAction(const NavigationAction& navigationAction)
 {
-    return mouseButtonForMouseEvent(mouseEventForNavigationAction(navigationAction));
+    return mouseButtonForMouseEventData(navigationAction.mouseEventData());
 }
 
 WebMouseEvent::SyntheticClickType InjectedBundleNavigationAction::syntheticClickTypeForNavigationAction(const NavigationAction& navigationAction)
 {
-    return syntheticClickTypeForMouseEvent(mouseEventForNavigationAction(navigationAction));
+    return syntheticClickTypeForMouseEventData(navigationAction.mouseEventData());
 }
     
 FloatPoint InjectedBundleNavigationAction::clickLocationInRootViewCoordinatesForNavigationAction(const NavigationAction& navigationAction)
 {
-    return clickLocationInRootViewCoordinatesForMouseEvent(mouseEventForNavigationAction(navigationAction));
+    return clickLocationInRootViewCoordinatesForMouseEventData(navigationAction.mouseEventData());
 }
 
 Ref<InjectedBundleNavigationAction> InjectedBundleNavigationAction::create(WebFrame* frame, const NavigationAction& action, RefPtr<FormState>&& formState)
@@ -126,9 +104,9 @@ InjectedBundleNavigationAction::InjectedBundleNavigationAction(WebFrame* frame,
     , m_shouldOpenExternalURLs(navigationAction.shouldOpenExternalURLsPolicy() == ShouldOpenExternalURLsPolicy::ShouldAllow || navigationAction.shouldOpenExternalURLsPolicy() == ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes)
     , m_shouldTryAppLinks(navigationAction.shouldOpenExternalURLsPolicy() == ShouldOpenExternalURLsPolicy::ShouldAllow)
 {
-    if (const MouseEvent* mouseEvent = mouseEventForNavigationAction(navigationAction)) {
-        m_hitTestResult = InjectedBundleHitTestResult::create(frame->coreFrame()->eventHandler().hitTestResultAtPoint(mouseEvent->absoluteLocation()));
-        m_mouseButton   = mouseButtonForMouseEvent(mouseEvent);
+    if (auto mouseEventData = navigationAction.mouseEventData()) {
+        m_hitTestResult = InjectedBundleHitTestResult::create(frame->coreFrame()->eventHandler().hitTestResultAtPoint(mouseEventData->absoluteLocation));
+        m_mouseButton = mouseButtonForMouseEventData(mouseEventData);
         m_syntheticClickType = syntheticClickTypeForNavigationAction(navigationAction);
         m_clickLocationInRootViewCoordinates = clickLocationInRootViewCoordinatesForNavigationAction(navigationAction);
     }
index e778550..430c423 100644 (file)
@@ -1,3 +1,17 @@
+2018-05-30  Daniel Bates  <dabates@apple.com>
+
+        NavigationAction does not need to hold initiating DOM Event
+        https://bugs.webkit.org/show_bug.cgi?id=185958
+        <rdar://problem/40531539>
+
+        Reviewed by Simon Fraser.
+
+        Write in terms of NavigationAction::{keyStateEventData, mouseEventDataForFirstMouseEvent}().
+
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::actionDictionary const):
+        (findMouseEvent): Deleted.
+
 2018-05-27  Dan Bernstein  <mitz@apple.com>
 
         Reverted the changes made for https://webkit.org/b/186016
index 5e465d7..bdb8839 100644 (file)
@@ -1555,28 +1555,19 @@ String WebFrameLoaderClient::userAgent(const URL& url)
     return [webView _userAgentString];
 }
 
-static const MouseEvent* findMouseEvent(const Event* event)
-{
-    for (const Event* e = event; e; e = e->underlyingEvent())
-        if (e->isMouseEvent())
-            return static_cast<const MouseEvent*>(e);
-    return 0;
-}
-
 NSDictionary *WebFrameLoaderClient::actionDictionary(const NavigationAction& action, FormState* formState) const
 {
     unsigned modifierFlags = 0;
-    const Event* event = action.event();
 #if !PLATFORM(IOS)
-    const UIEventWithKeyState* keyStateEvent = findEventWithKeyState(const_cast<Event*>(event));
-    if (keyStateEvent && keyStateEvent->isTrusted()) {
-        if (keyStateEvent->ctrlKey())
+    auto keyStateEventData = action.keyStateEventData();
+    if (keyStateEventData && keyStateEventData->isTrusted) {
+        if (keyStateEventData->ctrlKey)
             modifierFlags |= NSEventModifierFlagControl;
-        if (keyStateEvent->altKey())
+        if (keyStateEventData->altKey)
             modifierFlags |= NSEventModifierFlagOption;
-        if (keyStateEvent->shiftKey())
+        if (keyStateEventData->shiftKey)
             modifierFlags |= NSEventModifierFlagShift;
-        if (keyStateEvent->metaKey())
+        if (keyStateEventData->metaKey)
             modifierFlags |= NSEventModifierFlagCommand;
     }
 #else
@@ -1592,14 +1583,14 @@ NSDictionary *WebFrameLoaderClient::actionDictionary(const NavigationAction& act
         originalURL, WebActionOriginalURLKey,
         nil];
 
-    if (const MouseEvent* mouseEvent = findMouseEvent(event)) {
+    if (auto mouseEventData = action.mouseEventData()) {
         WebElementDictionary *element = [[WebElementDictionary alloc]
-            initWithHitTestResult:core(m_webFrame.get())->eventHandler().hitTestResultAtPoint(mouseEvent->absoluteLocation())];
+            initWithHitTestResult:core(m_webFrame.get())->eventHandler().hitTestResultAtPoint(mouseEventData->absoluteLocation)];
         [result setObject:element forKey:WebActionElementKey];
         [element release];
 
-        if (mouseEvent->isTrusted())
-            [result setObject:[NSNumber numberWithInt:mouseEvent->button()] forKey:WebActionButtonKey];
+        if (mouseEventData->isTrusted)
+            [result setObject:[NSNumber numberWithInt:mouseEventData->button] forKey:WebActionButtonKey];
         else
             [result setObject:[NSNumber numberWithInt:WebCore::NoButton] forKey:WebActionButtonKey];
     }