DOM event handling should pass Event around by reference.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Aug 2016 16:32:44 +0000 (16:32 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Aug 2016 16:32:44 +0000 (16:32 +0000)
<https://webkit.org/b/161398>

Reviewed by Chris Dumez.

Source/WebCore:

Start with making Node::defaultEventHandler() take an Event& instead of an Event*,
and then spread out from there, propagating the referenceness.

* dom/Element.cpp:
(WebCore::Element::isKeyboardFocusable):
* dom/Element.h:
* dom/EventDispatcher.cpp:
(WebCore::callDefaultEventHandlersInTheBubblingOrder):
* dom/Node.cpp:
(WebCore::Node::dispatchDOMActivateEvent):
(WebCore::Node::defaultEventHandler):
* dom/Node.h:
* editing/Editor.cpp:
(WebCore::Editor::handleKeyboardEvent):
(WebCore::Editor::handleInputMethodKeydown):
(WebCore::Editor::handleTextEvent):
* editing/Editor.h:
* html/BaseCheckableInputType.cpp:
(WebCore::BaseCheckableInputType::handleKeydownEvent):
(WebCore::BaseCheckableInputType::handleKeypressEvent):
* html/BaseCheckableInputType.h:
* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent):
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeypressEvent):
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeyupEvent):
* html/BaseChooserOnlyDateAndTimeInputType.h:
* html/BaseClickableWithKeyInputType.cpp:
(WebCore::BaseClickableWithKeyInputType::handleKeydownEvent):
(WebCore::BaseClickableWithKeyInputType::handleKeypressEvent):
(WebCore::BaseClickableWithKeyInputType::handleKeyupEvent):
* html/BaseClickableWithKeyInputType.h:
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::isKeyboardFocusable):
* html/BaseDateAndTimeInputType.h:
* html/CheckboxInputType.cpp:
(WebCore::CheckboxInputType::handleKeyupEvent):
* html/CheckboxInputType.h:
* html/ColorInputType.cpp:
(WebCore::ColorInputType::handleDOMActivateEvent):
* html/ColorInputType.h:
* html/FileInputType.cpp:
(WebCore::FileInputType::handleDOMActivateEvent):
* html/FileInputType.h:
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::isKeyboardFocusable):
(WebCore::HTMLAnchorElement::defaultEventHandler):
(WebCore::HTMLAnchorElement::handleClick):
(WebCore::HTMLAnchorElement::eventType):
(WebCore::isEnterKeyKeydownEvent):
* html/HTMLAnchorElement.h:
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::isKeyboardFocusable):
* html/HTMLAreaElement.h:
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::defaultEventHandler):
* html/HTMLButtonElement.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::isKeyboardFocusable):
* html/HTMLFormControlElement.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::submitImplicitly):
(WebCore::submitElementFromEvent):
(WebCore::HTMLFormElement::validateInteractively):
(WebCore::HTMLFormElement::prepareForSubmission):
* html/HTMLFormElement.h:
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::isKeyboardFocusable):
* html/HTMLFrameOwnerElement.h:
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::defaultEventHandler):
* html/HTMLFrameSetElement.h:
* html/HTMLIFrameElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isKeyboardFocusable):
(WebCore::HTMLInputElement::isTextFormControlKeyboardFocusable):
(WebCore::HTMLInputElement::willDispatchEvent):
(WebCore::HTMLInputElement::defaultEventHandler):
* html/HTMLInputElement.h:
* html/HTMLLabelElement.cpp:
(WebCore::HTMLLabelElement::defaultEventHandler):
* html/HTMLLabelElement.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::defaultEventHandler):
* html/HTMLLinkElement.h:
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::defaultEventHandler):
(WebCore::HTMLPlugInElement::isKeyboardFocusable):
* html/HTMLPlugInElement.h:
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::defaultEventHandler):
* html/HTMLPlugInImageElement.h:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::isKeyboardFocusable):
(WebCore::HTMLSelectElement::menuListDefaultEventHandler):
(WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
(WebCore::HTMLSelectElement::defaultEventHandler):
* html/HTMLSelectElement.h:
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::defaultEventHandler):
* html/HTMLSummaryElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::isKeyboardFocusable):
(WebCore::HTMLTextAreaElement::defaultEventHandler):
(WebCore::HTMLTextAreaElement::handleBeforeTextInsertedEvent):
* html/HTMLTextAreaElement.h:
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::forwardEvent):
* html/HTMLTextFormControlElement.h:
* html/ImageInputType.cpp:
(WebCore::ImageInputType::handleDOMActivateEvent):
* html/ImageInputType.h:
* html/InputType.cpp:
(WebCore::InputType::handleClickEvent):
(WebCore::InputType::handleMouseDownEvent):
(WebCore::InputType::handleDOMActivateEvent):
(WebCore::InputType::handleKeydownEvent):
(WebCore::InputType::handleKeypressEvent):
(WebCore::InputType::handleKeyupEvent):
(WebCore::InputType::handleBeforeTextInsertedEvent):
(WebCore::InputType::handleTouchEvent):
(WebCore::InputType::forwardEvent):
(WebCore::InputType::shouldSubmitImplicitly):
(WebCore::InputType::dispatchSimulatedClickIfActive):
(WebCore::InputType::isKeyboardFocusable):
* html/InputType.h:
* html/MediaDocument.cpp:
(WebCore::MediaDocument::defaultEventHandler):
* html/MediaDocument.h:
* html/NumberInputType.cpp:
(WebCore::NumberInputType::handleKeydownEvent):
* html/NumberInputType.h:
* html/RadioInputType.cpp:
(WebCore::RadioInputType::handleClickEvent):
(WebCore::RadioInputType::handleKeydownEvent):
(WebCore::RadioInputType::handleKeyupEvent):
(WebCore::RadioInputType::isKeyboardFocusable):
* html/RadioInputType.h:
* html/RangeInputType.cpp:
(WebCore::RangeInputType::handleMouseDownEvent):
(WebCore::RangeInputType::handleTouchEvent):
(WebCore::RangeInputType::handleKeydownEvent):
* html/RangeInputType.h:
* html/ResetInputType.cpp:
(WebCore::ResetInputType::handleDOMActivateEvent):
* html/ResetInputType.h:
* html/SearchInputType.cpp:
(WebCore::SearchInputType::handleKeydownEvent):
* html/SearchInputType.h:
* html/SubmitInputType.cpp:
(WebCore::SubmitInputType::handleDOMActivateEvent):
* html/SubmitInputType.h:
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::isKeyboardFocusable):
(WebCore::TextFieldInputType::handleKeydownEvent):
(WebCore::TextFieldInputType::handleKeydownEventForSpinButton):
(WebCore::TextFieldInputType::forwardEvent):
(WebCore::TextFieldInputType::shouldSubmitImplicitly):
(WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
* html/TextFieldInputType.h:
* html/shadow/AutoFillButtonElement.cpp:
(WebCore::AutoFillButtonElement::defaultEventHandler):
* html/shadow/AutoFillButtonElement.h:
* html/shadow/MediaControlElementTypes.cpp:
(WebCore::MediaControlMuteButtonElement::defaultEventHandler):
(WebCore::MediaControlSeekButtonElement::defaultEventHandler):
(WebCore::MediaControlVolumeSliderElement::defaultEventHandler):
* html/shadow/MediaControlElementTypes.h:
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlPanelElement::defaultEventHandler):
(WebCore::MediaControlVolumeSliderContainerElement::defaultEventHandler):
(WebCore::MediaControlPanelMuteButtonElement::defaultEventHandler):
(WebCore::MediaControlPlayButtonElement::defaultEventHandler):
(WebCore::MediaControlOverlayPlayButtonElement::defaultEventHandler):
(WebCore::MediaControlRewindButtonElement::defaultEventHandler):
(WebCore::MediaControlReturnToRealtimeButtonElement::defaultEventHandler):
(WebCore::MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler):
(WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler):
(WebCore::MediaControlTimelineElement::defaultEventHandler):
(WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
(WebCore::MediaControlFullscreenVolumeMinButtonElement::defaultEventHandler):
(WebCore::MediaControlFullscreenVolumeMaxButtonElement::defaultEventHandler):
* html/shadow/MediaControlElements.h:
* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::defaultEventHandler):
(WebCore::MediaControls::containsRelatedTarget):
* html/shadow/MediaControls.h:
* html/shadow/MediaControlsApple.cpp:
(WebCore::MediaControlsApple::defaultEventHandler):
(WebCore::MediaControlsApple::handleClickEvent):
(WebCore::MediaControlsAppleEventListener::handleEvent):
* html/shadow/MediaControlsApple.h:
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::defaultEventHandler):
(WebCore::SliderThumbElement::handleTouchStart):
(WebCore::SliderThumbElement::handleTouchMove):
(WebCore::SliderThumbElement::handleTouchEndAndCancel):
(WebCore::SliderThumbElement::handleTouchEvent):
* html/shadow/SliderThumbElement.h:
* html/shadow/SpinButtonElement.cpp:
(WebCore::SpinButtonElement::defaultEventHandler):
(WebCore::SpinButtonElement::forwardEvent):
* html/shadow/SpinButtonElement.h:
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerTextElement::defaultEventHandler):
(WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
(WebCore::SearchFieldCancelButtonElement::defaultEventHandler):
* html/shadow/TextControlInnerElements.h:
* html/shadow/mac/ImageControlsButtonElementMac.cpp:
(WebCore::ImageControlsButtonElementMac::defaultEventHandler):
* html/shadow/mac/ImageControlsButtonElementMac.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::dispatchBeforeUnloadEvent):
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::defaultEventHandler):
(WebCore::MathMLElement::isKeyboardFocusable):
* mathml/MathMLElement.h:
* mathml/MathMLSelectElement.cpp:
(WebCore::MathMLSelectElement::defaultEventHandler):
* mathml/MathMLSelectElement.h:
* page/EventHandler.cpp:
(WebCore::didScrollInScrollableArea):
(WebCore::handleWheelEventInAppropriateEnclosingBox):
(WebCore::EventHandler::defaultWheelEventHandler):
(WebCore::EventHandler::keyEvent):
(WebCore::handleKeyboardSelectionMovement):
(WebCore::EventHandler::handleKeyboardSelectionMovementForAccessibility):
(WebCore::EventHandler::defaultKeyboardEventHandler):
(WebCore::EventHandler::defaultTextInputEventHandler):
(WebCore::EventHandler::defaultSpaceEventHandler):
(WebCore::EventHandler::defaultBackspaceEventHandler):
(WebCore::EventHandler::defaultArrowEventHandler):
(WebCore::EventHandler::defaultTabEventHandler):
* page/EventHandler.h:
* page/FocusController.cpp:
(WebCore::isFocusableElementOrScopeOwner):
(WebCore::isNonFocusableScopeOwner):
(WebCore::isFocusableScopeOwner):
(WebCore::FocusController::advanceFocusInDocumentOrder):
(WebCore::FocusController::findFocusCandidateInContainer):
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::userResize):
* rendering/RenderFrameSet.h:
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::defaultEventHandler):
(WebCore::SVGAElement::isKeyboardFocusable):
* svg/SVGAElement.h:

Source/WebKit2:

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performNonEditingBehaviorForSelector):

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

107 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/EventDispatcher.cpp
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/Editor.h
Source/WebCore/html/BaseCheckableInputType.cpp
Source/WebCore/html/BaseCheckableInputType.h
Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.cpp
Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.h
Source/WebCore/html/BaseClickableWithKeyInputType.cpp
Source/WebCore/html/BaseClickableWithKeyInputType.h
Source/WebCore/html/BaseDateAndTimeInputType.cpp
Source/WebCore/html/BaseDateAndTimeInputType.h
Source/WebCore/html/CheckboxInputType.cpp
Source/WebCore/html/CheckboxInputType.h
Source/WebCore/html/ColorInputType.cpp
Source/WebCore/html/ColorInputType.h
Source/WebCore/html/FileInputType.cpp
Source/WebCore/html/FileInputType.h
Source/WebCore/html/HTMLAnchorElement.cpp
Source/WebCore/html/HTMLAnchorElement.h
Source/WebCore/html/HTMLAreaElement.cpp
Source/WebCore/html/HTMLAreaElement.h
Source/WebCore/html/HTMLButtonElement.cpp
Source/WebCore/html/HTMLButtonElement.h
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLFormControlElement.h
Source/WebCore/html/HTMLFormElement.cpp
Source/WebCore/html/HTMLFormElement.h
Source/WebCore/html/HTMLFrameOwnerElement.cpp
Source/WebCore/html/HTMLFrameOwnerElement.h
Source/WebCore/html/HTMLFrameSetElement.cpp
Source/WebCore/html/HTMLFrameSetElement.h
Source/WebCore/html/HTMLIFrameElement.h
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLInputElement.h
Source/WebCore/html/HTMLLabelElement.cpp
Source/WebCore/html/HTMLLabelElement.h
Source/WebCore/html/HTMLLinkElement.cpp
Source/WebCore/html/HTMLLinkElement.h
Source/WebCore/html/HTMLPlugInElement.cpp
Source/WebCore/html/HTMLPlugInElement.h
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/html/HTMLPlugInImageElement.h
Source/WebCore/html/HTMLSelectElement.cpp
Source/WebCore/html/HTMLSelectElement.h
Source/WebCore/html/HTMLSummaryElement.cpp
Source/WebCore/html/HTMLSummaryElement.h
Source/WebCore/html/HTMLTextAreaElement.cpp
Source/WebCore/html/HTMLTextAreaElement.h
Source/WebCore/html/HTMLTextFormControlElement.cpp
Source/WebCore/html/HTMLTextFormControlElement.h
Source/WebCore/html/ImageInputType.cpp
Source/WebCore/html/ImageInputType.h
Source/WebCore/html/InputType.cpp
Source/WebCore/html/InputType.h
Source/WebCore/html/MediaDocument.cpp
Source/WebCore/html/MediaDocument.h
Source/WebCore/html/NumberInputType.cpp
Source/WebCore/html/NumberInputType.h
Source/WebCore/html/RadioInputType.cpp
Source/WebCore/html/RadioInputType.h
Source/WebCore/html/RangeInputType.cpp
Source/WebCore/html/RangeInputType.h
Source/WebCore/html/ResetInputType.cpp
Source/WebCore/html/ResetInputType.h
Source/WebCore/html/SearchInputType.cpp
Source/WebCore/html/SearchInputType.h
Source/WebCore/html/SubmitInputType.cpp
Source/WebCore/html/SubmitInputType.h
Source/WebCore/html/TextFieldInputType.cpp
Source/WebCore/html/TextFieldInputType.h
Source/WebCore/html/shadow/AutoFillButtonElement.cpp
Source/WebCore/html/shadow/AutoFillButtonElement.h
Source/WebCore/html/shadow/MediaControlElementTypes.cpp
Source/WebCore/html/shadow/MediaControlElementTypes.h
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/html/shadow/MediaControlElements.h
Source/WebCore/html/shadow/MediaControls.cpp
Source/WebCore/html/shadow/MediaControls.h
Source/WebCore/html/shadow/MediaControlsApple.cpp
Source/WebCore/html/shadow/MediaControlsApple.h
Source/WebCore/html/shadow/SliderThumbElement.cpp
Source/WebCore/html/shadow/SliderThumbElement.h
Source/WebCore/html/shadow/SpinButtonElement.cpp
Source/WebCore/html/shadow/SpinButtonElement.h
Source/WebCore/html/shadow/TextControlInnerElements.cpp
Source/WebCore/html/shadow/TextControlInnerElements.h
Source/WebCore/html/shadow/mac/ImageControlsButtonElementMac.cpp
Source/WebCore/html/shadow/mac/ImageControlsButtonElementMac.h
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/mathml/MathMLElement.cpp
Source/WebCore/mathml/MathMLElement.h
Source/WebCore/mathml/MathMLSelectElement.cpp
Source/WebCore/mathml/MathMLSelectElement.h
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/EventHandler.h
Source/WebCore/page/FocusController.cpp
Source/WebCore/rendering/RenderFrameSet.cpp
Source/WebCore/rendering/RenderFrameSet.h
Source/WebCore/svg/SVGAElement.cpp
Source/WebCore/svg/SVGAElement.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm

index 17cc5cb..8e07603 100644 (file)
@@ -1,3 +1,258 @@
+2016-08-31  Andreas Kling  <akling@apple.com>
+
+        DOM event handling should pass Event around by reference.
+        <https://webkit.org/b/161398>
+
+        Reviewed by Chris Dumez.
+
+        Start with making Node::defaultEventHandler() take an Event& instead of an Event*,
+        and then spread out from there, propagating the referenceness.
+
+        * dom/Element.cpp:
+        (WebCore::Element::isKeyboardFocusable):
+        * dom/Element.h:
+        * dom/EventDispatcher.cpp:
+        (WebCore::callDefaultEventHandlersInTheBubblingOrder):
+        * dom/Node.cpp:
+        (WebCore::Node::dispatchDOMActivateEvent):
+        (WebCore::Node::defaultEventHandler):
+        * dom/Node.h:
+        * editing/Editor.cpp:
+        (WebCore::Editor::handleKeyboardEvent):
+        (WebCore::Editor::handleInputMethodKeydown):
+        (WebCore::Editor::handleTextEvent):
+        * editing/Editor.h:
+        * html/BaseCheckableInputType.cpp:
+        (WebCore::BaseCheckableInputType::handleKeydownEvent):
+        (WebCore::BaseCheckableInputType::handleKeypressEvent):
+        * html/BaseCheckableInputType.h:
+        * html/BaseChooserOnlyDateAndTimeInputType.cpp:
+        (WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
+        (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent):
+        (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeypressEvent):
+        (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeyupEvent):
+        * html/BaseChooserOnlyDateAndTimeInputType.h:
+        * html/BaseClickableWithKeyInputType.cpp:
+        (WebCore::BaseClickableWithKeyInputType::handleKeydownEvent):
+        (WebCore::BaseClickableWithKeyInputType::handleKeypressEvent):
+        (WebCore::BaseClickableWithKeyInputType::handleKeyupEvent):
+        * html/BaseClickableWithKeyInputType.h:
+        * html/BaseDateAndTimeInputType.cpp:
+        (WebCore::BaseDateAndTimeInputType::isKeyboardFocusable):
+        * html/BaseDateAndTimeInputType.h:
+        * html/CheckboxInputType.cpp:
+        (WebCore::CheckboxInputType::handleKeyupEvent):
+        * html/CheckboxInputType.h:
+        * html/ColorInputType.cpp:
+        (WebCore::ColorInputType::handleDOMActivateEvent):
+        * html/ColorInputType.h:
+        * html/FileInputType.cpp:
+        (WebCore::FileInputType::handleDOMActivateEvent):
+        * html/FileInputType.h:
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::HTMLAnchorElement::isKeyboardFocusable):
+        (WebCore::HTMLAnchorElement::defaultEventHandler):
+        (WebCore::HTMLAnchorElement::handleClick):
+        (WebCore::HTMLAnchorElement::eventType):
+        (WebCore::isEnterKeyKeydownEvent):
+        * html/HTMLAnchorElement.h:
+        * html/HTMLAreaElement.cpp:
+        (WebCore::HTMLAreaElement::isKeyboardFocusable):
+        * html/HTMLAreaElement.h:
+        * html/HTMLButtonElement.cpp:
+        (WebCore::HTMLButtonElement::defaultEventHandler):
+        * html/HTMLButtonElement.h:
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::isKeyboardFocusable):
+        * html/HTMLFormControlElement.h:
+        * html/HTMLFormElement.cpp:
+        (WebCore::HTMLFormElement::submitImplicitly):
+        (WebCore::submitElementFromEvent):
+        (WebCore::HTMLFormElement::validateInteractively):
+        (WebCore::HTMLFormElement::prepareForSubmission):
+        * html/HTMLFormElement.h:
+        * html/HTMLFrameOwnerElement.cpp:
+        (WebCore::HTMLFrameOwnerElement::isKeyboardFocusable):
+        * html/HTMLFrameOwnerElement.h:
+        * html/HTMLFrameSetElement.cpp:
+        (WebCore::HTMLFrameSetElement::defaultEventHandler):
+        * html/HTMLFrameSetElement.h:
+        * html/HTMLIFrameElement.h:
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::isKeyboardFocusable):
+        (WebCore::HTMLInputElement::isTextFormControlKeyboardFocusable):
+        (WebCore::HTMLInputElement::willDispatchEvent):
+        (WebCore::HTMLInputElement::defaultEventHandler):
+        * html/HTMLInputElement.h:
+        * html/HTMLLabelElement.cpp:
+        (WebCore::HTMLLabelElement::defaultEventHandler):
+        * html/HTMLLabelElement.h:
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::defaultEventHandler):
+        * html/HTMLLinkElement.h:
+        * html/HTMLPlugInElement.cpp:
+        (WebCore::HTMLPlugInElement::defaultEventHandler):
+        (WebCore::HTMLPlugInElement::isKeyboardFocusable):
+        * html/HTMLPlugInElement.h:
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::HTMLPlugInImageElement::defaultEventHandler):
+        * html/HTMLPlugInImageElement.h:
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::isKeyboardFocusable):
+        (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
+        (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
+        (WebCore::HTMLSelectElement::defaultEventHandler):
+        * html/HTMLSelectElement.h:
+        * html/HTMLSummaryElement.cpp:
+        (WebCore::HTMLSummaryElement::defaultEventHandler):
+        * html/HTMLSummaryElement.h:
+        * html/HTMLTextAreaElement.cpp:
+        (WebCore::HTMLTextAreaElement::isKeyboardFocusable):
+        (WebCore::HTMLTextAreaElement::defaultEventHandler):
+        (WebCore::HTMLTextAreaElement::handleBeforeTextInsertedEvent):
+        * html/HTMLTextAreaElement.h:
+        * html/HTMLTextFormControlElement.cpp:
+        (WebCore::HTMLTextFormControlElement::forwardEvent):
+        * html/HTMLTextFormControlElement.h:
+        * html/ImageInputType.cpp:
+        (WebCore::ImageInputType::handleDOMActivateEvent):
+        * html/ImageInputType.h:
+        * html/InputType.cpp:
+        (WebCore::InputType::handleClickEvent):
+        (WebCore::InputType::handleMouseDownEvent):
+        (WebCore::InputType::handleDOMActivateEvent):
+        (WebCore::InputType::handleKeydownEvent):
+        (WebCore::InputType::handleKeypressEvent):
+        (WebCore::InputType::handleKeyupEvent):
+        (WebCore::InputType::handleBeforeTextInsertedEvent):
+        (WebCore::InputType::handleTouchEvent):
+        (WebCore::InputType::forwardEvent):
+        (WebCore::InputType::shouldSubmitImplicitly):
+        (WebCore::InputType::dispatchSimulatedClickIfActive):
+        (WebCore::InputType::isKeyboardFocusable):
+        * html/InputType.h:
+        * html/MediaDocument.cpp:
+        (WebCore::MediaDocument::defaultEventHandler):
+        * html/MediaDocument.h:
+        * html/NumberInputType.cpp:
+        (WebCore::NumberInputType::handleKeydownEvent):
+        * html/NumberInputType.h:
+        * html/RadioInputType.cpp:
+        (WebCore::RadioInputType::handleClickEvent):
+        (WebCore::RadioInputType::handleKeydownEvent):
+        (WebCore::RadioInputType::handleKeyupEvent):
+        (WebCore::RadioInputType::isKeyboardFocusable):
+        * html/RadioInputType.h:
+        * html/RangeInputType.cpp:
+        (WebCore::RangeInputType::handleMouseDownEvent):
+        (WebCore::RangeInputType::handleTouchEvent):
+        (WebCore::RangeInputType::handleKeydownEvent):
+        * html/RangeInputType.h:
+        * html/ResetInputType.cpp:
+        (WebCore::ResetInputType::handleDOMActivateEvent):
+        * html/ResetInputType.h:
+        * html/SearchInputType.cpp:
+        (WebCore::SearchInputType::handleKeydownEvent):
+        * html/SearchInputType.h:
+        * html/SubmitInputType.cpp:
+        (WebCore::SubmitInputType::handleDOMActivateEvent):
+        * html/SubmitInputType.h:
+        * html/TextFieldInputType.cpp:
+        (WebCore::TextFieldInputType::isKeyboardFocusable):
+        (WebCore::TextFieldInputType::handleKeydownEvent):
+        (WebCore::TextFieldInputType::handleKeydownEventForSpinButton):
+        (WebCore::TextFieldInputType::forwardEvent):
+        (WebCore::TextFieldInputType::shouldSubmitImplicitly):
+        (WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
+        * html/TextFieldInputType.h:
+        * html/shadow/AutoFillButtonElement.cpp:
+        (WebCore::AutoFillButtonElement::defaultEventHandler):
+        * html/shadow/AutoFillButtonElement.h:
+        * html/shadow/MediaControlElementTypes.cpp:
+        (WebCore::MediaControlMuteButtonElement::defaultEventHandler):
+        (WebCore::MediaControlSeekButtonElement::defaultEventHandler):
+        (WebCore::MediaControlVolumeSliderElement::defaultEventHandler):
+        * html/shadow/MediaControlElementTypes.h:
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlPanelElement::defaultEventHandler):
+        (WebCore::MediaControlVolumeSliderContainerElement::defaultEventHandler):
+        (WebCore::MediaControlPanelMuteButtonElement::defaultEventHandler):
+        (WebCore::MediaControlPlayButtonElement::defaultEventHandler):
+        (WebCore::MediaControlOverlayPlayButtonElement::defaultEventHandler):
+        (WebCore::MediaControlRewindButtonElement::defaultEventHandler):
+        (WebCore::MediaControlReturnToRealtimeButtonElement::defaultEventHandler):
+        (WebCore::MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler):
+        (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler):
+        (WebCore::MediaControlTimelineElement::defaultEventHandler):
+        (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
+        (WebCore::MediaControlFullscreenVolumeMinButtonElement::defaultEventHandler):
+        (WebCore::MediaControlFullscreenVolumeMaxButtonElement::defaultEventHandler):
+        * html/shadow/MediaControlElements.h:
+        * html/shadow/MediaControls.cpp:
+        (WebCore::MediaControls::defaultEventHandler):
+        (WebCore::MediaControls::containsRelatedTarget):
+        * html/shadow/MediaControls.h:
+        * html/shadow/MediaControlsApple.cpp:
+        (WebCore::MediaControlsApple::defaultEventHandler):
+        (WebCore::MediaControlsApple::handleClickEvent):
+        (WebCore::MediaControlsAppleEventListener::handleEvent):
+        * html/shadow/MediaControlsApple.h:
+        * html/shadow/SliderThumbElement.cpp:
+        (WebCore::SliderThumbElement::defaultEventHandler):
+        (WebCore::SliderThumbElement::handleTouchStart):
+        (WebCore::SliderThumbElement::handleTouchMove):
+        (WebCore::SliderThumbElement::handleTouchEndAndCancel):
+        (WebCore::SliderThumbElement::handleTouchEvent):
+        * html/shadow/SliderThumbElement.h:
+        * html/shadow/SpinButtonElement.cpp:
+        (WebCore::SpinButtonElement::defaultEventHandler):
+        (WebCore::SpinButtonElement::forwardEvent):
+        * html/shadow/SpinButtonElement.h:
+        * html/shadow/TextControlInnerElements.cpp:
+        (WebCore::TextControlInnerTextElement::defaultEventHandler):
+        (WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
+        (WebCore::SearchFieldCancelButtonElement::defaultEventHandler):
+        * html/shadow/TextControlInnerElements.h:
+        * html/shadow/mac/ImageControlsButtonElementMac.cpp:
+        (WebCore::ImageControlsButtonElementMac::defaultEventHandler):
+        * html/shadow/mac/ImageControlsButtonElementMac.h:
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
+        * mathml/MathMLElement.cpp:
+        (WebCore::MathMLElement::defaultEventHandler):
+        (WebCore::MathMLElement::isKeyboardFocusable):
+        * mathml/MathMLElement.h:
+        * mathml/MathMLSelectElement.cpp:
+        (WebCore::MathMLSelectElement::defaultEventHandler):
+        * mathml/MathMLSelectElement.h:
+        * page/EventHandler.cpp:
+        (WebCore::didScrollInScrollableArea):
+        (WebCore::handleWheelEventInAppropriateEnclosingBox):
+        (WebCore::EventHandler::defaultWheelEventHandler):
+        (WebCore::EventHandler::keyEvent):
+        (WebCore::handleKeyboardSelectionMovement):
+        (WebCore::EventHandler::handleKeyboardSelectionMovementForAccessibility):
+        (WebCore::EventHandler::defaultKeyboardEventHandler):
+        (WebCore::EventHandler::defaultTextInputEventHandler):
+        (WebCore::EventHandler::defaultSpaceEventHandler):
+        (WebCore::EventHandler::defaultBackspaceEventHandler):
+        (WebCore::EventHandler::defaultArrowEventHandler):
+        (WebCore::EventHandler::defaultTabEventHandler):
+        * page/EventHandler.h:
+        * page/FocusController.cpp:
+        (WebCore::isFocusableElementOrScopeOwner):
+        (WebCore::isNonFocusableScopeOwner):
+        (WebCore::isFocusableScopeOwner):
+        (WebCore::FocusController::advanceFocusInDocumentOrder):
+        (WebCore::FocusController::findFocusCandidateInContainer):
+        * rendering/RenderFrameSet.cpp:
+        (WebCore::RenderFrameSet::userResize):
+        * rendering/RenderFrameSet.h:
+        * svg/SVGAElement.cpp:
+        (WebCore::SVGAElement::defaultEventHandler):
+        (WebCore::SVGAElement::isKeyboardFocusable):
+        * svg/SVGAElement.h:
+
 2016-08-31  Romain Bellessort  <romain.bellessort@crf.canon.fr>
 
         [Streams API] Align getReader() with spec
index 1e6bdaf..a2b36a7 100644 (file)
@@ -249,7 +249,7 @@ void Element::setTabIndex(int value)
     setIntegralAttribute(tabindexAttr, value);
 }
 
-bool Element::isKeyboardFocusable(KeyboardEvent*) const
+bool Element::isKeyboardFocusable(KeyboardEvent&) const
 {
     return isFocusable() && tabIndex() >= 0;
 }
index 3a0a751..953d682 100644 (file)
@@ -295,7 +295,7 @@ public:
     bool tabIndexSetExplicitly() const;
     virtual bool supportsFocus() const;
     virtual bool isFocusable() const;
-    virtual bool isKeyboardFocusable(KeyboardEvent*) const;
+    virtual bool isKeyboardFocusable(KeyboardEvent&) const;
     virtual bool isMouseFocusable() const;
 
     virtual bool shouldUseInputMethod();
index 5d06a00..97c5a1d 100644 (file)
@@ -87,7 +87,7 @@ static void callDefaultEventHandlersInTheBubblingOrder(Event& event, const Event
         return;
 
     // Non-bubbling events call only one default event handler, the one for the target.
-    path.contextAt(0).node()->defaultEventHandler(&event);
+    path.contextAt(0).node()->defaultEventHandler(event);
     ASSERT(!event.defaultPrevented());
 
     if (event.defaultHandled() || !event.bubbles())
@@ -95,7 +95,7 @@ static void callDefaultEventHandlersInTheBubblingOrder(Event& event, const Event
 
     size_t size = path.size();
     for (size_t i = 1; i < size; ++i) {
-        path.contextAt(i).node()->defaultEventHandler(&event);
+        path.contextAt(i).node()->defaultEventHandler(event);
         ASSERT(!event.defaultPrevented());
         if (event.defaultHandled())
             return;
index 679b288..52469fb 100644 (file)
@@ -2156,11 +2156,11 @@ void Node::dispatchSubtreeModifiedEvent()
     dispatchScopedEvent(MutationEvent::create(subtreeModifiedEventName, true));
 }
 
-bool Node::dispatchDOMActivateEvent(int detail, PassRefPtr<Event> underlyingEvent)
+bool Node::dispatchDOMActivateEvent(int detail, Event& underlyingEvent)
 {
     ASSERT_WITH_SECURITY_IMPLICATION(!NoEventDispatchAssertion::isEventDispatchForbidden());
     Ref<UIEvent> event = UIEvent::create(eventNames().DOMActivateEvent, true, true, document().defaultView(), detail);
-    event->setUnderlyingEvent(underlyingEvent.get());
+    event->setUnderlyingEvent(&underlyingEvent);
     dispatchScopedEvent(event);
     return event->defaultHandled();
 }
@@ -2196,34 +2196,34 @@ void Node::dispatchInputEvent()
     dispatchScopedEvent(Event::create(eventNames().inputEvent, true, false));
 }
 
-void Node::defaultEventHandler(Event* event)
+void Node::defaultEventHandler(Event& event)
 {
-    if (event->target() != this)
+    if (event.target() != this)
         return;
-    const AtomicString& eventType = event->type();
+    const AtomicString& eventType = event.type();
     if (eventType == eventNames().keydownEvent || eventType == eventNames().keypressEvent) {
-        if (is<KeyboardEvent>(*event)) {
+        if (is<KeyboardEvent>(event)) {
             if (Frame* frame = document().frame())
                 frame->eventHandler().defaultKeyboardEventHandler(downcast<KeyboardEvent>(event));
         }
     } else if (eventType == eventNames().clickEvent) {
-        int detail = is<UIEvent>(*event) ? downcast<UIEvent>(*event).detail() : 0;
+        int detail = is<UIEvent>(event) ? downcast<UIEvent>(event).detail() : 0;
         if (dispatchDOMActivateEvent(detail, event))
-            event->setDefaultHandled();
+            event.setDefaultHandled();
 #if ENABLE(CONTEXT_MENUS)
     } else if (eventType == eventNames().contextmenuEvent) {
         if (Frame* frame = document().frame())
             if (Page* page = frame->page())
-                page->contextMenuController().handleContextMenuEvent(event);
+                page->contextMenuController().handleContextMenuEvent(&event);
 #endif
     } else if (eventType == eventNames().textInputEvent) {
-        if (is<TextEvent>(*event)) {
+        if (is<TextEvent>(event)) {
             if (Frame* frame = document().frame())
                 frame->eventHandler().defaultTextInputEventHandler(downcast<TextEvent>(event));
         }
 #if ENABLE(PAN_SCROLLING)
-    } else if (eventType == eventNames().mousedownEvent && is<MouseEvent>(*event)) {
-        if (downcast<MouseEvent>(*event).button() == MiddleButton) {
+    } else if (eventType == eventNames().mousedownEvent && is<MouseEvent>(event)) {
+        if (downcast<MouseEvent>(event).button() == MiddleButton) {
             if (enclosingLinkEventParentOrSelf())
                 return;
 
@@ -2237,7 +2237,7 @@ void Node::defaultEventHandler(Event* event)
             }
         }
 #endif
-    } else if (eventNames().isWheelEventType(eventType) && is<WheelEvent>(*event)) {
+    } else if (eventNames().isWheelEventType(eventType) && is<WheelEvent>(event)) {
         // If we don't have a renderer, send the wheel event to the first node we find with a renderer.
         // This is needed for <option> and <optgroup> elements so that <select>s get a wheel scroll.
         Node* startNode = this;
@@ -2248,17 +2248,17 @@ void Node::defaultEventHandler(Event* event)
             if (Frame* frame = document().frame())
                 frame->eventHandler().defaultWheelEventHandler(startNode, downcast<WheelEvent>(event));
 #if ENABLE(TOUCH_EVENTS) && PLATFORM(IOS)
-    } else if (is<TouchEvent>(*event) && eventNames().isTouchEventType(eventType)) {
+    } else if (is<TouchEvent>(event) && eventNames().isTouchEventType(eventType)) {
         RenderObject* renderer = this->renderer();
         while (renderer && (!is<RenderBox>(*renderer) || !downcast<RenderBox>(*renderer).canBeScrolledAndHasScrollableArea()))
             renderer = renderer->parent();
 
         if (renderer && renderer->node()) {
             if (Frame* frame = document().frame())
-                frame->eventHandler().defaultTouchEventHandler(renderer->node(), downcast<TouchEvent>(event));
+                frame->eventHandler().defaultTouchEventHandler(renderer->node(), &downcast<TouchEvent>(event));
         }
 #endif
-    } else if (event->type() == eventNames().webkitEditableContentChangedEvent) {
+    } else if (event.type() == eventNames().webkitEditableContentChangedEvent) {
         dispatchInputEvent();
     }
 }
index 0d89cd9..82b0d54 100644 (file)
@@ -508,7 +508,7 @@ public:
     virtual void handleLocalEvents(Event&);
 
     void dispatchSubtreeModifiedEvent();
-    bool dispatchDOMActivateEvent(int detail, PassRefPtr<Event> underlyingEvent);
+    bool dispatchDOMActivateEvent(int detail, Event& underlyingEvent);
 
 #if ENABLE(TOUCH_EVENTS)
     virtual bool allowsDoubleTapGesture() const { return true; }
@@ -526,7 +526,7 @@ public:
     virtual void dispatchInputEvent();
 
     // Perform the default action for an event.
-    virtual void defaultEventHandler(Event*);
+    virtual void defaultEventHandler(Event&);
 
     void ref();
     void deref();
index c6ad412..fbf147c 100644 (file)
@@ -184,51 +184,51 @@ TextCheckerClient* Editor::textChecker() const
     return 0;
 }
 
-void Editor::handleKeyboardEvent(KeyboardEvent* event)
+void Editor::handleKeyboardEvent(KeyboardEvent& event)
 {
     if (EditorClient* c = client())
-        c->handleKeyboardEvent(event);
+        c->handleKeyboardEvent(&event);
 }
 
-void Editor::handleInputMethodKeydown(KeyboardEvent* event)
+void Editor::handleInputMethodKeydown(KeyboardEvent& event)
 {
     if (EditorClient* c = client())
-        c->handleInputMethodKeydown(event);
+        c->handleInputMethodKeydown(&event);
 }
 
-bool Editor::handleTextEvent(TextEvent* event)
+bool Editor::handleTextEvent(TextEvent& event)
 {
-    LOG(Editing, "Editor %p handleTextEvent (data %s)", this, event->data().utf8().data());
+    LOG(Editing, "Editor %p handleTextEvent (data %s)", this, event.data().utf8().data());
 
     // Default event handling for Drag and Drop will be handled by DragController
     // so we leave the event for it.
-    if (event->isDrop())
+    if (event.isDrop())
         return false;
 
-    if (event->isPaste()) {
-        if (event->pastingFragment())
+    if (event.isPaste()) {
+        if (event.pastingFragment())
 #if PLATFORM(IOS)
         {
-            if (client()->performsTwoStepPaste(event->pastingFragment()))
+            if (client()->performsTwoStepPaste(event.pastingFragment()))
                 return true;
 #endif
-            replaceSelectionWithFragment(event->pastingFragment(), false, event->shouldSmartReplace(), event->shouldMatchStyle(), EditActionPaste, event->mailBlockquoteHandling());
+            replaceSelectionWithFragment(event.pastingFragment(), false, event.shouldSmartReplace(), event.shouldMatchStyle(), EditActionPaste, event.mailBlockquoteHandling());
 #if PLATFORM(IOS)
         }
 #endif
         else 
-            replaceSelectionWithText(event->data(), false, event->shouldSmartReplace(), EditActionPaste);
+            replaceSelectionWithText(event.data(), false, event.shouldSmartReplace(), EditActionPaste);
         return true;
     }
 
-    String data = event->data();
+    String data = event.data();
     if (data == "\n") {
-        if (event->isLineBreak())
+        if (event.isLineBreak())
             return insertLineBreak();
         return insertParagraphSeparator();
     }
 
-    return insertTextWithoutSendingTextEvent(data, false, event);
+    return insertTextWithoutSendingTextEvent(data, false, &event);
 }
 
 bool Editor::canEdit() const
index 056b21b..915faac 100644 (file)
@@ -114,9 +114,9 @@ public:
 
     CompositeEditCommand* lastEditCommand() { return m_lastEditCommand.get(); }
 
-    void handleKeyboardEvent(KeyboardEvent*);
-    void handleInputMethodKeydown(KeyboardEvent*);
-    bool handleTextEvent(TextEvent*);
+    void handleKeyboardEvent(KeyboardEvent&);
+    void handleInputMethodKeydown(KeyboardEvent&);
+    bool handleTextEvent(TextEvent&);
 
     WEBCORE_EXPORT bool canEdit() const;
     WEBCORE_EXPORT bool canEditRichly() const;
index ba5a991..3e03e41 100644 (file)
@@ -60,9 +60,9 @@ bool BaseCheckableInputType::appendFormData(FormDataList& encoding, bool) const
     return true;
 }
 
-void BaseCheckableInputType::handleKeydownEvent(KeyboardEvent* event)
+void BaseCheckableInputType::handleKeydownEvent(KeyboardEvent& event)
 {
-    const String& key = event->keyIdentifier();
+    const String& key = event.keyIdentifier();
     if (key == "U+0020") {
         element().setActive(true, true);
         // No setDefaultHandled(), because IE dispatches a keypress in this case
@@ -70,11 +70,11 @@ void BaseCheckableInputType::handleKeydownEvent(KeyboardEvent* event)
     }
 }
 
-void BaseCheckableInputType::handleKeypressEvent(KeyboardEvent* event)
+void BaseCheckableInputType::handleKeypressEvent(KeyboardEvent& event)
 {
-    if (event->charCode() == ' ') {
+    if (event.charCode() == ' ') {
         // Prevent scrolling down the page.
-        event->setDefaultHandled();
+        event.setDefaultHandled();
     }
 }
 
index ae2155b..cbf6ffe 100644 (file)
@@ -39,13 +39,13 @@ namespace WebCore {
 class BaseCheckableInputType : public InputType {
 protected:
     explicit BaseCheckableInputType(HTMLInputElement& element) : InputType(element) { }
-    void handleKeydownEvent(KeyboardEvent*) override;
+    void handleKeydownEvent(KeyboardEvent&) override;
 
 private:
     FormControlState saveFormControlState() const override;
     void restoreFormControlState(const FormControlState&) override;
     bool appendFormData(FormDataList&, bool) const override;
-    void handleKeypressEvent(KeyboardEvent*) override;
+    void handleKeypressEvent(KeyboardEvent&) override;
     bool canSetStringValue() const override;
     void accessKeyAction(bool sendMouseEvents) override;
     String fallbackValue() const override;
index eb5c672..f5446bd 100644 (file)
@@ -43,7 +43,7 @@ BaseChooserOnlyDateAndTimeInputType::~BaseChooserOnlyDateAndTimeInputType()
     closeDateTimeChooser();
 }
 
-void BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent(Event*)
+void BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent(Event&)
 {
     if (element().isDisabledOrReadOnly() || !element().renderer() || !ScriptController::processingUserGesture())
         return;
@@ -108,17 +108,17 @@ void BaseChooserOnlyDateAndTimeInputType::closeDateTimeChooser()
         m_dateTimeChooser->endChooser();
 }
 
-void BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent(KeyboardEvent* event)
+void BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent(KeyboardEvent& event)
 {
     BaseClickableWithKeyInputType::handleKeydownEvent(element(), event);
 }
 
-void BaseChooserOnlyDateAndTimeInputType::handleKeypressEvent(KeyboardEvent* event)
+void BaseChooserOnlyDateAndTimeInputType::handleKeypressEvent(KeyboardEvent& event)
 {
     BaseClickableWithKeyInputType::handleKeypressEvent(element(), event);
 }
 
-void BaseChooserOnlyDateAndTimeInputType::handleKeyupEvent(KeyboardEvent* event)
+void BaseChooserOnlyDateAndTimeInputType::handleKeyupEvent(KeyboardEvent& event)
 {
     BaseClickableWithKeyInputType::handleKeyupEvent(*this, event);
 }
index 5e2df99..e5b3753 100644 (file)
@@ -47,10 +47,10 @@ private:
     void createShadowSubtree() override;
     void detach() override;
     void setValue(const String&, bool valueChanged, TextFieldEventBehavior) override;
-    void handleDOMActivateEvent(Event*) override;
-    void handleKeydownEvent(KeyboardEvent*) override;
-    void handleKeypressEvent(KeyboardEvent*) override;
-    void handleKeyupEvent(KeyboardEvent*) override;
+    void handleDOMActivateEvent(Event&) override;
+    void handleKeydownEvent(KeyboardEvent&) override;
+    void handleKeypressEvent(KeyboardEvent&) override;
+    void handleKeyupEvent(KeyboardEvent&) override;
     void accessKeyAction(bool sendMouseEvents) override;
     bool isMouseFocusable() const override;
 
index f99dc98..26eb957 100644 (file)
@@ -39,9 +39,9 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
-void BaseClickableWithKeyInputType::handleKeydownEvent(HTMLInputElement& element, KeyboardEvent* event)
+void BaseClickableWithKeyInputType::handleKeydownEvent(HTMLInputElement& element, KeyboardEvent& event)
 {
-    const String& key = event->keyIdentifier();
+    const String& key = event.keyIdentifier();
     if (key == "U+0020") {
         element.setActive(true, true);
         // No setDefaultHandled(), because IE dispatches a keypress in this case
@@ -49,23 +49,23 @@ void BaseClickableWithKeyInputType::handleKeydownEvent(HTMLInputElement& element
     }
 }
 
-void BaseClickableWithKeyInputType::handleKeypressEvent(HTMLInputElement& element, KeyboardEvent* event)
+void BaseClickableWithKeyInputType::handleKeypressEvent(HTMLInputElement& element, KeyboardEvent& event)
 {
-    int charCode = event->charCode();
+    int charCode = event.charCode();
     if (charCode == '\r') {
-        element.dispatchSimulatedClick(event);
-        event->setDefaultHandled();
+        element.dispatchSimulatedClick(&event);
+        event.setDefaultHandled();
         return;
     }
     if (charCode == ' ') {
         // Prevent scrolling down the page.
-        event->setDefaultHandled();
+        event.setDefaultHandled();
     }
 }
 
-void BaseClickableWithKeyInputType::handleKeyupEvent(InputType& inputType, KeyboardEvent* event)
+void BaseClickableWithKeyInputType::handleKeyupEvent(InputType& inputType, KeyboardEvent& event)
 {
-    const String& key = event->keyIdentifier();
+    const String& key = event.keyIdentifier();
     if (key != "U+0020")
         return;
     // Simulate mouse click for spacebar for button types.
@@ -78,17 +78,17 @@ void BaseClickableWithKeyInputType::accessKeyAction(HTMLInputElement& element, b
     element.dispatchSimulatedClick(0, sendMouseEvents ? SendMouseUpDownEvents : SendNoEvents);
 }
 
-void BaseClickableWithKeyInputType::handleKeydownEvent(KeyboardEvent* event)
+void BaseClickableWithKeyInputType::handleKeydownEvent(KeyboardEvent& event)
 {
     handleKeydownEvent(element(), event);
 }
 
-void BaseClickableWithKeyInputType::handleKeypressEvent(KeyboardEvent* event)
+void BaseClickableWithKeyInputType::handleKeypressEvent(KeyboardEvent& event)
 {
     handleKeypressEvent(element(), event);
 }
 
-void BaseClickableWithKeyInputType::handleKeyupEvent(KeyboardEvent* event)
+void BaseClickableWithKeyInputType::handleKeyupEvent(KeyboardEvent& event)
 {
     handleKeyupEvent(*this, event);
 }
index bdd4500..a101958 100644 (file)
@@ -38,18 +38,18 @@ namespace WebCore {
 // Base of input types that dispatches a simulated click on space/return key.
 class BaseClickableWithKeyInputType : public InputType {
 public:
-    static void handleKeydownEvent(HTMLInputElement&, KeyboardEvent*);
-    static void handleKeypressEvent(HTMLInputElement&, KeyboardEvent*);
-    static void handleKeyupEvent(InputType&, KeyboardEvent*);
+    static void handleKeydownEvent(HTMLInputElement&, KeyboardEvent&);
+    static void handleKeypressEvent(HTMLInputElement&, KeyboardEvent&);
+    static void handleKeyupEvent(InputType&, KeyboardEvent&);
     static void accessKeyAction(HTMLInputElement&, bool sendMouseEvents);
     
 protected:
     explicit BaseClickableWithKeyInputType(HTMLInputElement& element) : InputType(element) { }
 
 private:
-    void handleKeydownEvent(KeyboardEvent*) override;
-    void handleKeypressEvent(KeyboardEvent*) override;
-    void handleKeyupEvent(KeyboardEvent*) override;
+    void handleKeydownEvent(KeyboardEvent&) override;
+    void handleKeypressEvent(KeyboardEvent&) override;
+    void handleKeyupEvent(KeyboardEvent&) override;
     void accessKeyAction(bool sendMouseEvents) override;
 };
 
index 0b23cee..e3bc452 100644 (file)
@@ -181,7 +181,7 @@ bool BaseDateAndTimeInputType::valueMissing(const String& value) const
 }
 
 #if PLATFORM(IOS)
-bool BaseDateAndTimeInputType::isKeyboardFocusable(KeyboardEvent*) const
+bool BaseDateAndTimeInputType::isKeyboardFocusable(KeyboardEvent&) const
 {
     return !element().isReadOnly() && element().isTextFormControlFocusable();
 }
index 1b4320b..a7b9ebe 100644 (file)
@@ -51,7 +51,7 @@ protected:
     virtual bool setMillisecondToDateComponents(double, DateComponents*) const = 0;
     String visibleValue() const override;
 #if PLATFORM(IOS)
-    bool isKeyboardFocusable(KeyboardEvent*) const override;
+    bool isKeyboardFocusable(KeyboardEvent&) const override;
 #endif
 
 private:
index 50c822f..b8b7e08 100644 (file)
@@ -54,9 +54,9 @@ String CheckboxInputType::valueMissingText() const
     return validationMessageValueMissingForCheckboxText();
 }
 
-void CheckboxInputType::handleKeyupEvent(KeyboardEvent* event)
+void CheckboxInputType::handleKeyupEvent(KeyboardEvent& event)
 {
-    const String& key = event->keyIdentifier();
+    const String& key = event.keyIdentifier();
     if (key != "U+0020")
         return;
     dispatchSimulatedClickIfActive(event);
index ec0b70e..001c452 100644 (file)
@@ -43,7 +43,7 @@ private:
     const AtomicString& formControlType() const override;
     bool valueMissing(const String&) const override;
     String valueMissingText() const override;
-    void handleKeyupEvent(KeyboardEvent*) override;
+    void handleKeyupEvent(KeyboardEvent&) override;
     void willDispatchClick(InputElementClickState&) override;
     void didDispatchClick(Event*, const InputElementClickState&) override;
     bool isCheckbox() const override;
index a6c1538..1432462 100644 (file)
@@ -133,7 +133,7 @@ void ColorInputType::setValue(const String& value, bool valueChanged, TextFieldE
         m_chooser->setSelectedColor(valueAsColor());
 }
 
-void ColorInputType::handleDOMActivateEvent(Event* event)
+void ColorInputType::handleDOMActivateEvent(Event& event)
 {
     if (element().isDisabledOrReadOnly() || !element().renderer())
         return;
@@ -148,7 +148,7 @@ void ColorInputType::handleDOMActivateEvent(Event* event)
             m_chooser->reattachColorChooser(valueAsColor());
     }
 
-    event->setDefaultHandled();
+    event.setDefaultHandled();
 }
 
 void ColorInputType::detach()
index ff6498b..7a1ca85 100644 (file)
@@ -58,7 +58,7 @@ private:
     String sanitizeValue(const String&) const override;
     void createShadowSubtree() override;
     void setValue(const String&, bool valueChanged, TextFieldEventBehavior) override;
-    void handleDOMActivateEvent(Event*) override;
+    void handleDOMActivateEvent(Event&) override;
     void detach() override;
     bool shouldRespectListAttribute() override;
     bool typeMismatchFor(const String&) const override;
index 822babd..e6debec 100644 (file)
@@ -169,7 +169,7 @@ String FileInputType::valueMissingText() const
     return element().multiple() ? validationMessageValueMissingForMultipleFileText() : validationMessageValueMissingForFileText();
 }
 
-void FileInputType::handleDOMActivateEvent(Event* event)
+void FileInputType::handleDOMActivateEvent(Event& event)
 {
     if (element().isDisabledFormControl())
         return;
@@ -192,7 +192,7 @@ void FileInputType::handleDOMActivateEvent(Event* event)
         chrome->runOpenPanel(input.document().frame(), m_fileChooser);
     }
 
-    event->setDefaultHandled();
+    event.setDefaultHandled();
 }
 
 RenderPtr<RenderElement> FileInputType::createInputRenderer(RenderStyle&& style)
index ff7ecf8..3a875ef 100644 (file)
@@ -57,7 +57,7 @@ private:
     bool appendFormData(FormDataList&, bool) const override;
     bool valueMissing(const String&) const override;
     String valueMissingText() const override;
-    void handleDOMActivateEvent(Event*) override;
+    void handleDOMActivateEvent(Event&) override;
     RenderPtr<RenderElement> createInputRenderer(RenderStyle&&) override;
     bool canSetStringValue() const override;
     bool canChangeFromAnotherType() const override;
index e65a19d..d6160dd 100644 (file)
@@ -118,7 +118,7 @@ static bool hasNonEmptyBox(RenderBoxModelObject* renderer)
     return false;
 }
 
-bool HTMLAnchorElement::isKeyboardFocusable(KeyboardEvent* event) const
+bool HTMLAnchorElement::isKeyboardFocusable(KeyboardEvent& event) const
 {
     if (!isLink())
         return HTMLElement::isKeyboardFocusable(event);
@@ -129,7 +129,7 @@ bool HTMLAnchorElement::isKeyboardFocusable(KeyboardEvent* event) const
     if (!document().frame())
         return false;
 
-    if (!document().frame()->eventHandler().tabsToLinks(event))
+    if (!document().frame()->eventHandler().tabsToLinks(&event))
         return false;
 
     if (!renderer() && ancestorsOfType<HTMLCanvasElement>(*this).first())
@@ -166,16 +166,16 @@ static void appendServerMapMousePosition(StringBuilder& url, Event& event)
     url.appendNumber(std::lround(absolutePosition.y()));
 }
 
-void HTMLAnchorElement::defaultEventHandler(Event* event)
+void HTMLAnchorElement::defaultEventHandler(Event& event)
 {
     if (isLink()) {
         if (focused() && isEnterKeyKeydownEvent(event) && treatLinkAsLiveForEventType(NonMouseEvent)) {
-            event->setDefaultHandled();
-            dispatchSimulatedClick(event);
+            event.setDefaultHandled();
+            dispatchSimulatedClick(&event);
             return;
         }
 
-        if (MouseEvent::canTriggerActivationBehavior(*event) && treatLinkAsLiveForEventType(eventType(event))) {
+        if (MouseEvent::canTriggerActivationBehavior(event) && treatLinkAsLiveForEventType(eventType(event))) {
             handleClick(event);
             return;
         }
@@ -183,10 +183,10 @@ void HTMLAnchorElement::defaultEventHandler(Event* event)
         if (hasEditableStyle()) {
             // This keeps track of the editable block that the selection was in (if it was in one) just before the link was clicked
             // for the LiveWhenNotFocused editable link behavior
-            if (event->type() == eventNames().mousedownEvent && is<MouseEvent>(*event) && downcast<MouseEvent>(*event).button() != RightButton && document().frame()) {
+            if (event.type() == eventNames().mousedownEvent && is<MouseEvent>(event) && downcast<MouseEvent>(event).button() != RightButton && document().frame()) {
                 setRootEditableElementForSelectionOnMouseDown(document().frame()->selection().selection().rootEditableElement());
-                m_wasShiftKeyDownOnMouseDown = downcast<MouseEvent>(*event).shiftKey();
-            } else if (event->type() == eventNames().mouseoverEvent) {
+                m_wasShiftKeyDownOnMouseDown = downcast<MouseEvent>(event).shiftKey();
+            } else if (event.type() == eventNames().mouseoverEvent) {
                 // These are cleared on mouseover and not mouseout because their values are needed for drag events,
                 // but drag events happen after mouse out events.
                 clearRootEditableElementForSelectionOnMouseDown();
@@ -352,9 +352,9 @@ void HTMLAnchorElement::sendPings(const URL& destinationURL)
         PingLoader::sendPing(*document().frame(), document().completeURL(pingURLs[i]), destinationURL);
 }
 
-void HTMLAnchorElement::handleClick(Event* event)
+void HTMLAnchorElement::handleClick(Event& event)
 {
-    event->setDefaultHandled();
+    event.setDefaultHandled();
 
     Frame* frame = document().frame();
     if (!frame)
@@ -362,7 +362,7 @@ void HTMLAnchorElement::handleClick(Event* event)
 
     StringBuilder url;
     url.append(stripLeadingAndTrailingHTMLSpaces(attributeWithoutSynchronization(hrefAttr)));
-    appendServerMapMousePosition(url, *event);
+    appendServerMapMousePosition(url, event);
     URL kurl = document().completeURL(url.toString());
 
     auto downloadAttribute = nullAtom;
@@ -371,17 +371,16 @@ void HTMLAnchorElement::handleClick(Event* event)
         downloadAttribute = attributeWithoutSynchronization(downloadAttr);
 #endif
 
-    frame->loader().urlSelected(kurl, target(), event, LockHistory::No, LockBackForwardList::No, hasRel(RelationNoReferrer) ? NeverSendReferrer : MaybeSendReferrer, document().shouldOpenExternalURLsPolicyToPropagate(), downloadAttribute);
+    frame->loader().urlSelected(kurl, target(), &event, LockHistory::No, LockBackForwardList::No, hasRel(RelationNoReferrer) ? NeverSendReferrer : MaybeSendReferrer, document().shouldOpenExternalURLsPolicyToPropagate(), downloadAttribute);
 
     sendPings(kurl);
 }
 
-HTMLAnchorElement::EventType HTMLAnchorElement::eventType(Event* event)
+HTMLAnchorElement::EventType HTMLAnchorElement::eventType(Event& event)
 {
-    ASSERT(event);
-    if (!is<MouseEvent>(*event))
+    if (!is<MouseEvent>(event))
         return NonMouseEvent;
-    return downcast<MouseEvent>(*event).shiftKey() ? MouseEventWithShiftKey : MouseEventWithoutShiftKey;
+    return downcast<MouseEvent>(event).shiftKey() ? MouseEventWithShiftKey : MouseEventWithoutShiftKey;
 }
 
 bool HTMLAnchorElement::treatLinkAsLiveForEventType(EventType eventType) const
@@ -414,9 +413,9 @@ bool HTMLAnchorElement::treatLinkAsLiveForEventType(EventType eventType) const
     return false;
 }
 
-bool isEnterKeyKeydownEvent(Event* event)
+bool isEnterKeyKeydownEvent(Event& event)
 {
-    return event->type() == eventNames().keydownEvent && is<KeyboardEvent>(*event) && downcast<KeyboardEvent>(*event).keyIdentifier() == "Enter";
+    return event.type() == eventNames().keydownEvent && is<KeyboardEvent>(event) && downcast<KeyboardEvent>(event).keyIdentifier() == "Enter";
 }
 
 bool shouldProhibitLinks(Element* element)
index 8472a01..3665e4a 100644 (file)
@@ -91,8 +91,8 @@ protected:
 private:
     bool supportsFocus() const override;
     bool isMouseFocusable() const override;
-    bool isKeyboardFocusable(KeyboardEvent*) const override;
-    void defaultEventHandler(Event*) final;
+    bool isKeyboardFocusable(KeyboardEvent&) const override;
+    void defaultEventHandler(Event&) final;
     void setActive(bool active = true, bool pause = false) final;
     void accessKeyAction(bool sendMouseEvents) final;
     bool isURLAttribute(const Attribute&) const final;
@@ -103,14 +103,14 @@ private:
 
     void sendPings(const URL& destinationURL);
 
-    void handleClick(Event*);
+    void handleClick(Event&);
 
     enum EventType {
         MouseEventWithoutShiftKey,
         MouseEventWithShiftKey,
         NonMouseEvent,
     };
-    static EventType eventType(Event*);
+    static EventType eventType(Event&);
     bool treatLinkAsLiveForEventType(EventType) const;
 
     Element* rootEditableElementForSelectionOnMouseDown() const;
@@ -134,7 +134,7 @@ inline LinkHash HTMLAnchorElement::visitedLinkHash() const
 
 // Functions shared with the other anchor elements (i.e., SVG).
 
-bool isEnterKeyKeydownEvent(Event*);
+bool isEnterKeyKeydownEvent(Event&);
 bool shouldProhibitLinks(Element*);
 
 } // namespace WebCore
index 8501f9c..62fb6a8 100644 (file)
@@ -191,7 +191,7 @@ HTMLImageElement* HTMLAreaElement::imageElement() const
     return downcast<HTMLMapElement>(*mapElement).imageElement();
 }
 
-bool HTMLAreaElement::isKeyboardFocusable(KeyboardEvent*) const
+bool HTMLAreaElement::isKeyboardFocusable(KeyboardEvent&) const
 {
     return isFocusable();
 }
index 4efe185..9229193 100644 (file)
@@ -54,7 +54,7 @@ private:
     void parseAttribute(const QualifiedName&, const AtomicString&) final;
     bool supportsFocus() const final;
     String target() const final;
-    bool isKeyboardFocusable(KeyboardEvent*) const final;
+    bool isKeyboardFocusable(KeyboardEvent&) const final;
     bool isMouseFocusable() const final;
     bool isFocusable() const final;
     void updateFocusAppearance(SelectionRestorationMode, SelectionRevealMode) final;
index a602235..c7913e1 100644 (file)
@@ -112,23 +112,23 @@ void HTMLButtonElement::parseAttribute(const QualifiedName& name, const AtomicSt
         HTMLFormControlElement::parseAttribute(name, value);
 }
 
-void HTMLButtonElement::defaultEventHandler(Event* event)
+void HTMLButtonElement::defaultEventHandler(Event& event)
 {
-    if (event->type() == eventNames().DOMActivateEvent && !isDisabledFormControl()) {
+    if (event.type() == eventNames().DOMActivateEvent && !isDisabledFormControl()) {
         if (form() && m_type == SUBMIT) {
             m_isActivatedSubmit = true;
             form()->prepareForSubmission(event);
-            event->setDefaultHandled();
+            event.setDefaultHandled();
             m_isActivatedSubmit = false; // Do this in case submission was canceled.
         }
         if (form() && m_type == RESET) {
             form()->reset();
-            event->setDefaultHandled();
+            event.setDefaultHandled();
         }
     }
 
-    if (is<KeyboardEvent>(*event)) {
-        KeyboardEvent& keyboardEvent = downcast<KeyboardEvent>(*event);
+    if (is<KeyboardEvent>(event)) {
+        KeyboardEvent& keyboardEvent = downcast<KeyboardEvent>(event);
         if (keyboardEvent.type() == eventNames().keydownEvent && keyboardEvent.keyIdentifier() == "U+0020") {
             setActive(true, true);
             // No setDefaultHandled() - IE dispatches a keypress in this case.
index 62e3a51..c3a8b35 100644 (file)
@@ -55,7 +55,7 @@ private:
 
     void parseAttribute(const QualifiedName&, const AtomicString&) final;
     bool isPresentationAttribute(const QualifiedName&) const final;
-    void defaultEventHandler(Event*) final;
+    void defaultEventHandler(Event&) final;
 
     bool appendFormData(FormDataList&, bool) final;
 
index a68e559..41a1eba 100644 (file)
@@ -368,11 +368,11 @@ bool HTMLFormControlElement::isFocusable() const
     return HTMLElement::isFocusable();
 }
 
-bool HTMLFormControlElement::isKeyboardFocusable(KeyboardEvent* event) const
+bool HTMLFormControlElement::isKeyboardFocusable(KeyboardEvent& event) const
 {
     if (isFocusable())
         if (document().frame())
-            return document().frame()->eventHandler().tabsToAllFormControls(event);
+            return document().frame()->eventHandler().tabsToAllFormControls(&event);
     return false;
 }
 
index e094974..891a576 100644 (file)
@@ -143,7 +143,7 @@ protected:
     void didMoveToNewDocument(Document* oldDocument) override;
 
     bool supportsFocus() const override;
-    bool isKeyboardFocusable(KeyboardEvent*) const override;
+    bool isKeyboardFocusable(KeyboardEvent&) const override;
     bool isMouseFocusable() const override;
 
     void didRecalcStyle(Style::Change) override;
index 0eaa653..12a84fe 100644 (file)
@@ -180,7 +180,7 @@ HTMLElement* HTMLFormElement::item(unsigned index)
     return elements()->item(index);
 }
 
-void HTMLFormElement::submitImplicitly(Event* event, bool fromImplicitSubmissionTrigger)
+void HTMLFormElement::submitImplicitly(Event& event, bool fromImplicitSubmissionTrigger)
 {
     unsigned submissionTriggerCount = 0;
     for (auto& formAssociatedElement : m_associatedElements) {
@@ -189,7 +189,7 @@ void HTMLFormElement::submitImplicitly(Event* event, bool fromImplicitSubmission
         HTMLFormControlElement& formElement = downcast<HTMLFormControlElement>(*formAssociatedElement);
         if (formElement.isSuccessfulSubmitButton()) {
             if (formElement.renderer()) {
-                formElement.dispatchSimulatedClick(event);
+                formElement.dispatchSimulatedClick(&event);
                 return;
             }
         } else if (formElement.canTriggerImplicitSubmission())
@@ -205,18 +205,17 @@ void HTMLFormElement::submitImplicitly(Event* event, bool fromImplicitSubmission
         prepareForSubmission(event);
 }
 
-static inline HTMLFormControlElement* submitElementFromEvent(const Event* event)
+static inline HTMLFormControlElement* submitElementFromEvent(const Event& event)
 {
-    for (Node* node = event->target()->toNode(); node; node = node->parentNode()) {
+    for (Node* node = event.target()->toNode(); node; node = node->parentNode()) {
         if (is<HTMLFormControlElement>(*node))
             return downcast<HTMLFormControlElement>(node);
     }
     return nullptr;
 }
 
-bool HTMLFormElement::validateInteractively(Event* event)
+bool HTMLFormElement::validateInteractively(Event& event)
 {
-    ASSERT(event);
     if (!document().page() || !document().page()->settings().interactiveFormValidationEnabled() || noValidate())
         return true;
 
@@ -268,7 +267,7 @@ bool HTMLFormElement::validateInteractively(Event* event)
     return false;
 }
 
-void HTMLFormElement::prepareForSubmission(Event* event)
+void HTMLFormElement::prepareForSubmission(Event& event)
 {
     Frame* frame = document().frame();
     if (m_isSubmittingOrPreparingForSubmission || !frame)
@@ -296,7 +295,7 @@ void HTMLFormElement::prepareForSubmission(Event* event)
     m_isSubmittingOrPreparingForSubmission = false;
 
     if (m_shouldSubmit)
-        submit(event, true, true, NotSubmittedByJavaScript);
+        submit(&event, true, true, NotSubmittedByJavaScript);
 }
 
 void HTMLFormElement::submit()
index 9e8253c..89e04a2 100644 (file)
@@ -84,14 +84,14 @@ public:
     void registerImgElement(HTMLImageElement*);
     void removeImgElement(HTMLImageElement*);
 
-    void prepareForSubmission(Event*); // FIXME: This function doesn't only prepare, it sometimes calls submit() itself.
+    void prepareForSubmission(Event&); // FIXME: This function doesn't only prepare, it sometimes calls submit() itself.
     WEBCORE_EXPORT void submit();
     void submitFromJavaScript();
     WEBCORE_EXPORT void reset();
 
     void setDemoted(bool demoted) { m_wasDemoted = demoted; }
 
-    void submitImplicitly(Event*, bool fromImplicitSubmissionTrigger);
+    void submitImplicitly(Event&, bool fromImplicitSubmissionTrigger);
     bool formWouldHaveSecureSubmission(const String& url);
 
     String name() const;
@@ -162,7 +162,7 @@ private:
     unsigned formElementIndex(FormAssociatedElement*);
 
     // Returns true if the submission should proceed.
-    bool validateInteractively(Event*);
+    bool validateInteractively(Event&);
 
     // Validates each of the controls, and stores controls of which 'invalid'
     // event was not canceled to the specified vector. Returns true if there
index 2af585b..78370a3 100644 (file)
@@ -107,7 +107,7 @@ void HTMLFrameOwnerElement::setSandboxFlags(SandboxFlags flags)
     m_sandboxFlags = flags;
 }
 
-bool HTMLFrameOwnerElement::isKeyboardFocusable(KeyboardEvent* event) const
+bool HTMLFrameOwnerElement::isKeyboardFocusable(KeyboardEvent& event) const
 {
     return m_contentFrame && HTMLElement::isKeyboardFocusable(event);
 }
index 0f89630..9fa5613 100644 (file)
@@ -62,7 +62,7 @@ protected:
     void setSandboxFlags(SandboxFlags);
 
 private:
-    bool isKeyboardFocusable(KeyboardEvent*) const override;
+    bool isKeyboardFocusable(KeyboardEvent&) const override;
     bool isFrameOwnerElement() const final { return true; }
 
     Frame* m_contentFrame;
index a8ee824..5413b32 100644 (file)
@@ -189,12 +189,11 @@ void HTMLFrameSetElement::willAttachRenderers()
         m_noresize = containingFrameSet->noResize();
 }
 
-void HTMLFrameSetElement::defaultEventHandler(Event* event)
+void HTMLFrameSetElement::defaultEventHandler(Event& event)
 {
-    ASSERT(event);
-    if (is<MouseEvent>(*event) && !m_noresize && is<RenderFrameSet>(renderer())) {
+    if (is<MouseEvent>(event) && !m_noresize && is<RenderFrameSet>(renderer())) {
         if (downcast<RenderFrameSet>(*renderer()).userResize(downcast<MouseEvent>(event))) {
-            event->setDefaultHandled();
+            event.setDefaultHandled();
             return;
         }
     }
index d3d2e87..f1e3708 100644 (file)
@@ -58,7 +58,7 @@ private:
     bool rendererIsNeeded(const RenderStyle&) final;
     RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final;
     
-    void defaultEventHandler(Event*) final;
+    void defaultEventHandler(Event&) final;
 
     bool willRecalcStyle(Style::Change) final;
 
index 0690b22..1626e0b 100644 (file)
@@ -42,7 +42,7 @@ private:
     HTMLIFrameElement(const QualifiedName&, Document&);
 
 #if PLATFORM(IOS)
-    bool isKeyboardFocusable(KeyboardEvent*) const final { return false; }
+    bool isKeyboardFocusable(KeyboardEvent&) const final { return false; }
 #endif
 
     void parseAttribute(const QualifiedName&, const AtomicString&) final;
index 354fc35..b189631 100644 (file)
@@ -372,7 +372,7 @@ bool HTMLInputElement::hasCustomFocusLogic() const
     return m_inputType->hasCustomFocusLogic();
 }
 
-bool HTMLInputElement::isKeyboardFocusable(KeyboardEvent* event) const
+bool HTMLInputElement::isKeyboardFocusable(KeyboardEvent& event) const
 {
     return m_inputType->isKeyboardFocusable(event);
 }
@@ -387,7 +387,7 @@ bool HTMLInputElement::isTextFormControlFocusable() const
     return HTMLTextFormControlElement::isFocusable();
 }
 
-bool HTMLInputElement::isTextFormControlKeyboardFocusable(KeyboardEvent* event) const
+bool HTMLInputElement::isTextFormControlKeyboardFocusable(KeyboardEvent& event) const
 {
     return HTMLTextFormControlElement::isKeyboardFocusable(event);
 }
@@ -1083,7 +1083,7 @@ void HTMLInputElement::setValueFromRenderer(const String& value)
 
 void HTMLInputElement::willDispatchEvent(Event& event, InputElementClickState& state)
 {
-    if (event.type() == eventNames().textInputEvent && m_inputType->shouldSubmitImplicitly(&event))
+    if (event.type() == eventNames().textInputEvent && m_inputType->shouldSubmitImplicitly(event))
         event.stopPropagation();
     if (event.type() == eventNames().clickEvent && is<MouseEvent>(event) && downcast<MouseEvent>(event).button() == LeftButton) {
         m_inputType->willDispatchClick(state);
@@ -1096,35 +1096,34 @@ void HTMLInputElement::didDispatchClickEvent(Event& event, const InputElementCli
     m_inputType->didDispatchClick(&event, state);
 }
 
-void HTMLInputElement::defaultEventHandler(Event* evt)
+void HTMLInputElement::defaultEventHandler(Event& event)
 {
-    ASSERT(evt);
-    if (is<MouseEvent>(*evt) && evt->type() == eventNames().clickEvent && downcast<MouseEvent>(*evt).button() == LeftButton) {
-        m_inputType->handleClickEvent(downcast<MouseEvent>(evt));
-        if (evt->defaultHandled())
+    if (is<MouseEvent>(event) && event.type() == eventNames().clickEvent && downcast<MouseEvent>(event).button() == LeftButton) {
+        m_inputType->handleClickEvent(downcast<MouseEvent>(event));
+        if (event.defaultHandled())
             return;
     }
 
 #if ENABLE(TOUCH_EVENTS)
-    if (is<TouchEvent>(*evt)) {
-        m_inputType->handleTouchEvent(downcast<TouchEvent>(evt));
-        if (evt->defaultHandled())
+    if (is<TouchEvent>(event)) {
+        m_inputType->handleTouchEvent(downcast<TouchEvent>(event));
+        if (event.defaultHandled())
             return;
     }
 #endif
 
-    if (is<KeyboardEvent>(*evt) && evt->type() == eventNames().keydownEvent) {
-        m_inputType->handleKeydownEvent(downcast<KeyboardEvent>(evt));
-        if (evt->defaultHandled())
+    if (is<KeyboardEvent>(event) && event.type() == eventNames().keydownEvent) {
+        m_inputType->handleKeydownEvent(downcast<KeyboardEvent>(event));
+        if (event.defaultHandled())
             return;
     }
 
     // Call the base event handler before any of our own event handling for almost all events in text fields.
     // Makes editing keyboard handling take precedence over the keydown and keypress handling in this function.
-    bool callBaseClassEarly = isTextField() && (evt->type() == eventNames().keydownEvent || evt->type() == eventNames().keypressEvent);
+    bool callBaseClassEarly = isTextField() && (event.type() == eventNames().keydownEvent || event.type() == eventNames().keypressEvent);
     if (callBaseClassEarly) {
-        HTMLTextFormControlElement::defaultEventHandler(evt);
-        if (evt->defaultHandled())
+        HTMLTextFormControlElement::defaultEventHandler(event);
+        if (event.defaultHandled())
             return;
     }
 
@@ -1132,28 +1131,28 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
     // actually submitting the form. For reset inputs, the form is reset. These events are sent when the user clicks
     // on the element, or presses enter while it is the active element. JavaScript code wishing to activate the element
     // must dispatch a DOMActivate event - a click event will not do the job.
-    if (evt->type() == eventNames().DOMActivateEvent) {
-        m_inputType->handleDOMActivateEvent(evt);
-        if (evt->defaultHandled())
+    if (event.type() == eventNames().DOMActivateEvent) {
+        m_inputType->handleDOMActivateEvent(event);
+        if (event.defaultHandled())
             return;
     }
 
     // Use key press event here since sending simulated mouse events
     // on key down blocks the proper sending of the key press event.
-    if (is<KeyboardEvent>(*evt)) {
-        KeyboardEvent& keyboardEvent = downcast<KeyboardEvent>(*evt);
+    if (is<KeyboardEvent>(event)) {
+        KeyboardEvent& keyboardEvent = downcast<KeyboardEvent>(event);
         if (keyboardEvent.type() == eventNames().keypressEvent) {
-            m_inputType->handleKeypressEvent(&keyboardEvent);
+            m_inputType->handleKeypressEvent(keyboardEvent);
             if (keyboardEvent.defaultHandled())
                 return;
         } else if (keyboardEvent.type() == eventNames().keyupEvent) {
-            m_inputType->handleKeyupEvent(&keyboardEvent);
+            m_inputType->handleKeyupEvent(keyboardEvent);
             if (keyboardEvent.defaultHandled())
                 return;
         }
     }
 
-    if (m_inputType->shouldSubmitImplicitly(evt)) {
+    if (m_inputType->shouldSubmitImplicitly(event)) {
         if (isSearchField()) {
             addSearchResult();
             onSearch();
@@ -1166,25 +1165,25 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
         RefPtr<HTMLFormElement> formForSubmission = m_inputType->formForSubmission();
         // Form may never have been present, or may have been destroyed by code responding to the change event.
         if (formForSubmission)
-            formForSubmission->submitImplicitly(evt, canTriggerImplicitSubmission());
+            formForSubmission->submitImplicitly(event, canTriggerImplicitSubmission());
 
-        evt->setDefaultHandled();
+        event.setDefaultHandled();
         return;
     }
 
-    if (is<BeforeTextInsertedEvent>(*evt))
-        m_inputType->handleBeforeTextInsertedEvent(downcast<BeforeTextInsertedEvent>(evt));
+    if (is<BeforeTextInsertedEvent>(event))
+        m_inputType->handleBeforeTextInsertedEvent(downcast<BeforeTextInsertedEvent>(event));
 
-    if (is<MouseEvent>(*evt) && evt->type() == eventNames().mousedownEvent) {
-        m_inputType->handleMouseDownEvent(downcast<MouseEvent>(evt));
-        if (evt->defaultHandled())
+    if (is<MouseEvent>(event) && event.type() == eventNames().mousedownEvent) {
+        m_inputType->handleMouseDownEvent(downcast<MouseEvent>(event));
+        if (event.defaultHandled())
             return;
     }
 
-    m_inputType->forwardEvent(evt);
+    m_inputType->forwardEvent(event);
 
-    if (!callBaseClassEarly && !evt->defaultHandled())
-        HTMLTextFormControlElement::defaultEventHandler(evt);
+    if (!callBaseClassEarly && !event.defaultHandled())
+        HTMLTextFormControlElement::defaultEventHandler(event);
 }
 
 bool HTMLInputElement::willRespondToMouseClickEvents()
index d98cc62..f3db040 100644 (file)
@@ -284,7 +284,7 @@ public:
     // Functions for InputType classes.
     void setValueInternal(const String&, TextFieldEventBehavior);
     bool isTextFormControlFocusable() const;
-    bool isTextFormControlKeyboardFocusable(KeyboardEvent*) const;
+    bool isTextFormControlKeyboardFocusable(KeyboardEvent&) const;
     bool isTextFormControlMouseFocusable() const;
     bool valueAttributeWasUpdatedAfterParsing() const { return m_valueAttributeWasUpdatedAfterParsing; }
 
@@ -335,7 +335,7 @@ public:
 protected:
     HTMLInputElement(const QualifiedName&, Document&, HTMLFormElement*, bool createdByParser);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 
 private:
     enum AutoCompleteSetting { Uninitialized, On, Off };
@@ -350,7 +350,7 @@ private:
     void didMoveToNewDocument(Document* oldDocument) final;
 
     bool hasCustomFocusLogic() const final;
-    bool isKeyboardFocusable(KeyboardEvent*) const final;
+    bool isKeyboardFocusable(KeyboardEvent&) const final;
     bool isMouseFocusable() const final;
     bool isEnumeratable() const final;
     bool supportLabels() const final;
index dfbd7b1..4c21d84 100644 (file)
@@ -110,22 +110,22 @@ void HTMLLabelElement::setHovered(bool over)
         element->setHovered(over);
 }
 
-void HTMLLabelElement::defaultEventHandler(Event* evt)
+void HTMLLabelElement::defaultEventHandler(Event& event)
 {
     static bool processingClick = false;
 
-    if (evt->type() == eventNames().clickEvent && !processingClick) {
+    if (event.type() == eventNames().clickEvent && !processingClick) {
         RefPtr<LabelableElement> element = control();
 
         // If we can't find a control or if the control received the click
         // event, then there's no need for us to do anything.
-        if (!element || (evt->target() && element->containsIncludingShadowDOM(evt->target()->toNode())))
+        if (!element || (event.target() && element->containsIncludingShadowDOM(event.target()->toNode())))
             return;
 
         processingClick = true;
 
         // Click the corresponding control.
-        element->dispatchSimulatedClick(evt);
+        element->dispatchSimulatedClick(&event);
 
         document().updateLayoutIgnorePendingStylesheets();
         if (element->isMouseFocusable())
@@ -133,10 +133,10 @@ void HTMLLabelElement::defaultEventHandler(Event* evt)
 
         processingClick = false;
         
-        evt->setDefaultHandled();
+        event.setDefaultHandled();
     }
     
-    HTMLElement::defaultEventHandler(evt);
+    HTMLElement::defaultEventHandler(event);
 }
 
 bool HTMLLabelElement::willRespondToMouseClickEvents()
index 69f57e3..a2830b3 100644 (file)
@@ -48,7 +48,7 @@ private:
     void setHovered(bool = true) final;
 
     // Overridden to either click() or focus() the corresponding control.
-    void defaultEventHandler(Event*) final;
+    void defaultEventHandler(Event&) final;
 
     void focus(bool restorePreviousSelection, FocusDirection) final;
 };
index 4fdb6a3..9bfa908 100644 (file)
@@ -454,11 +454,10 @@ bool HTMLLinkElement::isURLAttribute(const Attribute& attribute) const
     return attribute.name().localName() == hrefAttr || HTMLElement::isURLAttribute(attribute);
 }
 
-void HTMLLinkElement::defaultEventHandler(Event* event)
+void HTMLLinkElement::defaultEventHandler(Event& event)
 {
-    ASSERT(event);
-    if (MouseEvent::canTriggerActivationBehavior(*event)) {
-        handleClick(*event);
+    if (MouseEvent::canTriggerActivationBehavior(event)) {
+        handleClick(event);
         return;
     }
     HTMLElement::defaultEventHandler(event);
index f71eadb..9ee81c2 100644 (file)
@@ -97,7 +97,7 @@ private:
 
     bool isURLAttribute(const Attribute&) const final;
 
-    void defaultEventHandler(Event*) final;
+    void defaultEventHandler(Event&) final;
     void handleClick(Event&);
 
     HTMLLinkElement(const QualifiedName&, Document&, bool createdByParser);
index f21eb96..ccdfb60 100644 (file)
@@ -180,7 +180,7 @@ void HTMLPlugInElement::collectStyleForPresentationAttribute(const QualifiedName
         HTMLFrameOwnerElement::collectStyleForPresentationAttribute(name, value, style);
 }
 
-void HTMLPlugInElement::defaultEventHandler(Event* event)
+void HTMLPlugInElement::defaultEventHandler(Event& event)
 {
     // Firefox seems to use a fake event listener to dispatch events to plug-in (tested with mouse events only).
     // This is observable via different order of events - in Firefox, event listeners specified in HTML attributes fires first, then an event
@@ -194,12 +194,12 @@ void HTMLPlugInElement::defaultEventHandler(Event* event)
 
     if (is<RenderEmbeddedObject>(*renderer)) {
         if (downcast<RenderEmbeddedObject>(*renderer).isPluginUnavailable()) {
-            downcast<RenderEmbeddedObject>(*renderer).handleUnavailablePluginIndicatorEvent(event);
+            downcast<RenderEmbeddedObject>(*renderer).handleUnavailablePluginIndicatorEvent(&event);
             return;
         }
 
         if (is<RenderSnapshottedPlugIn>(*renderer) && displayState() < Restarting) {
-            downcast<RenderSnapshottedPlugIn>(*renderer).handleEvent(event);
+            downcast<RenderSnapshottedPlugIn>(*renderer).handleEvent(&event);
             HTMLFrameOwnerElement::defaultEventHandler(event);
             return;
         }
@@ -213,14 +213,14 @@ void HTMLPlugInElement::defaultEventHandler(Event* event)
         RefPtr<Widget> widget = downcast<RenderWidget>(*renderer).widget();
         if (!widget)
             return;
-        widget->handleEvent(event);
-        if (event->defaultHandled())
+        widget->handleEvent(&event);
+        if (event.defaultHandled())
             return;
     }
     HTMLFrameOwnerElement::defaultEventHandler(event);
 }
 
-bool HTMLPlugInElement::isKeyboardFocusable(KeyboardEvent*) const
+bool HTMLPlugInElement::isKeyboardFocusable(KeyboardEvent&) const
 {
     // FIXME: Why is this check needed?
     if (!document().page())
index a87a987..b0b9bd0 100644 (file)
@@ -92,7 +92,7 @@ protected:
 
     virtual bool useFallbackContent() const { return false; }
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 
     virtual bool requestObject(const String& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues);
     RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override;
@@ -114,7 +114,7 @@ private:
 
     bool supportsFocus() const override;
 
-    bool isKeyboardFocusable(KeyboardEvent*) const override;
+    bool isKeyboardFocusable(KeyboardEvent&) const override;
     bool isPluginElement() const final;
 
     RefPtr<JSC::Bindings::Instance> m_instance;
index 26c7f71..0114915 100644 (file)
@@ -755,12 +755,12 @@ void HTMLPlugInImageElement::subframeLoaderDidCreatePlugIn(const Widget& widget)
     }
 }
 
-void HTMLPlugInImageElement::defaultEventHandler(Event* event)
+void HTMLPlugInImageElement::defaultEventHandler(Event& event)
 {
     RenderElement* r = renderer();
     if (r && r->isEmbeddedObject()) {
-        if (displayState() == WaitingForSnapshot && is<MouseEvent>(*event) && event->type() == eventNames().clickEvent) {
-            MouseEvent& mouseEvent = downcast<MouseEvent>(*event);
+        if (displayState() == WaitingForSnapshot && is<MouseEvent>(event) && event.type() == eventNames().clickEvent) {
+            MouseEvent& mouseEvent = downcast<MouseEvent>(event);
             if (mouseEvent.button() == LeftButton) {
                 userDidClickSnapshot(&mouseEvent, true);
                 mouseEvent.setDefaultHandled();
index 988d9e6..0dab409 100644 (file)
@@ -125,7 +125,7 @@ private:
     void prepareForDocumentSuspension() final;
     void resumeFromDocumentSuspension() final;
 
-    void defaultEventHandler(Event*) final;
+    void defaultEventHandler(Event&) final;
     void dispatchPendingMouseClick() final;
 
     void updateSnapshot(PassRefPtr<Image>) final;
index 16d603e..e13ea98 100644 (file)
@@ -316,7 +316,7 @@ void HTMLSelectElement::parseAttribute(const QualifiedName& name, const AtomicSt
         HTMLFormControlElementWithState::parseAttribute(name, value);
 }
 
-bool HTMLSelectElement::isKeyboardFocusable(KeyboardEvent* event) const
+bool HTMLSelectElement::isKeyboardFocusable(KeyboardEvent& event) const
 {
     if (renderer())
         return isFocusable();
@@ -1113,7 +1113,7 @@ bool HTMLSelectElement::platformHandleKeydownEvent(KeyboardEvent* event)
 
 #endif
 
-void HTMLSelectElement::menuListDefaultEventHandler(Event* event)
+void HTMLSelectElement::menuListDefaultEventHandler(Event& event)
 {
     ASSERT(renderer());
     ASSERT(renderer()->isMenuList());
@@ -1121,11 +1121,11 @@ void HTMLSelectElement::menuListDefaultEventHandler(Event* event)
     const Page* page = document().page();
     RefPtr<RenderTheme> renderTheme = page ? &page->theme() : RenderTheme::defaultTheme();
 
-    if (event->type() == eventNames().keydownEvent) {
-        if (!is<KeyboardEvent>(*event))
+    if (event.type() == eventNames().keydownEvent) {
+        if (!is<KeyboardEvent>(event))
             return;
 
-        KeyboardEvent& keyboardEvent = downcast<KeyboardEvent>(*event);
+        KeyboardEvent& keyboardEvent = downcast<KeyboardEvent>(event);
         if (platformHandleKeydownEvent(&keyboardEvent))
             return;
 
@@ -1174,11 +1174,11 @@ void HTMLSelectElement::menuListDefaultEventHandler(Event* event)
 
     // Use key press event here since sending simulated mouse events
     // on key down blocks the proper sending of the key press event.
-    if (event->type() == eventNames().keypressEvent) {
-        if (!is<KeyboardEvent>(*event))
+    if (event.type() == eventNames().keypressEvent) {
+        if (!is<KeyboardEvent>(event))
             return;
 
-        KeyboardEvent& keyboardEvent = downcast<KeyboardEvent>(*event);
+        KeyboardEvent& keyboardEvent = downcast<KeyboardEvent>(event);
         int keyCode = keyboardEvent.keyCode();
         bool handled = false;
 
@@ -1224,7 +1224,7 @@ void HTMLSelectElement::menuListDefaultEventHandler(Event* event)
                 handled = true;
             } else if (keyCode == '\r') {
                 if (form())
-                    form()->submitImplicitly(&keyboardEvent, false);
+                    form()->submitImplicitly(keyboardEvent, false);
                 dispatchChangeEventForMenuList();
                 handled = true;
             }
@@ -1234,7 +1234,7 @@ void HTMLSelectElement::menuListDefaultEventHandler(Event* event)
             keyboardEvent.setDefaultHandled();
     }
 
-    if (event->type() == eventNames().mousedownEvent && is<MouseEvent>(*event) && downcast<MouseEvent>(*event).button() == LeftButton) {
+    if (event.type() == eventNames().mousedownEvent && is<MouseEvent>(event) && downcast<MouseEvent>(event).button() == LeftButton) {
         focus();
 #if !PLATFORM(IOS)
         auto* renderer = this->renderer();
@@ -1250,11 +1250,11 @@ void HTMLSelectElement::menuListDefaultEventHandler(Event* event)
             menuList.showPopup();
         }
 #endif
-        event->setDefaultHandled();
+        event.setDefaultHandled();
     }
 
 #if !PLATFORM(IOS)
-    if (event->type() == eventNames().blurEvent && !focused()) {
+    if (event.type() == eventNames().blurEvent && !focused()) {
         auto& menuList = downcast<RenderMenuList>(*renderer());
         if (menuList.popupIsVisible())
             menuList.hidePopup();
@@ -1314,11 +1314,11 @@ void HTMLSelectElement::updateSelectedState(int listIndex, bool multi, bool shif
     updateListBoxSelection(!multiSelect);
 }
 
-void HTMLSelectElement::listBoxDefaultEventHandler(Event* event)
+void HTMLSelectElement::listBoxDefaultEventHandler(Event& event)
 {
     auto& listItems = this->listItems();
 
-    if (event->type() == eventNames().mousedownEvent && is<MouseEvent>(*event) && downcast<MouseEvent>(*event).button() == LeftButton) {
+    if (event.type() == eventNames().mousedownEvent && is<MouseEvent>(event) && downcast<MouseEvent>(event).button() == LeftButton) {
         focus();
 
         // Calling focus() may remove or change our renderer, in which case we don't want to handle the event further.
@@ -1328,7 +1328,7 @@ void HTMLSelectElement::listBoxDefaultEventHandler(Event* event)
         auto& renderListBox = downcast<RenderListBox>(*renderer);
 
         // Convert to coords relative to the list box if needed.
-        MouseEvent& mouseEvent = downcast<MouseEvent>(*event);
+        MouseEvent& mouseEvent = downcast<MouseEvent>(event);
         IntPoint localOffset = roundedIntPoint(renderListBox.absoluteToLocal(mouseEvent.absoluteLocation(), UseTransforms));
         int listIndex = renderListBox.listIndexAtOffset(toIntSize(localOffset));
         if (listIndex >= 0) {
@@ -1344,8 +1344,8 @@ void HTMLSelectElement::listBoxDefaultEventHandler(Event* event)
 
             mouseEvent.setDefaultHandled();
         }
-    } else if (event->type() == eventNames().mousemoveEvent && is<MouseEvent>(*event) && !downcast<RenderListBox>(*renderer()).canBeScrolledAndHasScrollableArea()) {
-        MouseEvent& mouseEvent = downcast<MouseEvent>(*event);
+    } else if (event.type() == eventNames().mousemoveEvent && is<MouseEvent>(event) && !downcast<RenderListBox>(*renderer()).canBeScrolledAndHasScrollableArea()) {
+        MouseEvent& mouseEvent = downcast<MouseEvent>(event);
         if (mouseEvent.button() != LeftButton || !mouseEvent.buttonDown())
             return;
 
@@ -1369,7 +1369,7 @@ void HTMLSelectElement::listBoxDefaultEventHandler(Event* event)
             }
             mouseEvent.setDefaultHandled();
         }
-    } else if (event->type() == eventNames().mouseupEvent && is<MouseEvent>(*event) && downcast<MouseEvent>(*event).button() == LeftButton && document().frame()->eventHandler().autoscrollRenderer() != renderer()) {
+    } else if (event.type() == eventNames().mouseupEvent && is<MouseEvent>(event) && downcast<MouseEvent>(event).button() == LeftButton && document().frame()->eventHandler().autoscrollRenderer() != renderer()) {
         // This click or drag event was not over any of the options.
         if (m_lastOnChangeSelection.isEmpty())
             return;
@@ -1377,11 +1377,11 @@ void HTMLSelectElement::listBoxDefaultEventHandler(Event* event)
         // click. For drag selection, onChange will fire when the autoscroll
         // timer stops.
         listBoxOnChange();
-    } else if (event->type() == eventNames().keydownEvent) {
-        if (!is<KeyboardEvent>(*event))
+    } else if (event.type() == eventNames().keydownEvent) {
+        if (!is<KeyboardEvent>(event))
             return;
 
-        KeyboardEvent& keyboardEvent = downcast<KeyboardEvent>(*event);
+        KeyboardEvent& keyboardEvent = downcast<KeyboardEvent>(event);
         const String& keyIdentifier = keyboardEvent.keyIdentifier();
 
         bool handled = false;
@@ -1468,15 +1468,15 @@ void HTMLSelectElement::listBoxDefaultEventHandler(Event* event)
 
             keyboardEvent.setDefaultHandled();
         }
-    } else if (event->type() == eventNames().keypressEvent) {
-        if (!is<KeyboardEvent>(*event))
+    } else if (event.type() == eventNames().keypressEvent) {
+        if (!is<KeyboardEvent>(event))
             return;
-        KeyboardEvent& keyboardEvent = downcast<KeyboardEvent>(*event);
+        KeyboardEvent& keyboardEvent = downcast<KeyboardEvent>(event);
         int keyCode = keyboardEvent.keyCode();
 
         if (keyCode == '\r') {
             if (form())
-                form()->submitImplicitly(&keyboardEvent, false);
+                form()->submitImplicitly(keyboardEvent, false);
             keyboardEvent.setDefaultHandled();
         } else if (m_multiple && keyCode == ' ' && m_allowsNonContiguousSelection) {
             // Use space to toggle selection change.
@@ -1491,7 +1491,7 @@ void HTMLSelectElement::listBoxDefaultEventHandler(Event* event)
     }
 }
 
-void HTMLSelectElement::defaultEventHandler(Event* event)
+void HTMLSelectElement::defaultEventHandler(Event& event)
 {
     auto* renderer = this->renderer();
     if (!renderer)
@@ -1510,14 +1510,14 @@ void HTMLSelectElement::defaultEventHandler(Event* event)
 #else
     menuListDefaultEventHandler(event);
 #endif
-    if (event->defaultHandled())
+    if (event.defaultHandled())
         return;
 
-    if (event->type() == eventNames().keypressEvent && is<KeyboardEvent>(*event)) {
-        KeyboardEvent& keyboardEvent = downcast<KeyboardEvent>(*event);
+    if (event.type() == eventNames().keypressEvent && is<KeyboardEvent>(event)) {
+        KeyboardEvent& keyboardEvent = downcast<KeyboardEvent>(event);
         if (!keyboardEvent.ctrlKey() && !keyboardEvent.altKey() && !keyboardEvent.metaKey() && u_isprint(keyboardEvent.charCode())) {
             typeAheadFind(keyboardEvent);
-            event->setDefaultHandled();
+            event.setDefaultHandled();
             return;
         }
     }
index f9e7bf6..3e3677b 100644 (file)
@@ -110,7 +110,7 @@ protected:
 private:
     const AtomicString& formControlType() const final;
     
-    bool isKeyboardFocusable(KeyboardEvent*) const final;
+    bool isKeyboardFocusable(KeyboardEvent&) const final;
     bool isMouseFocusable() const final;
 
     void dispatchFocusEvent(RefPtr<Element>&& oldFocusedElement, FocusDirection) final;
@@ -133,7 +133,7 @@ private:
 
     void reset() final;
 
-    void defaultEventHandler(Event*) final;
+    void defaultEventHandler(Event&) final;
     bool willRespondToMouseClickEvents() final;
 
     void dispatchChangeEventForMenuList();
@@ -164,9 +164,9 @@ private:
     void parseMultipleAttribute(const AtomicString&);
     int lastSelectedListIndex() const;
     void updateSelectedState(int listIndex, bool multi, bool shift);
-    void menuListDefaultEventHandler(Event*);
+    void menuListDefaultEventHandler(Event&);
     bool platformHandleKeydownEvent(KeyboardEvent*);
-    void listBoxDefaultEventHandler(Event*);
+    void listBoxDefaultEventHandler(Event&);
     void setOptionsChangedOnRenderer();
     size_t searchOptionsForValue(const String&, size_t listIndexStart, size_t listIndexEnd) const;
 
index a16ed38..21f4a4a 100644 (file)
@@ -98,18 +98,18 @@ bool HTMLSummaryElement::supportsFocus() const
     return isActiveSummary();
 }
 
-void HTMLSummaryElement::defaultEventHandler(Event* event)
+void HTMLSummaryElement::defaultEventHandler(Event& event)
 {
     if (isActiveSummary() && renderer()) {
-        if (event->type() == eventNames().DOMActivateEvent && !isClickableControl(event->target()->toNode())) {
+        if (event.type() == eventNames().DOMActivateEvent && !isClickableControl(event.target()->toNode())) {
             if (HTMLDetailsElement* details = detailsElement())
                 details->toggleOpen();
-            event->setDefaultHandled();
+            event.setDefaultHandled();
             return;
         }
 
-        if (is<KeyboardEvent>(*event)) {
-            KeyboardEvent& keyboardEvent = downcast<KeyboardEvent>(*event);
+        if (is<KeyboardEvent>(event)) {
+            KeyboardEvent& keyboardEvent = downcast<KeyboardEvent>(event);
             if (keyboardEvent.type() == eventNames().keydownEvent && keyboardEvent.keyIdentifier() == "U+0020") {
                 setActive(true, true);
                 // No setDefaultHandled() - IE dispatches a keypress in this case.
@@ -118,7 +118,7 @@ void HTMLSummaryElement::defaultEventHandler(Event* event)
             if (keyboardEvent.type() == eventNames().keypressEvent) {
                 switch (keyboardEvent.charCode()) {
                 case '\r':
-                    dispatchSimulatedClick(event);
+                    dispatchSimulatedClick(&event);
                     keyboardEvent.setDefaultHandled();
                     return;
                 case ' ':
@@ -129,7 +129,7 @@ void HTMLSummaryElement::defaultEventHandler(Event* event)
             }
             if (keyboardEvent.type() == eventNames().keyupEvent && keyboardEvent.keyIdentifier() == "U+0020") {
                 if (active())
-                    dispatchSimulatedClick(event);
+                    dispatchSimulatedClick(&event);
                 keyboardEvent.setDefaultHandled();
                 return;
             }
index ac416eb..a04b3e5 100644 (file)
@@ -38,7 +38,7 @@ private:
     HTMLSummaryElement(const QualifiedName&, Document&);
 
     RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final;
-    void defaultEventHandler(Event*) final;
+    void defaultEventHandler(Event&) final;
 
     void didAddUserAgentShadowRoot(ShadowRoot*) final;
 
index 3a0a9db..0a6182d 100644 (file)
@@ -238,7 +238,7 @@ bool HTMLTextAreaElement::hasCustomFocusLogic() const
     return true;
 }
 
-bool HTMLTextAreaElement::isKeyboardFocusable(KeyboardEvent*) const
+bool HTMLTextAreaElement::isKeyboardFocusable(KeyboardEvent&) const
 {
     // If a given text area can be focused at all, then it will always be keyboard focusable.
     return isFocusable();
@@ -263,11 +263,11 @@ void HTMLTextAreaElement::updateFocusAppearance(SelectionRestorationMode restora
         document().frame()->selection().revealSelection(revealMode);
 }
 
-void HTMLTextAreaElement::defaultEventHandler(Event* event)
+void HTMLTextAreaElement::defaultEventHandler(Event& event)
 {
-    if (renderer() && (event->isMouseEvent() || event->type() == eventNames().blurEvent))
+    if (renderer() && (event.isMouseEvent() || event.type() == eventNames().blurEvent))
         forwardEvent(event);
-    else if (renderer() && is<BeforeTextInsertedEvent>(*event))
+    else if (renderer() && is<BeforeTextInsertedEvent>(event))
         handleBeforeTextInsertedEvent(downcast<BeforeTextInsertedEvent>(event));
 
     HTMLTextFormControlElement::defaultEventHandler(event);
@@ -288,9 +288,8 @@ void HTMLTextAreaElement::subtreeHasChanged()
     calculateAndAdjustDirectionality();
 }
 
-void HTMLTextAreaElement::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent* event) const
+void HTMLTextAreaElement::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent& event) const
 {
-    ASSERT(event);
     ASSERT(renderer());
     int signedMaxLength = effectiveMaxLength();
     if (signedMaxLength < 0)
@@ -300,7 +299,7 @@ void HTMLTextAreaElement::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*
     const String& currentValue = innerTextValue();
     unsigned numberOfLineBreaksInCurrentValue = numberOfLineBreaks(currentValue);
     if (upperBoundForLengthForSubmission(currentValue, numberOfLineBreaksInCurrentValue)
-        + upperBoundForLengthForSubmission(event->text(), numberOfLineBreaks(event->text())) < unsignedMaxLength)
+        + upperBoundForLengthForSubmission(event.text(), numberOfLineBreaks(event.text())) < unsignedMaxLength)
         return;
 
     unsigned currentLength = computeLengthForSubmission(currentValue, numberOfLineBreaksInCurrentValue);
@@ -313,7 +312,7 @@ void HTMLTextAreaElement::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*
     ASSERT(currentLength >= selectionLength);
     unsigned baseLength = currentLength - selectionLength;
     unsigned appendableLength = unsignedMaxLength > baseLength ? unsignedMaxLength - baseLength : 0;
-    event->setText(sanitizeUserInputValue(event->text(), appendableLength));
+    event.setText(sanitizeUserInputValue(event.text(), appendableLength));
 }
 
 String HTMLTextAreaElement::sanitizeUserInputValue(const String& proposedValue, unsigned maxLength)
index a8eadf0..536b97a 100644 (file)
@@ -74,7 +74,7 @@ private:
 
     void maxLengthAttributeChanged(const AtomicString& newValue);
 
-    void handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*) const;
+    void handleBeforeTextInsertedEvent(BeforeTextInsertedEvent&) const;
     static String sanitizeUserInputValue(const String&, unsigned maxLength);
     void updateValue() const;
     void setNonDirtyValue(const String&);
@@ -88,7 +88,7 @@ private:
     bool isOptionalFormControl() const final { return !isRequiredFormControl(); }
     bool isRequiredFormControl() const final { return isRequired(); }
 
-    void defaultEventHandler(Event*) final;
+    void defaultEventHandler(Event&) final;
     
     void subtreeHasChanged() final;
 
@@ -111,7 +111,7 @@ private:
     void reset() final;
     bool hasCustomFocusLogic() const final;
     bool isMouseFocusable() const final;
-    bool isKeyboardFocusable(KeyboardEvent*) const final;
+    bool isKeyboardFocusable(KeyboardEvent&) const final;
     void updateFocusAppearance(SelectionRestorationMode, SelectionRevealMode) final;
 
     void accessKeyAction(bool sendMouseEvents) final;
index 55145fd..7b8aa74 100644 (file)
@@ -116,9 +116,9 @@ void HTMLTextFormControlElement::didEditInnerTextValue()
     subtreeHasChanged();
 }
 
-void HTMLTextFormControlElement::forwardEvent(Event* event)
+void HTMLTextFormControlElement::forwardEvent(Event& event)
 {
-    if (event->type() == eventNames().blurEvent || event->type() == eventNames().focusEvent)
+    if (event.type() == eventNames().blurEvent || event.type() == eventNames().focusEvent)
         return;
     innerTextElement()->defaultEventHandler(event);
 }
index 7eb5c10..f2edec5 100644 (file)
@@ -46,7 +46,7 @@ public:
     virtual ~HTMLTextFormControlElement();
 
     void didEditInnerTextValue();
-    void forwardEvent(Event*);
+    void forwardEvent(Event&);
 
     WEBCORE_EXPORT void setMaxLengthForBindings(int, ExceptionCode&);
 
index 3ca55f5..a738175 100644 (file)
@@ -80,7 +80,7 @@ bool ImageInputType::supportsValidation() const
     return false;
 }
 
-void ImageInputType::handleDOMActivateEvent(Event* event)
+void ImageInputType::handleDOMActivateEvent(Event& event)
 {
     Ref<HTMLInputElement> element(this->element());
     if (element->isDisabledFormControl() || !element->form())
@@ -88,8 +88,8 @@ void ImageInputType::handleDOMActivateEvent(Event* event)
     element->setActivatedSubmit(true);
 
     m_clickLocation = IntPoint();
-    if (event->underlyingEvent()) {
-        Event& underlyingEvent = *event->underlyingEvent();
+    if (event.underlyingEvent()) {
+        Event& underlyingEvent = *event.underlyingEvent();
         if (is<MouseEvent>(underlyingEvent)) {
             MouseEvent& mouseEvent = downcast<MouseEvent>(underlyingEvent);
             if (!mouseEvent.isSimulated())
@@ -99,7 +99,7 @@ void ImageInputType::handleDOMActivateEvent(Event* event)
 
     element->form()->prepareForSubmission(event); // Event handlers can run.
     element->setActivatedSubmit(false);
-    event->setDefaultHandled();
+    event.setDefaultHandled();
 }
 
 RenderPtr<RenderElement> ImageInputType::createInputRenderer(RenderStyle&& style)
index 1e6e937..704026d 100644 (file)
@@ -48,7 +48,7 @@ private:
     bool appendFormData(FormDataList&, bool) const override;
     bool supportsValidation() const override;
     RenderPtr<RenderElement> createInputRenderer(RenderStyle&&) override;
-    void handleDOMActivateEvent(Event*) override;
+    void handleDOMActivateEvent(Event&) override;
     void altAttributeChanged() override;
     void srcAttributeChanged() override;
     void attach() override;
index 2a5f899..8f245c1 100644 (file)
@@ -438,47 +438,47 @@ String InputType::validationMessage() const
     return emptyString();
 }
 
-void InputType::handleClickEvent(MouseEvent*)
+void InputType::handleClickEvent(MouseEvent&)
 {
 }
 
-void InputType::handleMouseDownEvent(MouseEvent*)
+void InputType::handleMouseDownEvent(MouseEvent&)
 {
 }
 
-void InputType::handleDOMActivateEvent(Event*)
+void InputType::handleDOMActivateEvent(Event&)
 {
 }
 
-void InputType::handleKeydownEvent(KeyboardEvent*)
+void InputType::handleKeydownEvent(KeyboardEvent&)
 {
 }
 
-void InputType::handleKeypressEvent(KeyboardEvent*)
+void InputType::handleKeypressEvent(KeyboardEvent&)
 {
 }
 
-void InputType::handleKeyupEvent(KeyboardEvent*)
+void InputType::handleKeyupEvent(KeyboardEvent&)
 {
 }
 
-void InputType::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*)
+void InputType::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent&)
 {
 }
 
 #if ENABLE(TOUCH_EVENTS)
-void InputType::handleTouchEvent(TouchEvent*)
+void InputType::handleTouchEvent(TouchEvent&)
 {
 }
 #endif
 
-void InputType::forwardEvent(Event*)
+void InputType::forwardEvent(Event&)
 {
 }
 
-bool InputType::shouldSubmitImplicitly(Event* event)
+bool InputType::shouldSubmitImplicitly(Event& event)
 {
-    return is<KeyboardEvent>(*event) && event->type() == eventNames().keypressEvent && downcast<KeyboardEvent>(*event).charCode() == '\r';
+    return is<KeyboardEvent>(event) && event.type() == eventNames().keypressEvent && downcast<KeyboardEvent>(event).charCode() == '\r';
 }
 
 PassRefPtr<HTMLFormElement> InputType::formForSubmission() const
@@ -539,11 +539,11 @@ DateComponents::Type InputType::dateType() const
 }
 #endif
 
-void InputType::dispatchSimulatedClickIfActive(KeyboardEvent* event) const
+void InputType::dispatchSimulatedClickIfActive(KeyboardEvent& event) const
 {
     if (element().active())
-        element().dispatchSimulatedClick(event);
-    event->setDefaultHandled();
+        element().dispatchSimulatedClick(&event);
+    event.setDefaultHandled();
 }
 
 Chrome* InputType::chrome() const
@@ -563,7 +563,7 @@ bool InputType::hasCustomFocusLogic() const
     return true;
 }
 
-bool InputType::isKeyboardFocusable(KeyboardEvent* event) const
+bool InputType::isKeyboardFocusable(KeyboardEvent& event) const
 {
     return !element().isReadOnly() && element().isTextFormControlKeyboardFocusable(event);
 }
index 60b3a4c..c7fa6e4 100644 (file)
@@ -178,27 +178,27 @@ public:
 
     // Event handlers.
 
-    virtual void handleClickEvent(MouseEvent*);
-    virtual void handleMouseDownEvent(MouseEvent*);
+    virtual void handleClickEvent(MouseEvent&);
+    virtual void handleMouseDownEvent(MouseEvent&);
     virtual void willDispatchClick(InputElementClickState&);
     virtual void didDispatchClick(Event*, const InputElementClickState&);
-    virtual void handleDOMActivateEvent(Event*);
-    virtual void handleKeydownEvent(KeyboardEvent*);
-    virtual void handleKeypressEvent(KeyboardEvent*);
-    virtual void handleKeyupEvent(KeyboardEvent*);
-    virtual void handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*);
-    virtual void forwardEvent(Event*);
+    virtual void handleDOMActivateEvent(Event&);
+    virtual void handleKeydownEvent(KeyboardEvent&);
+    virtual void handleKeypressEvent(KeyboardEvent&);
+    virtual void handleKeyupEvent(KeyboardEvent&);
+    virtual void handleBeforeTextInsertedEvent(BeforeTextInsertedEvent&);
+    virtual void forwardEvent(Event&);
 
 #if ENABLE(TOUCH_EVENTS)
-    virtual void handleTouchEvent(TouchEvent*);
+    virtual void handleTouchEvent(TouchEvent&);
 #endif
 
     // Helpers for event handlers.
 
-    virtual bool shouldSubmitImplicitly(Event*);
+    virtual bool shouldSubmitImplicitly(Event&);
     virtual PassRefPtr<HTMLFormElement> formForSubmission() const;
     virtual bool hasCustomFocusLogic() const;
-    virtual bool isKeyboardFocusable(KeyboardEvent*) const;
+    virtual bool isKeyboardFocusable(KeyboardEvent&) const;
     virtual bool isMouseFocusable() const;
     virtual bool shouldUseInputMethod() const;
     virtual void handleFocusEvent(Node* oldFocusedNode, FocusDirection);
@@ -295,7 +295,7 @@ public:
     virtual unsigned height() const;
     virtual unsigned width() const;
 
-    void dispatchSimulatedClickIfActive(KeyboardEvent*) const;
+    void dispatchSimulatedClickIfActive(KeyboardEvent&) const;
 
 #if ENABLE(DATALIST_ELEMENT)
     virtual void listAttributeTargetChanged();
index 234c491..8cf1c5a 100644 (file)
@@ -178,24 +178,24 @@ static inline HTMLVideoElement* ancestorVideoElement(Node* node)
     return downcast<HTMLVideoElement>(node);
 }
 
-void MediaDocument::defaultEventHandler(Event* event)
+void MediaDocument::defaultEventHandler(Event& event)
 {
     // Match the default Quicktime plugin behavior to allow 
     // clicking and double-clicking to pause and play the media.
-    Node* targetNode = event->target()->toNode();
+    Node* targetNode = event.target()->toNode();
     if (!targetNode)
         return;
 
     if (HTMLVideoElement* video = ancestorVideoElement(targetNode)) {
-        if (event->type() == eventNames().clickEvent) {
+        if (event.type() == eventNames().clickEvent) {
             if (!video->canPlay()) {
                 video->pause();
-                event->setDefaultHandled();
+                event.setDefaultHandled();
             }
-        } else if (event->type() == eventNames().dblclickEvent) {
+        } else if (event.type() == eventNames().dblclickEvent) {
             if (video->canPlay()) {
                 video->play();
-                event->setDefaultHandled();
+                event.setDefaultHandled();
             }
         }
     }
@@ -203,12 +203,12 @@ void MediaDocument::defaultEventHandler(Event* event)
     if (!is<ContainerNode>(*targetNode))
         return;
     ContainerNode& targetContainer = downcast<ContainerNode>(*targetNode);
-    if (event->type() == eventNames().keydownEvent && is<KeyboardEvent>(*event)) {
+    if (event.type() == eventNames().keydownEvent && is<KeyboardEvent>(event)) {
         HTMLVideoElement* video = descendantVideoElement(targetContainer);
         if (!video)
             return;
 
-        KeyboardEvent& keyboardEvent = downcast<KeyboardEvent>(*event);
+        KeyboardEvent& keyboardEvent = downcast<KeyboardEvent>(event);
         if (keyboardEvent.keyIdentifier() == "U+0020") { // space
             if (video->paused()) {
                 if (video->canPlay())
index c6d7de1..e39da6d 100644 (file)
@@ -49,7 +49,7 @@ private:
 
     Ref<DocumentParser> createParser() override;
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 
     void replaceMediaElementTimerFired();
 
index c6e97d8..741984a 100644 (file)
@@ -219,10 +219,10 @@ bool NumberInputType::isSteppable() const
     return true;
 }
 
-void NumberInputType::handleKeydownEvent(KeyboardEvent* event)
+void NumberInputType::handleKeydownEvent(KeyboardEvent& event)
 {
     handleKeydownEventForSpinButton(event);
-    if (!event->defaultHandled())
+    if (!event.defaultHandled())
         TextFieldInputType::handleKeydownEvent(event);
 }
 
index d9c4950..21fea49 100644 (file)
@@ -51,7 +51,7 @@ private:
     float decorationWidth() const override;
     bool isSteppable() const override;
     StepRange createStepRange(AnyStepHandling) const override;
-    void handleKeydownEvent(KeyboardEvent*) override;
+    void handleKeydownEvent(KeyboardEvent&) override;
     Decimal parseToNumber(const String&, const Decimal&) const override;
     String serialize(const Decimal&) const override;
     String localizeValue(const String&) const override;
index 460fce2..bc66939 100644 (file)
@@ -53,17 +53,17 @@ String RadioInputType::valueMissingText() const
     return validationMessageValueMissingForRadioText();
 }
 
-void RadioInputType::handleClickEvent(MouseEvent* event)
+void RadioInputType::handleClickEvent(MouseEvent& event)
 {
-    event->setDefaultHandled();
+    event.setDefaultHandled();
 }
 
-void RadioInputType::handleKeydownEvent(KeyboardEvent* event)
+void RadioInputType::handleKeydownEvent(KeyboardEvent& event)
 {
     BaseCheckableInputType::handleKeydownEvent(event);
-    if (event->defaultHandled())
+    if (event.defaultHandled())
         return;
-    const String& key = event->keyIdentifier();
+    const String& key = event.keyIdentifier();
     if (key != "Up" && key != "Down" && key != "Left" && key != "Right")
         return;
 
@@ -91,16 +91,16 @@ void RadioInputType::handleKeydownEvent(KeyboardEvent* event)
             break;
         if (inputElement->isRadioButton() && inputElement->name() == element().name() && inputElement->isFocusable()) {
             element().document().setFocusedElement(inputElement.get());
-            inputElement->dispatchSimulatedClick(event, SendNoEvents, DoNotShowPressedLook);
-            event->setDefaultHandled();
+            inputElement->dispatchSimulatedClick(&event, SendNoEvents, DoNotShowPressedLook);
+            event.setDefaultHandled();
             return;
         }
     }
 }
 
-void RadioInputType::handleKeyupEvent(KeyboardEvent* event)
+void RadioInputType::handleKeyupEvent(KeyboardEvent& event)
 {
-    const String& key = event->keyIdentifier();
+    const String& key = event.keyIdentifier();
     if (key != "U+0020")
         return;
     // If an unselected radio is tabbed into (because the entire group has nothing
@@ -110,7 +110,7 @@ void RadioInputType::handleKeyupEvent(KeyboardEvent* event)
     dispatchSimulatedClickIfActive(event);
 }
 
-bool RadioInputType::isKeyboardFocusable(KeyboardEvent* event) const
+bool RadioInputType::isKeyboardFocusable(KeyboardEvent& event) const
 {
     if (!InputType::isKeyboardFocusable(event))
         return false;
index 1425e7b..4d20ada 100644 (file)
@@ -44,10 +44,10 @@ private:
     const AtomicString& formControlType() const override;
     bool valueMissing(const String&) const override;
     String valueMissingText() const override;
-    void handleClickEvent(MouseEvent*) override;
-    void handleKeydownEvent(KeyboardEvent*) override;
-    void handleKeyupEvent(KeyboardEvent*) override;
-    bool isKeyboardFocusable(KeyboardEvent*) const override;
+    void handleClickEvent(MouseEvent&) override;
+    void handleKeydownEvent(KeyboardEvent&) override;
+    void handleKeyupEvent(KeyboardEvent&) override;
+    bool isKeyboardFocusable(KeyboardEvent&) const override;
     bool shouldSendChangeEventAfterCheckedChanged() override;
     void willDispatchClick(InputElementClickState&) override;
     void didDispatchClick(Event*, const InputElementClickState&) override;
index 7aa66f5..f6b9bb6 100644 (file)
@@ -136,13 +136,13 @@ bool RangeInputType::isSteppable() const
 }
 
 #if !PLATFORM(IOS)
-void RangeInputType::handleMouseDownEvent(MouseEvent* event)
+void RangeInputType::handleMouseDownEvent(MouseEvent& event)
 {
     if (element().isDisabledOrReadOnly())
         return;
 
-    Node* targetNode = event->target()->toNode();
-    if (event->button() != LeftButton || !targetNode)
+    Node* targetNode = event.target()->toNode();
+    if (event.button() != LeftButton || !targetNode)
         return;
     ASSERT(element().shadowRoot());
     if (targetNode != &element() && !targetNode->isDescendantOf(element().userAgentShadowRoot()))
@@ -150,12 +150,12 @@ void RangeInputType::handleMouseDownEvent(MouseEvent* event)
     SliderThumbElement& thumb = typedSliderThumbElement();
     if (targetNode == &thumb)
         return;
-    thumb.dragFrom(event->absoluteLocation());
+    thumb.dragFrom(event.absoluteLocation());
 }
 #endif
 
 #if ENABLE(TOUCH_EVENTS)
-void RangeInputType::handleTouchEvent(TouchEvent* event)
+void RangeInputType::handleTouchEvent(TouchEvent& event)
 {
 #if PLATFORM(IOS)
     typedSliderThumbElement().handleTouchEvent(event);
@@ -163,15 +163,15 @@ void RangeInputType::handleTouchEvent(TouchEvent* event)
     if (element().isDisabledOrReadOnly())
         return;
 
-    if (event->type() == eventNames().touchendEvent) {
-        event->setDefaultHandled();
+    if (event.type() == eventNames().touchendEvent) {
+        event.setDefaultHandled();
         return;
     }
 
-    TouchList* touches = event->targetTouches();
+    TouchList* touches = event.targetTouches();
     if (touches->length() == 1) {
         typedSliderThumbElement().setPositionFromPoint(touches->item(0)->absoluteLocation());
-        event->setDefaultHandled();
+        event.setDefaultHandled();
     }
 #else
     UNUSED_PARAM(event);
@@ -193,12 +193,12 @@ void RangeInputType::disabledAttributeChanged()
 #endif
 #endif // ENABLE(TOUCH_EVENTS)
 
-void RangeInputType::handleKeydownEvent(KeyboardEvent* event)
+void RangeInputType::handleKeydownEvent(KeyboardEvent& event)
 {
     if (element().isDisabledOrReadOnly())
         return;
 
-    const String& key = event->keyIdentifier();
+    const String& key = event.keyIdentifier();
 
     const Decimal current = parseToNumberOrNaN(element().value());
     ASSERT(current.isFinite());
@@ -247,7 +247,7 @@ void RangeInputType::handleKeydownEvent(KeyboardEvent* event)
             cache->postNotification(&element(), AXObjectCache::AXValueChanged);
     }
 
-    event->setDefaultHandled();
+    event.setDefaultHandled();
 }
 
 void RangeInputType::createShadowSubtree()
index e6bc788..dffde80 100644 (file)
@@ -51,9 +51,9 @@ private:
     StepRange createStepRange(AnyStepHandling) const override;
     bool isSteppable() const override;
 #if !PLATFORM(IOS)
-    void handleMouseDownEvent(MouseEvent*) override;
+    void handleMouseDownEvent(MouseEvent&) override;
 #endif
-    void handleKeydownEvent(KeyboardEvent*) override;
+    void handleKeydownEvent(KeyboardEvent&) override;
     RenderPtr<RenderElement> createInputRenderer(RenderStyle&&) override;
     void createShadowSubtree() override;
     Decimal parseToNumber(const String&, const Decimal&) const override;
@@ -79,7 +79,7 @@ private:
 #endif
 
 #if ENABLE(TOUCH_EVENTS)
-    void handleTouchEvent(TouchEvent*) override;
+    void handleTouchEvent(TouchEvent&) override;
 
 #if PLATFORM(IOS)
     void disabledAttributeChanged() override;
index c3288dd..016fe10 100644 (file)
@@ -50,12 +50,12 @@ bool ResetInputType::supportsValidation() const
     return false;
 }
 
-void ResetInputType::handleDOMActivateEvent(Event* event)
+void ResetInputType::handleDOMActivateEvent(Event& event)
 {
     if (element().isDisabledFormControl() || !element().form())
         return;
     element().form()->reset();
-    event->setDefaultHandled();
+    event.setDefaultHandled();
 }
 
 String ResetInputType::defaultValue() const
index eb01f5b..ec0ed99 100644 (file)
@@ -42,7 +42,7 @@ public:
 private:
     const AtomicString& formControlType() const override;
     bool supportsValidation() const override;
-    void handleDOMActivateEvent(Event*) override;
+    void handleDOMActivateEvent(Event&) override;
     String defaultValue() const override;
     bool isTextButton() const override;
 };
index 1ba129c..7b23216 100644 (file)
@@ -127,19 +127,19 @@ HTMLElement* SearchInputType::cancelButtonElement() const
     return m_cancelButton;
 }
 
-void SearchInputType::handleKeydownEvent(KeyboardEvent* event)
+void SearchInputType::handleKeydownEvent(KeyboardEvent& event)
 {
     if (element().isDisabledOrReadOnly()) {
         TextFieldInputType::handleKeydownEvent(event);
         return;
     }
 
-    const String& key = event->keyIdentifier();
+    const String& key = event.keyIdentifier();
     if (key == "U+001B") {
         Ref<HTMLInputElement> input(this->element());
         input->setValueForUser(emptyString());
         input->onSearch();
-        event->setDefaultHandled();
+        event.setDefaultHandled();
         return;
     }
     TextFieldInputType::handleKeydownEvent(event);
index d8bc7a5..ccb398f 100644 (file)
@@ -56,7 +56,7 @@ private:
     void destroyShadowSubtree() override;
     HTMLElement* resultsButtonElement() const override;
     HTMLElement* cancelButtonElement() const override;
-    void handleKeydownEvent(KeyboardEvent*) override;
+    void handleKeydownEvent(KeyboardEvent&) override;
     void didSetValueByUserEdit() override;
     bool sizeShouldIncludeDecoration(int defaultSize, int& preferredSize) const override;
     float decorationWidth() const override;
index 1d0b72e..97360e0 100644 (file)
@@ -59,7 +59,7 @@ bool SubmitInputType::supportsRequired() const
     return false;
 }
 
-void SubmitInputType::handleDOMActivateEvent(Event* event)
+void SubmitInputType::handleDOMActivateEvent(Event& event)
 {
     Ref<HTMLInputElement> element(this->element());
     if (element->isDisabledFormControl() || !element->form())
@@ -67,7 +67,7 @@ void SubmitInputType::handleDOMActivateEvent(Event* event)
     element->setActivatedSubmit(true);
     element->form()->prepareForSubmission(event); // Event handlers can run.
     element->setActivatedSubmit(false);
-    event->setDefaultHandled();
+    event.setDefaultHandled();
 }
 
 bool SubmitInputType::canBeSuccessfulSubmitButton()
index fa5f949..7af8ab8 100644 (file)
@@ -43,7 +43,7 @@ private:
     const AtomicString& formControlType() const override;
     bool appendFormData(FormDataList&, bool) const override;
     bool supportsRequired() const override;
-    void handleDOMActivateEvent(Event*) override;
+    void handleDOMActivateEvent(Event&) override;
     bool canBeSuccessfulSubmitButton() override;
     String defaultValue() const override;
     bool isSubmitButton() const override;
index e008fd0..cb92817 100644 (file)
@@ -73,7 +73,7 @@ TextFieldInputType::~TextFieldInputType()
         m_innerSpinButton->removeSpinButtonOwner();
 }
 
-bool TextFieldInputType::isKeyboardFocusable(KeyboardEvent*) const
+bool TextFieldInputType::isKeyboardFocusable(KeyboardEvent&) const
 {
 #if PLATFORM(IOS)
     if (element().isReadOnly())
@@ -156,47 +156,47 @@ void TextFieldInputType::setValue(const String& sanitizedValue, bool valueChange
         input->setTextAsOfLastFormControlChangeEvent(sanitizedValue);
 }
 
-void TextFieldInputType::handleKeydownEvent(KeyboardEvent* event)
+void TextFieldInputType::handleKeydownEvent(KeyboardEvent& event)
 {
     if (!element().focused())
         return;
     Frame* frame = element().document().frame();
-    if (!frame || !frame->editor().doTextFieldCommandFromEvent(&element(), event))
+    if (!frame || !frame->editor().doTextFieldCommandFromEvent(&element(), &event))
         return;
-    event->setDefaultHandled();
+    event.setDefaultHandled();
 }
 
-void TextFieldInputType::handleKeydownEventForSpinButton(KeyboardEvent* event)
+void TextFieldInputType::handleKeydownEventForSpinButton(KeyboardEvent& event)
 {
     if (element().isDisabledOrReadOnly())
         return;
-    const String& key = event->keyIdentifier();
+    const String& key = event.keyIdentifier();
     if (key == "Up")
         spinButtonStepUp();
     else if (key == "Down")
         spinButtonStepDown();
     else
         return;
-    event->setDefaultHandled();
+    event.setDefaultHandled();
 }
 
-void TextFieldInputType::forwardEvent(Event* event)
+void TextFieldInputType::forwardEvent(Event& event)
 {
     if (m_innerSpinButton) {
         m_innerSpinButton->forwardEvent(event);
-        if (event->defaultHandled())
+        if (event.defaultHandled())
             return;
     }
 
-    if (event->isMouseEvent()
-        || event->type() == eventNames().blurEvent
-        || event->type() == eventNames().focusEvent)
+    if (event.isMouseEvent()
+        || event.type() == eventNames().blurEvent
+        || event.type() == eventNames().focusEvent)
     {
         element().document().updateStyleIfNeeded();
 
         auto* renderer = element().renderer();
         if (element().renderer()) {
-            if (event->type() == eventNames().blurEvent) {
+            if (event.type() == eventNames().blurEvent) {
                 if (auto* innerTextRenderer = innerTextElement()->renderer()) {
                     if (auto* innerLayer = innerTextRenderer->layer()) {
                         bool isLeftToRightDirection = downcast<RenderTextControlSingleLine>(*renderer).style().isLeftToRightDirection();
@@ -205,7 +205,7 @@ void TextFieldInputType::forwardEvent(Event* event)
                     }
                 }
                 capsLockStateMayHaveChanged();
-            } else if (event->type() == eventNames().focusEvent)
+            } else if (event.type() == eventNames().focusEvent)
                 capsLockStateMayHaveChanged();
 
             element().forwardEvent(event);
@@ -226,9 +226,9 @@ void TextFieldInputType::handleBlurEvent()
     element().endEditing();
 }
 
-bool TextFieldInputType::shouldSubmitImplicitly(Event* event)
+bool TextFieldInputType::shouldSubmitImplicitly(Event& event)
 {
-    return (event->type() == eventNames().textInputEvent && is<TextEvent>(*event) && downcast<TextEvent>(*event).data() == "\n")
+    return (event.type() == eventNames().textInputEvent && is<TextEvent>(event) && downcast<TextEvent>(event).data() == "\n")
         || InputType::shouldSubmitImplicitly(event);
 }
 
@@ -449,7 +449,7 @@ String TextFieldInputType::sanitizeValue(const String& proposedValue) const
     return limitLength(proposedValue.removeCharacters(isASCIILineBreak), HTMLInputElement::maxEffectiveLength);
 }
 
-void TextFieldInputType::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent* event)
+void TextFieldInputType::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent& event)
 {
     // Make sure that the text to be inserted will not violate the maxLength.
 
@@ -480,7 +480,7 @@ void TextFieldInputType::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*
     unsigned appendableLength = maxLength > baseLength ? maxLength - baseLength : 0;
 
     // Truncate the inserted text to avoid violating the maxLength and other constraints.
-    String eventText = event->text();
+    String eventText = event.text();
     unsigned textLength = eventText.length();
     while (textLength > 0 && isASCIILineBreak(eventText[textLength - 1]))
         textLength--;
@@ -489,7 +489,7 @@ void TextFieldInputType::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*
     eventText.replace('\r', ' ');
     eventText.replace('\n', ' ');
 
-    event->setText(limitLength(eventText, appendableLength));
+    event.setText(limitLength(eventText, appendableLength));
 }
 
 bool TextFieldInputType::shouldRespectListAttribute()
index dbfbdd0..808a402 100644 (file)
@@ -46,8 +46,8 @@ class TextFieldInputType : public InputType, protected SpinButtonElement::SpinBu
 protected:
     explicit TextFieldInputType(HTMLInputElement&);
     virtual ~TextFieldInputType();
-    void handleKeydownEvent(KeyboardEvent*) override;
-    void handleKeydownEventForSpinButton(KeyboardEvent*);
+    void handleKeydownEvent(KeyboardEvent&) override;
+    void handleKeydownEventForSpinButton(KeyboardEvent&);
 
     HTMLElement* containerElement() const final;
     HTMLElement* innerBlockElement() const final;
@@ -74,14 +74,14 @@ protected:
     virtual void didSetValueByUserEdit();
 
 private:
-    bool isKeyboardFocusable(KeyboardEvent*) const final;
+    bool isKeyboardFocusable(KeyboardEvent&) const final;
     bool isMouseFocusable() const final;
     bool isTextField() const final;
     bool isEmptyValue() const final;
     bool valueMissing(const String&) const final;
-    void handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*) final;
-    void forwardEvent(Event*) final;
-    bool shouldSubmitImplicitly(Event*) final;
+    void handleBeforeTextInsertedEvent(BeforeTextInsertedEvent&) final;
+    void forwardEvent(Event&) final;
+    bool shouldSubmitImplicitly(Event&) final;
     RenderPtr<RenderElement> createInputRenderer(RenderStyle&&) override;
     bool shouldUseInputMethod() const override;
     bool shouldRespectListAttribute() override;
index 0931bcd..c021daa 100644 (file)
@@ -47,22 +47,22 @@ AutoFillButtonElement::AutoFillButtonElement(Document& document, AutoFillButtonO
 {
 }
 
-void AutoFillButtonElement::defaultEventHandler(Event* event)
+void AutoFillButtonElement::defaultEventHandler(Event& event)
 {
-    if (!is<MouseEvent>(*event)) {
-        if (!event->defaultHandled())
+    if (!is<MouseEvent>(event)) {
+        if (!event.defaultHandled())
             HTMLDivElement::defaultEventHandler(event);
         return;
     }
 
-    MouseEvent& mouseEvent = downcast<MouseEvent>(*event);
+    MouseEvent& mouseEvent = downcast<MouseEvent>(event);
 
     if (mouseEvent.type() == eventNames().clickEvent) {
         m_owner.autoFillButtonElementWasClicked();
-        event->setDefaultHandled();
+        event.setDefaultHandled();
     }
 
-    if (!event->defaultHandled())
+    if (!event.defaultHandled())
         HTMLDivElement::defaultEventHandler(event);
 }
 
index fc473dc..52b22c5 100644 (file)
@@ -45,7 +45,7 @@ public:
 private:
     explicit AutoFillButtonElement(Document&, AutoFillButtonOwner&);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 
     AutoFillButtonOwner& m_owner;
 };
index e65dbc8..23a3383 100644 (file)
@@ -138,11 +138,11 @@ MediaControlMuteButtonElement::MediaControlMuteButtonElement(Document& document,
 {
 }
 
-void MediaControlMuteButtonElement::defaultEventHandler(Event* event)
+void MediaControlMuteButtonElement::defaultEventHandler(Event& event)
 {
-    if (event->type() == eventNames().clickEvent) {
+    if (event.type() == eventNames().clickEvent) {
         mediaController()->setMuted(!mediaController()->muted());
-        event->setDefaultHandled();
+        event.setDefaultHandled();
     }
 
     HTMLInputElement::defaultEventHandler(event);
@@ -165,12 +165,12 @@ MediaControlSeekButtonElement::MediaControlSeekButtonElement(Document& document,
 {
 }
 
-void MediaControlSeekButtonElement::defaultEventHandler(Event* event)
+void MediaControlSeekButtonElement::defaultEventHandler(Event& event)
 {
     // Set the mousedown and mouseup events as defaultHandled so they
     // do not trigger drag start or end actions in MediaControlPanelElement.
-    if (event->type() == eventNames().mousedownEvent || event->type() == eventNames().mouseupEvent)
-        event->setDefaultHandled();
+    if (event.type() == eventNames().mousedownEvent || event.type() == eventNames().mouseupEvent)
+        event.setDefaultHandled();
 }
 
 void MediaControlSeekButtonElement::setActive(bool flag, bool pause)
@@ -194,10 +194,10 @@ MediaControlVolumeSliderElement::MediaControlVolumeSliderElement(Document& docum
 {
 }
 
-void MediaControlVolumeSliderElement::defaultEventHandler(Event* event)
+void MediaControlVolumeSliderElement::defaultEventHandler(Event& event)
 {
     // Left button is 0. Rejects mouse events not from left button.
-    if (is<MouseEvent>(*event) && downcast<MouseEvent>(*event).button())
+    if (is<MouseEvent>(event) && downcast<MouseEvent>(event).button())
         return;
 
     if (!renderer())
@@ -205,7 +205,7 @@ void MediaControlVolumeSliderElement::defaultEventHandler(Event* event)
 
     MediaControlInputElement::defaultEventHandler(event);
 
-    if (event->type() == eventNames().mouseoverEvent || event->type() == eventNames().mouseoutEvent || event->type() == eventNames().mousemoveEvent)
+    if (event.type() == eventNames().mouseoverEvent || event.type() == eventNames().mouseoutEvent || event.type() == eventNames().mousemoveEvent)
         return;
 
     double volume = value().toDouble();
@@ -213,7 +213,7 @@ void MediaControlVolumeSliderElement::defaultEventHandler(Event* event)
         mediaController()->setVolume(volume, ASSERT_NO_EXCEPTION);
     if (m_clearMutedOnUserInteraction)
         mediaController()->setMuted(false);
-    event->setDefaultHandled();
+    event.setDefaultHandled();
 }
 
 bool MediaControlVolumeSliderElement::willRespondToMouseMoveEvents()
index 1cde5ce..ddd7bbc 100644 (file)
@@ -151,7 +151,7 @@ public:
 protected:
     explicit MediaControlMuteButtonElement(Document&, MediaControlElementType);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 
 private:
     void updateDisplayType() override;
@@ -166,7 +166,7 @@ public:
 protected:
     explicit MediaControlSeekButtonElement(Document&, MediaControlElementType);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
     virtual bool isForwardButton() const = 0;
 
 private:
@@ -185,7 +185,7 @@ public:
 protected:
     explicit MediaControlVolumeSliderElement(Document&);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 
 private:
     bool m_clearMutedOnUserInteraction;
index ea29deb..df67faf 100644 (file)
@@ -215,21 +215,21 @@ void MediaControlPanelElement::makeTransparent()
     startTimer();
 }
 
-void MediaControlPanelElement::defaultEventHandler(Event* event)
+void MediaControlPanelElement::defaultEventHandler(Event& event)
 {
     MediaControlDivElement::defaultEventHandler(event);
 
-    if (is<MouseEvent>(*event)) {
-        LayoutPoint location = downcast<MouseEvent>(*event).absoluteLocation();
-        if (event->type() == eventNames().mousedownEvent && event->target() == this) {
+    if (is<MouseEvent>(event)) {
+        LayoutPoint location = downcast<MouseEvent>(event).absoluteLocation();
+        if (event.type() == eventNames().mousedownEvent && event.target() == this) {
             startDrag(location);
-            event->setDefaultHandled();
-        } else if (event->type() == eventNames().mousemoveEvent && m_isBeingDragged)
+            event.setDefaultHandled();
+        } else if (event.type() == eventNames().mousemoveEvent && m_isBeingDragged)
             continueDrag(location);
-        else if (event->type() == eventNames().mouseupEvent && m_isBeingDragged) {
+        else if (event.type() == eventNames().mouseupEvent && m_isBeingDragged) {
             continueDrag(location);
             endDrag();
-            event->setDefaultHandled();
+            event.setDefaultHandled();
         }
     }
 }
@@ -333,13 +333,13 @@ RenderPtr<RenderElement> MediaControlVolumeSliderContainerElement::createElement
     return createRenderer<RenderMediaVolumeSliderContainer>(*this, WTFMove(style));
 }
 
-void MediaControlVolumeSliderContainerElement::defaultEventHandler(Event* event)
+void MediaControlVolumeSliderContainerElement::defaultEventHandler(Event& event)
 {
-    if (!is<MouseEvent>(*event) || event->type() != eventNames().mouseoutEvent)
+    if (!is<MouseEvent>(event) || event.type() != eventNames().mouseoutEvent)
         return;
 
     // Poor man's mouseleave event detection.
-    MouseEvent& mouseEvent = downcast<MouseEvent>(*event);
+    MouseEvent& mouseEvent = downcast<MouseEvent>(event);
     EventTarget* relatedTarget = mouseEvent.relatedTarget();
     if (!relatedTarget || !relatedTarget->toNode())
         return;
@@ -418,9 +418,9 @@ Ref<MediaControlPanelMuteButtonElement> MediaControlPanelMuteButtonElement::crea
     return button;
 }
 
-void MediaControlPanelMuteButtonElement::defaultEventHandler(Event* event)
+void MediaControlPanelMuteButtonElement::defaultEventHandler(Event& event)
 {
-    if (event->type() == eventNames().mouseoverEvent)
+    if (event.type() == eventNames().mouseoverEvent)
         m_controls->showVolumeSlider();
 
     MediaControlMuteButtonElement::defaultEventHandler(event);
@@ -458,15 +458,15 @@ Ref<MediaControlPlayButtonElement> MediaControlPlayButtonElement::create(Documen
     return button;
 }
 
-void MediaControlPlayButtonElement::defaultEventHandler(Event* event)
+void MediaControlPlayButtonElement::defaultEventHandler(Event& event)
 {
-    if (event->type() == eventNames().clickEvent) {
+    if (event.type() == eventNames().clickEvent) {
         if (mediaController()->canPlay())
             mediaController()->play();
         else
             mediaController()->pause();
         updateDisplayType();
-        event->setDefaultHandled();
+        event.setDefaultHandled();
     }
     HTMLInputElement::defaultEventHandler(event);
 }
@@ -492,12 +492,12 @@ Ref<MediaControlOverlayPlayButtonElement> MediaControlOverlayPlayButtonElement::
     return button;
 }
 
-void MediaControlOverlayPlayButtonElement::defaultEventHandler(Event* event)
+void MediaControlOverlayPlayButtonElement::defaultEventHandler(Event& event)
 {
-    if (event->type() == eventNames().clickEvent && mediaController()->canPlay()) {
+    if (event.type() == eventNames().clickEvent && mediaController()->canPlay()) {
         mediaController()->play();
         updateDisplayType();
-        event->setDefaultHandled();
+        event.setDefaultHandled();
     }
     HTMLInputElement::defaultEventHandler(event);
 }
@@ -558,11 +558,11 @@ Ref<MediaControlRewindButtonElement> MediaControlRewindButtonElement::create(Doc
     return button;
 }
 
-void MediaControlRewindButtonElement::defaultEventHandler(Event* event)
+void MediaControlRewindButtonElement::defaultEventHandler(Event& event)
 {
-    if (event->type() == eventNames().clickEvent) {
+    if (event.type() == eventNames().clickEvent) {
         mediaController()->setCurrentTime(std::max<double>(0, mediaController()->currentTime() - 30));
-        event->setDefaultHandled();
+        event.setDefaultHandled();
     }
     HTMLInputElement::defaultEventHandler(event);
 }
@@ -584,11 +584,11 @@ Ref<MediaControlReturnToRealtimeButtonElement> MediaControlReturnToRealtimeButto
     return button;
 }
 
-void MediaControlReturnToRealtimeButtonElement::defaultEventHandler(Event* event)
+void MediaControlReturnToRealtimeButtonElement::defaultEventHandler(Event& event)
 {
-    if (event->type() == eventNames().clickEvent) {
+    if (event.type() == eventNames().clickEvent) {
         mediaController()->returnToRealtime();
-        event->setDefaultHandled();
+        event.setDefaultHandled();
     }
     HTMLInputElement::defaultEventHandler(event);
 }
@@ -625,9 +625,9 @@ void MediaControlToggleClosedCaptionsButtonElement::updateDisplayType()
     setChecked(captionsVisible);
 }
 
-void MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler(Event* event)
+void MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler(Event& event)
 {
-    if (event->type() == eventNames().clickEvent) {
+    if (event.type() == eventNames().clickEvent) {
         // FIXME: It's not great that the shared code is dictating behavior of platform-specific
         // UI. Not all ports may want the closed captions button to toggle a list of tracks, so
         // we have to use #if.
@@ -639,7 +639,7 @@ void MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler(Event* e
 #else
         m_controls->toggleClosedCaptionTrackList();
 #endif
-        event->setDefaultHandled();
+        event.setDefaultHandled();
     }
 
     HTMLInputElement::defaultEventHandler(event);
@@ -682,11 +682,11 @@ Ref<MediaControlClosedCaptionsTrackListElement> MediaControlClosedCaptionsTrackL
     return element;
 }
 
-void MediaControlClosedCaptionsTrackListElement::defaultEventHandler(Event* event)
+void MediaControlClosedCaptionsTrackListElement::defaultEventHandler(Event& event)
 {
 #if ENABLE(VIDEO_TRACK)
-    if (event->type() == eventNames().clickEvent) {
-        Node* target = event->target()->toNode();
+    if (event.type() == eventNames().clickEvent) {
+        Node* target = event.target()->toNode();
         if (!is<Element>(target))
             return;
 
@@ -842,28 +842,28 @@ Ref<MediaControlTimelineElement> MediaControlTimelineElement::create(Document& d
     return timeline;
 }
 
-void MediaControlTimelineElement::defaultEventHandler(Event* event)
+void MediaControlTimelineElement::defaultEventHandler(Event& event)
 {
     // Left button is 0. Rejects mouse events not from left button.
-    if (is<MouseEvent>(*event) && downcast<MouseEvent>(*event).button())
+    if (is<MouseEvent>(event) && downcast<MouseEvent>(event).button())
         return;
 
     if (!renderer())
         return;
 
-    if (event->type() == eventNames().mousedownEvent)
+    if (event.type() == eventNames().mousedownEvent)
         mediaController()->beginScrubbing();
 
-    if (event->type() == eventNames().mouseupEvent)
+    if (event.type() == eventNames().mouseupEvent)
         mediaController()->endScrubbing();
 
     MediaControlInputElement::defaultEventHandler(event);
 
-    if (event->type() == eventNames().mouseoverEvent || event->type() == eventNames().mouseoutEvent || event->type() == eventNames().mousemoveEvent)
+    if (event.type() == eventNames().mouseoverEvent || event.type() == eventNames().mouseoutEvent || event.type() == eventNames().mousemoveEvent)
         return;
 
     double time = value().toDouble();
-    if (event->type() == eventNames().inputEvent && time != mediaController()->currentTime())
+    if (event.type() == eventNames().inputEvent && time != mediaController()->currentTime())
         mediaController()->setCurrentTime(time);
 
     RenderSlider& slider = downcast<RenderSlider>(*renderer());
@@ -944,9 +944,9 @@ Ref<MediaControlFullscreenButtonElement> MediaControlFullscreenButtonElement::cr
     return button;
 }
 
-void MediaControlFullscreenButtonElement::defaultEventHandler(Event* event)
+void MediaControlFullscreenButtonElement::defaultEventHandler(Event& event)
 {
-    if (event->type() == eventNames().clickEvent) {
+    if (event.type() == eventNames().clickEvent) {
 #if ENABLE(FULLSCREEN_API)
         // Only use the new full screen API if the fullScreenEnabled setting has
         // been explicitly enabled. Otherwise, use the old fullscreen API. This
@@ -961,7 +961,7 @@ void MediaControlFullscreenButtonElement::defaultEventHandler(Event* event)
         } else
 #endif
             mediaController()->enterFullscreen();
-        event->setDefaultHandled();
+        event.setDefaultHandled();
     }
     HTMLInputElement::defaultEventHandler(event);
 }
@@ -987,12 +987,12 @@ Ref<MediaControlFullscreenVolumeMinButtonElement> MediaControlFullscreenVolumeMi
     return button;
 }
 
-void MediaControlFullscreenVolumeMinButtonElement::defaultEventHandler(Event* event)
+void MediaControlFullscreenVolumeMinButtonElement::defaultEventHandler(Event& event)
 {
-    if (event->type() == eventNames().clickEvent) {
+    if (event.type() == eventNames().clickEvent) {
         ExceptionCode code = 0;
         mediaController()->setVolume(0, code);
-        event->setDefaultHandled();
+        event.setDefaultHandled();
     }
     HTMLInputElement::defaultEventHandler(event);
 }
@@ -1013,12 +1013,12 @@ Ref<MediaControlFullscreenVolumeMaxButtonElement> MediaControlFullscreenVolumeMa
     return button;
 }
 
-void MediaControlFullscreenVolumeMaxButtonElement::defaultEventHandler(Event* event)
+void MediaControlFullscreenVolumeMaxButtonElement::defaultEventHandler(Event& event)
 {
-    if (event->type() == eventNames().clickEvent) {
+    if (event.type() == eventNames().clickEvent) {
         ExceptionCode code = 0;
         mediaController()->setVolume(1, code);
-        event->setDefaultHandled();
+        event.setDefaultHandled();
     }
     HTMLInputElement::defaultEventHandler(event);
 }
index 6102a8e..f3b2186 100644 (file)
@@ -57,7 +57,7 @@ public:
 private:
     explicit MediaControlPanelElement(Document&);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 
     void startDrag(const LayoutPoint& eventLocation);
     void continueDrag(const LayoutPoint& eventLocation);
@@ -126,7 +126,7 @@ public:
 private:
     explicit MediaControlVolumeSliderContainerElement(Document&);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 
     RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override;
 };
@@ -159,7 +159,7 @@ public:
 private:
     explicit MediaControlPanelMuteButtonElement(Document&, MediaControls*);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 
     MediaControls* m_controls;
 };
@@ -190,7 +190,7 @@ public:
 private:
     explicit MediaControlPlayButtonElement(Document&);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 };
 
 // ----------------------------
@@ -204,7 +204,7 @@ public:
 private:
     explicit MediaControlOverlayPlayButtonElement(Document&);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 };
 
 // ----------------------------
@@ -244,7 +244,7 @@ public:
 private:
     explicit MediaControlRewindButtonElement(Document&);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 };
 
 // ----------------------------
@@ -260,7 +260,7 @@ public:
 private:
     explicit MediaControlReturnToRealtimeButtonElement(Document&);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 };
 
 // ----------------------------
@@ -278,7 +278,7 @@ public:
 private:
     explicit MediaControlToggleClosedCaptionsButtonElement(Document&, MediaControls*);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 
 #if PLATFORM(COCOA) || PLATFORM(WIN) || PLATFORM(GTK)
     MediaControls* m_controls;
@@ -316,7 +316,7 @@ private:
 
     void rebuildTrackListMenu();
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 
     typedef Vector<RefPtr<Element>> TrackMenuItems;
     TrackMenuItems m_menuItems;
@@ -343,7 +343,7 @@ public:
 private:
     explicit MediaControlTimelineElement(Document&, MediaControls*);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 
     MediaControls* m_controls;
 };
@@ -363,7 +363,7 @@ public:
 private:
     explicit MediaControlFullscreenButtonElement(Document&);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 };
 
 // ----------------------------
@@ -397,7 +397,7 @@ public:
 
 private:
     explicit MediaControlFullscreenVolumeMinButtonElement(Document&);
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 };
 
 // ----------------------------
@@ -413,7 +413,7 @@ public:
 private:
     explicit MediaControlFullscreenVolumeMaxButtonElement(Document&);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 };
 
 
index 82a5098..603b88d 100644 (file)
@@ -297,11 +297,11 @@ void MediaControls::exitedFullscreen()
 #endif
 }
 
-void MediaControls::defaultEventHandler(Event* event)
+void MediaControls::defaultEventHandler(Event& event)
 {
     HTMLDivElement::defaultEventHandler(event);
 
-    if (event->type() == eventNames().mouseoverEvent) {
+    if (event.type() == eventNames().mouseoverEvent) {
         if (!containsRelatedTarget(event)) {
             m_isMouseOverControls = true;
             if (!m_mediaController->canPlay()) {
@@ -313,7 +313,7 @@ void MediaControls::defaultEventHandler(Event* event)
         return;
     }
 
-    if (event->type() == eventNames().mouseoutEvent) {
+    if (event.type() == eventNames().mouseoutEvent) {
         if (!containsRelatedTarget(event)) {
             m_isMouseOverControls = false;
             stopHideFullscreenControlsTimer();
@@ -321,7 +321,7 @@ void MediaControls::defaultEventHandler(Event* event)
         return;
     }
 
-    if (event->type() == eventNames().mousemoveEvent) {
+    if (event.type() == eventNames().mousemoveEvent) {
         if (m_isFullscreen) {
             // When we get a mouse move in fullscreen mode, show the media controls, and start a timer
             // that will hide the media controls after a 3 seconds without a mouse move.
@@ -367,11 +367,11 @@ void MediaControls::stopHideFullscreenControlsTimer()
     m_hideFullscreenControlsTimer.stop();
 }
 
-bool MediaControls::containsRelatedTarget(Event* event)
+bool MediaControls::containsRelatedTarget(Event& event)
 {
-    if (!is<MouseEvent>(*event))
+    if (!is<MouseEvent>(event))
         return false;
-    EventTarget* relatedTarget = downcast<MouseEvent>(*event).relatedTarget();
+    EventTarget* relatedTarget = downcast<MouseEvent>(event).relatedTarget();
     if (!relatedTarget)
         return false;
     return contains(relatedTarget->toNode());
index e74a155..0b1ab26 100644 (file)
@@ -110,9 +110,9 @@ class MediaControls : public HTMLDivElement {
 protected:
     explicit MediaControls(Document&);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 
-    virtual bool containsRelatedTarget(Event*);
+    virtual bool containsRelatedTarget(Event&);
 
     void setSliderVolume();
 
index 7ddc70c..3875b71 100644 (file)
@@ -265,12 +265,12 @@ void MediaControlsApple::setMediaController(MediaControllerInterface* controller
         m_closedCaptionsContainer->setMediaController(controller);
 }
 
-void MediaControlsApple::defaultEventHandler(Event* event)
+void MediaControlsApple::defaultEventHandler(Event& event)
 {
-    if (event->type() == eventNames().clickEvent) {
+    if (event.type() == eventNames().clickEvent) {
         if (m_closedCaptionsContainer && m_closedCaptionsContainer->isShowing()) {
             hideClosedCaptionTrackList();
-            event->setDefaultHandled();
+            event.setDefaultHandled();
         }
     }
 
@@ -555,15 +555,15 @@ bool MediaControlsApple::shouldClosedCaptionsContainerPreventPageScrolling(int w
     return false;
 }
 
-void MediaControlsApple::handleClickEvent(Event* event)
+void MediaControlsApple::handleClickEvent(Event& event)
 {
-    Node* currentTarget = event->currentTarget()->toNode();
-    Node* target = event->target()->toNode();
+    Node* currentTarget = event.currentTarget()->toNode();
+    Node* target = event.target()->toNode();
 
     if ((currentTarget == &document() && !shadowHost()->contains(target)) || (currentTarget == this && !m_closedCaptionsContainer->contains(target))) {
         hideClosedCaptionTrackList();
-        event->stopImmediatePropagation();
-        event->setDefaultHandled();
+        event.stopImmediatePropagation();
+        event.setDefaultHandled();
     }
 }
 
@@ -589,7 +589,7 @@ MediaControlsAppleEventListener& MediaControlsApple::eventListener()
 void MediaControlsAppleEventListener::handleEvent(ScriptExecutionContext*, Event* event)
 {
     if (event->type() == eventNames().clickEvent)
-        m_mediaControls->handleClickEvent(event);
+        m_mediaControls->handleClickEvent(*event);
     else if (eventNames().isWheelEventType(event->type()) && is<WheelEvent>(*event)) {
         WheelEvent& wheelEvent = downcast<WheelEvent>(*event);
         if (m_mediaControls->shouldClosedCaptionsContainerPreventPageScrolling(wheelEvent.wheelDeltaY()))
index f28dd6b..1930909 100644 (file)
@@ -89,12 +89,12 @@ public:
     void closedCaptionTracksChanged() override;
 
     bool shouldClosedCaptionsContainerPreventPageScrolling(int wheelDeltaY);
-    void handleClickEvent(Event*);
+    void handleClickEvent(Event&);
 
 private:
     MediaControlsApple(Document&);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
     MediaControlsAppleEventListener& eventListener();
 
     void showClosedCaptionTrackList();
index 7af7e71..d111c2d 100644 (file)
@@ -343,9 +343,9 @@ void SliderThumbElement::stopDragging()
 }
 
 #if !PLATFORM(IOS)
-void SliderThumbElement::defaultEventHandler(Event* event)
+void SliderThumbElement::defaultEventHandler(Event& event)
 {
-    if (!is<MouseEvent>(*event)) {
+    if (!is<MouseEvent>(event)) {
         HTMLDivElement::defaultEventHandler(event);
         return;
     }
@@ -359,7 +359,7 @@ void SliderThumbElement::defaultEventHandler(Event* event)
         return;
     }
 
-    MouseEvent& mouseEvent = downcast<MouseEvent>(*event);
+    MouseEvent& mouseEvent = downcast<MouseEvent>(event);
     bool isLeftButton = mouseEvent.button() == LeftButton;
     const AtomicString& eventType = mouseEvent.type();
 
@@ -378,7 +378,7 @@ void SliderThumbElement::defaultEventHandler(Event* event)
         return;
     }
 
-    HTMLDivElement::defaultEventHandler(&mouseEvent);
+    HTMLDivElement::defaultEventHandler(mouseEvent);
 }
 #endif
 
@@ -441,9 +441,9 @@ static Touch* findTouchWithIdentifier(TouchList& list, unsigned identifier)
     return nullptr;
 }
 
-void SliderThumbElement::handleTouchStart(TouchEvent* touchEvent)
+void SliderThumbElement::handleTouchStart(TouchEvent& touchEvent)
 {
-    TouchList* targetTouches = touchEvent->targetTouches();
+    TouchList* targetTouches = touchEvent.targetTouches();
     if (!targetTouches)
         return;
 
@@ -461,16 +461,16 @@ void SliderThumbElement::handleTouchStart(TouchEvent* touchEvent)
     setExclusiveTouchIdentifier(touch->identifier());
 
     startDragging();
-    touchEvent->setDefaultHandled();
+    touchEvent.setDefaultHandled();
 }
 
-void SliderThumbElement::handleTouchMove(TouchEvent* touchEvent)
+void SliderThumbElement::handleTouchMove(TouchEvent& touchEvent)
 {
     unsigned identifier = exclusiveTouchIdentifier();
     if (identifier == NoIdentifier)
         return;
 
-    TouchList* targetTouches = touchEvent->targetTouches();
+    TouchList* targetTouches = touchEvent.targetTouches();
     if (!targetTouches)
         return;
 
@@ -480,16 +480,16 @@ void SliderThumbElement::handleTouchMove(TouchEvent* touchEvent)
 
     if (m_inDragMode)
         setPositionFromPoint(IntPoint(touch->pageX(), touch->pageY()));
-    touchEvent->setDefaultHandled();
+    touchEvent.setDefaultHandled();
 }
 
-void SliderThumbElement::handleTouchEndAndCancel(TouchEvent* touchEvent)
+void SliderThumbElement::handleTouchEndAndCancel(TouchEvent& touchEvent)
 {
     unsigned identifier = exclusiveTouchIdentifier();
     if (identifier == NoIdentifier)
         return;
 
-    TouchList* targetTouches = touchEvent->targetTouches();
+    TouchList* targetTouches = touchEvent.targetTouches();
     if (!targetTouches)
         return;
     // If our exclusive touch still exists, it was not the touch
@@ -509,19 +509,19 @@ void SliderThumbElement::didAttachRenderers()
         registerForTouchEvents();
 }
 
-void SliderThumbElement::handleTouchEvent(TouchEvent* touchEvent)
+void SliderThumbElement::handleTouchEvent(TouchEvent& touchEvent)
 {
     HTMLInputElement* input = hostInput();
     ASSERT(input);
     if (input->isReadOnly() || input->isDisabledFormControl()) {
         clearExclusiveTouchIdentifier();
         stopDragging();
-        touchEvent->setDefaultHandled();
+        touchEvent.setDefaultHandled();
         HTMLDivElement::defaultEventHandler(touchEvent);
         return;
     }
 
-    const AtomicString& eventType = touchEvent->type();
+    const AtomicString& eventType = touchEvent.type();
     if (eventType == eventNames().touchstartEvent) {
         handleTouchStart(touchEvent);
         return;
index a58a7cb..e68c065 100644 (file)
@@ -53,7 +53,7 @@ public:
     void setPositionFromPoint(const LayoutPoint&);
 
 #if ENABLE(IOS_TOUCH_EVENTS)
-    void handleTouchEvent(TouchEvent*);
+    void handleTouchEvent(TouchEvent&);
 
     void disabledAttributeChanged();
 #endif
@@ -68,7 +68,7 @@ private:
     bool matchesReadWritePseudoClass() const override;
     Element* focusDelegate() override;
 #if !PLATFORM(IOS)
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
     bool willRespondToMouseMoveEvents() override;
     bool willRespondToMouseClickEvents() override;
 #endif
@@ -89,9 +89,9 @@ private:
     void setExclusiveTouchIdentifier(unsigned);
     void clearExclusiveTouchIdentifier();
 
-    void handleTouchStart(TouchEvent*);
-    void handleTouchMove(TouchEvent*);
-    void handleTouchEndAndCancel(TouchEvent*);
+    void handleTouchStart(TouchEvent&);
+    void handleTouchMove(TouchEvent&);
+    void handleTouchEndAndCancel(TouchEvent&);
 
     bool shouldAcceptTouchEvents();
     void registerForTouchEvents();
index ecdb5da..58bd62a 100644 (file)
@@ -66,28 +66,28 @@ void SpinButtonElement::willDetachRenderers()
     releaseCapture();
 }
 
-void SpinButtonElement::defaultEventHandler(Event* event)
+void SpinButtonElement::defaultEventHandler(Event& event)
 {
-    if (!is<MouseEvent>(*event)) {
-        if (!event->defaultHandled())
+    if (!is<MouseEvent>(event)) {
+        if (!event.defaultHandled())
             HTMLDivElement::defaultEventHandler(event);
         return;
     }
 
     RenderBox* box = renderBox();
     if (!box) {
-        if (!event->defaultHandled())
+        if (!event.defaultHandled())
             HTMLDivElement::defaultEventHandler(event);
         return;
     }
 
     if (!shouldRespondToMouseEvents()) {
-        if (!event->defaultHandled())
+        if (!event.defaultHandled())
             HTMLDivElement::defaultEventHandler(event);
         return;
     }
 
-    MouseEvent& mouseEvent = downcast<MouseEvent>(*event);
+    MouseEvent& mouseEvent = downcast<MouseEvent>(event);
     IntPoint local = roundedIntPoint(box->absoluteToLocal(mouseEvent.absoluteLocation(), UseTransforms));
     if (mouseEvent.type() == eventNames().mousedownEvent && mouseEvent.button() == LeftButton) {
         if (box->borderBoxRect().contains(local)) {
@@ -143,7 +143,7 @@ void SpinButtonElement::defaultEventHandler(Event* event)
     }
 
     if (!mouseEvent.defaultHandled())
-        HTMLDivElement::defaultEventHandler(&mouseEvent);
+        HTMLDivElement::defaultEventHandler(mouseEvent);
 }
 
 void SpinButtonElement::willOpenPopup()
@@ -152,12 +152,12 @@ void SpinButtonElement::willOpenPopup()
     m_upDownState = Indeterminate;
 }
 
-void SpinButtonElement::forwardEvent(Event* event)
+void SpinButtonElement::forwardEvent(Event& event)
 {
     if (!renderBox())
         return;
 
-    if (!is<WheelEvent>(*event))
+    if (!is<WheelEvent>(event))
         return;
 
     if (!m_spinButtonOwner)
@@ -166,8 +166,8 @@ void SpinButtonElement::forwardEvent(Event* event)
     if (!m_spinButtonOwner->shouldSpinButtonRespondToWheelEvents())
         return;
 
-    doStepAction(downcast<WheelEvent>(*event).wheelDeltaY());
-    event->setDefaultHandled();
+    doStepAction(downcast<WheelEvent>(event).wheelDeltaY());
+    event.setDefaultHandled();
 }
 
 bool SpinButtonElement::willRespondToMouseMoveEvents()
index 36d4f6a..272a4d8 100644 (file)
@@ -64,7 +64,7 @@ public:
     bool willRespondToMouseMoveEvents() override;
     bool willRespondToMouseClickEvents() override;
 
-    void forwardEvent(Event*);
+    void forwardEvent(Event&);
 
 private:
     SpinButtonElement(Document&, SpinButtonOwner&);
@@ -73,7 +73,7 @@ private:
     bool isSpinButtonElement() const override { return true; }
     bool isDisabledFormControl() const override { return shadowHost() && shadowHost()->isDisabledFormControl(); }
     bool matchesReadWritePseudoClass() const override;
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
     void willOpenPopup() override;
     void doStepAction(int);
     void startRepeatingTimer();
index c02329e..e0d7f2e 100644 (file)
@@ -105,12 +105,12 @@ Ref<TextControlInnerTextElement> TextControlInnerTextElement::create(Document& d
     return adoptRef(*new TextControlInnerTextElement(document));
 }
 
-void TextControlInnerTextElement::defaultEventHandler(Event* event)
+void TextControlInnerTextElement::defaultEventHandler(Event& event)
 {
     // FIXME: In the future, we should add a way to have default event listeners.
     // Then we would add one to the text field's inner div, and we wouldn't need this subclass.
     // Or possibly we could just use a normal event listener.
-    if (event->isBeforeTextInsertedEvent() || event->type() == eventNames().webkitEditableContentChangedEvent) {
+    if (event.isBeforeTextInsertedEvent() || event.type() == eventNames().webkitEditableContentChangedEvent) {
         Element* shadowAncestor = shadowHost();
         // A TextControlInnerTextElement can have no host if its been detached,
         // but kept alive by an EditCommand. In this case, an undo/redo can
@@ -120,7 +120,7 @@ void TextControlInnerTextElement::defaultEventHandler(Event* event)
         if (shadowAncestor)
             shadowAncestor->defaultEventHandler(event);
     }
-    if (!event->defaultHandled())
+    if (!event.defaultHandled())
         HTMLDivElement::defaultEventHandler(event);
 }
 
@@ -175,11 +175,11 @@ Ref<SearchFieldResultsButtonElement> SearchFieldResultsButtonElement::create(Doc
     return adoptRef(*new SearchFieldResultsButtonElement(document));
 }
 
-void SearchFieldResultsButtonElement::defaultEventHandler(Event* event)
+void SearchFieldResultsButtonElement::defaultEventHandler(Event& event)
 {
     // On mousedown, bring up a menu, if needed
     auto* input = downcast<HTMLInputElement>(shadowHost());
-    if (input && event->type() == eventNames().mousedownEvent && is<MouseEvent>(*event) && downcast<MouseEvent>(*event).button() == LeftButton) {
+    if (input && event.type() == eventNames().mousedownEvent && is<MouseEvent>(event) && downcast<MouseEvent>(event).button() == LeftButton) {
         input->focus();
         input->select();
 #if !PLATFORM(IOS)
@@ -191,10 +191,10 @@ void SearchFieldResultsButtonElement::defaultEventHandler(Event* event)
                 searchFieldRenderer.showPopup();
         }
 #endif
-        event->setDefaultHandled();
+        event.setDefaultHandled();
     }
 
-    if (!event->defaultHandled())
+    if (!event.defaultHandled())
         HTMLDivElement::defaultEventHandler(event);
 }
 
@@ -222,28 +222,28 @@ Ref<SearchFieldCancelButtonElement> SearchFieldCancelButtonElement::create(Docum
     return adoptRef(*new SearchFieldCancelButtonElement(document));
 }
 
-void SearchFieldCancelButtonElement::defaultEventHandler(Event* event)
+void SearchFieldCancelButtonElement::defaultEventHandler(Event& event)
 {
     RefPtr<HTMLInputElement> input(downcast<HTMLInputElement>(shadowHost()));
     if (!input || input->isDisabledOrReadOnly()) {
-        if (!event->defaultHandled())
+        if (!event.defaultHandled())
             HTMLDivElement::defaultEventHandler(event);
         return;
     }
 
-    if (event->type() == eventNames().mousedownEvent && is<MouseEvent>(*event) && downcast<MouseEvent>(*event).button() == LeftButton) {
+    if (event.type() == eventNames().mousedownEvent && is<MouseEvent>(event) && downcast<MouseEvent>(event).button() == LeftButton) {
         input->focus();
         input->select();
-        event->setDefaultHandled();
+        event.setDefaultHandled();
     }
 
-    if (event->type() == eventNames().clickEvent) {
+    if (event.type() == eventNames().clickEvent) {
         input->setValueForUser(emptyString());
         input->onSearch();
-        event->setDefaultHandled();
+        event.setDefaultHandled();
     }
 
-    if (!event->defaultHandled())
+    if (!event.defaultHandled())
         HTMLDivElement::defaultEventHandler(event);
 }
 
index e68a1bb..f5b68f8 100644 (file)
@@ -58,7 +58,7 @@ class TextControlInnerTextElement final : public HTMLDivElement {
 public:
     static Ref<TextControlInnerTextElement> create(Document&);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 
     RenderTextControlInnerBlock* renderer() const;
 
@@ -84,7 +84,7 @@ class SearchFieldResultsButtonElement final : public HTMLDivElement {
 public:
     static Ref<SearchFieldResultsButtonElement> create(Document&);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 #if !PLATFORM(IOS)
     bool willRespondToMouseClickEvents() override;
 #endif
@@ -98,7 +98,7 @@ class SearchFieldCancelButtonElement final : public HTMLDivElement {
 public:
     static Ref<SearchFieldCancelButtonElement> create(Document&);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 #if !PLATFORM(IOS)
     bool willRespondToMouseClickEvents() override;
 #endif
index 1df383d..4d1c345 100644 (file)
@@ -107,9 +107,9 @@ RefPtr<ImageControlsButtonElementMac> ImageControlsButtonElementMac::tryCreate(D
     return WTFMove(button);
 }
 
-void ImageControlsButtonElementMac::defaultEventHandler(Event* event)
+void ImageControlsButtonElementMac::defaultEventHandler(Event& event)
 {
-    if (event->type() == eventNames().clickEvent) {
+    if (event.type() == eventNames().clickEvent) {
         Frame* frame = document().frame();
         if (!frame)
             return;
@@ -118,8 +118,8 @@ void ImageControlsButtonElementMac::defaultEventHandler(Event* event)
         if (!page)
             return;
 
-        page->contextMenuController().showImageControlsMenu(event);
-        event->setDefaultHandled();
+        page->contextMenuController().showImageControlsMenu(&event);
+        event.setDefaultHandled();
         return;
     }
 
index ee59379..c69d85e 100644 (file)
@@ -41,7 +41,7 @@ public:
 private:
     ImageControlsButtonElementMac(Document&);
 
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
     RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override;
 
     bool isImageControlsButtonElement() const override { return true; }
index 1d58814..bd83406 100644 (file)
@@ -2990,7 +2990,7 @@ bool FrameLoader::dispatchBeforeUnloadEvent(Chrome& chrome, FrameLoader* frameLo
     m_pageDismissalEventBeingDispatched = PageDismissalType::None;
 
     if (!beforeUnloadEvent->defaultPrevented())
-        document->defaultEventHandler(beforeUnloadEvent.ptr());
+        document->defaultEventHandler(beforeUnloadEvent.get());
     if (beforeUnloadEvent->returnValue().isNull())
         return true;
 
index bcc2784..5ca38dc 100644 (file)
@@ -137,20 +137,20 @@ bool MathMLElement::willRespondToMouseClickEvents()
     return isLink() || StyledElement::willRespondToMouseClickEvents();
 }
 
-void MathMLElement::defaultEventHandler(Event* event)
+void MathMLElement::defaultEventHandler(Event& event)
 {
     if (isLink()) {
         if (focused() && isEnterKeyKeydownEvent(event)) {
-            event->setDefaultHandled();
-            dispatchSimulatedClick(event);
+            event.setDefaultHandled();
+            dispatchSimulatedClick(&event);
             return;
         }
-        if (MouseEvent::canTriggerActivationBehavior(*event)) {
+        if (MouseEvent::canTriggerActivationBehavior(event)) {
             auto& href = attributeWithoutSynchronization(hrefAttr);
             const auto& url = stripLeadingAndTrailingHTMLSpaces(href);
-            event->setDefaultHandled();
+            event.setDefaultHandled();
             if (auto* frame = document().frame())
-                frame->loader().urlSelected(document().completeURL(url), "_self", event, LockHistory::No, LockBackForwardList::No, MaybeSendReferrer, document().shouldOpenExternalURLsPolicyToPropagate());
+                frame->loader().urlSelected(document().completeURL(url), "_self", &event, LockHistory::No, LockBackForwardList::No, MaybeSendReferrer, document().shouldOpenExternalURLsPolicyToPropagate());
             return;
         }
     }
@@ -174,13 +174,13 @@ bool MathMLElement::isFocusable() const
     return StyledElement::isFocusable();
 }
 
-bool MathMLElement::isKeyboardFocusable(KeyboardEvent* event) const
+bool MathMLElement::isKeyboardFocusable(KeyboardEvent& event) const
 {
     if (isFocusable() && StyledElement::supportsFocus())
         return StyledElement::isKeyboardFocusable(event);
 
     if (isLink())
-        return document().frame()->eventHandler().tabsToLinks(event);
+        return document().frame()->eventHandler().tabsToLinks(&event);
 
     return StyledElement::isKeyboardFocusable(event);
 }
index d8863c6..ceb34f1 100644 (file)
@@ -101,12 +101,12 @@ protected:
     void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) override;
 
     bool willRespondToMouseClickEvents() override;
-    void defaultEventHandler(Event*) override;
+    void defaultEventHandler(Event&) override;
 
 private:
     bool canStartSelection() const final;
     bool isFocusable() const final;
-    bool isKeyboardFocusable(KeyboardEvent*) const final;
+    bool isKeyboardFocusable(KeyboardEvent&) const final;
     bool isMouseFocusable() const final;
     bool isURLAttribute(const Attribute&) const final;
     bool supportsFocus() const final;
index 27b714f..d5d7445 100644 (file)
@@ -209,12 +209,12 @@ void MathMLSelectElement::updateSelectedChild()
     setNeedsStyleRecalc();
 }
 
-void MathMLSelectElement::defaultEventHandler(Event* event)
+void MathMLSelectElement::defaultEventHandler(Event& event)
 {
-    if (event->type() == eventNames().clickEvent) {
+    if (event.type() == eventNames().clickEvent) {
         if (attributeWithoutSynchronization(MathMLNames::actiontypeAttr) == "toggle") {
             toggle();
-            event->setDefaultHandled();
+            event.setDefaultHandled();
             return;
         }
     }
index 5f0515c..1043dd5 100644 (file)
@@ -47,7 +47,7 @@ private:
     void finishParsingChildren() final;
     void childrenChanged(const ChildChange&) final;
     void attributeChanged(const QualifiedName&, const AtomicString& oldValue, const AtomicString& newValue, AttributeModificationReason = ModifiedDirectly) final;
-    void defaultEventHandler(Event*) final;
+    void defaultEventHandler(Event&) final;
     bool willRespondToMouseClickEvents() final;
 
     void toggle();
index 3dfe3ab..483c357 100644 (file)
@@ -287,26 +287,26 @@ static inline ScrollGranularity wheelGranularityToScrollGranularity(unsigned del
     }
 }
 
-static inline bool didScrollInScrollableArea(ScrollableArea* scrollableArea, WheelEvent* wheelEvent)
+static inline bool didScrollInScrollableArea(ScrollableArea* scrollableArea, WheelEvent& wheelEvent)
 {
-    ScrollGranularity scrollGranularity = wheelGranularityToScrollGranularity(wheelEvent->deltaMode());
+    ScrollGranularity scrollGranularity = wheelGranularityToScrollGranularity(wheelEvent.deltaMode());
     bool didHandleWheelEvent = false;
-    if (float absoluteDelta = std::abs(wheelEvent->deltaX()))
-        didHandleWheelEvent |= scrollableArea->scroll(wheelEvent->deltaX() > 0 ? ScrollRight : ScrollLeft, scrollGranularity, absoluteDelta);
+    if (float absoluteDelta = std::abs(wheelEvent.deltaX()))
+        didHandleWheelEvent |= scrollableArea->scroll(wheelEvent.deltaX() > 0 ? ScrollRight : ScrollLeft, scrollGranularity, absoluteDelta);
     
-    if (float absoluteDelta = std::abs(wheelEvent->deltaY()))
-        didHandleWheelEvent |= scrollableArea->scroll(wheelEvent->deltaY() > 0 ? ScrollDown : ScrollUp, scrollGranularity, absoluteDelta);
+    if (float absoluteDelta = std::abs(wheelEvent.deltaY()))
+        didHandleWheelEvent |= scrollableArea->scroll(wheelEvent.deltaY() > 0 ? ScrollDown : ScrollUp, scrollGranularity, absoluteDelta);
     
     return didHandleWheelEvent;
 }
 
-static inline bool handleWheelEventInAppropriateEnclosingBox(Node* startNode, WheelEvent* wheelEvent, Element** stopElement, const FloatSize& filteredPlatformDelta)
+static inline bool handleWheelEventInAppropriateEnclosingBox(Node* startNode, WheelEvent& wheelEvent, Element** stopElement, const FloatSize& filteredPlatformDelta)
 {
-    bool shouldHandleEvent = wheelEvent->deltaX() || wheelEvent->deltaY();
+    bool shouldHandleEvent = wheelEvent.deltaX() || wheelEvent.deltaY();
 #if PLATFORM(MAC)
-    shouldHandleEvent |= wheelEvent->phase() == PlatformWheelEventPhaseEnded;
+    shouldHandleEvent |= wheelEvent.phase() == PlatformWheelEventPhaseEnded;
 #if ENABLE(CSS_SCROLL_SNAP)
-    shouldHandleEvent |= wheelEvent->momentumPhase() == PlatformWheelEventPhaseEnded;
+    shouldHandleEvent |= wheelEvent.momentumPhase() == PlatformWheelEventPhaseEnded;
 #endif
 #endif
     if (!startNode->renderer() || !shouldHandleEvent)
@@ -319,7 +319,7 @@ static inline bool handleWheelEventInAppropriateEnclosingBox(Node* startNode, Wh
     RenderBox* currentEnclosingBox = &initialEnclosingBox;
     while (currentEnclosingBox) {
         if (RenderLayer* boxLayer = currentEnclosingBox->layer()) {
-            const PlatformWheelEvent* platformEvent = wheelEvent->wheelEvent();
+            const PlatformWheelEvent* platformEvent = wheelEvent.wheelEvent();
             bool scrollingWasHandled;
             if (platformEvent != nullptr)
                 scrollingWasHandled = boxLayer->handleWheelEvent(platformEvent->copyWithDeltas(filteredPlatformDelta.width(), filteredPlatformDelta.height()));
@@ -338,7 +338,7 @@ static inline bool handleWheelEventInAppropriateEnclosingBox(Node* startNode, Wh
 
         currentEnclosingBox = currentEnclosingBox->containingBlock();
         if (currentEnclosingBox && currentEnclosingBox->isRenderNamedFlowThread())
-            currentEnclosingBox = RenderNamedFlowThread::fragmentFromRenderBoxAsRenderBlock(currentEnclosingBox, roundedIntPoint(wheelEvent->absoluteLocation()), initialEnclosingBox);
+            currentEnclosingBox = RenderNamedFlowThread::fragmentFromRenderBoxAsRenderBlock(currentEnclosingBox, roundedIntPoint(wheelEvent.absoluteLocation()), initialEnclosingBox);
         if (!currentEnclosingBox || currentEnclosingBox->isRenderView())
             return false;
     }
@@ -2717,13 +2717,13 @@ void EventHandler::clearLatchedState()
         filter->endFilteringDeltas();
 }
 
-void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEvent)
+void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent& wheelEvent)
 {
-    if (!startNode || !wheelEvent)
+    if (!startNode)
         return;
     
-    FloatSize filteredPlatformDelta(wheelEvent->deltaX(), wheelEvent->deltaY());
-    if (const PlatformWheelEvent* platformWheelEvent = wheelEvent->wheelEvent()) {
+    FloatSize filteredPlatformDelta(wheelEvent.deltaX(), wheelEvent.deltaY());
+    if (const PlatformWheelEvent* platformWheelEvent = wheelEvent.wheelEvent()) {
         filteredPlatformDelta.setWidth(platformWheelEvent->deltaX());
         filteredPlatformDelta.setHeight(platformWheelEvent->deltaY());
     }
@@ -2740,7 +2740,7 @@ void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEv
     
     
     if (handleWheelEventInAppropriateEnclosingBox(startNode, wheelEvent, &stopElement, filteredPlatformDelta))
-        wheelEvent->setDefaultHandled();
+        wheelEvent.setDefaultHandled();
     
 #if PLATFORM(MAC)
     if (latchedState && !latchedState->wheelEventElement())
@@ -3089,7 +3089,7 @@ bool EventHandler::keyEvent(const PlatformKeyboardEvent& initialKeyEvent)
     // in order to match IE:
     // 1. preventing default handling of keydown and keypress events has no effect on IM input;
     // 2. if an input method handles the event, its keyCode is set to 229 in keydown event.
-    m_frame.editor().handleInputMethodKeydown(keydown.ptr());
+    m_frame.editor().handleInputMethodKeydown(keydown.get());
     
     bool handledByInputMethod = keydown->defaultHandled();
     
@@ -3190,22 +3190,19 @@ static void setInitialKeyboardSelection(Frame& frame, SelectionDirection directi
     selection.setSelection(visiblePosition, FrameSelection::defaultSetSelectionOptions(UserTriggered), intent);
 }
 
-static void handleKeyboardSelectionMovement(Frame& frame, KeyboardEvent* event)
+static void handleKeyboardSelectionMovement(Frame& frame, KeyboardEvent& event)
 {
-    if (!event)
-        return;
-
     FrameSelection& selection = frame.selection();
 
-    bool isCommanded = event->getModifierState("Meta");
-    bool isOptioned = event->getModifierState("Alt");
+    bool isCommanded = event.getModifierState("Meta");
+    bool isOptioned = event.getModifierState("Alt");
     bool isSelection = !selection.isNone();
 
-    FrameSelection::EAlteration alternation = event->getModifierState("Shift") ? FrameSelection::AlterationExtend : FrameSelection::AlterationMove;
+    FrameSelection::EAlteration alternation = event.getModifierState("Shift") ? FrameSelection::AlterationExtend : FrameSelection::AlterationMove;
     SelectionDirection direction = DirectionForward;
     TextGranularity granularity = CharacterGranularity;
 
-    switch (focusDirectionForKey(event->keyIdentifier())) {
+    switch (focusDirectionForKey(event.keyIdentifier())) {
     case FocusDirectionNone:
         return;
     case FocusDirectionForward:
@@ -3235,12 +3232,12 @@ static void handleKeyboardSelectionMovement(Frame& frame, KeyboardEvent* event)
     else
         setInitialKeyboardSelection(frame, direction);
 
-    event->setDefaultHandled();
+    event.setDefaultHandled();
 }
 
-void EventHandler::handleKeyboardSelectionMovementForAccessibility(KeyboardEvent* event)
+void EventHandler::handleKeyboardSelectionMovementForAccessibility(KeyboardEvent& event)
 {
-    if (event->type() == eventNames().keydownEvent) {
+    if (event.type() == eventNames().keydownEvent) {
         if (AXObjectCache::accessibilityEnhancedUserInterfaceEnabled())
             handleKeyboardSelectionMovement(m_frame, event);
     }
@@ -3267,29 +3264,29 @@ bool EventHandler::accessibilityPreventsEventPropogation(KeyboardEvent& event)
     return false;
 }
 
-void EventHandler::defaultKeyboardEventHandler(KeyboardEvent* event)
+void EventHandler::defaultKeyboardEventHandler(KeyboardEvent& event)
 {
-    if (event->type() == eventNames().keydownEvent) {
+    if (event.type() == eventNames().keydownEvent) {
         m_frame.editor().handleKeyboardEvent(event);
-        if (event->defaultHandled())
+        if (event.defaultHandled())
             return;
-        if (event->keyIdentifier() == "U+0009")
+        if (event.keyIdentifier() == "U+0009")
             defaultTabEventHandler(event);
-        else if (event->keyIdentifier() == "U+0008")
+        else if (event.keyIdentifier() == "U+0008")
             defaultBackspaceEventHandler(event);
         else {
-            FocusDirection direction = focusDirectionForKey(event->keyIdentifier());
+            FocusDirection direction = focusDirectionForKey(event.keyIdentifier());
             if (direction != FocusDirectionNone)
                 defaultArrowEventHandler(direction, event);
         }
 
         handleKeyboardSelectionMovementForAccessibility(event);
     }
-    if (event->type() == eventNames().keypressEvent) {
+    if (event.type() == eventNames().keypressEvent) {
         m_frame.editor().handleKeyboardEvent(event);
-        if (event->defaultHandled())
+        if (event.defaultHandled())
             return;
-        if (event->charCode() == ' ')
+        if (event.charCode() == ' ')
             defaultSpaceEventHandler(event);
     }
 }
@@ -3593,23 +3590,23 @@ bool EventHandler::tabsToLinks(KeyboardEvent* event) const
     return eventInvertsTabsToLinksClientCallResult(event) ? !tabsToLinksClientCallResult : tabsToLinksClientCallResult;
 }
 
-void EventHandler::defaultTextInputEventHandler(TextEvent* event)
+void EventHandler::defaultTextInputEventHandler(TextEvent& event)
 {
     if (m_frame.editor().handleTextEvent(event))
-        event->setDefaultHandled();
+        event.setDefaultHandled();
 }
 
 
-void EventHandler::defaultSpaceEventHandler(KeyboardEvent* event)
+void EventHandler::defaultSpaceEventHandler(KeyboardEvent& event)
 {
-    ASSERT(event->type() == eventNames().keypressEvent);
+    ASSERT(event.type() == eventNames().keypressEvent);
 
-    if (event->ctrlKey() || event->metaKey() || event->altKey() || event->altGraphKey())
+    if (event.ctrlKey() || event.metaKey() || event.altKey() || event.altGraphKey())
         return;
 
-    ScrollLogicalDirection direction = event->shiftKey() ? ScrollBlockDirectionBackward : ScrollBlockDirectionForward;
+    ScrollLogicalDirection direction = event.shiftKey() ? ScrollBlockDirectionBackward : ScrollBlockDirectionForward;
     if (logicalScrollOverflow(direction, ScrollByPage)) {
-        event->setDefaultHandled();
+        event.setDefaultHandled();
         return;
     }
 
@@ -3618,14 +3615,14 @@ void EventHandler::defaultSpaceEventHandler(KeyboardEvent* event)
         return;
 
     if (view->logicalScroll(direction, ScrollByPage))
-        event->setDefaultHandled();
+        event.setDefaultHandled();
 }
 
-void EventHandler::defaultBackspaceEventHandler(KeyboardEvent* event)
+void EventHandler::defaultBackspaceEventHandler(KeyboardEvent& event)
 {
-    ASSERT(event->type() == eventNames().keydownEvent);
+    ASSERT(event.type() == eventNames().keydownEvent);
 
-    if (event->ctrlKey() || event->metaKey() || event->altKey() || event->altGraphKey())
+    if (event.ctrlKey() || event.metaKey() || event.altKey() || event.altGraphKey())
         return;
 
     if (!m_frame.editor().behavior().shouldNavigateBackOnBackspace())
@@ -3640,21 +3637,21 @@ void EventHandler::defaultBackspaceEventHandler(KeyboardEvent* event)
     
     bool handledEvent = false;
 
-    if (event->shiftKey())
+    if (event.shiftKey())
         handledEvent = page->backForward().goForward();
     else
         handledEvent = page->backForward().goBack();
 
     if (handledEvent)
-        event->setDefaultHandled();
+        event.setDefaultHandled();
 }
 
 
-void EventHandler::defaultArrowEventHandler(FocusDirection focusDirection, KeyboardEvent* event)
+void EventHandler::defaultArrowEventHandler(FocusDirection focusDirection, KeyboardEvent& event)
 {
-    ASSERT(event->type() == eventNames().keydownEvent);
+    ASSERT(event.type() == eventNames().keydownEvent);
 
-    if (event->ctrlKey() || event->metaKey() || event->altGraphKey() || event->shiftKey())
+    if (event.ctrlKey() || event.metaKey() || event.altGraphKey() || event.shiftKey())
         return;
 
     Page* page = m_frame.page();
@@ -3669,16 +3666,16 @@ void EventHandler::defaultArrowEventHandler(FocusDirection focusDirection, Keybo
     if (m_frame.document()->inDesignMode())
         return;
 
-    if (page->focusController().advanceFocus(focusDirection, event))
-        event->setDefaultHandled();
+    if (page->focusController().advanceFocus(focusDirection, &event))
+        event.setDefaultHandled();
 }
 
-void EventHandler::defaultTabEventHandler(KeyboardEvent* event)
+void EventHandler::defaultTabEventHandler(KeyboardEvent& event)
 {
-    ASSERT(event->type() == eventNames().keydownEvent);
+    ASSERT(event.type() == eventNames().keydownEvent);
 
     // We should only advance focus on tabs if no special modifier keys are held down.
-    if (event->ctrlKey() || event->metaKey() || event->altGraphKey())
+    if (event.ctrlKey() || event.metaKey() || event.altGraphKey())
         return;
 
     Page* page = m_frame.page();
@@ -3687,14 +3684,14 @@ void EventHandler::defaultTabEventHandler(KeyboardEvent* event)
     if (!page->tabKeyCyclesThroughElements())
         return;
 
-    FocusDirection focusDirection = event->shiftKey() ? FocusDirectionBackward : FocusDirectionForward;
+    FocusDirection focusDirection = event.shiftKey() ? FocusDirectionBackward : FocusDirectionForward;
 
     // Tabs can be used in design mode editing.
     if (m_frame.document()->inDesignMode())
         return;
 
-    if (page->focusController().advanceFocus(focusDirection, event))
-        event->setDefaultHandled();
+    if (page->focusController().advanceFocus(focusDirection, &event))
+        event.setDefaultHandled();
 }
 
 void EventHandler::sendScrollEvent()
index 70e480c..52aa544 100644 (file)
@@ -201,7 +201,7 @@ public:
     WEBCORE_EXPORT bool handleMouseReleaseEvent(const PlatformMouseEvent&);
     bool handleMouseForceEvent(const PlatformMouseEvent&);
     WEBCORE_EXPORT bool handleWheelEvent(const PlatformWheelEvent&);
-    void defaultWheelEventHandler(Node*, WheelEvent*);
+    void defaultWheelEventHandler(Node*, WheelEvent&);
     bool handlePasteGlobalSelection(const PlatformMouseEvent&);
 
     void platformPrepareForWheelEvents(const PlatformWheelEvent&, const HitTestResult&, RefPtr<Element>& eventTarget, RefPtr<ContainerNode>& scrollableContainer, WeakPtr<ScrollableArea>&, bool& isOverWidget);
@@ -247,13 +247,13 @@ public:
     static unsigned accessKeyModifiers();
     WEBCORE_EXPORT bool handleAccessKey(const PlatformKeyboardEvent&);
     WEBCORE_EXPORT bool keyEvent(const PlatformKeyboardEvent&);
-    void defaultKeyboardEventHandler(KeyboardEvent*);
+    void defaultKeyboardEventHandler(KeyboardEvent&);
 
     bool accessibilityPreventsEventPropogation(KeyboardEvent&);
-    WEBCORE_EXPORT void handleKeyboardSelectionMovementForAccessibility(KeyboardEvent*);
+    WEBCORE_EXPORT void handleKeyboardSelectionMovementForAccessibility(KeyboardEvent&);
 
     bool handleTextInputEvent(const String& text, Event* underlyingEvent = nullptr, TextEventInputType = TextEventInputKeyboard);
-    void defaultTextInputEventHandler(TextEvent*);
+    void defaultTextInputEventHandler(TextEvent&);
 
 #if ENABLE(DRAG_SUPPORT)
     WEBCORE_EXPORT bool eventMayStartDrag(const PlatformMouseEvent&) const;
@@ -420,10 +420,10 @@ private:
     bool widgetDidHandleWheelEvent(const PlatformWheelEvent&, Widget&);
     bool completeWidgetWheelEvent(const PlatformWheelEvent&, const WeakPtr<Widget>&, const WeakPtr<ScrollableArea>&, ContainerNode*);
 
-    void defaultSpaceEventHandler(KeyboardEvent*);
-    void defaultBackspaceEventHandler(KeyboardEvent*);
-    void defaultTabEventHandler(KeyboardEvent*);
-    void defaultArrowEventHandler(FocusDirection, KeyboardEvent*);
+    void defaultSpaceEventHandler(KeyboardEvent&);
+    void defaultBackspaceEventHandler(KeyboardEvent&);
+    void defaultTabEventHandler(KeyboardEvent&);
+    void defaultArrowEventHandler(FocusDirection, KeyboardEvent&);
 
 #if ENABLE(DRAG_SUPPORT)
     DragSourceAction updateDragSourceActionsAllowed() const;
index 28cc8db..b2d682b 100644 (file)
@@ -291,17 +291,17 @@ static inline void dispatchEventsOnWindowAndFocusedElement(Document* document, b
 
 static inline bool isFocusableElementOrScopeOwner(Element& element, KeyboardEvent* event)
 {
-    return element.isKeyboardFocusable(event) || isFocusScopeOwner(element);
+    return element.isKeyboardFocusable(*event) || isFocusScopeOwner(element);
 }
 
 static inline bool isNonFocusableScopeOwner(Element& element, KeyboardEvent* event)
 {
-    return !element.isKeyboardFocusable(event) && isFocusScopeOwner(element);
+    return !element.isKeyboardFocusable(*event) && isFocusScopeOwner(element);
 }
 
 static inline bool isFocusableScopeOwner(Element& element, KeyboardEvent* event)
 {
-    return element.isKeyboardFocusable(event) && isFocusScopeOwner(element);
+    return element.isKeyboardFocusable(*event) && isFocusScopeOwner(element);
 }
 
 static inline int shadowAdjustedTabIndex(Element& element, KeyboardEvent* event)
@@ -464,7 +464,7 @@ bool FocusController::advanceFocusInDocumentOrder(FocusDirection direction, Keyb
         return true;
     }
 
-    if (is<HTMLFrameOwnerElement>(*element) && (!is<HTMLPlugInElement>(*element) || !element->isKeyboardFocusable(event))) {
+    if (is<HTMLFrameOwnerElement>(*element) && (!is<HTMLPlugInElement>(*element) || !element->isKeyboardFocusable(*event))) {
         // We focus frames rather than frame owners.
         // FIXME: We should not focus frames that have no scrollbars, as focusing them isn't useful to the user.
         HTMLFrameOwnerElement& owner = downcast<HTMLFrameOwnerElement>(*element);
@@ -954,7 +954,7 @@ void FocusController::findFocusCandidateInContainer(Node& container, const Layou
         if (element == focusedNode)
             continue;
 
-        if (!element->isKeyboardFocusable(event) && !element->isFrameOwnerElement() && !canScrollInDirection(element, direction))
+        if (!element->isKeyboardFocusable(*event) && !element->isFrameOwnerElement() && !canScrollInDirection(element, direction))
             continue;
 
         FocusCandidate candidate = FocusCandidate(element, direction);
index da80011..716108d 100644 (file)
@@ -677,7 +677,7 @@ void RenderFrameSet::continueResizing(GridAxis& axis, int position)
     setNeedsLayout();
 }
 
-bool RenderFrameSet::userResize(MouseEvent* evt)
+bool RenderFrameSet::userResize(MouseEvent& event)
 {
     if (flattenFrameSet())
         return false;
@@ -685,8 +685,8 @@ bool RenderFrameSet::userResize(MouseEvent* evt)
     if (!m_isResizing) {
         if (needsLayout())
             return false;
-        if (evt->type() == eventNames().mousedownEvent && evt->button() == LeftButton) {
-            FloatPoint localPos = absoluteToLocal(evt->absoluteLocation(), UseTransforms);
+        if (event.type() == eventNames().mousedownEvent && event.button() == LeftButton) {
+            FloatPoint localPos = absoluteToLocal(event.absoluteLocation(), UseTransforms);
             startResizing(m_cols, localPos.x());
             startResizing(m_rows, localPos.y());
             if (m_cols.m_splitBeingResized != noSplit || m_rows.m_splitBeingResized != noSplit) {
@@ -695,11 +695,11 @@ bool RenderFrameSet::userResize(MouseEvent* evt)
             }
         }
     } else {
-        if (evt->type() == eventNames().mousemoveEvent || (evt->type() == eventNames().mouseupEvent && evt->button() == LeftButton)) {
-            FloatPoint localPos = absoluteToLocal(evt->absoluteLocation(), UseTransforms);
+        if (event.type() == eventNames().mousemoveEvent || (event.type() == eventNames().mouseupEvent && event.button() == LeftButton)) {
+            FloatPoint localPos = absoluteToLocal(event.absoluteLocation(), UseTransforms);
             continueResizing(m_cols, localPos.x());
             continueResizing(m_rows, localPos.y());
-            if (evt->type() == eventNames().mouseupEvent && evt->button() == LeftButton) {
+            if (event.type() == eventNames().mouseupEvent && event.button() == LeftButton) {
                 setIsResizing(false);
                 return true;
             }
index b2469d7..6575f75 100644 (file)
@@ -62,7 +62,7 @@ public:
 
     FrameEdgeInfo edgeInfo() const;
 
-    bool userResize(MouseEvent*);
+    bool userResize(MouseEvent&);
 
     bool isResizingRow() const;
     bool isResizingColumn() const;
index 605c622..0a9b395 100644 (file)
@@ -113,23 +113,23 @@ RenderPtr<RenderElement> SVGAElement::createElementRenderer(RenderStyle&& style,
     return createRenderer<RenderSVGTransformableContainer>(*this, WTFMove(style));
 }
 
-void SVGAElement::defaultEventHandler(Event* event)
+void SVGAElement::defaultEventHandler(Event& event)
 {
     if (isLink()) {
         if (focused() && isEnterKeyKeydownEvent(event)) {
-            event->setDefaultHandled();
-            dispatchSimulatedClick(event);
+            event.setDefaultHandled();
+            dispatchSimulatedClick(&event);
             return;
         }
 
-        if (MouseEvent::canTriggerActivationBehavior(*event)) {
+        if (MouseEvent::canTriggerActivationBehavior(event)) {
             String url = stripLeadingAndTrailingHTMLSpaces(href());
 
             if (url[0] == '#') {
                 Element* targetElement = treeScope().getElementById(url.substringSharingImpl(1));
                 if (is<SVGSMILElement>(targetElement)) {
                     downcast<SVGSMILElement>(*targetElement).beginByLinkActivation();
-                    event->setDefaultHandled();
+                    event.setDefaultHandled();
                     return;
                 }
                 // Only allow navigation to internal <view> anchors.
@@ -140,12 +140,12 @@ void SVGAElement::defaultEventHandler(Event* event)
             String target = this->target();
             if (target.isEmpty() && attributeWithoutSynchronization(XLinkNames::showAttr) == "new")
                 target = "_blank";
-            event->setDefaultHandled();
+            event.setDefaultHandled();
 
             Frame* frame = document().frame();
             if (!frame)
                 return;
-            frame->loader().urlSelected(document().completeURL(url), target, event, LockHistory::No, LockBackForwardList::No, MaybeSendReferrer, document().shouldOpenExternalURLsPolicyToPropagate());
+            frame->loader().urlSelected(document().completeURL(url), target, &event, LockHistory::No, LockBackForwardList::No, MaybeSendReferrer, document().shouldOpenExternalURLsPolicyToPropagate());
             return;
         }
     }
@@ -190,13 +190,13 @@ bool SVGAElement::isMouseFocusable() const
     return SVGElement::isMouseFocusable();
 }
 
-bool SVGAElement::isKeyboardFocusable(KeyboardEvent* event) const
+bool SVGAElement::isKeyboardFocusable(KeyboardEvent& event) const
 {
     if (isFocusable() && Element::supportsFocus())
         return SVGElement::isKeyboardFocusable(event);
 
     if (isLink())
-        return document().frame()->eventHandler().tabsToLinks(event);
+        return document().frame()->eventHandler().tabsToLinks(&event);
 
     return SVGElement::isKeyboardFocusable(event);
 }
index 8d4de4a..6b556f9 100644 (file)
@@ -49,11 +49,11 @@ private:
     RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final;
     bool childShouldCreateRenderer(const Node&) const final;
 
-    void defaultEventHandler(Event*) final;
+    void defaultEventHandler(Event&) final;
     
     bool supportsFocus() const final;
     bool isMouseFocusable() const final;
-    bool isKeyboardFocusable(KeyboardEvent*) const final;
+    bool isKeyboardFocusable(KeyboardEvent&) const final;
     bool isFocusable() const final;
     bool isURLAttribute(const Attribute&) const final;
     bool canStartSelection() const final;
index a6fd3ce..f0c5792 100644 (file)
@@ -1,3 +1,13 @@
+2016-08-31  Andreas Kling  <akling@apple.com>
+
+        DOM event handling should pass Event around by reference.
+        <https://webkit.org/b/161398>
+
+        Reviewed by Chris Dumez.
+
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::performNonEditingBehaviorForSelector):
+
 2016-08-31  Brady Eidson  <beidson@apple.com>
 
         WK2 Gamepad provider on iOS.
index 345028f..ca8bed1 100644 (file)
@@ -532,7 +532,7 @@ bool WebPage::performNonEditingBehaviorForSelector(const String& selector, Keybo
 {
     // First give accessibility a chance to handle the event.
     Frame* frame = frameForEvent(event);
-    frame->eventHandler().handleKeyboardSelectionMovementForAccessibility(event);
+    frame->eventHandler().handleKeyboardSelectionMovementForAccessibility(*event);
     if (event->defaultHandled())
         return true;