Replace canBubble and cancelable booleans in Event by enum classes
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Aug 2018 21:24:40 +0000 (21:24 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Aug 2018 21:24:40 +0000 (21:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188692

Reviewed by Alex Christensen.

Source/WebCore:

Replaced booleans indicating whether an event can bubble and an event is cancelable
by two enum classes: CanBubble and IsCancelable.

No new tests since there should be no behavioral changes.

* Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp:
(WebCore::WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent):
* Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp:
(WebCore::ApplePayPaymentAuthorizedEvent::ApplePayPaymentAuthorizedEvent):
* Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp:
(WebCore::ApplePayPaymentMethodSelectedEvent::ApplePayPaymentMethodSelectedEvent):
* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::didCancelPaymentSession):
* Modules/applepay/ApplePayShippingContactSelectedEvent.cpp:
(WebCore::ApplePayShippingContactSelectedEvent::ApplePayShippingContactSelectedEvent):
* Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
(WebCore::ApplePayShippingMethodSelectedEvent::ApplePayShippingMethodSelectedEvent):
* Modules/applepay/ApplePayValidateMerchantEvent.cpp:
(WebCore::ApplePayValidateMerchantEvent::ApplePayValidateMerchantEvent):
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::updateKeyStatuses):
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
(WebCore::WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent):
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
(WebCore::WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent):
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::addKeyTimerFired):
(WebCore::WebKitMediaKeySession::sendError):
* Modules/gamepad/GamepadEvent.cpp:
(WebCore::GamepadEvent::GamepadEvent):
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::connectionToServerLost):
* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::onError):
(WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
(WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
(WebCore::IDBOpenDBRequest::onSuccess):
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::onError):
(WebCore::IDBRequest::onSuccess):
* Modules/indexeddb/IDBRequestCompletionEvent.cpp:
(WebCore::IDBRequestCompletionEvent::IDBRequestCompletionEvent):
* Modules/indexeddb/IDBRequestCompletionEvent.h:
(WebCore::IDBRequestCompletionEvent::create):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::fireOnComplete):
(WebCore::IDBTransaction::fireOnAbort):
* Modules/indexeddb/IDBVersionChangeEvent.cpp:
(WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
* Modules/mediasession/MediaSession.cpp:
(WebCore::MediaSession::skipToNextTrack):
(WebCore::MediaSession::skipToPreviousTrack):
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::scheduleEvent):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::scheduleEvent):
* Modules/mediasource/SourceBufferList.cpp:
(WebCore::SourceBufferList::scheduleEvent):
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::scheduledEventTimerFired):
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::internalAddTrack):
(WebCore::MediaStream::internalRemoveTrack):
* Modules/mediastream/MediaStreamEvent.cpp:
(WebCore::MediaStreamEvent::create):
(WebCore::MediaStreamEvent::MediaStreamEvent):
* Modules/mediastream/MediaStreamEvent.h:
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::trackEnded):
(WebCore::MediaStreamTrack::trackMutedChanged):
* Modules/mediastream/MediaStreamTrackEvent.cpp:
(WebCore::MediaStreamTrackEvent::create):
(WebCore::MediaStreamTrackEvent::MediaStreamTrackEvent):
* Modules/mediastream/MediaStreamTrackEvent.h:
* Modules/mediastream/OverconstrainedErrorEvent.h:
(WebCore::OverconstrainedErrorEvent::create):
(WebCore::OverconstrainedErrorEvent::OverconstrainedErrorEvent):
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::fireICECandidateEvent):
(WebCore::PeerConnectionBackend::doneGatheringCandidates):
(WebCore::PeerConnectionBackend::updateSignalingState):
* Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
(WebCore::RTCDTMFToneChangeEvent::RTCDTMFToneChangeEvent):
* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::didChangeReadyState):
(WebCore::RTCDataChannel::didDetectError):
(WebCore::RTCDataChannel::bufferedAmountIsDecreasing):
* Modules/mediastream/RTCDataChannelEvent.cpp:
(WebCore::RTCDataChannelEvent::create):
(WebCore::RTCDataChannelEvent::RTCDataChannelEvent):
* Modules/mediastream/RTCDataChannelEvent.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::updateIceGatheringState):
(WebCore::RTCPeerConnection::updateIceConnectionState):
(WebCore::RTCPeerConnection::updateConnectionState):
(WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent):
* Modules/mediastream/RTCPeerConnectionIceEvent.cpp:
(WebCore::RTCPeerConnectionIceEvent::create):
(WebCore::RTCPeerConnectionIceEvent::RTCPeerConnectionIceEvent):
* Modules/mediastream/RTCPeerConnectionIceEvent.h:
* Modules/mediastream/RTCTrackEvent.cpp:
(WebCore::RTCTrackEvent::create):
(WebCore::RTCTrackEvent::RTCTrackEvent):
* Modules/mediastream/RTCTrackEvent.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::addRemoteStream):
(WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
(WebCore::LibWebRTCMediaEndpoint::addDataChannel):
* Modules/notifications/Notification.cpp:
(WebCore::Notification::dispatchShowEvent):
(WebCore::Notification::dispatchClickEvent):
(WebCore::Notification::dispatchCloseEvent):
(WebCore::Notification::dispatchErrorEvent):
* Modules/paymentrequest/MerchantValidationEvent.cpp:
(WebCore::MerchantValidationEvent::MerchantValidationEvent):
* Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
(WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::postEvent):
* Modules/speech/SpeechSynthesisEvent.cpp:
(WebCore::SpeechSynthesisEvent::SpeechSynthesisEvent):
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::setState):
* Modules/webaudio/AudioProcessingEvent.cpp:
(WebCore::AudioProcessingEvent::AudioProcessingEvent):
* Modules/webaudio/AudioScheduledSourceNode.cpp:
(WebCore::AudioScheduledSourceNode::finish):
* Modules/webaudio/OfflineAudioCompletionEvent.cpp:
(WebCore::OfflineAudioCompletionEvent::OfflineAudioCompletionEvent):
* Modules/websockets/CloseEvent.h:
(WebCore::CloseEvent::CloseEvent):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::didConnect):
(WebCore::WebSocket::dispatchOrQueueErrorEvent):
* Modules/webvr/VRDisplayEvent.cpp:
(WebCore::VRDisplayEvent::VRDisplayEvent):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::dispatchAccessibilityEventWithType const):
* accessibility/AccessibleSetValueEvent.cpp:
(WebCore::AccessibleSetValueEvent::AccessibleSetValueEvent):
* animation/AnimationPlaybackEvent.cpp:
(WebCore::AnimationPlaybackEvent::AnimationPlaybackEvent):
* dom/AbortSignal.cpp:
(WebCore::AbortSignal::abort):
* dom/AnimationEvent.cpp:
(WebCore::AnimationEvent::AnimationEvent):
* dom/BeforeLoadEvent.h:
* dom/BeforeTextInsertedEvent.cpp:
(WebCore::BeforeTextInsertedEvent::BeforeTextInsertedEvent):
* dom/BeforeUnloadEvent.cpp:
(WebCore::BeforeUnloadEvent::BeforeUnloadEvent):
* dom/CharacterData.cpp:
(WebCore::CharacterData::dispatchModifiedEvent):
* dom/CompositionEvent.cpp:
(WebCore::CompositionEvent::CompositionEvent):
* dom/ContainerNode.cpp:
(WebCore::dispatchChildInsertionEvents):
(WebCore::dispatchChildRemovalEvents):
* dom/DeviceMotionEvent.cpp:
(WebCore::DeviceMotionEvent::DeviceMotionEvent):
* dom/DeviceOrientationEvent.cpp:
(WebCore::DeviceOrientationEvent::DeviceOrientationEvent):
* dom/Document.cpp:
(WebCore::Document::setReadyState):
(WebCore::Document::visibilityStateChanged):
(WebCore::Document::finishedParsing):
(WebCore::Document::dispatchFullScreenChangeOrErrorEvent):
(WebCore::Document::orientationChanged):
* dom/DocumentEventQueue.cpp:
(WebCore::DocumentEventQueue::enqueueOrDispatchScrollEvent):
(WebCore::DocumentEventQueue::enqueueScrollEvent):
(WebCore::DocumentEventQueue::enqueueResizeEvent):
* dom/DocumentEventQueue.h:
* dom/Element.cpp:
(WebCore::Element::dispatchMouseEvent):
(WebCore::Element::dispatchFocusInEvent):
(WebCore::Element::dispatchFocusOutEvent):
(WebCore::Element::dispatchFocusEvent):
(WebCore::Element::dispatchBlurEvent):
(WebCore::Element::dispatchWebKitImageReadyEventForTesting):
* dom/ErrorEvent.cpp:
(WebCore::ErrorEvent::ErrorEvent):
* dom/Event.cpp:
(WebCore::Event::Event):
(WebCore::Event::create):
* dom/Event.h:
* dom/FocusEvent.cpp:
(WebCore::FocusEvent::FocusEvent):
* dom/FocusEvent.h:
* dom/HashChangeEvent.h:
* dom/InputEvent.cpp:
(WebCore::InputEvent::create):
(WebCore::InputEvent::InputEvent):
* dom/InputEvent.h:
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent):
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::create):
(WebCore::MouseEvent::MouseEvent):
* dom/MouseEvent.h:
* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::MouseRelatedEvent):
* dom/MouseRelatedEvent.h:
* dom/MutationEvent.cpp:
(WebCore::MutationEvent::MutationEvent):
* dom/MutationEvent.h:
* dom/Node.cpp:
(WebCore::Node::dispatchSubtreeModifiedEvent):
(WebCore::Node::dispatchDOMActivateEvent):
(WebCore::Node::dispatchInputEvent):
* dom/OverflowEvent.cpp:
(WebCore::OverflowEvent::OverflowEvent):
* dom/PageTransitionEvent.cpp:
(WebCore::PageTransitionEvent::PageTransitionEvent):
* dom/PopStateEvent.cpp:
(WebCore::PopStateEvent::PopStateEvent):
* dom/ProgressEvent.cpp:
(WebCore::ProgressEvent::ProgressEvent):
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::dispatchErrorEvent):
* dom/SecurityPolicyViolationEvent.h:
* dom/SimulatedClick.cpp:
* dom/TextEvent.cpp:
(WebCore::TextEvent::TextEvent):
* dom/TransitionEvent.cpp:
(WebCore::TransitionEvent::TransitionEvent):
* dom/UIEvent.cpp:
(WebCore::UIEvent::UIEvent):
* dom/UIEvent.h:
(WebCore::UIEvent::create):
* dom/UIEventWithKeyState.h:
(WebCore::UIEventWithKeyState::UIEventWithKeyState):
* dom/WebKitAnimationEvent.cpp:
(WebCore::WebKitAnimationEvent::WebKitAnimationEvent):
* dom/WebKitTransitionEvent.cpp:
(WebCore::WebKitTransitionEvent::WebKitTransitionEvent):
* dom/WheelEvent.cpp:
(WebCore::WheelEvent::WheelEvent):
* editing/Editor.cpp:
(WebCore::dispatchBeforeInputEvent):
(WebCore::dispatchBeforeInputEvents):
(WebCore::Editor::willApplyEditing const):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
(WebCore::FrameSelection::selectAll):
(WebCore::FrameSelection::dispatchSelectStart):
* html/HTMLDetailsElement.cpp:
(WebCore::HTMLDetailsElement::dispatchPendingEvent):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::dispatchChangeEvent):
(WebCore::HTMLFormControlElement::checkValidity):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::prepareForSubmission):
(WebCore::HTMLFormElement::reset):
* html/HTMLImageLoader.cpp:
(WebCore::HTMLImageLoader::dispatchLoadEvent):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::onSearch):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::dispatchPendingEvent):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::scheduleEvent):
(WebCore::HTMLMediaElement::notifyAboutPlaying):
(WebCore::HTMLMediaElement::updateActiveTextTrackCues):
(WebCore::HTMLMediaElement::layoutSizeChanged):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::checkSnapshotStatus):
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::dispatchLoadEvent):
* html/HTMLSlotElement.cpp:
(WebCore::HTMLSlotElement::dispatchSlotChangeEvent):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::errorEventTimerFired):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::dispatchPendingEvent):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::selectionChanged):
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::didCompleteLoad):
* html/MediaController.cpp:
(WebCore::MediaController::scheduleEvent):
* html/canvas/WebGLContextEvent.cpp:
(WebCore::WebGLContextEvent::WebGLContextEvent):
* html/canvas/WebGLContextEvent.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
(WebCore::WebGLRenderingContextBase::maybeRestoreContext):
(WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent):
* html/parser/HTMLScriptRunner.cpp:
(WebCore::createScriptLoadEvent):
* html/track/TrackEvent.cpp:
(WebCore::TrackEvent::TrackEvent):
* html/track/TrackEvent.h:
* html/track/TrackListBase.cpp:
(WebCore::TrackListBase::scheduleTrackEvent):
(WebCore::TrackListBase::scheduleChangeEvent):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::dispatchUnloadEvents):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::dispatchPendingErrorEvent):
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::createApplicationCacheEvent):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::dispatchAllPendingUnloadEvents):
(WebCore::DOMWindow::languagesChanged):
(WebCore::DOMWindow::dispatchLoadEvent):
* page/EventHandler.cpp:
(WebCore::dispatchSelectStart):
(WebCore::EventHandler::dispatchDragEvent):
* page/EventSource.cpp:
(WebCore::EventSource::scheduleReconnect):
(WebCore::EventSource::didReceiveResponse):
(WebCore::EventSource::abortConnectionAttempt):
* page/FocusController.cpp:
(WebCore::dispatchEventsOnWindowAndFocusedElement):
(WebCore::FocusController::setFocusedFrame):
* page/FrameView.cpp:
(WebCore::FrameView::sendResizeEventIfNeeded):
* page/Page.cpp:
(WebCore::networkStateChanged):
* page/Performance.cpp:
(WebCore::Performance::resourceTimingBufferFullTimerFired):
* page/PointerLockController.cpp:
(WebCore::PointerLockController::enqueueEvent):
* page/VisualViewport.cpp:
(WebCore::VisualViewport::enqueueResizeEvent):
(WebCore::VisualViewport::enqueueScrollEvent):
* storage/StorageEvent.cpp:
(WebCore::StorageEvent::StorageEvent):
* svg/SVGElement.cpp:
(WebCore::SVGElement::sendSVGLoadEventIfPossible):
* svg/SVGImageLoader.cpp:
(WebCore::SVGImageLoader::dispatchLoadEvent):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::notifyFinished):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::dispatchPendingEvent):
* workers/Worker.cpp:
(WebCore::Worker::notifyFinished):
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::notifyNetworkStateChange):
* workers/service/ExtendableEvent.cpp:
(WebCore::ExtendableEvent::ExtendableEvent):
* workers/service/ExtendableEvent.h:
* workers/service/ExtendableMessageEvent.cpp:
(WebCore::ExtendableMessageEvent::ExtendableMessageEvent):
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::scheduleTaskToUpdateState):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent):
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::scheduleTaskToFireUpdateFoundEvent):
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::notifyNetworkStateChange):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::callReadyStateChangeListener):

Source/WebKit:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):

Source/WebKitLegacy/ios:

* WebView/WebPDFViewPlaceholder.mm:
(-[WebPDFViewPlaceholder simulateClickOnLinkToURL:]):

Source/WebKitLegacy/mac:

* WebView/WebPDFView.mm:
(-[WebPDFView PDFViewWillClickOnLink:withURL:]):
* WebView/WebView.mm:
(-[WebView _dispatchUnloadEvent]):

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

165 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp
Source/WebCore/Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp
Source/WebCore/Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp
Source/WebCore/Modules/applepay/ApplePaySession.cpp
Source/WebCore/Modules/applepay/ApplePayShippingContactSelectedEvent.cpp
Source/WebCore/Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp
Source/WebCore/Modules/applepay/ApplePayValidateMerchantEvent.cpp
Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp
Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp
Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp
Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp
Source/WebCore/Modules/gamepad/GamepadEvent.cpp
Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp
Source/WebCore/Modules/indexeddb/IDBRequest.cpp
Source/WebCore/Modules/indexeddb/IDBRequestCompletionEvent.cpp
Source/WebCore/Modules/indexeddb/IDBRequestCompletionEvent.h
Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp
Source/WebCore/Modules/mediasession/MediaSession.cpp
Source/WebCore/Modules/mediasource/MediaSource.cpp
Source/WebCore/Modules/mediasource/SourceBuffer.cpp
Source/WebCore/Modules/mediasource/SourceBufferList.cpp
Source/WebCore/Modules/mediastream/MediaDevices.cpp
Source/WebCore/Modules/mediastream/MediaStream.cpp
Source/WebCore/Modules/mediastream/MediaStreamEvent.cpp
Source/WebCore/Modules/mediastream/MediaStreamEvent.h
Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrackEvent.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrackEvent.h
Source/WebCore/Modules/mediastream/OverconstrainedErrorEvent.h
Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
Source/WebCore/Modules/mediastream/RTCDTMFToneChangeEvent.cpp
Source/WebCore/Modules/mediastream/RTCDataChannel.cpp
Source/WebCore/Modules/mediastream/RTCDataChannelEvent.cpp
Source/WebCore/Modules/mediastream/RTCDataChannelEvent.h
Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
Source/WebCore/Modules/mediastream/RTCPeerConnectionIceEvent.cpp
Source/WebCore/Modules/mediastream/RTCPeerConnectionIceEvent.h
Source/WebCore/Modules/mediastream/RTCTrackEvent.cpp
Source/WebCore/Modules/mediastream/RTCTrackEvent.h
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp
Source/WebCore/Modules/notifications/Notification.cpp
Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.cpp
Source/WebCore/Modules/paymentrequest/PaymentRequestUpdateEvent.cpp
Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm
Source/WebCore/Modules/speech/SpeechSynthesisEvent.cpp
Source/WebCore/Modules/webaudio/AudioContext.cpp
Source/WebCore/Modules/webaudio/AudioProcessingEvent.cpp
Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp
Source/WebCore/Modules/webaudio/OfflineAudioCompletionEvent.cpp
Source/WebCore/Modules/websockets/CloseEvent.h
Source/WebCore/Modules/websockets/WebSocket.cpp
Source/WebCore/Modules/webvr/VRDisplayEvent.cpp
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibleSetValueEvent.cpp
Source/WebCore/animation/AnimationPlaybackEvent.cpp
Source/WebCore/dom/AbortSignal.cpp
Source/WebCore/dom/AnimationEvent.cpp
Source/WebCore/dom/BeforeLoadEvent.h
Source/WebCore/dom/BeforeTextInsertedEvent.cpp
Source/WebCore/dom/BeforeUnloadEvent.cpp
Source/WebCore/dom/CharacterData.cpp
Source/WebCore/dom/CompositionEvent.cpp
Source/WebCore/dom/ContainerNode.cpp
Source/WebCore/dom/DeviceMotionEvent.cpp
Source/WebCore/dom/DeviceOrientationEvent.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/DocumentEventQueue.cpp
Source/WebCore/dom/DocumentEventQueue.h
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/ErrorEvent.cpp
Source/WebCore/dom/Event.cpp
Source/WebCore/dom/Event.h
Source/WebCore/dom/FocusEvent.cpp
Source/WebCore/dom/FocusEvent.h
Source/WebCore/dom/HashChangeEvent.h
Source/WebCore/dom/InputEvent.cpp
Source/WebCore/dom/InputEvent.h
Source/WebCore/dom/KeyboardEvent.cpp
Source/WebCore/dom/MessageEvent.cpp
Source/WebCore/dom/MouseEvent.cpp
Source/WebCore/dom/MouseEvent.h
Source/WebCore/dom/MouseRelatedEvent.cpp
Source/WebCore/dom/MouseRelatedEvent.h
Source/WebCore/dom/MutationEvent.cpp
Source/WebCore/dom/MutationEvent.h
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/OverflowEvent.cpp
Source/WebCore/dom/PageTransitionEvent.cpp
Source/WebCore/dom/PopStateEvent.cpp
Source/WebCore/dom/ProgressEvent.cpp
Source/WebCore/dom/ScriptElement.cpp
Source/WebCore/dom/SecurityPolicyViolationEvent.h
Source/WebCore/dom/SimulatedClick.cpp
Source/WebCore/dom/TextEvent.cpp
Source/WebCore/dom/TouchEvent.cpp
Source/WebCore/dom/TransitionEvent.cpp
Source/WebCore/dom/UIEvent.cpp
Source/WebCore/dom/UIEvent.h
Source/WebCore/dom/UIEventWithKeyState.h
Source/WebCore/dom/WebKitAnimationEvent.cpp
Source/WebCore/dom/WebKitTransitionEvent.cpp
Source/WebCore/dom/WheelEvent.cpp
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/html/HTMLDetailsElement.cpp
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLFormElement.cpp
Source/WebCore/html/HTMLImageLoader.cpp
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLLinkElement.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/html/HTMLScriptElement.cpp
Source/WebCore/html/HTMLSlotElement.cpp
Source/WebCore/html/HTMLSourceElement.cpp
Source/WebCore/html/HTMLStyleElement.cpp
Source/WebCore/html/HTMLTextFormControlElement.cpp
Source/WebCore/html/HTMLTrackElement.cpp
Source/WebCore/html/MediaController.cpp
Source/WebCore/html/canvas/WebGLContextEvent.cpp
Source/WebCore/html/canvas/WebGLContextEvent.h
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
Source/WebCore/html/parser/HTMLScriptRunner.cpp
Source/WebCore/html/track/TrackEvent.cpp
Source/WebCore/html/track/TrackEvent.h
Source/WebCore/html/track/TrackListBase.cpp
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/ImageLoader.cpp
Source/WebCore/loader/PolicyChecker.cpp
Source/WebCore/loader/appcache/ApplicationCacheHost.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/EventSource.cpp
Source/WebCore/page/FocusController.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/Performance.cpp
Source/WebCore/page/PointerLockController.cpp
Source/WebCore/page/VisualViewport.cpp
Source/WebCore/storage/StorageEvent.cpp
Source/WebCore/svg/SVGElement.cpp
Source/WebCore/svg/SVGImageLoader.cpp
Source/WebCore/svg/SVGUseElement.cpp
Source/WebCore/svg/animation/SVGSMILElement.cpp
Source/WebCore/workers/Worker.cpp
Source/WebCore/workers/WorkerMessagingProxy.cpp
Source/WebCore/workers/service/ExtendableEvent.cpp
Source/WebCore/workers/service/ExtendableEvent.h
Source/WebCore/workers/service/ExtendableMessageEvent.cpp
Source/WebCore/workers/service/ServiceWorker.cpp
Source/WebCore/workers/service/ServiceWorkerContainer.cpp
Source/WebCore/workers/service/ServiceWorkerRegistration.cpp
Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp
Source/WebCore/xml/XMLHttpRequest.cpp
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKitLegacy/ios/ChangeLog
Source/WebKitLegacy/ios/WebView/WebPDFViewPlaceholder.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebPDFView.mm
Source/WebKitLegacy/mac/WebView/WebView.mm

index 0cb77c8..40a21a5 100644 (file)
@@ -1,3 +1,374 @@
+2018-08-16  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Replace canBubble and cancelable booleans in Event by enum classes
+        https://bugs.webkit.org/show_bug.cgi?id=188692
+
+        Reviewed by Alex Christensen.
+
+        Replaced booleans indicating whether an event can bubble and an event is cancelable
+        by two enum classes: CanBubble and IsCancelable.
+
+        No new tests since there should be no behavioral changes.
+
+        * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp:
+        (WebCore::WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent):
+        * Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp:
+        (WebCore::ApplePayPaymentAuthorizedEvent::ApplePayPaymentAuthorizedEvent):
+        * Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp:
+        (WebCore::ApplePayPaymentMethodSelectedEvent::ApplePayPaymentMethodSelectedEvent):
+        * Modules/applepay/ApplePaySession.cpp:
+        (WebCore::ApplePaySession::didCancelPaymentSession):
+        * Modules/applepay/ApplePayShippingContactSelectedEvent.cpp:
+        (WebCore::ApplePayShippingContactSelectedEvent::ApplePayShippingContactSelectedEvent):
+        * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
+        (WebCore::ApplePayShippingMethodSelectedEvent::ApplePayShippingMethodSelectedEvent):
+        * Modules/applepay/ApplePayValidateMerchantEvent.cpp:
+        (WebCore::ApplePayValidateMerchantEvent::ApplePayValidateMerchantEvent):
+        * Modules/encryptedmedia/MediaKeySession.cpp:
+        (WebCore::MediaKeySession::updateKeyStatuses):
+        * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
+        (WebCore::WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent):
+        * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
+        (WebCore::WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent):
+        * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
+        (WebCore::WebKitMediaKeySession::addKeyTimerFired):
+        (WebCore::WebKitMediaKeySession::sendError):
+        * Modules/gamepad/GamepadEvent.cpp:
+        (WebCore::GamepadEvent::GamepadEvent):
+        * Modules/indexeddb/IDBDatabase.cpp:
+        (WebCore::IDBDatabase::connectionToServerLost):
+        * Modules/indexeddb/IDBOpenDBRequest.cpp:
+        (WebCore::IDBOpenDBRequest::onError):
+        (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
+        (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
+        (WebCore::IDBOpenDBRequest::onSuccess):
+        * Modules/indexeddb/IDBRequest.cpp:
+        (WebCore::IDBRequest::onError):
+        (WebCore::IDBRequest::onSuccess):
+        * Modules/indexeddb/IDBRequestCompletionEvent.cpp:
+        (WebCore::IDBRequestCompletionEvent::IDBRequestCompletionEvent):
+        * Modules/indexeddb/IDBRequestCompletionEvent.h:
+        (WebCore::IDBRequestCompletionEvent::create):
+        * Modules/indexeddb/IDBTransaction.cpp:
+        (WebCore::IDBTransaction::fireOnComplete):
+        (WebCore::IDBTransaction::fireOnAbort):
+        * Modules/indexeddb/IDBVersionChangeEvent.cpp:
+        (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
+        * Modules/mediasession/MediaSession.cpp:
+        (WebCore::MediaSession::skipToNextTrack):
+        (WebCore::MediaSession::skipToPreviousTrack):
+        * Modules/mediasource/MediaSource.cpp:
+        (WebCore::MediaSource::scheduleEvent):
+        * Modules/mediasource/SourceBuffer.cpp:
+        (WebCore::SourceBuffer::scheduleEvent):
+        * Modules/mediasource/SourceBufferList.cpp:
+        (WebCore::SourceBufferList::scheduleEvent):
+        * Modules/mediastream/MediaDevices.cpp:
+        (WebCore::MediaDevices::scheduledEventTimerFired):
+        * Modules/mediastream/MediaStream.cpp:
+        (WebCore::MediaStream::internalAddTrack):
+        (WebCore::MediaStream::internalRemoveTrack):
+        * Modules/mediastream/MediaStreamEvent.cpp:
+        (WebCore::MediaStreamEvent::create):
+        (WebCore::MediaStreamEvent::MediaStreamEvent):
+        * Modules/mediastream/MediaStreamEvent.h:
+        * Modules/mediastream/MediaStreamTrack.cpp:
+        (WebCore::MediaStreamTrack::trackEnded):
+        (WebCore::MediaStreamTrack::trackMutedChanged):
+        * Modules/mediastream/MediaStreamTrackEvent.cpp:
+        (WebCore::MediaStreamTrackEvent::create):
+        (WebCore::MediaStreamTrackEvent::MediaStreamTrackEvent):
+        * Modules/mediastream/MediaStreamTrackEvent.h:
+        * Modules/mediastream/OverconstrainedErrorEvent.h:
+        (WebCore::OverconstrainedErrorEvent::create):
+        (WebCore::OverconstrainedErrorEvent::OverconstrainedErrorEvent):
+        * Modules/mediastream/PeerConnectionBackend.cpp:
+        (WebCore::PeerConnectionBackend::fireICECandidateEvent):
+        (WebCore::PeerConnectionBackend::doneGatheringCandidates):
+        (WebCore::PeerConnectionBackend::updateSignalingState):
+        * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
+        (WebCore::RTCDTMFToneChangeEvent::RTCDTMFToneChangeEvent):
+        * Modules/mediastream/RTCDataChannel.cpp:
+        (WebCore::RTCDataChannel::didChangeReadyState):
+        (WebCore::RTCDataChannel::didDetectError):
+        (WebCore::RTCDataChannel::bufferedAmountIsDecreasing):
+        * Modules/mediastream/RTCDataChannelEvent.cpp:
+        (WebCore::RTCDataChannelEvent::create):
+        (WebCore::RTCDataChannelEvent::RTCDataChannelEvent):
+        * Modules/mediastream/RTCDataChannelEvent.h:
+        * Modules/mediastream/RTCPeerConnection.cpp:
+        (WebCore::RTCPeerConnection::updateIceGatheringState):
+        (WebCore::RTCPeerConnection::updateIceConnectionState):
+        (WebCore::RTCPeerConnection::updateConnectionState):
+        (WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent):
+        * Modules/mediastream/RTCPeerConnectionIceEvent.cpp:
+        (WebCore::RTCPeerConnectionIceEvent::create):
+        (WebCore::RTCPeerConnectionIceEvent::RTCPeerConnectionIceEvent):
+        * Modules/mediastream/RTCPeerConnectionIceEvent.h:
+        * Modules/mediastream/RTCTrackEvent.cpp:
+        (WebCore::RTCTrackEvent::create):
+        (WebCore::RTCTrackEvent::RTCTrackEvent):
+        * Modules/mediastream/RTCTrackEvent.h:
+        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
+        (WebCore::LibWebRTCMediaEndpoint::addRemoteStream):
+        (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
+        (WebCore::LibWebRTCMediaEndpoint::addDataChannel):
+        * Modules/notifications/Notification.cpp:
+        (WebCore::Notification::dispatchShowEvent):
+        (WebCore::Notification::dispatchClickEvent):
+        (WebCore::Notification::dispatchCloseEvent):
+        (WebCore::Notification::dispatchErrorEvent):
+        * Modules/paymentrequest/MerchantValidationEvent.cpp:
+        (WebCore::MerchantValidationEvent::MerchantValidationEvent):
+        * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
+        (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
+        * Modules/plugins/QuickTimePluginReplacement.mm:
+        (WebCore::QuickTimePluginReplacement::postEvent):
+        * Modules/speech/SpeechSynthesisEvent.cpp:
+        (WebCore::SpeechSynthesisEvent::SpeechSynthesisEvent):
+        * Modules/webaudio/AudioContext.cpp:
+        (WebCore::AudioContext::setState):
+        * Modules/webaudio/AudioProcessingEvent.cpp:
+        (WebCore::AudioProcessingEvent::AudioProcessingEvent):
+        * Modules/webaudio/AudioScheduledSourceNode.cpp:
+        (WebCore::AudioScheduledSourceNode::finish):
+        * Modules/webaudio/OfflineAudioCompletionEvent.cpp:
+        (WebCore::OfflineAudioCompletionEvent::OfflineAudioCompletionEvent):
+        * Modules/websockets/CloseEvent.h:
+        (WebCore::CloseEvent::CloseEvent):
+        * Modules/websockets/WebSocket.cpp:
+        (WebCore::WebSocket::didConnect):
+        (WebCore::WebSocket::dispatchOrQueueErrorEvent):
+        * Modules/webvr/VRDisplayEvent.cpp:
+        (WebCore::VRDisplayEvent::VRDisplayEvent):
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::dispatchAccessibilityEventWithType const):
+        * accessibility/AccessibleSetValueEvent.cpp:
+        (WebCore::AccessibleSetValueEvent::AccessibleSetValueEvent):
+        * animation/AnimationPlaybackEvent.cpp:
+        (WebCore::AnimationPlaybackEvent::AnimationPlaybackEvent):
+        * dom/AbortSignal.cpp:
+        (WebCore::AbortSignal::abort):
+        * dom/AnimationEvent.cpp:
+        (WebCore::AnimationEvent::AnimationEvent):
+        * dom/BeforeLoadEvent.h:
+        * dom/BeforeTextInsertedEvent.cpp:
+        (WebCore::BeforeTextInsertedEvent::BeforeTextInsertedEvent):
+        * dom/BeforeUnloadEvent.cpp:
+        (WebCore::BeforeUnloadEvent::BeforeUnloadEvent):
+        * dom/CharacterData.cpp:
+        (WebCore::CharacterData::dispatchModifiedEvent):
+        * dom/CompositionEvent.cpp:
+        (WebCore::CompositionEvent::CompositionEvent):
+        * dom/ContainerNode.cpp:
+        (WebCore::dispatchChildInsertionEvents):
+        (WebCore::dispatchChildRemovalEvents):
+        * dom/DeviceMotionEvent.cpp:
+        (WebCore::DeviceMotionEvent::DeviceMotionEvent):
+        * dom/DeviceOrientationEvent.cpp:
+        (WebCore::DeviceOrientationEvent::DeviceOrientationEvent):
+        * dom/Document.cpp:
+        (WebCore::Document::setReadyState):
+        (WebCore::Document::visibilityStateChanged):
+        (WebCore::Document::finishedParsing):
+        (WebCore::Document::dispatchFullScreenChangeOrErrorEvent):
+        (WebCore::Document::orientationChanged):
+        * dom/DocumentEventQueue.cpp:
+        (WebCore::DocumentEventQueue::enqueueOrDispatchScrollEvent):
+        (WebCore::DocumentEventQueue::enqueueScrollEvent):
+        (WebCore::DocumentEventQueue::enqueueResizeEvent):
+        * dom/DocumentEventQueue.h:
+        * dom/Element.cpp:
+        (WebCore::Element::dispatchMouseEvent):
+        (WebCore::Element::dispatchFocusInEvent):
+        (WebCore::Element::dispatchFocusOutEvent):
+        (WebCore::Element::dispatchFocusEvent):
+        (WebCore::Element::dispatchBlurEvent):
+        (WebCore::Element::dispatchWebKitImageReadyEventForTesting):
+        * dom/ErrorEvent.cpp:
+        (WebCore::ErrorEvent::ErrorEvent):
+        * dom/Event.cpp:
+        (WebCore::Event::Event):
+        (WebCore::Event::create):
+        * dom/Event.h:
+        * dom/FocusEvent.cpp:
+        (WebCore::FocusEvent::FocusEvent):
+        * dom/FocusEvent.h:
+        * dom/HashChangeEvent.h:
+        * dom/InputEvent.cpp:
+        (WebCore::InputEvent::create):
+        (WebCore::InputEvent::InputEvent):
+        * dom/InputEvent.h:
+        * dom/KeyboardEvent.cpp:
+        (WebCore::KeyboardEvent::KeyboardEvent):
+        * dom/MessageEvent.cpp:
+        (WebCore::MessageEvent::MessageEvent):
+        * dom/MouseEvent.cpp:
+        (WebCore::MouseEvent::create):
+        (WebCore::MouseEvent::MouseEvent):
+        * dom/MouseEvent.h:
+        * dom/MouseRelatedEvent.cpp:
+        (WebCore::MouseRelatedEvent::MouseRelatedEvent):
+        * dom/MouseRelatedEvent.h:
+        * dom/MutationEvent.cpp:
+        (WebCore::MutationEvent::MutationEvent):
+        * dom/MutationEvent.h:
+        * dom/Node.cpp:
+        (WebCore::Node::dispatchSubtreeModifiedEvent):
+        (WebCore::Node::dispatchDOMActivateEvent):
+        (WebCore::Node::dispatchInputEvent):
+        * dom/OverflowEvent.cpp:
+        (WebCore::OverflowEvent::OverflowEvent):
+        * dom/PageTransitionEvent.cpp:
+        (WebCore::PageTransitionEvent::PageTransitionEvent):
+        * dom/PopStateEvent.cpp:
+        (WebCore::PopStateEvent::PopStateEvent):
+        * dom/ProgressEvent.cpp:
+        (WebCore::ProgressEvent::ProgressEvent):
+        * dom/ScriptElement.cpp:
+        (WebCore::ScriptElement::dispatchErrorEvent):
+        * dom/SecurityPolicyViolationEvent.h:
+        * dom/SimulatedClick.cpp:
+        * dom/TextEvent.cpp:
+        (WebCore::TextEvent::TextEvent):
+        * dom/TransitionEvent.cpp:
+        (WebCore::TransitionEvent::TransitionEvent):
+        * dom/UIEvent.cpp:
+        (WebCore::UIEvent::UIEvent):
+        * dom/UIEvent.h:
+        (WebCore::UIEvent::create):
+        * dom/UIEventWithKeyState.h:
+        (WebCore::UIEventWithKeyState::UIEventWithKeyState):
+        * dom/WebKitAnimationEvent.cpp:
+        (WebCore::WebKitAnimationEvent::WebKitAnimationEvent):
+        * dom/WebKitTransitionEvent.cpp:
+        (WebCore::WebKitTransitionEvent::WebKitTransitionEvent):
+        * dom/WheelEvent.cpp:
+        (WebCore::WheelEvent::WheelEvent):
+        * editing/Editor.cpp:
+        (WebCore::dispatchBeforeInputEvent):
+        (WebCore::dispatchBeforeInputEvents):
+        (WebCore::Editor::willApplyEditing const):
+        * editing/FrameSelection.cpp:
+        (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
+        (WebCore::FrameSelection::selectAll):
+        (WebCore::FrameSelection::dispatchSelectStart):
+        * html/HTMLDetailsElement.cpp:
+        (WebCore::HTMLDetailsElement::dispatchPendingEvent):
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::dispatchChangeEvent):
+        (WebCore::HTMLFormControlElement::checkValidity):
+        * html/HTMLFormElement.cpp:
+        (WebCore::HTMLFormElement::prepareForSubmission):
+        (WebCore::HTMLFormElement::reset):
+        * html/HTMLImageLoader.cpp:
+        (WebCore::HTMLImageLoader::dispatchLoadEvent):
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::onSearch):
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::dispatchPendingEvent):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::scheduleEvent):
+        (WebCore::HTMLMediaElement::notifyAboutPlaying):
+        (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
+        (WebCore::HTMLMediaElement::layoutSizeChanged):
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::HTMLPlugInImageElement::checkSnapshotStatus):
+        * html/HTMLScriptElement.cpp:
+        (WebCore::HTMLScriptElement::dispatchLoadEvent):
+        * html/HTMLSlotElement.cpp:
+        (WebCore::HTMLSlotElement::dispatchSlotChangeEvent):
+        * html/HTMLSourceElement.cpp:
+        (WebCore::HTMLSourceElement::errorEventTimerFired):
+        * html/HTMLStyleElement.cpp:
+        (WebCore::HTMLStyleElement::dispatchPendingEvent):
+        * html/HTMLTextFormControlElement.cpp:
+        (WebCore::HTMLTextFormControlElement::selectionChanged):
+        * html/HTMLTrackElement.cpp:
+        (WebCore::HTMLTrackElement::didCompleteLoad):
+        * html/MediaController.cpp:
+        (WebCore::MediaController::scheduleEvent):
+        * html/canvas/WebGLContextEvent.cpp:
+        (WebCore::WebGLContextEvent::WebGLContextEvent):
+        * html/canvas/WebGLContextEvent.h:
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::create):
+        (WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
+        (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
+        (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent):
+        * html/parser/HTMLScriptRunner.cpp:
+        (WebCore::createScriptLoadEvent):
+        * html/track/TrackEvent.cpp:
+        (WebCore::TrackEvent::TrackEvent):
+        * html/track/TrackEvent.h:
+        * html/track/TrackListBase.cpp:
+        (WebCore::TrackListBase::scheduleTrackEvent):
+        (WebCore::TrackListBase::scheduleChangeEvent):
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::dispatchUnloadEvents):
+        * loader/ImageLoader.cpp:
+        (WebCore::ImageLoader::dispatchPendingErrorEvent):
+        * loader/PolicyChecker.cpp:
+        (WebCore::PolicyChecker::checkNavigationPolicy):
+        * loader/appcache/ApplicationCacheHost.cpp:
+        (WebCore::createApplicationCacheEvent):
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::dispatchAllPendingUnloadEvents):
+        (WebCore::DOMWindow::languagesChanged):
+        (WebCore::DOMWindow::dispatchLoadEvent):
+        * page/EventHandler.cpp:
+        (WebCore::dispatchSelectStart):
+        (WebCore::EventHandler::dispatchDragEvent):
+        * page/EventSource.cpp:
+        (WebCore::EventSource::scheduleReconnect):
+        (WebCore::EventSource::didReceiveResponse):
+        (WebCore::EventSource::abortConnectionAttempt):
+        * page/FocusController.cpp:
+        (WebCore::dispatchEventsOnWindowAndFocusedElement):
+        (WebCore::FocusController::setFocusedFrame):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::sendResizeEventIfNeeded):
+        * page/Page.cpp:
+        (WebCore::networkStateChanged):
+        * page/Performance.cpp:
+        (WebCore::Performance::resourceTimingBufferFullTimerFired):
+        * page/PointerLockController.cpp:
+        (WebCore::PointerLockController::enqueueEvent):
+        * page/VisualViewport.cpp:
+        (WebCore::VisualViewport::enqueueResizeEvent):
+        (WebCore::VisualViewport::enqueueScrollEvent):
+        * storage/StorageEvent.cpp:
+        (WebCore::StorageEvent::StorageEvent):
+        * svg/SVGElement.cpp:
+        (WebCore::SVGElement::sendSVGLoadEventIfPossible):
+        * svg/SVGImageLoader.cpp:
+        (WebCore::SVGImageLoader::dispatchLoadEvent):
+        * svg/SVGUseElement.cpp:
+        (WebCore::SVGUseElement::notifyFinished):
+        * svg/animation/SVGSMILElement.cpp:
+        (WebCore::SVGSMILElement::dispatchPendingEvent):
+        * workers/Worker.cpp:
+        (WebCore::Worker::notifyFinished):
+        * workers/WorkerMessagingProxy.cpp:
+        (WebCore::WorkerMessagingProxy::notifyNetworkStateChange):
+        * workers/service/ExtendableEvent.cpp:
+        (WebCore::ExtendableEvent::ExtendableEvent):
+        * workers/service/ExtendableEvent.h:
+        * workers/service/ExtendableMessageEvent.cpp:
+        (WebCore::ExtendableMessageEvent::ExtendableMessageEvent):
+        * workers/service/ServiceWorker.cpp:
+        (WebCore::ServiceWorker::scheduleTaskToUpdateState):
+        * workers/service/ServiceWorkerContainer.cpp:
+        (WebCore::ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent):
+        * workers/service/ServiceWorkerRegistration.cpp:
+        (WebCore::ServiceWorkerRegistration::scheduleTaskToFireUpdateFoundEvent):
+        * workers/service/context/ServiceWorkerThreadProxy.cpp:
+        (WebCore::ServiceWorkerThreadProxy::notifyNetworkStateChange):
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::callReadyStateChangeListener):
+
 2018-08-17  Yusuke Suzuki  <yusukesuzuki@slowstart.org> and Fujii Hironori  <Hironori.Fujii@sony.com>
 
         [JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg
index 1090d94..2a3e092 100644 (file)
@@ -41,7 +41,7 @@ static const AtomicString& stringForPlaybackTargetAvailability(bool available)
 }
 
 WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent(const AtomicString& eventType, bool available)
-    : Event(eventType, false, false)
+    : Event(eventType, CanBubble::No, IsCancelable::No)
     , m_availability(stringForPlaybackTargetAvailability(available))
 {
 }
index 3a39452..b797070 100644 (file)
@@ -33,7 +33,7 @@
 namespace WebCore {
 
 ApplePayPaymentAuthorizedEvent::ApplePayPaymentAuthorizedEvent(const AtomicString& type, unsigned version, const Payment& payment)
-    : Event(type, false, false)
+    : Event(type, CanBubble::No, IsCancelable::No)
     , m_payment(payment.toApplePayPayment(version))
 {
 }
index 6b6cd1b..8126e85 100644 (file)
@@ -33,7 +33,7 @@
 namespace WebCore {
 
 ApplePayPaymentMethodSelectedEvent::ApplePayPaymentMethodSelectedEvent(const AtomicString& type, const PaymentMethod& paymentMethod)
-    : Event(type, false, false)
+    : Event(type, CanBubble::No, IsCancelable::No)
     , m_paymentMethod(paymentMethod.toApplePayPaymentMethod())
 {
 }
index 093b86f..46dfac9 100644 (file)
@@ -840,7 +840,7 @@ void ApplePaySession::didCancelPaymentSession()
 
     m_state = State::Canceled;
 
-    auto event = Event::create(eventNames().cancelEvent, false, false);
+    auto event = Event::create(eventNames().cancelEvent, Event::CanBubble::No, Event::IsCancelable::No);
     dispatchEvent(event.get());
 
     didReachFinalState();
index 0be1659..eca02d7 100644 (file)
@@ -33,7 +33,7 @@
 namespace WebCore {
 
 ApplePayShippingContactSelectedEvent::ApplePayShippingContactSelectedEvent(const AtomicString& type, unsigned version, const PaymentContact& shippingContact)
-    : Event(type, false, false)
+    : Event(type, CanBubble::No, IsCancelable::No)
     , m_shippingContact(shippingContact.toApplePayPaymentContact(version))
 {
 }
index 1a9dcae..d6304b9 100644 (file)
@@ -44,7 +44,7 @@ static inline ApplePayShippingMethod convert(const ApplePaySessionPaymentRequest
 }
 
 ApplePayShippingMethodSelectedEvent::ApplePayShippingMethodSelectedEvent(const AtomicString& type, const ApplePaySessionPaymentRequest::ShippingMethod& shippingMethod)
-    : Event(type, false, false)
+    : Event(type, CanBubble::No, IsCancelable::No)
     , m_shippingMethod(convert(shippingMethod))
 {
 }
index 3e32c27..37be1c0 100644 (file)
@@ -31,7 +31,7 @@
 namespace WebCore {
 
 ApplePayValidateMerchantEvent::ApplePayValidateMerchantEvent(const AtomicString& type, const URL& validationURL)
-    : Event(type, false, false)
+    : Event(type, CanBubble::No, IsCancelable::No)
     , m_validationURL(validationURL)
 {
 }
index 9427cd4..eb72ce0 100644 (file)
@@ -641,7 +641,7 @@ void MediaKeySession::updateKeyStatuses(CDMInstanceClient::KeyStatusVector&& inp
         m_statuses.uncheckedAppend({ WTFMove(status.first), toMediaKeyStatus(status.second) });
 
     // 5. Queue a task to fire a simple event named keystatuseschange at the session.
-    m_eventQueue.enqueueEvent(Event::create(eventNames().keystatuseschangeEvent, false, false));
+    m_eventQueue.enqueueEvent(Event::create(eventNames().keystatuseschangeEvent, Event::CanBubble::No, Event::IsCancelable::No));
 
     // 6. Queue a task to run the Attempt to Resume Playback If Necessary algorithm on each of the media element(s) whose mediaKeys attribute is the MediaKeys object that created the session.
     m_taskQueue.enqueueTask(
index b25834f..84113f5 100644 (file)
@@ -33,7 +33,7 @@
 namespace WebCore {
 
 WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent(const AtomicString& type, Uint8Array* message, const String& destinationURL)
-    : Event(type, false, false)
+    : Event(type, CanBubble::No, IsCancelable::No)
     , m_message(message)
     , m_destinationURL(destinationURL)
 {
index 3b0a208..4bab062 100644 (file)
@@ -33,7 +33,7 @@
 namespace WebCore {
 
 WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent(const AtomicString& type, Uint8Array* initData)
-    : Event(type, false, false)
+    : Event(type, CanBubble::No, IsCancelable::No)
     , m_initData(initData)
 {
 }
index f0bf1e0..b6aa5d8 100644 (file)
@@ -179,7 +179,7 @@ void WebKitMediaKeySession::addKeyTimerFired()
 
         // 2.7. If did store key is true, queue a task to fire a simple event named keyadded at the MediaKeySession object.
         if (didStoreKey) {
-            auto keyaddedEvent = Event::create(eventNames().webkitkeyaddedEvent, false, false);
+            auto keyaddedEvent = Event::create(eventNames().webkitkeyaddedEvent, Event::CanBubble::No, Event::IsCancelable::No);
             keyaddedEvent->setTarget(this);
             m_asyncEventQueue.enqueueEvent(WTFMove(keyaddedEvent));
 
@@ -212,7 +212,7 @@ void WebKitMediaKeySession::sendError(MediaKeyErrorCode errorCode, uint32_t syst
 {
     m_error = WebKitMediaKeyError::create(errorCode, systemCode);
 
-    auto keyerrorEvent = Event::create(eventNames().webkitkeyerrorEvent, false, false);
+    auto keyerrorEvent = Event::create(eventNames().webkitkeyerrorEvent, Event::CanBubble::No, Event::IsCancelable::No);
     keyerrorEvent->setTarget(this);
     m_asyncEventQueue.enqueueEvent(WTFMove(keyerrorEvent));
 }
index a6800af..6834194 100644 (file)
@@ -30,7 +30,7 @@
 namespace WebCore {
 
 GamepadEvent::GamepadEvent(const AtomicString& eventType, Gamepad& gamepad)
-    : Event(eventType, false, false)
+    : Event(eventType, CanBubble::No, IsCancelable::No)
     , m_gamepad(&gamepad)
 {
 }
index 0328575..3391855 100644 (file)
@@ -267,13 +267,13 @@ void IDBDatabase::connectionToServerLost(const IDBError& error)
     for (auto& transaction : m_activeTransactions.values())
         transaction->connectionClosedFromServer(error);
 
-    auto errorEvent = Event::create(m_eventNames.errorEvent, true, false);
+    auto errorEvent = Event::create(m_eventNames.errorEvent, Event::CanBubble::Yes, Event::IsCancelable::No);
     errorEvent->setTarget(this);
 
     if (auto* context = scriptExecutionContext())
         context->eventQueue().enqueueEvent(WTFMove(errorEvent));
 
-    auto closeEvent = Event::create(m_eventNames.closeEvent, true, false);
+    auto closeEvent = Event::create(m_eventNames.closeEvent, Event::CanBubble::Yes, Event::IsCancelable::No);
     closeEvent->setTarget(this);
 
     if (auto* context = scriptExecutionContext())
index 57db0a0..91ce9c4 100644 (file)
@@ -71,7 +71,7 @@ void IDBOpenDBRequest::onError(const IDBResultData& data)
     ASSERT(&originThread() == &Thread::current());
 
     m_domError = data.error().toDOMException();
-    enqueueEvent(IDBRequestCompletionEvent::create(eventNames().errorEvent, true, true, *this));
+    enqueueEvent(IDBRequestCompletionEvent::create(eventNames().errorEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes, *this));
 }
 
 void IDBOpenDBRequest::versionChangeTransactionDidFinish()
@@ -91,7 +91,7 @@ void IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit()
     ASSERT(hasPendingActivity());
     m_transaction->addRequest(*this);
 
-    auto event = IDBRequestCompletionEvent::create(eventNames().successEvent, false, false, *this);
+    auto event = IDBRequestCompletionEvent::create(eventNames().successEvent, Event::CanBubble::No, Event::IsCancelable::No, *this);
     m_openDatabaseSuccessEvent = &event.get();
 
     enqueueEvent(WTFMove(event));
@@ -109,7 +109,7 @@ void IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion()
     setResultToUndefined();
 
     m_transaction->addRequest(*this);
-    enqueueEvent(IDBRequestCompletionEvent::create(eventNames().errorEvent, true, true, *this));
+    enqueueEvent(IDBRequestCompletionEvent::create(eventNames().errorEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes, *this));
 }
 
 void IDBOpenDBRequest::cancelForStop()
@@ -138,7 +138,7 @@ void IDBOpenDBRequest::onSuccess(const IDBResultData& resultData)
     setResult(IDBDatabase::create(*scriptExecutionContext(), connectionProxy(), resultData));
     m_readyState = ReadyState::Done;
 
-    enqueueEvent(IDBRequestCompletionEvent::create(eventNames().successEvent, false, false, *this));
+    enqueueEvent(IDBRequestCompletionEvent::create(eventNames().successEvent, Event::CanBubble::No, Event::IsCancelable::No, *this));
 }
 
 void IDBOpenDBRequest::onUpgradeNeeded(const IDBResultData& resultData)
index afdc99a..2c27dfd 100644 (file)
@@ -528,15 +528,14 @@ void IDBRequest::onError()
     ASSERT(!m_idbError.isNull());
 
     m_domError = m_idbError.toDOMException();
-    enqueueEvent(Event::create(eventNames().errorEvent, true, true));
+    enqueueEvent(Event::create(eventNames().errorEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes));
 }
 
 void IDBRequest::onSuccess()
 {
     LOG(IndexedDB, "IDBRequest::onSuccess");
     ASSERT(&originThread() == &Thread::current());
-
-    enqueueEvent(Event::create(eventNames().successEvent, false, false));
+    enqueueEvent(Event::create(eventNames().successEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 void IDBRequest::setResult(Ref<IDBDatabase>&& database)
index 100a41e..b972004 100644 (file)
@@ -30,7 +30,7 @@
 
 namespace WebCore {
 
-IDBRequestCompletionEvent::IDBRequestCompletionEvent(const AtomicString& type, bool canBubble, bool cancelable, IDBRequest& request)
+IDBRequestCompletionEvent::IDBRequestCompletionEvent(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, IDBRequest& request)
     : Event(type, canBubble, cancelable)
     , m_request(request)
 {
index 6466643..32101ea 100644 (file)
@@ -34,13 +34,13 @@ namespace WebCore {
 
 class IDBRequestCompletionEvent : public Event {
 public:
-    static Ref<Event> create(const AtomicString& type, bool canBubble, bool cancelable, IDBRequest& request)
+    static Ref<Event> create(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, IDBRequest& request)
     {
         return adoptRef(*new IDBRequestCompletionEvent(type, canBubble, cancelable, request));
     }
 
 private:
-    IDBRequestCompletionEvent(const AtomicString& type, bool canBubble, bool cancelable, IDBRequest&);
+    IDBRequestCompletionEvent(const AtomicString& type, CanBubble, IsCancelable, IDBRequest&);
 
     Ref<IDBRequest> m_request;
 };
index 95fc867..4811c7c 100644 (file)
@@ -591,14 +591,14 @@ void IDBTransaction::fireOnComplete()
 {
     LOG(IndexedDB, "IDBTransaction::fireOnComplete");
     ASSERT(&m_database->originThread() == &Thread::current());
-    enqueueEvent(Event::create(eventNames().completeEvent, false, false));
+    enqueueEvent(Event::create(eventNames().completeEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 void IDBTransaction::fireOnAbort()
 {
     LOG(IndexedDB, "IDBTransaction::fireOnAbort");
     ASSERT(&m_database->originThread() == &Thread::current());
-    enqueueEvent(Event::create(eventNames().abortEvent, true, false));
+    enqueueEvent(Event::create(eventNames().abortEvent, Event::CanBubble::Yes, Event::IsCancelable::No));
 }
 
 void IDBTransaction::enqueueEvent(Ref<Event>&& event)
index e84a733..c39bbcb 100644 (file)
@@ -31,7 +31,7 @@
 namespace WebCore {
 
 IDBVersionChangeEvent::IDBVersionChangeEvent(const IDBResourceIdentifier& requestIdentifier, uint64_t oldVersion, uint64_t newVersion, const AtomicString& name)
-    : Event(name, false /*canBubble*/, false /*cancelable*/)
+    : Event(name, CanBubble::No, IsCancelable::No)
     , m_requestIdentifier(requestIdentifier)
     , m_oldVersion(oldVersion)
 {
index 84cd2f1..31fb987 100644 (file)
@@ -253,13 +253,13 @@ void MediaSession::safelyIterateActiveMediaElements(const WTF::Function<void(HTM
 void MediaSession::skipToNextTrack()
 {
     if (m_controls && m_controls->nextTrackEnabled())
-        m_controls->dispatchEvent(Event::create(eventNames().nexttrackEvent, false, false));
+        m_controls->dispatchEvent(Event::create(eventNames().nexttrackEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 void MediaSession::skipToPreviousTrack()
 {
     if (m_controls && m_controls->previousTrackEnabled())
-        m_controls->dispatchEvent(Event::create(eventNames().previoustrackEvent, false, false));
+        m_controls->dispatchEvent(Event::create(eventNames().previoustrackEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 void MediaSession::controlIsEnabledDidChange()
index bf84281..eab6819 100644 (file)
@@ -1030,7 +1030,7 @@ ExceptionOr<Ref<SourceBufferPrivate>> MediaSource::createSourceBufferPrivate(con
 
 void MediaSource::scheduleEvent(const AtomicString& eventName)
 {
-    auto event = Event::create(eventName, false, false);
+    auto event = Event::create(eventName, Event::CanBubble::No, Event::IsCancelable::No);
     event->setTarget(this);
 
     m_asyncEventQueue.enqueueEvent(WTFMove(event));
index 44443c7..df87c6b 100644 (file)
@@ -553,7 +553,7 @@ bool SourceBuffer::isRemoved() const
 
 void SourceBuffer::scheduleEvent(const AtomicString& eventName)
 {
-    auto event = Event::create(eventName, false, false);
+    auto event = Event::create(eventName, Event::CanBubble::No, Event::IsCancelable::No);
     event->setTarget(this);
 
     m_asyncEventQueue.enqueueEvent(WTFMove(event));
index ec178ee..cd0fdf2 100644 (file)
@@ -92,7 +92,7 @@ void SourceBufferList::swap(Vector<RefPtr<SourceBuffer>>& other)
 
 void SourceBufferList::scheduleEvent(const AtomicString& eventName)
 {
-    auto event = Event::create(eventName, false, false);
+    auto event = Event::create(eventName, Event::CanBubble::No, Event::IsCancelable::No);
     event->setTarget(this);
 
     m_asyncEventQueue.enqueueEvent(WTFMove(event));
index be9051c..1b18f84 100644 (file)
@@ -163,7 +163,7 @@ MediaTrackSupportedConstraints MediaDevices::getSupportedConstraints()
 void MediaDevices::scheduledEventTimerFired()
 {
     if (scriptExecutionContext())
-        dispatchEvent(Event::create(eventNames().devicechangeEvent, false, false));
+        dispatchEvent(Event::create(eventNames().devicechangeEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 bool MediaDevices::hasPendingActivity() const
index 90d6c56..7e22150 100644 (file)
@@ -227,7 +227,7 @@ bool MediaStream::internalAddTrack(Ref<MediaStreamTrack>&& trackToAdd, StreamMod
     if (streamModifier == StreamModifier::DomAPI)
         m_private->addTrack(&track.privateTrack(), MediaStreamPrivate::NotifyClientOption::DontNotify);
     else
-        dispatchEvent(MediaStreamTrackEvent::create(eventNames().addtrackEvent, false, false, &track));
+        dispatchEvent(MediaStreamTrackEvent::create(eventNames().addtrackEvent, Event::CanBubble::No, Event::IsCancelable::No, &track));
 
     return true;
 }
@@ -245,7 +245,7 @@ bool MediaStream::internalRemoveTrack(const String& trackId, StreamModifier stre
     if (streamModifier == StreamModifier::DomAPI)
         m_private->removeTrack(track->privateTrack(), MediaStreamPrivate::NotifyClientOption::DontNotify);
     else
-        dispatchEvent(MediaStreamTrackEvent::create(eventNames().removetrackEvent, false, false, WTFMove(track)));
+        dispatchEvent(MediaStreamTrackEvent::create(eventNames().removetrackEvent, Event::CanBubble::No, Event::IsCancelable::No, WTFMove(track)));
 
     return true;
 }
index c1ce18b..7bd10f6 100644 (file)
@@ -31,7 +31,7 @@
 
 namespace WebCore {
 
-Ref<MediaStreamEvent> MediaStreamEvent::create(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<MediaStream>&& stream)
+Ref<MediaStreamEvent> MediaStreamEvent::create(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, RefPtr<MediaStream>&& stream)
 {
     return adoptRef(*new MediaStreamEvent(type, canBubble, cancelable, WTFMove(stream)));
 }
@@ -41,7 +41,7 @@ Ref<MediaStreamEvent> MediaStreamEvent::create(const AtomicString& type, const I
     return adoptRef(*new MediaStreamEvent(type, initializer, isTrusted));
 }
 
-MediaStreamEvent::MediaStreamEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<MediaStream>&& stream)
+MediaStreamEvent::MediaStreamEvent(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, RefPtr<MediaStream>&& stream)
     : Event(type, canBubble, cancelable)
     , m_stream(WTFMove(stream))
 {
index f67c529..c7abf5a 100644 (file)
@@ -36,7 +36,7 @@ class MediaStreamEvent : public Event {
 public:
     virtual ~MediaStreamEvent();
 
-    static Ref<MediaStreamEvent> create(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<MediaStream>&&);
+    static Ref<MediaStreamEvent> create(const AtomicString& type, CanBubble, IsCancelable, RefPtr<MediaStream>&&);
 
     struct Init : EventInit {
         RefPtr<MediaStream> stream;
@@ -48,7 +48,7 @@ public:
     virtual EventInterface eventInterface() const;
 
 private:
-    MediaStreamEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<MediaStream>&&);
+    MediaStreamEvent(const AtomicString& type, CanBubble, IsCancelable, RefPtr<MediaStream>&&);
     MediaStreamEvent(const AtomicString& type, const Init&, IsTrusted);
 
     RefPtr<MediaStream> m_stream;
index d1cbc7f..2c1a5db 100644 (file)
@@ -365,7 +365,7 @@ void MediaStreamTrack::trackEnded(MediaStreamTrackPrivate&)
 
     // 3. Notify track's source that track is ended so that the source may be stopped, unless other MediaStreamTrack objects depend on it.
     // 4. Fire a simple event named ended at the object.
-    dispatchEvent(Event::create(eventNames().endedEvent, false, false));
+    dispatchEvent(Event::create(eventNames().endedEvent, Event::CanBubble::No, Event::IsCancelable::No));
 
     for (auto& observer : m_observers)
         observer->trackDidEnd();
@@ -379,7 +379,7 @@ void MediaStreamTrack::trackMutedChanged(MediaStreamTrackPrivate&)
         return;
 
     AtomicString eventType = muted() ? eventNames().muteEvent : eventNames().unmuteEvent;
-    dispatchEvent(Event::create(eventType, false, false));
+    dispatchEvent(Event::create(eventType, Event::CanBubble::No, Event::IsCancelable::No));
 
     configureTrackRendering();
 }
index ab3ff89..67c45cd 100644 (file)
@@ -31,7 +31,7 @@
 
 namespace WebCore {
 
-Ref<MediaStreamTrackEvent> MediaStreamTrackEvent::create(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<MediaStreamTrack>&& track)
+Ref<MediaStreamTrackEvent> MediaStreamTrackEvent::create(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, RefPtr<MediaStreamTrack>&& track)
 {
     return adoptRef(*new MediaStreamTrackEvent(type, canBubble, cancelable, WTFMove(track)));
 }
@@ -41,7 +41,7 @@ Ref<MediaStreamTrackEvent> MediaStreamTrackEvent::create(const AtomicString& typ
     return adoptRef(*new MediaStreamTrackEvent(type, initializer, isTrusted));
 }
 
-MediaStreamTrackEvent::MediaStreamTrackEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<MediaStreamTrack>&& track)
+MediaStreamTrackEvent::MediaStreamTrackEvent(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, RefPtr<MediaStreamTrack>&& track)
     : Event(type, canBubble, cancelable)
     , m_track(WTFMove(track))
 {
index 4101f49..d155dae 100644 (file)
@@ -37,7 +37,7 @@ class MediaStreamTrackEvent : public Event {
 public:
     virtual ~MediaStreamTrackEvent();
 
-    static Ref<MediaStreamTrackEvent> create(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<MediaStreamTrack>&&);
+    static Ref<MediaStreamTrackEvent> create(const AtomicString& type, CanBubble, IsCancelable, RefPtr<MediaStreamTrack>&&);
 
     struct Init : EventInit {
         RefPtr<MediaStreamTrack> track;
@@ -50,7 +50,7 @@ public:
     EventInterface eventInterface() const override;
 
 private:
-    MediaStreamTrackEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<MediaStreamTrack>&&);
+    MediaStreamTrackEvent(const AtomicString& type, CanBubble, IsCancelable, RefPtr<MediaStreamTrack>&&);
     MediaStreamTrackEvent(const AtomicString& type, const Init&, IsTrusted);
 
     RefPtr<MediaStreamTrack> m_track;
index 370ba0a..c804e2a 100644 (file)
@@ -40,7 +40,7 @@ class OverconstrainedErrorEvent : public Event {
 public:
     virtual ~OverconstrainedErrorEvent() = default;
 
-    static Ref<OverconstrainedErrorEvent> create(const AtomicString& type, bool canBubble, bool cancelable, OverconstrainedError* error)
+    static Ref<OverconstrainedErrorEvent> create(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, OverconstrainedError* error)
     {
         return adoptRef(*new OverconstrainedErrorEvent(type, canBubble, cancelable, error));
     }
@@ -58,7 +58,7 @@ public:
     EventInterface eventInterface() const override { return OverconstrainedErrorEventInterfaceType; }
 
 private:
-    explicit OverconstrainedErrorEvent(const AtomicString& type, bool canBubble, bool cancelable, OverconstrainedError* error)
+    explicit OverconstrainedErrorEvent(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, OverconstrainedError* error)
         : Event(type, canBubble, cancelable)
         , m_error(error)
     {
index f5e9931..7af4665 100644 (file)
@@ -356,7 +356,7 @@ void PeerConnectionBackend::fireICECandidateEvent(RefPtr<RTCIceCandidate>&& cand
 {
     ASSERT(isMainThread());
 
-    m_peerConnection.fireEvent(RTCPeerConnectionIceEvent::create(false, false, WTFMove(candidate), WTFMove(serverURL)));
+    m_peerConnection.fireEvent(RTCPeerConnectionIceEvent::create(Event::CanBubble::No, Event::IsCancelable::No, WTFMove(candidate), WTFMove(serverURL)));
 }
 
 void PeerConnectionBackend::enableICECandidateFiltering()
@@ -456,7 +456,7 @@ void PeerConnectionBackend::doneGatheringCandidates()
     if (m_waitingForMDNSRegistration)
         return;
 
-    m_peerConnection.fireEvent(RTCPeerConnectionIceEvent::create(false, false, nullptr, { }));
+    m_peerConnection.fireEvent(RTCPeerConnectionIceEvent::create(Event::CanBubble::No, Event::IsCancelable::No, nullptr, { }));
     m_peerConnection.updateIceGatheringState(RTCIceGatheringState::Complete);
     m_pendingICECandidates.clear();
 }
@@ -505,7 +505,7 @@ void PeerConnectionBackend::updateSignalingState(RTCSignalingState newSignalingS
 
     if (newSignalingState != m_peerConnection.signalingState()) {
         m_peerConnection.setSignalingState(newSignalingState);
-        m_peerConnection.fireEvent(Event::create(eventNames().signalingstatechangeEvent, false, false));
+        m_peerConnection.fireEvent(Event::create(eventNames().signalingstatechangeEvent, Event::CanBubble::No, Event::IsCancelable::No));
     }
 }
 
index d84b357..b067d12 100644 (file)
@@ -43,7 +43,7 @@ Ref<RTCDTMFToneChangeEvent> RTCDTMFToneChangeEvent::create(const AtomicString& t
 }
 
 RTCDTMFToneChangeEvent::RTCDTMFToneChangeEvent(const String& tone)
-    : Event(eventNames().tonechangeEvent, false, false)
+    : Event(eventNames().tonechangeEvent, CanBubble::No, IsCancelable::No)
     , m_tone(tone)
 {
 }
index 32cc6de..90d1c8a 100644 (file)
@@ -171,10 +171,10 @@ void RTCDataChannel::didChangeReadyState(RTCDataChannelState newState)
 
     switch (m_readyState) {
     case RTCDataChannelState::Open:
-        scheduleDispatchEvent(Event::create(eventNames().openEvent, false, false));
+        scheduleDispatchEvent(Event::create(eventNames().openEvent, Event::CanBubble::No, Event::IsCancelable::No));
         break;
     case RTCDataChannelState::Closed:
-        scheduleDispatchEvent(Event::create(eventNames().closeEvent, false, false));
+        scheduleDispatchEvent(Event::create(eventNames().closeEvent, Event::CanBubble::No, Event::IsCancelable::No));
         break;
     default:
         break;
@@ -211,7 +211,7 @@ void RTCDataChannel::didDetectError()
     if (m_stopped)
         return;
 
-    scheduleDispatchEvent(Event::create(eventNames().errorEvent, false, false));
+    scheduleDispatchEvent(Event::create(eventNames().errorEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 void RTCDataChannel::bufferedAmountIsDecreasing(size_t amount)
@@ -220,7 +220,7 @@ void RTCDataChannel::bufferedAmountIsDecreasing(size_t amount)
         return;
 
     if (amount <= m_bufferedAmountLowThreshold)
-        scheduleDispatchEvent(Event::create(eventNames().bufferedamountlowEvent, false, false));
+        scheduleDispatchEvent(Event::create(eventNames().bufferedamountlowEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 void RTCDataChannel::stop()
index 4c80ce2..d72fb7a 100644 (file)
@@ -32,7 +32,7 @@
 
 namespace WebCore {
 
-Ref<RTCDataChannelEvent> RTCDataChannelEvent::create(const AtomicString& type, bool canBubble, bool cancelable, Ref<RTCDataChannel>&& channel)
+Ref<RTCDataChannelEvent> RTCDataChannelEvent::create(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, Ref<RTCDataChannel>&& channel)
 {
     return adoptRef(*new RTCDataChannelEvent(type, canBubble, cancelable, WTFMove(channel)));
 }
@@ -42,7 +42,7 @@ Ref<RTCDataChannelEvent> RTCDataChannelEvent::create(const AtomicString& type, I
     return adoptRef(*new RTCDataChannelEvent(type, WTFMove(initializer), isTrusted));
 }
 
-RTCDataChannelEvent::RTCDataChannelEvent(const AtomicString& type, bool canBubble, bool cancelable, Ref<RTCDataChannel>&& channel)
+RTCDataChannelEvent::RTCDataChannelEvent(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, Ref<RTCDataChannel>&& channel)
     : Event(type, canBubble, cancelable)
     , m_channel(WTFMove(channel))
 {
index 1da89cd..49b24c7 100644 (file)
@@ -39,7 +39,7 @@ public:
         RefPtr<RTCDataChannel> channel;
     };
 
-    static Ref<RTCDataChannelEvent> create(const AtomicString& type, bool canBubble, bool cancelable, Ref<RTCDataChannel>&&);
+    static Ref<RTCDataChannelEvent> create(const AtomicString& type, CanBubble, IsCancelable, Ref<RTCDataChannel>&&);
     static Ref<RTCDataChannelEvent> create(const AtomicString& type, Init&&, IsTrusted = IsTrusted::No);
 
     RTCDataChannel& channel();
@@ -47,7 +47,7 @@ public:
     virtual EventInterface eventInterface() const;
 
 private:
-    RTCDataChannelEvent(const AtomicString& type, bool canBubble, bool cancelable, Ref<RTCDataChannel>&&);
+    RTCDataChannelEvent(const AtomicString& type, CanBubble, IsCancelable, Ref<RTCDataChannel>&&);
     RTCDataChannelEvent(const AtomicString& type, Init&&, IsTrusted);
 
     Ref<RTCDataChannel> m_channel;
index b87f62f..225edfa 100644 (file)
@@ -503,7 +503,7 @@ void RTCPeerConnection::updateIceGatheringState(RTCIceGatheringState newState)
             return;
 
         protectedThis->m_iceGatheringState = newState;
-        protectedThis->dispatchEvent(Event::create(eventNames().icegatheringstatechangeEvent, false, false));
+        protectedThis->dispatchEvent(Event::create(eventNames().icegatheringstatechangeEvent, Event::CanBubble::No, Event::IsCancelable::No));
         protectedThis->updateConnectionState();
     });
 }
@@ -517,7 +517,7 @@ void RTCPeerConnection::updateIceConnectionState(RTCIceConnectionState newState)
             return;
 
         protectedThis->m_iceConnectionState = newState;
-        protectedThis->dispatchEvent(Event::create(eventNames().iceconnectionstatechangeEvent, false, false));
+        protectedThis->dispatchEvent(Event::create(eventNames().iceconnectionstatechangeEvent, Event::CanBubble::No, Event::IsCancelable::No));
         protectedThis->updateConnectionState();
     });
 }
@@ -547,7 +547,7 @@ void RTCPeerConnection::updateConnectionState()
     INFO_LOG(LOGIDENTIFIER, "state changed from: " , m_connectionState, " to ", state);
 
     m_connectionState = state;
-    dispatchEvent(Event::create(eventNames().connectionstatechangeEvent, false, false));
+    dispatchEvent(Event::create(eventNames().connectionstatechangeEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 void RTCPeerConnection::scheduleNegotiationNeededEvent()
@@ -558,7 +558,7 @@ void RTCPeerConnection::scheduleNegotiationNeededEvent()
         if (!protectedThis->m_backend->isNegotiationNeeded())
             return;
         protectedThis->m_backend->clearNegotiationNeededState();
-        protectedThis->dispatchEvent(Event::create(eventNames().negotiationneededEvent, false, false));
+        protectedThis->dispatchEvent(Event::create(eventNames().negotiationneededEvent, Event::CanBubble::No, Event::IsCancelable::No));
     });
 }
 
index b813ddf..536ab51 100644 (file)
 
 namespace WebCore {
 
-Ref<RTCPeerConnectionIceEvent> RTCPeerConnectionIceEvent::create(bool canBubble, bool cancelable, RefPtr<RTCIceCandidate>&& candidate, String&& serverURL)
+Ref<RTCPeerConnectionIceEvent> RTCPeerConnectionIceEvent::create(CanBubble canBubble, IsCancelable cancelable, RefPtr<RTCIceCandidate>&& candidate, String&& serverURL)
 {
     return adoptRef(*new RTCPeerConnectionIceEvent(eventNames().icecandidateEvent, canBubble, cancelable, WTFMove(candidate), WTFMove(serverURL)));
 }
 
 Ref<RTCPeerConnectionIceEvent> RTCPeerConnectionIceEvent::create(const AtomicString& type, Init&& init)
 {
-    return adoptRef(*new RTCPeerConnectionIceEvent(type, init.bubbles, init.cancelable, WTFMove(init.candidate), WTFMove(init.url)));
+    return adoptRef(*new RTCPeerConnectionIceEvent(type, init.bubbles ? CanBubble::Yes : CanBubble::No,
+        init.cancelable ? IsCancelable::Yes : IsCancelable::No, WTFMove(init.candidate), WTFMove(init.url)));
 }
 
-RTCPeerConnectionIceEvent::RTCPeerConnectionIceEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<RTCIceCandidate>&& candidate, String&& serverURL)
+RTCPeerConnectionIceEvent::RTCPeerConnectionIceEvent(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, RefPtr<RTCIceCandidate>&& candidate, String&& serverURL)
     : Event(type, canBubble, cancelable)
     , m_candidate(WTFMove(candidate))
     , m_url(WTFMove(serverURL))
index 5ae69b7..5f69d8e 100644 (file)
@@ -42,7 +42,7 @@ public:
     };
 
     static Ref<RTCPeerConnectionIceEvent> create(const AtomicString& type, Init&&);
-    static Ref<RTCPeerConnectionIceEvent> create(bool canBubble, bool cancelable, RefPtr<RTCIceCandidate>&&, String&& serverURL);
+    static Ref<RTCPeerConnectionIceEvent> create(CanBubble, IsCancelable, RefPtr<RTCIceCandidate>&&, String&& serverURL);
 
     RTCIceCandidate* candidate() const;
     const String& url() const { return m_url; }
@@ -50,7 +50,7 @@ public:
     virtual EventInterface eventInterface() const;
 
 private:
-    RTCPeerConnectionIceEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<RTCIceCandidate>&&, String&& serverURL);
+    RTCPeerConnectionIceEvent(const AtomicString& type, CanBubble, IsCancelable, RefPtr<RTCIceCandidate>&&, String&& serverURL);
 
     RefPtr<RTCIceCandidate> m_candidate;
     String m_url;
index c090157..d4f3355 100644 (file)
@@ -39,7 +39,7 @@
 
 namespace WebCore {
 
-Ref<RTCTrackEvent> RTCTrackEvent::create(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<RTCRtpReceiver>&& receiver, RefPtr<MediaStreamTrack>&& track, Vector<RefPtr<MediaStream>>&& streams, RefPtr<RTCRtpTransceiver>&& transceiver)
+Ref<RTCTrackEvent> RTCTrackEvent::create(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, RefPtr<RTCRtpReceiver>&& receiver, RefPtr<MediaStreamTrack>&& track, Vector<RefPtr<MediaStream>>&& streams, RefPtr<RTCRtpTransceiver>&& transceiver)
 {
     return adoptRef(*new RTCTrackEvent(type, canBubble, cancelable, WTFMove(receiver), WTFMove(track), WTFMove(streams), WTFMove(transceiver)));
 }
@@ -49,7 +49,7 @@ Ref<RTCTrackEvent> RTCTrackEvent::create(const AtomicString& type, const Init& i
     return adoptRef(*new RTCTrackEvent(type, initializer, isTrusted));
 }
 
-RTCTrackEvent::RTCTrackEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<RTCRtpReceiver>&& receiver, RefPtr<MediaStreamTrack>&& track, Vector<RefPtr<MediaStream>>&& streams, RefPtr<RTCRtpTransceiver>&& transceiver)
+RTCTrackEvent::RTCTrackEvent(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, RefPtr<RTCRtpReceiver>&& receiver, RefPtr<MediaStreamTrack>&& track, Vector<RefPtr<MediaStream>>&& streams, RefPtr<RTCRtpTransceiver>&& transceiver)
     : Event(type, canBubble, cancelable)
     , m_receiver(WTFMove(receiver))
     , m_track(WTFMove(track))
index 3617cbd..13251cd 100644 (file)
@@ -46,7 +46,7 @@ typedef Vector<RefPtr<MediaStream>> MediaStreamArray;
 
 class RTCTrackEvent : public Event {
 public:
-    static Ref<RTCTrackEvent> create(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<RTCRtpReceiver>&&, RefPtr<MediaStreamTrack>&&, MediaStreamArray&&, RefPtr<RTCRtpTransceiver>&&);
+    static Ref<RTCTrackEvent> create(const AtomicString& type, CanBubble, IsCancelable, RefPtr<RTCRtpReceiver>&&, RefPtr<MediaStreamTrack>&&, MediaStreamArray&&, RefPtr<RTCRtpTransceiver>&&);
 
     struct Init : EventInit {
         RefPtr<RTCRtpReceiver> receiver;
@@ -64,7 +64,7 @@ public:
     virtual EventInterface eventInterface() const { return RTCTrackEventInterfaceType; }
 
 private:
-    RTCTrackEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<RTCRtpReceiver>&&, RefPtr<MediaStreamTrack>&&, MediaStreamArray&&, RefPtr<RTCRtpTransceiver>&&);
+    RTCTrackEvent(const AtomicString& type, CanBubble, IsCancelable, RefPtr<RTCRtpReceiver>&&, RefPtr<MediaStreamTrack>&&, MediaStreamArray&&, RefPtr<RTCRtpTransceiver>&&);
     RTCTrackEvent(const AtomicString& type, const Init&, IsTrusted);
 
     RefPtr<RTCRtpReceiver> m_receiver;
index ac97196..d240ab0 100644 (file)
@@ -634,7 +634,8 @@ void LibWebRTCMediaEndpoint::addRemoteStream(webrtc::MediaStreamInterface& rtcSt
         return;
 
     auto& mediaStream = mediaStreamFromRTCStream(rtcStream);
-    m_peerConnectionBackend.connection().fireEvent(MediaStreamEvent::create(eventNames().addstreamEvent, false, false, &mediaStream));
+    m_peerConnectionBackend.connection().fireEvent(MediaStreamEvent::create(eventNames().addstreamEvent,
+        Event::CanBubble::No, Event::IsCancelable::No, &mediaStream));
 }
 
 class RTCRtpReceiverBackend final : public RTCRtpReceiver::Backend {
@@ -687,7 +688,8 @@ void LibWebRTCMediaEndpoint::addRemoteTrack(rtc::scoped_refptr<webrtc::RtpReceiv
         streams.append(&mediaStream);
         mediaStream.addTrackFromPlatform(*track);
     }
-    m_peerConnectionBackend.connection().fireEvent(RTCTrackEvent::create(eventNames().trackEvent, false, false, WTFMove(receiver), track, WTFMove(streams), nullptr));
+    m_peerConnectionBackend.connection().fireEvent(RTCTrackEvent::create(eventNames().trackEvent,
+        Event::CanBubble::No, Event::IsCancelable::No, WTFMove(receiver), track, WTFMove(streams), nullptr));
 }
 
 void LibWebRTCMediaEndpoint::removeRemoteStream(webrtc::MediaStreamInterface& rtcStream)
@@ -777,7 +779,8 @@ void LibWebRTCMediaEndpoint::addDataChannel(rtc::scoped_refptr<webrtc::DataChann
         });
     }
 
-    m_peerConnectionBackend.connection().fireEvent(RTCDataChannelEvent::create(eventNames().datachannelEvent, false, false, WTFMove(channel)));
+    m_peerConnectionBackend.connection().fireEvent(RTCDataChannelEvent::create(eventNames().datachannelEvent,
+        Event::CanBubble::No, Event::IsCancelable::No, WTFMove(channel)));
 }
 
 void LibWebRTCMediaEndpoint::OnDataChannel(rtc::scoped_refptr<webrtc::DataChannelInterface> dataChannel)
index 380fd9d..1958db2 100644 (file)
@@ -141,24 +141,24 @@ void Notification::finalize()
 
 void Notification::dispatchShowEvent()
 {
-    dispatchEvent(Event::create(eventNames().showEvent, false, false));
+    dispatchEvent(Event::create(eventNames().showEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 void Notification::dispatchClickEvent()
 {
     WindowFocusAllowedIndicator windowFocusAllowed;
-    dispatchEvent(Event::create(eventNames().clickEvent, false, false));
+    dispatchEvent(Event::create(eventNames().clickEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 void Notification::dispatchCloseEvent()
 {
-    dispatchEvent(Event::create(eventNames().closeEvent, false, false));
+    dispatchEvent(Event::create(eventNames().closeEvent, Event::CanBubble::No, Event::IsCancelable::No));
     finalize();
 }
 
 void Notification::dispatchErrorEvent()
 {
-    dispatchEvent(Event::create(eventNames().errorEvent, false, false));
+    dispatchEvent(Event::create(eventNames().errorEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 auto Notification::permission(Document& document) -> Permission
index 408acd2..6927577 100644 (file)
@@ -38,7 +38,7 @@ Ref<MerchantValidationEvent> MerchantValidationEvent::create(const AtomicString&
 }
 
 MerchantValidationEvent::MerchantValidationEvent(const AtomicString& type, const URL& validationURL, PaymentRequest& paymentRequest)
-    : Event { type, false, false }
+    : Event { type, Event::CanBubble::No, Event::IsCancelable::No }
     , m_validationURL { validationURL }
     , m_paymentRequest { paymentRequest }
 {
index fe27558..c205335 100644 (file)
@@ -38,7 +38,7 @@ PaymentRequestUpdateEvent::PaymentRequestUpdateEvent(const AtomicString& type, P
 }
 
 PaymentRequestUpdateEvent::PaymentRequestUpdateEvent(const AtomicString& type, PaymentRequest& paymentRequest)
-    : Event { type, false, false }
+    : Event { type, CanBubble::No, IsCancelable::No }
     , m_paymentRequest { &paymentRequest }
 {
 }
index 7206cdc..3dfd97b 100644 (file)
@@ -250,7 +250,7 @@ unsigned long long QuickTimePluginReplacement::movieSize() const
 void QuickTimePluginReplacement::postEvent(const String& eventName)
 {
     Ref<HTMLPlugInElement> protect(*m_parentElement);
-    Ref<Event> event = Event::create(eventName, false, true);
+    Ref<Event> event = Event::create(eventName, Event::CanBubble::No, Event::IsCancelable::Yes);
     m_parentElement->dispatchEvent(event);
 }
 
index ec4a7f7..f2fe025 100644 (file)
@@ -36,7 +36,7 @@ Ref<SpeechSynthesisEvent> SpeechSynthesisEvent::create(const AtomicString& type,
 }
 
 SpeechSynthesisEvent::SpeechSynthesisEvent(const AtomicString& type, unsigned charIndex, float elapsedTime, const String& name)
-    : Event(type, false, false)
+    : Event(type, CanBubble::No, IsCancelable::No)
     , m_charIndex(charIndex)
     , m_elapsedTime(elapsedTime)
     , m_name(name)
index 1ab8bf2..fbd2815 100644 (file)
@@ -288,7 +288,7 @@ void AudioContext::setState(State state)
         return;
 
     m_state = state;
-    m_eventQueue->enqueueEvent(Event::create(eventNames().statechangeEvent, true, false));
+    m_eventQueue->enqueueEvent(Event::create(eventNames().statechangeEvent, Event::CanBubble::Yes, Event::IsCancelable::No));
 
     size_t stateIndex = static_cast<size_t>(state);
     if (stateIndex >= m_stateReactions.size())
index 725cde6..aab29a3 100644 (file)
@@ -36,7 +36,7 @@ namespace WebCore {
 AudioProcessingEvent::AudioProcessingEvent() = default;
 
 AudioProcessingEvent::AudioProcessingEvent(RefPtr<AudioBuffer>&& inputBuffer, RefPtr<AudioBuffer>&& outputBuffer, double playbackTime)
-    : Event(eventNames().audioprocessEvent, true, false)
+    : Event(eventNames().audioprocessEvent, CanBubble::Yes, IsCancelable::No)
     , m_inputBuffer(WTFMove(inputBuffer))
     , m_outputBuffer(WTFMove(outputBuffer))
     , m_playbackTime(playbackTime)
index 74edaca..456f260 100644 (file)
@@ -179,7 +179,7 @@ void AudioScheduledSourceNode::finish()
         if (!this->scriptExecutionContext())
             return;
 
-        this->dispatchEvent(Event::create(eventNames().endedEvent, false, false));
+        this->dispatchEvent(Event::create(eventNames().endedEvent, Event::CanBubble::No, Event::IsCancelable::No));
     });
 }
 
index eaf635d..1634a1c 100644 (file)
@@ -39,7 +39,7 @@ Ref<OfflineAudioCompletionEvent> OfflineAudioCompletionEvent::create(RefPtr<Audi
 }
 
 OfflineAudioCompletionEvent::OfflineAudioCompletionEvent(RefPtr<AudioBuffer>&& renderedBuffer)
-    : Event(eventNames().completeEvent, true, false)
+    : Event(eventNames().completeEvent, CanBubble::Yes, IsCancelable::No)
     , m_renderedBuffer(WTFMove(renderedBuffer))
 {
 }
index 85954f0..bc1a0c4 100644 (file)
@@ -62,7 +62,7 @@ public:
 
 private:
     CloseEvent(bool wasClean, int code, const String& reason)
-        : Event(eventNames().closeEvent, false, false)
+        : Event(eventNames().closeEvent, CanBubble::No, IsCancelable::No)
         , m_wasClean(wasClean)
         , m_code(code)
         , m_reason(reason)
index 02dac6e..c3ddd84 100644 (file)
@@ -563,7 +563,7 @@ void WebSocket::didConnect()
     m_state = OPEN;
     m_subprotocol = m_channel->subprotocol();
     m_extensions = m_channel->extensions();
-    dispatchEvent(Event::create(eventNames().openEvent, false, false));
+    dispatchEvent(Event::create(eventNames().openEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 void WebSocket::didReceiveMessage(const String& msg)
@@ -657,7 +657,7 @@ void WebSocket::dispatchOrQueueErrorEvent()
         return;
 
     m_dispatchedErrorEvent = true;
-    dispatchOrQueueEvent(Event::create(eventNames().errorEvent, false, false));
+    dispatchOrQueueEvent(Event::create(eventNames().errorEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 void WebSocket::dispatchOrQueueEvent(Ref<Event>&& event)
index 5acd698..0aa8ea1 100644 (file)
@@ -37,7 +37,7 @@ VRDisplayEvent::VRDisplayEvent(const AtomicString& type, const Init& initializer
 }
 
 VRDisplayEvent::VRDisplayEvent(const AtomicString& name, const RefPtr<VRDisplay>& display, std::optional<VRDisplayEventReason>&& reason)
-    : Event(name, false /*canBubble*/, false /*cancelable*/)
+    : Event(name, CanBubble::No, IsCancelable::No)
     , m_display(display)
     , m_reason(WTFMove(reason))
 {
index 77d1fdb..31beacd 100644 (file)
@@ -2216,7 +2216,7 @@ bool AccessibilityObject::dispatchAccessibilityEventWithType(AccessibilityEventT
         return false;
     }
     
-    auto event = Event::create(eventName, true, true);
+    auto event = Event::create(eventName, Event::CanBubble::Yes, Event::IsCancelable::Yes);
     return dispatchAccessibilityEvent(event);
 }
 
index 4ccfa15..0f81afb 100644 (file)
@@ -29,7 +29,7 @@
 namespace WebCore {
 
 AccessibleSetValueEvent::AccessibleSetValueEvent(const AtomicString& type, const AtomicString& value)
-    : Event(type, true, true)
+    : Event(type, CanBubble::Yes, IsCancelable::Yes)
     , m_value(value)
 {
 }
index 4a5f4cb..96c0924 100644 (file)
@@ -45,7 +45,7 @@ AnimationPlaybackEvent::AnimationPlaybackEvent(const AtomicString& type, const A
 }
 
 AnimationPlaybackEvent::AnimationPlaybackEvent(const AtomicString& type, std::optional<Seconds> currentTime, std::optional<Seconds> timelineTime)
-    : Event(type, true, false)
+    : Event(type, CanBubble::Yes, IsCancelable::No)
     , m_currentTime(currentTime)
     , m_timelineTime(timelineTime)
 {
index edca46d..512ecae 100644 (file)
@@ -58,7 +58,7 @@ void AbortSignal::abort()
     // FIXME: Add support for 'abort algorithms' - https://dom.spec.whatwg.org/#abortsignal-abort-algorithms
 
     // 5. Fire an event named abort at signal.
-    dispatchEvent(Event::create(eventNames().abortEvent, false, false));
+    dispatchEvent(Event::create(eventNames().abortEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 }
index b0b40a7..c525667 100644 (file)
@@ -36,7 +36,7 @@ AnimationEvent::AnimationEvent(const AtomicString& type, const Init& initializer
 }
 
 AnimationEvent::AnimationEvent(const AtomicString& type, const String& animationName, double elapsedTime)
-    : Event(type, true, false)
+    : Event(type, CanBubble::Yes, IsCancelable::No)
     , m_animationName(animationName)
     , m_elapsedTime(elapsedTime)
 {
index 7c57daa..f635692 100644 (file)
@@ -53,7 +53,7 @@ public:
 
 private:
     explicit BeforeLoadEvent(const String& url)
-        : Event(eventNames().beforeloadEvent, false, true)
+        : Event(eventNames().beforeloadEvent, CanBubble::No, IsCancelable::Yes)
         , m_url(url)
     {
     }
index 1aff608..dcfcee0 100644 (file)
@@ -31,7 +31,7 @@
 namespace WebCore {
 
 BeforeTextInsertedEvent::BeforeTextInsertedEvent(const String& text)
-    : Event(eventNames().webkitBeforeTextInsertedEvent, false, true), m_text(text)
+    : Event(eventNames().webkitBeforeTextInsertedEvent, CanBubble::No, IsCancelable::Yes), m_text(text)
 {
 }
 
index 54e7472..494fb7d 100644 (file)
@@ -28,7 +28,7 @@
 namespace WebCore {
 
 BeforeUnloadEvent::BeforeUnloadEvent()
-    : Event(eventNames().beforeunloadEvent, false, true)
+    : Event(eventNames().beforeunloadEvent, CanBubble::No, IsCancelable::Yes)
 {
 }
 
index 43aeb39..9c99e78 100644 (file)
@@ -227,7 +227,7 @@ void CharacterData::dispatchModifiedEvent(const String& oldData)
 
     if (!isInShadowTree()) {
         if (document().hasListenerType(Document::DOMCHARACTERDATAMODIFIED_LISTENER))
-            dispatchScopedEvent(MutationEvent::create(eventNames().DOMCharacterDataModifiedEvent, true, nullptr, oldData, m_data));
+            dispatchScopedEvent(MutationEvent::create(eventNames().DOMCharacterDataModifiedEvent, Event::CanBubble::Yes, nullptr, oldData, m_data));
         dispatchSubtreeModifiedEvent();
     }
 
index 007af7d..b7125fc 100644 (file)
@@ -32,7 +32,7 @@ namespace WebCore {
 CompositionEvent::CompositionEvent() = default;
 
 CompositionEvent::CompositionEvent(const AtomicString& type, RefPtr<WindowProxy>&& view, const String& data)
-    : UIEvent(type, true, true, WTFMove(view), 0)
+    : UIEvent(type, CanBubble::Yes, IsCancelable::Yes, WTFMove(view), 0)
     , m_data(data)
 {
 }
index 0a5f4da..8b509f7 100644 (file)
@@ -775,12 +775,12 @@ static void dispatchChildInsertionEvents(Node& child)
     Ref<Document> document(child.document());
 
     if (c->parentNode() && document->hasListenerType(Document::DOMNODEINSERTED_LISTENER))
-        c->dispatchScopedEvent(MutationEvent::create(eventNames().DOMNodeInsertedEvent, true, c->parentNode()));
+        c->dispatchScopedEvent(MutationEvent::create(eventNames().DOMNodeInsertedEvent, Event::CanBubble::Yes, c->parentNode()));
 
     // dispatch the DOMNodeInsertedIntoDocument event to all descendants
     if (c->isConnected() && document->hasListenerType(Document::DOMNODEINSERTEDINTODOCUMENT_LISTENER)) {
         for (; c; c = NodeTraversal::next(*c, &child))
-            c->dispatchScopedEvent(MutationEvent::create(eventNames().DOMNodeInsertedIntoDocumentEvent, false));
+            c->dispatchScopedEvent(MutationEvent::create(eventNames().DOMNodeInsertedIntoDocumentEvent, Event::CanBubble::No));
     }
 }
 
@@ -800,12 +800,12 @@ static void dispatchChildRemovalEvents(Ref<Node>& child)
 
     // dispatch pre-removal mutation events
     if (child->parentNode() && document->hasListenerType(Document::DOMNODEREMOVED_LISTENER))
-        child->dispatchScopedEvent(MutationEvent::create(eventNames().DOMNodeRemovedEvent, true, child->parentNode()));
+        child->dispatchScopedEvent(MutationEvent::create(eventNames().DOMNodeRemovedEvent, Event::CanBubble::Yes, child->parentNode()));
 
     // dispatch the DOMNodeRemovedFromDocument event to all descendants
     if (child->isConnected() && document->hasListenerType(Document::DOMNODEREMOVEDFROMDOCUMENT_LISTENER)) {
         for (RefPtr<Node> currentNode = child.copyRef(); currentNode; currentNode = NodeTraversal::next(*currentNode, child.ptr()))
-            currentNode->dispatchScopedEvent(MutationEvent::create(eventNames().DOMNodeRemovedFromDocumentEvent, false));
+            currentNode->dispatchScopedEvent(MutationEvent::create(eventNames().DOMNodeRemovedFromDocumentEvent, Event::CanBubble::No));
     }
 }
 
index 4a4b3e3..904ef3a 100644 (file)
@@ -38,7 +38,7 @@ DeviceMotionEvent::DeviceMotionEvent()
 }
 
 DeviceMotionEvent::DeviceMotionEvent(const AtomicString& eventType, DeviceMotionData* deviceMotionData)
-    : Event(eventType, false, false) // Can't bubble, not cancelable
+    : Event(eventType, CanBubble::No, IsCancelable::No)
     , m_deviceMotionData(deviceMotionData)
 {
 }
index b178046..c59896e 100644 (file)
@@ -38,7 +38,7 @@ DeviceOrientationEvent::DeviceOrientationEvent()
 }
 
 DeviceOrientationEvent::DeviceOrientationEvent(const AtomicString& eventType, DeviceOrientationData* orientation)
-    : Event(eventType, false, false) // Can't bubble, not cancelable
+    : Event(eventType, CanBubble::No, IsCancelable::No)
     , m_orientation(orientation)
 {
 }
index ee74da2..a351585 100644 (file)
@@ -1216,7 +1216,7 @@ void Document::setReadyState(ReadyState readyState)
     }
 
     m_readyState = readyState;
-    dispatchEvent(Event::create(eventNames().readystatechangeEvent, false, false));
+    dispatchEvent(Event::create(eventNames().readystatechangeEvent, Event::CanBubble::No, Event::IsCancelable::No));
 
     if (settings().suppressesIncrementalRendering())
         setVisualUpdatesAllowed(readyState);
@@ -1630,7 +1630,7 @@ void Document::unregisterForVisibilityStateChangedCallbacks(VisibilityChangeClie
 
 void Document::visibilityStateChanged()
 {
-    enqueueDocumentEvent(Event::create(eventNames().visibilitychangeEvent, false, false));
+    enqueueDocumentEvent(Event::create(eventNames().visibilitychangeEvent, Event::CanBubble::No, Event::IsCancelable::No));
     for (auto* client : m_visibilityStateCallbackClients)
         client->visibilityStateChanged();
 
@@ -5430,7 +5430,7 @@ void Document::finishedParsing()
     // FIXME: Schdule a task to fire DOMContentLoaded event instead. See webkit.org/b/82931
     MicrotaskQueue::mainThreadQueue().performMicrotaskCheckpoint();
 
-    dispatchEvent(Event::create(eventNames().DOMContentLoadedEvent, true, false));
+    dispatchEvent(Event::create(eventNames().DOMContentLoadedEvent, Event::CanBubble::Yes, Event::IsCancelable::No));
 
     if (!m_documentTiming.domContentLoadedEventEnd)
         m_documentTiming.domContentLoadedEventEnd = MonotonicTime::now();
@@ -6404,7 +6404,7 @@ void Document::dispatchFullScreenChangeOrErrorEvent(Deque<RefPtr<Node>>& queue,
         if (shouldNotifyMediaElement && is<HTMLMediaElement>(*node))
             downcast<HTMLMediaElement>(*node).enteredOrExitedFullscreen();
 #endif
-        node->dispatchEvent(Event::create(eventName, true, false));
+        node->dispatchEvent(Event::create(eventName, Event::CanBubble::Yes, Event::IsCancelable::No));
     }
 }
 
@@ -7452,7 +7452,7 @@ void Document::didRemoveInDocumentShadowRoot(ShadowRoot& shadowRoot)
 void Document::orientationChanged(int orientation)
 {
     LOG(Events, "Document %p orientationChanged - orientation %d", this, orientation);
-    dispatchWindowEvent(Event::create(eventNames().orientationchangeEvent, false, false));
+    dispatchWindowEvent(Event::create(eventNames().orientationchangeEvent, Event::CanBubble::No, Event::IsCancelable::No));
     m_orientationNotifier.orientationChanged(orientation);
 }
 
index 6f05d24..01c7f96 100644 (file)
@@ -86,12 +86,10 @@ void DocumentEventQueue::enqueueOrDispatchScrollEvent(Node& target)
     ASSERT(&target.document() == &m_document);
 
     // Per the W3C CSSOM View Module, scroll events fired at the document should bubble, others should not.
-    bool bubbles = target.isDocumentNode();
-    bool cancelable = false;
-    enqueueScrollEvent(target, bubbles, cancelable);
+    enqueueScrollEvent(target, target.isDocumentNode() ? Event::CanBubble::Yes : Event::CanBubble::No, Event::IsCancelable::No);
 }
 
-void DocumentEventQueue::enqueueScrollEvent(EventTarget& target, bool bubbles, bool cancelable)
+void DocumentEventQueue::enqueueScrollEvent(EventTarget& target, Event::CanBubble canBubble, Event::IsCancelable cancelable)
 {
     if (m_isClosed)
         return;
@@ -102,12 +100,12 @@ void DocumentEventQueue::enqueueScrollEvent(EventTarget& target, bool bubbles, b
     if (!m_targetsWithQueuedScrollEvents.add(&target).isNewEntry)
         return;
 
-    Ref<Event> scrollEvent = Event::create(eventNames().scrollEvent, bubbles, cancelable);
+    Ref<Event> scrollEvent = Event::create(eventNames().scrollEvent, canBubble, cancelable);
     scrollEvent->setTarget(&target);
     enqueueEvent(WTFMove(scrollEvent));
 }
 
-void DocumentEventQueue::enqueueResizeEvent(EventTarget& target, bool bubbles, bool cancelable)
+void DocumentEventQueue::enqueueResizeEvent(EventTarget& target, Event::CanBubble canBubble, Event::IsCancelable cancelable)
 {
     if (m_isClosed)
         return;
@@ -118,7 +116,7 @@ void DocumentEventQueue::enqueueResizeEvent(EventTarget& target, bool bubbles, b
     if (!m_targetsWithQueuedResizeEvents.add(&target).isNewEntry)
         return;
 
-    Ref<Event> resizeEvent = Event::create(eventNames().resizeEvent, bubbles, cancelable);
+    Ref<Event> resizeEvent = Event::create(eventNames().resizeEvent, canBubble, cancelable);
     resizeEvent->setTarget(&target);
     enqueueEvent(WTFMove(resizeEvent));
 }
index b2f1ba0..b455b72 100644 (file)
@@ -27,6 +27,7 @@
 
 #pragma once
 
+#include "Event.h"
 #include "EventQueue.h"
 #include <memory>
 #include <wtf/HashSet.h>
@@ -35,7 +36,6 @@
 namespace WebCore {
 
 class Document;
-class Event;
 class Node;
 
 class DocumentEventQueue final : public EventQueue {
@@ -48,8 +48,8 @@ public:
     void close() override;
 
     void enqueueOrDispatchScrollEvent(Node&);
-    void enqueueScrollEvent(EventTarget&, bool bubbles, bool cancelable);
-    void enqueueResizeEvent(EventTarget&, bool bubbles, bool cancelable);
+    void enqueueScrollEvent(EventTarget&, Event::CanBubble, Event::IsCancelable);
+    void enqueueResizeEvent(EventTarget&, Event::CanBubble, Event::IsCancelable);
 
 private:
     void pendingEventTimerFired();
index 73ec862..7899b6d 100644 (file)
@@ -291,7 +291,8 @@ bool Element::dispatchMouseEvent(const PlatformMouseEvent& platformEvent, const
         // of the DOM specs, but is used for compatibility with the ondblclick="" attribute. This is treated
         // as a separate event in other DOM-compliant browsers like Firefox, and so we do the same.
         Ref<MouseEvent> doubleClickEvent = MouseEvent::create(eventNames().dblclickEvent,
-            mouseEvent->bubbles(), mouseEvent->cancelable(), mouseEvent->view(), mouseEvent->detail(),
+            mouseEvent->bubbles() ? Event::CanBubble::Yes : Event::CanBubble::No, mouseEvent->cancelable() ? Event::IsCancelable::Yes : Event::IsCancelable::No,
+            mouseEvent->view(), mouseEvent->detail(),
             mouseEvent->screenX(), mouseEvent->screenY(), mouseEvent->clientX(), mouseEvent->clientY(),
             mouseEvent->ctrlKey(), mouseEvent->altKey(), mouseEvent->shiftKey(), mouseEvent->metaKey(),
             mouseEvent->button(), mouseEvent->buttons(), mouseEvent->syntheticClickType(), relatedTarget);
@@ -2580,34 +2581,34 @@ void Element::dispatchFocusInEvent(const AtomicString& eventType, RefPtr<Element
 {
     ASSERT_WITH_SECURITY_IMPLICATION(ScriptDisallowedScope::InMainThread::isScriptAllowed());
     ASSERT(eventType == eventNames().focusinEvent || eventType == eventNames().DOMFocusInEvent);
-    dispatchScopedEvent(FocusEvent::create(eventType, true, false, document().windowProxy(), 0, WTFMove(oldFocusedElement)));
+    dispatchScopedEvent(FocusEvent::create(eventType, Event::CanBubble::Yes, Event::IsCancelable::No, document().windowProxy(), 0, WTFMove(oldFocusedElement)));
 }
 
 void Element::dispatchFocusOutEvent(const AtomicString& eventType, RefPtr<Element>&& newFocusedElement)
 {
     ASSERT_WITH_SECURITY_IMPLICATION(ScriptDisallowedScope::InMainThread::isScriptAllowed());
     ASSERT(eventType == eventNames().focusoutEvent || eventType == eventNames().DOMFocusOutEvent);
-    dispatchScopedEvent(FocusEvent::create(eventType, true, false, document().windowProxy(), 0, WTFMove(newFocusedElement)));
+    dispatchScopedEvent(FocusEvent::create(eventType, Event::CanBubble::Yes, Event::IsCancelable::No, document().windowProxy(), 0, WTFMove(newFocusedElement)));
 }
 
 void Element::dispatchFocusEvent(RefPtr<Element>&& oldFocusedElement, FocusDirection)
 {
     if (auto* page = document().page())
         page->chrome().client().elementDidFocus(*this);
-    dispatchEvent(FocusEvent::create(eventNames().focusEvent, false, false, document().windowProxy(), 0, WTFMove(oldFocusedElement)));
+    dispatchEvent(FocusEvent::create(eventNames().focusEvent, Event::CanBubble::No, Event::IsCancelable::No, document().windowProxy(), 0, WTFMove(oldFocusedElement)));
 }
 
 void Element::dispatchBlurEvent(RefPtr<Element>&& newFocusedElement)
 {
     if (auto* page = document().page())
         page->chrome().client().elementDidBlur(*this);
-    dispatchEvent(FocusEvent::create(eventNames().blurEvent, false, false, document().windowProxy(), 0, WTFMove(newFocusedElement)));
+    dispatchEvent(FocusEvent::create(eventNames().blurEvent, Event::CanBubble::No, Event::IsCancelable::No, document().windowProxy(), 0, WTFMove(newFocusedElement)));
 }
 
 void Element::dispatchWebKitImageReadyEventForTesting()
 {
     if (document().settings().webkitImageReadyEventEnabled())
-        dispatchEvent(Event::create("webkitImageFrameReady", true, true));
+        dispatchEvent(Event::create("webkitImageFrameReady", Event::CanBubble::Yes, Event::IsCancelable::Yes));
 }
 
 bool Element::dispatchMouseForceWillBegin()
index d9dbbdc..48dbd1d 100644 (file)
@@ -51,7 +51,7 @@ ErrorEvent::ErrorEvent(const AtomicString& type, const Init& initializer, IsTrus
 }
 
 ErrorEvent::ErrorEvent(const String& message, const String& fileName, unsigned lineNumber, unsigned columnNumber, JSC::Strong<JSC::Unknown> error)
-    : Event(eventNames().errorEvent, false, true)
+    : Event(eventNames().errorEvent, CanBubble::No, IsCancelable::Yes)
     , m_message(message)
     , m_fileName(fileName)
     , m_lineNumber(lineNumber)
index c67822a..7bb64bb 100644 (file)
@@ -40,21 +40,21 @@ Event::Event(IsTrusted isTrusted)
 {
 }
 
-Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableArg)
+Event::Event(const AtomicString& eventType, CanBubble canBubble, IsCancelable isCancelable)
     : m_type(eventType)
     , m_isInitialized(true)
-    , m_canBubble(canBubbleArg)
-    , m_cancelable(cancelableArg)
+    , m_canBubble(canBubble == CanBubble::Yes)
+    , m_cancelable(isCancelable == IsCancelable::Yes)
     , m_isTrusted(true)
     , m_createTime(MonotonicTime::now())
 {
 }
 
-Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableArg, MonotonicTime timestamp)
+Event::Event(const AtomicString& eventType, CanBubble canBubble, IsCancelable isCancelable, MonotonicTime timestamp)
     : m_type(eventType)
     , m_isInitialized(true)
-    , m_canBubble(canBubbleArg)
-    , m_cancelable(cancelableArg)
+    , m_canBubble(canBubble == CanBubble::Yes)
+    , m_cancelable(isCancelable == IsCancelable::Yes)
     , m_isTrusted(true)
     , m_createTime(timestamp)
 {
@@ -73,9 +73,9 @@ Event::Event(const AtomicString& eventType, const EventInit& initializer, IsTrus
 
 Event::~Event() = default;
 
-Ref<Event> Event::create(const AtomicString& type, bool canBubble, bool cancelable)
+Ref<Event> Event::create(const AtomicString& type, CanBubble canBubble, IsCancelable isCancelable)
 {
-    return adoptRef(*new Event(type, canBubble, cancelable));
+    return adoptRef(*new Event(type, canBubble, isCancelable));
 }
 
 Ref<Event> Event::createForBindings()
index fef098a..22cd3a5 100644 (file)
@@ -41,6 +41,8 @@ class ScriptExecutionContext;
 class Event : public ScriptWrappable, public RefCounted<Event> {
 public:
     enum class IsTrusted { No, Yes };
+    enum class CanBubble { No, Yes };
+    enum class IsCancelable { No, Yes };
 
     enum PhaseType { 
         NONE = 0,
@@ -49,7 +51,7 @@ public:
         BUBBLING_PHASE = 3
     };
 
-    WEBCORE_EXPORT static Ref<Event> create(const AtomicString& type, bool canBubble, bool cancelable);
+    WEBCORE_EXPORT static Ref<Event> create(const AtomicString& type, CanBubble, IsCancelable);
     static Ref<Event> createForBindings();
     static Ref<Event> create(const AtomicString& type, const EventInit&, IsTrusted = IsTrusted::No);
 
@@ -139,8 +141,8 @@ public:
 
 protected:
     explicit Event(IsTrusted = IsTrusted::No);
-    Event(const AtomicString& type, bool canBubble, bool cancelable);
-    Event(const AtomicString& type, bool canBubble, bool cancelable, MonotonicTime timestamp);
+    Event(const AtomicString& type, CanBubble, IsCancelable);
+    Event(const AtomicString& type, CanBubble, IsCancelable, MonotonicTime timestamp);
     Event(const AtomicString& type, const EventInit&, IsTrusted);
 
     virtual void receivedTarget() { }
index 9868773..1ea55fc 100644 (file)
@@ -40,7 +40,7 @@ bool FocusEvent::isFocusEvent() const
     return true;
 }
 
-FocusEvent::FocusEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<WindowProxy>&& view, int detail, RefPtr<EventTarget>&& relatedTarget)
+FocusEvent::FocusEvent(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, RefPtr<WindowProxy>&& view, int detail, RefPtr<EventTarget>&& relatedTarget)
     : UIEvent(type, canBubble, cancelable, WTFMove(view), detail)
     , m_relatedTarget(WTFMove(relatedTarget))
 {
index c7a4df8..ddd5311 100644 (file)
@@ -35,7 +35,7 @@ class Node;
 
 class FocusEvent final : public UIEvent {
 public:
-    static Ref<FocusEvent> create(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<WindowProxy>&& view, int detail, RefPtr<EventTarget>&& relatedTarget)
+    static Ref<FocusEvent> create(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, RefPtr<WindowProxy>&& view, int detail, RefPtr<EventTarget>&& relatedTarget)
     {
         return adoptRef(*new FocusEvent(type, canBubble, cancelable, WTFMove(view), detail, WTFMove(relatedTarget)));
     }
@@ -58,7 +58,7 @@ public:
 
 private:
     FocusEvent() = default;
-    FocusEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<WindowProxy>&&, int, RefPtr<EventTarget>&&);
+    FocusEvent(const AtomicString& type, CanBubble, IsCancelable, RefPtr<WindowProxy>&&, int, RefPtr<EventTarget>&&);
     FocusEvent(const AtomicString& type, const Init&, IsTrusted);
 
     EventInterface eventInterface() const final;
index ae36747..c81375e 100644 (file)
@@ -69,7 +69,7 @@ private:
     }
 
     HashChangeEvent(const String& oldURL, const String& newURL)
-        : Event(eventNames().hashchangeEvent, false, false)
+        : Event(eventNames().hashchangeEvent, CanBubble::No, IsCancelable::No)
         , m_oldURL(oldURL)
         , m_newURL(newURL)
     {
index c17bf18..8556203 100644 (file)
 
 namespace WebCore {
 
-Ref<InputEvent> InputEvent::create(const AtomicString& eventType, const String& inputType, bool canBubble, bool cancelable, RefPtr<WindowProxy>&& view, const String& data, RefPtr<DataTransfer>&& dataTransfer, const Vector<RefPtr<StaticRange>>& targetRanges, int detail)
+Ref<InputEvent> InputEvent::create(const AtomicString& eventType, const String& inputType, CanBubble canBubble, IsCancelable cancelable, RefPtr<WindowProxy>&& view, const String& data, RefPtr<DataTransfer>&& dataTransfer, const Vector<RefPtr<StaticRange>>& targetRanges, int detail)
 {
     return adoptRef(*new InputEvent(eventType, inputType, canBubble, cancelable, WTFMove(view), data, WTFMove(dataTransfer), targetRanges, detail));
 }
 
-InputEvent::InputEvent(const AtomicString& eventType, const String& inputType, bool canBubble, bool cancelable, RefPtr<WindowProxy>&& view, const String& data, RefPtr<DataTransfer>&& dataTransfer, const Vector<RefPtr<StaticRange>>& targetRanges, int detail)
+InputEvent::InputEvent(const AtomicString& eventType, const String& inputType, CanBubble canBubble, IsCancelable cancelable, RefPtr<WindowProxy>&& view, const String& data, RefPtr<DataTransfer>&& dataTransfer, const Vector<RefPtr<StaticRange>>& targetRanges, int detail)
     : UIEvent(eventType, canBubble, cancelable, WTFMove(view), detail)
     , m_inputType(inputType)
     , m_data(data)
index d050763..631dc6d 100644 (file)
@@ -39,13 +39,15 @@ public:
         String data;
     };
 
-    static Ref<InputEvent> create(const AtomicString& eventType, const String& inputType, bool canBubble, bool cancelable, RefPtr<WindowProxy>&& view, const String& data, RefPtr<DataTransfer>&&, const Vector<RefPtr<StaticRange>>& targetRanges, int detail);
+    static Ref<InputEvent> create(const AtomicString& eventType, const String& inputType, CanBubble, IsCancelable, RefPtr<WindowProxy>&& view,
+        const String& data, RefPtr<DataTransfer>&&, const Vector<RefPtr<StaticRange>>& targetRanges, int detail);
+
     static Ref<InputEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
     {
         return adoptRef(*new InputEvent(type, initializer, isTrusted));
     }
 
-    InputEvent(const AtomicString& eventType, const String& inputType, bool canBubble, bool cancelable, RefPtr<WindowProxy>&&, const String& data, RefPtr<DataTransfer>&&, const Vector<RefPtr<StaticRange>>& targetRanges, int detail);
+    InputEvent(const AtomicString& eventType, const String& inputType, CanBubble, IsCancelable, RefPtr<WindowProxy>&&, const String& data, RefPtr<DataTransfer>&&, const Vector<RefPtr<StaticRange>>& targetRanges, int detail);
     InputEvent(const AtomicString& eventType, const Init&, IsTrusted);
 
     bool isInputEvent() const override { return true; }
index 4acb5f4..ad4dce4 100644 (file)
@@ -94,7 +94,9 @@ static inline KeyboardEvent::KeyLocationCode keyLocationCode(const PlatformKeybo
 inline KeyboardEvent::KeyboardEvent() = default;
 
 inline KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, RefPtr<WindowProxy>&& view)
-    : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()), true, true, key.timestamp().approximateMonotonicTime(), view.copyRef(), 0, key.ctrlKey(), key.altKey(), key.shiftKey(), key.metaKey(), false, key.modifiers().contains(PlatformEvent::Modifier::CapsLockKey))
+    : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()), CanBubble::Yes, IsCancelable::Yes,
+        key.timestamp().approximateMonotonicTime(), view.copyRef(), 0, key.ctrlKey(), key.altKey(), key.shiftKey(), key.metaKey(),
+        false, key.modifiers().contains(PlatformEvent::Modifier::CapsLockKey))
     , m_underlyingPlatformEvent(std::make_unique<PlatformKeyboardEvent>(key))
 #if ENABLE(KEYBOARD_KEY_ATTRIBUTE)
     , m_key(key.key())
index 36c082d..d1f7b04 100644 (file)
@@ -49,7 +49,7 @@ inline MessageEvent::MessageEvent(const AtomicString& type, Init&& initializer,
 }
 
 inline MessageEvent::MessageEvent(DataType&& data, const String& origin, const String& lastEventId, std::optional<MessageEventSource>&& source, Vector<RefPtr<MessagePort>>&& ports)
-    : Event(eventNames().messageEvent, false, false)
+    : Event(eventNames().messageEvent, CanBubble::No, IsCancelable::No)
     , m_data(WTFMove(data))
     , m_origin(origin)
     , m_lastEventId(lastEventId)
@@ -59,7 +59,7 @@ inline MessageEvent::MessageEvent(DataType&& data, const String& origin, const S
 }
 
 inline MessageEvent::MessageEvent(const AtomicString& type, Ref<SerializedScriptValue>&& data, const String& origin, const String& lastEventId)
-    : Event(type, false, false)
+    : Event(type, CanBubble::No, IsCancelable::No)
     , m_data(WTFMove(data))
     , m_origin(origin)
     , m_lastEventId(lastEventId)
index 05c1451..b267de2 100644 (file)
@@ -47,8 +47,8 @@ Ref<MouseEvent> MouseEvent::create(const AtomicString& type, const MouseEventIni
 Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, RefPtr<WindowProxy>&& view, const PlatformMouseEvent& event, int detail, Node* relatedTarget)
 {
     bool isMouseEnterOrLeave = eventType == eventNames().mouseenterEvent || eventType == eventNames().mouseleaveEvent;
-    bool isCancelable = eventType != eventNames().mousemoveEvent && !isMouseEnterOrLeave;
-    bool canBubble = !isMouseEnterOrLeave;
+    auto isCancelable = eventType != eventNames().mousemoveEvent && !isMouseEnterOrLeave ? IsCancelable::Yes : IsCancelable::No;
+    auto canBubble = !isMouseEnterOrLeave ? CanBubble::Yes : CanBubble::No;
 
     return MouseEvent::create(eventType, canBubble, isCancelable, event.timestamp().approximateMonotonicTime(), WTFMove(view),
         detail, event.globalPosition().x(), event.globalPosition().y(), event.position().x(), event.position().y(),
@@ -59,7 +59,7 @@ Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, RefPtr<WindowP
         relatedTarget, event.force(), event.syntheticClickType());
 }
 
-Ref<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& view, int detail, int screenX, int screenY, int pageX, int pageY,
+Ref<MouseEvent> MouseEvent::create(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& view, int detail, int screenX, int screenY, int pageX, int pageY,
 #if ENABLE(POINTER_LOCK)
     int movementX, int movementY,
 #endif
@@ -73,14 +73,14 @@ Ref<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, boo
         ctrlKey, altKey, shiftKey, metaKey, button, buttons, relatedTarget, force, syntheticClickType, dataTransfer, isSimulated));
 }
 
-Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, bool canBubble, bool cancelable, RefPtr<WindowProxy>&& view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, unsigned short buttons, unsigned short syntheticClickType, EventTarget* relatedTarget)
+Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, CanBubble canBubble, IsCancelable cancelable, RefPtr<WindowProxy>&& view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, unsigned short buttons, unsigned short syntheticClickType, EventTarget* relatedTarget)
 {
     return adoptRef(*new MouseEvent(eventType, canBubble, cancelable, WTFMove(view), detail, { screenX, screenY }, { clientX, clientY }, ctrlKey, altKey, shiftKey, metaKey, button, buttons, syntheticClickType, relatedTarget));
 }
 
 MouseEvent::MouseEvent() = default;
 
-MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& view, int detail, const IntPoint& screenLocation, const IntPoint& windowLocation,
+MouseEvent::MouseEvent(const AtomicString& eventType, CanBubble canBubble, IsCancelable cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& view, int detail, const IntPoint& screenLocation, const IntPoint& windowLocation,
 #if ENABLE(POINTER_LOCK)
         const IntPoint& movementDelta,
 #endif
@@ -100,7 +100,7 @@ MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cance
 {
 }
 
-MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cancelable, RefPtr<WindowProxy>&& view, int detail, const IntPoint& screenLocation, const IntPoint& clientLocation, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, unsigned short buttons, unsigned short syntheticClickType, EventTarget* relatedTarget)
+MouseEvent::MouseEvent(const AtomicString& eventType, CanBubble canBubble, IsCancelable cancelable, RefPtr<WindowProxy>&& view, int detail, const IntPoint& screenLocation, const IntPoint& clientLocation, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, unsigned short buttons, unsigned short syntheticClickType, EventTarget* relatedTarget)
     : MouseRelatedEvent(eventType, canBubble, cancelable, MonotonicTime::now(), WTFMove(view), detail, screenLocation, { },
 #if ENABLE(POINTER_LOCK)
         { },
index 4b28079..b03aabb 100644 (file)
@@ -34,15 +34,19 @@ class PlatformMouseEvent;
 
 class MouseEvent : public MouseRelatedEvent {
 public:
-    WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& type, bool canBubble, bool cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&&, int detail, int screenX, int screenY, int pageX, int pageY,
+    WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& type, CanBubble, IsCancelable, MonotonicTime timestamp,
+        RefPtr<WindowProxy>&&, int detail, int screenX, int screenY, int pageX, int pageY,
 #if ENABLE(POINTER_LOCK)
         int movementX, int movementY,
 #endif
-        bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, unsigned short buttons, EventTarget* relatedTarget, double force, unsigned short syntheticClickType, DataTransfer* = nullptr, bool isSimulated = false);
+        bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, unsigned short buttons,
+        EventTarget* relatedTarget, double force, unsigned short syntheticClickType, DataTransfer* = nullptr, bool isSimulated = false);
 
     WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& eventType, RefPtr<WindowProxy>&&, const PlatformMouseEvent&, int detail, Node* relatedTarget);
 
-    static Ref<MouseEvent> create(const AtomicString& eventType, bool canBubble, bool cancelable, RefPtr<WindowProxy>&&, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, unsigned short buttons, unsigned short syntheticClickType, EventTarget* relatedTarget);
+    static Ref<MouseEvent> create(const AtomicString& eventType, CanBubble, IsCancelable, RefPtr<WindowProxy>&&,
+        int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
+        unsigned short button, unsigned short buttons, unsigned short syntheticClickType, EventTarget* relatedTarget);
 
     static Ref<MouseEvent> createForBindings() { return adoptRef(*new MouseEvent); }
 
@@ -50,8 +54,13 @@ public:
 
     virtual ~MouseEvent();
 
-    WEBCORE_EXPORT void initMouseEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<WindowProxy>&&, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, EventTarget* relatedTarget);
-    void initMouseEventQuirk(JSC::ExecState&, ScriptExecutionContext&, const AtomicString& type, bool canBubble, bool cancelable, RefPtr<WindowProxy>&&, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, JSC::JSValue relatedTarget);
+    WEBCORE_EXPORT void initMouseEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<WindowProxy>&&,
+        int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
+        unsigned short button, EventTarget* relatedTarget);
+
+    void initMouseEventQuirk(JSC::ExecState&, ScriptExecutionContext&, const AtomicString& type, bool canBubble, bool cancelable, RefPtr<WindowProxy>&&,
+        int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
+        unsigned short button, JSC::JSValue relatedTarget);
 
     unsigned short button() const { return m_button; }
     unsigned short buttons() const { return m_buttons; }
@@ -71,7 +80,7 @@ public:
     int which() const final;
 
 protected:
-    MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&&,
+    MouseEvent(const AtomicString& type, CanBubble, IsCancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&&,
         int detail, const IntPoint& screenLocation, const IntPoint& windowLocation,
 #if ENABLE(POINTER_LOCK)
         const IntPoint& movementDelta,
@@ -79,7 +88,7 @@ protected:
         bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, unsigned short buttons,
         EventTarget* relatedTarget, double force, unsigned short syntheticClickType, DataTransfer*, bool isSimulated);
 
-    MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<WindowProxy>&&,
+    MouseEvent(const AtomicString& type, CanBubble, IsCancelable, RefPtr<WindowProxy>&&,
         int detail, const IntPoint& screenLocation, const IntPoint& clientLocation,
         bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
         unsigned short button, unsigned short buttons, unsigned short syntheticClickType, EventTarget* relatedTarget);
index 9d37bca..a3227a5 100644 (file)
@@ -33,7 +33,7 @@
 
 namespace WebCore {
 
-MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, bool canBubble, bool cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& view,
+MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, CanBubble canBubble, IsCancelable cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& view,
                                      int detail, const IntPoint& screenLocation, const IntPoint& windowLocation,
 #if ENABLE(POINTER_LOCK)
                                      const IntPoint& movementDelta,
index 2e8e27b..d8f1fcd 100644 (file)
@@ -74,7 +74,7 @@ public:
 
 protected:
     MouseRelatedEvent() = default;
-    MouseRelatedEvent(const AtomicString& type, bool canBubble, bool cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&&,
+    MouseRelatedEvent(const AtomicString& type, CanBubble, IsCancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&&,
         int detail, const IntPoint& screenLocation, const IntPoint& windowLocation,
 #if ENABLE(POINTER_LOCK)
         const IntPoint& movementDelta,
index 6422ad7..13a7c22 100644 (file)
@@ -25,7 +25,7 @@
 
 namespace WebCore {
 
-MutationEvent::MutationEvent(const AtomicString& type, bool canBubble, bool cancelable, Node* relatedNode, const String& prevValue, const String& newValue)
+MutationEvent::MutationEvent(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, Node* relatedNode, const String& prevValue, const String& newValue)
     : Event(type, canBubble, cancelable)
     , m_relatedNode(relatedNode)
     , m_prevValue(prevValue)
index f48e855..e58ed18 100644 (file)
@@ -36,9 +36,9 @@ public:
         REMOVAL = 3
     };
 
-    static Ref<MutationEvent> create(const AtomicString& type, bool canBubble, Node* relatedNode = nullptr, const String& prevValue = String(), const String& newValue = String())
+    static Ref<MutationEvent> create(const AtomicString& type, CanBubble canBubble, Node* relatedNode = nullptr, const String& prevValue = String(), const String& newValue = String())
     {
-        return adoptRef(*new MutationEvent(type, canBubble, false, relatedNode, prevValue, newValue));
+        return adoptRef(*new MutationEvent(type, canBubble, IsCancelable::No, relatedNode, prevValue, newValue));
     }
 
     static Ref<MutationEvent> createForBindings()
@@ -56,7 +56,7 @@ public:
 
 private:
     MutationEvent() = default;
-    MutationEvent(const AtomicString& type, bool canBubble, bool cancelable, Node* relatedNode, const String& prevValue, const String& newValue);
+    MutationEvent(const AtomicString& type, CanBubble, IsCancelable, Node* relatedNode, const String& prevValue, const String& newValue);
 
     EventInterface eventInterface() const final;
 
index 97a2e0c..6b4f204 100644 (file)
@@ -2342,14 +2342,14 @@ void Node::dispatchSubtreeModifiedEvent()
     if (!parentNode() && !hasEventListeners(subtreeModifiedEventName))
         return;
 
-    dispatchScopedEvent(MutationEvent::create(subtreeModifiedEventName, true));
+    dispatchScopedEvent(MutationEvent::create(subtreeModifiedEventName, Event::CanBubble::Yes));
 }
 
 void Node::dispatchDOMActivateEvent(Event& underlyingClickEvent)
 {
     ASSERT_WITH_SECURITY_IMPLICATION(ScriptDisallowedScope::InMainThread::isScriptAllowed());
     int detail = is<UIEvent>(underlyingClickEvent) ? downcast<UIEvent>(underlyingClickEvent).detail() : 0;
-    auto event = UIEvent::create(eventNames().DOMActivateEvent, true, true, document().windowProxy(), detail);
+    auto event = UIEvent::create(eventNames().DOMActivateEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes, document().windowProxy(), detail);
     event->setUnderlyingEvent(&underlyingClickEvent);
     dispatchScopedEvent(event);
     if (event->defaultHandled())
@@ -2369,7 +2369,7 @@ bool Node::dispatchBeforeLoadEvent(const String& sourceURL)
 
 void Node::dispatchInputEvent()
 {
-    dispatchScopedEvent(Event::create(eventNames().inputEvent, true, false));
+    dispatchScopedEvent(Event::create(eventNames().inputEvent, Event::CanBubble::Yes, Event::IsCancelable::No));
 }
 
 void Node::defaultEventHandler(Event& event)
index 5253d74..8c53ad4 100644 (file)
@@ -38,7 +38,7 @@ OverflowEvent::OverflowEvent()
 }
 
 OverflowEvent::OverflowEvent(bool horizontalOverflowChanged, bool horizontalOverflow, bool verticalOverflowChanged, bool verticalOverflow)
-    : Event(eventNames().overflowchangedEvent, false, false)
+    : Event(eventNames().overflowchangedEvent, CanBubble::No, IsCancelable::No)
     , m_horizontalOverflow(horizontalOverflow)
     , m_verticalOverflow(verticalOverflow)
 {
index 4d869cc..08089d4 100644 (file)
@@ -29,7 +29,7 @@
 namespace WebCore {
 
 PageTransitionEvent::PageTransitionEvent(const AtomicString& type, bool persisted)
-    : Event(type, true, true)
+    : Event(type, CanBubble::Yes, IsCancelable::Yes)
     , m_persisted(persisted)
 {
 }
index 82995f0..3ad0c4f 100644 (file)
@@ -40,7 +40,7 @@ PopStateEvent::PopStateEvent(const AtomicString& type, const Init& initializer,
 }
 
 PopStateEvent::PopStateEvent(RefPtr<SerializedScriptValue>&& serializedState, History* history)
-    : Event(eventNames().popstateEvent, false, false)
+    : Event(eventNames().popstateEvent, CanBubble::No, IsCancelable::No)
     , m_serializedState(WTFMove(serializedState))
     , m_history(history)
 {
index 7978212..a13708b 100644 (file)
@@ -37,7 +37,7 @@ ProgressEvent::ProgressEvent(const AtomicString& type, const Init& initializer,
 }
 
 ProgressEvent::ProgressEvent(const AtomicString& type, bool lengthComputable, unsigned long long loaded, unsigned long long total)
-    : Event(type, false, false)
+    : Event(type, CanBubble::No, IsCancelable::No)
     , m_lengthComputable(lengthComputable)
     , m_loaded(loaded)
     , m_total(total)
index a1d41cc..488ab8e 100644 (file)
@@ -125,7 +125,7 @@ static bool isLegacySupportedJavaScriptLanguage(const String& language)
 
 void ScriptElement::dispatchErrorEvent()
 {
-    m_element.dispatchEvent(Event::create(eventNames().errorEvent, false, false));
+    m_element.dispatchEvent(Event::create(eventNames().errorEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 std::optional<ScriptElement::ScriptType> ScriptElement::determineScriptType(LegacyTypeSupport supportLegacyTypes) const
index 815b8bd..abdd5c5 100644 (file)
@@ -31,7 +31,7 @@ namespace WebCore {
 
 class SecurityPolicyViolationEvent final : public Event {
 public:
-    static Ref<SecurityPolicyViolationEvent> create(const AtomicString& type, bool canBubble, bool cancelable, const String& documentURI, const String& referrer, const String& blockedURI, const String& violatedDirective, const String& effectiveDirective, const String& originalPolicy, const String& sourceFile, unsigned short statusCode, int lineNumber, int columnNumber)
+    static Ref<SecurityPolicyViolationEvent> create(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, const String& documentURI, const String& referrer, const String& blockedURI, const String& violatedDirective, const String& effectiveDirective, const String& originalPolicy, const String& sourceFile, unsigned short statusCode, int lineNumber, int columnNumber)
     {
         return adoptRef(*new SecurityPolicyViolationEvent(type, canBubble, cancelable, documentURI, referrer, blockedURI, violatedDirective, effectiveDirective, originalPolicy, sourceFile, statusCode, lineNumber, columnNumber));
     }
@@ -80,7 +80,7 @@ private:
     {
     }
 
-    SecurityPolicyViolationEvent(const AtomicString& type, bool canBubble, bool cancelable, const String& documentURI, const String& referrer, const String& blockedURI, const String& violatedDirective, const String& effectiveDirective, const String& originalPolicy, const String& sourceFile, unsigned short statusCode, int lineNumber, int columnNumber)
+    SecurityPolicyViolationEvent(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, const String& documentURI, const String& referrer, const String& blockedURI, const String& violatedDirective, const String& effectiveDirective, const String& originalPolicy, const String& sourceFile, unsigned short statusCode, int lineNumber, int columnNumber)
         : Event(type, canBubble, cancelable)
         , m_documentURI(documentURI)
         , m_referrer(referrer)
index f46439a..a52c1a7 100644 (file)
@@ -44,7 +44,7 @@ public:
 
 private:
     SimulatedMouseEvent(const AtomicString& eventType, RefPtr<WindowProxy>&& view, RefPtr<Event>&& underlyingEvent, Element& target, SimulatedClickSource source)
-        : MouseEvent(eventType, true, true, underlyingEvent ? underlyingEvent->timeStamp() : MonotonicTime::now(), WTFMove(view), 0, { }, { },
+        : MouseEvent(eventType, CanBubble::Yes, IsCancelable::Yes, underlyingEvent ? underlyingEvent->timeStamp() : MonotonicTime::now(), WTFMove(view), 0, { }, { },
 #if ENABLE(POINTER_LOCK)
             { },
 #endif
index b094493..225db42 100644 (file)
@@ -72,7 +72,7 @@ TextEvent::TextEvent()
 }
 
 TextEvent::TextEvent(RefPtr<WindowProxy>&& view, const String& data, TextEventInputType inputType)
-    : UIEvent(eventNames().textInputEvent, true, true, WTFMove(view), 0)
+    : UIEvent(eventNames().textInputEvent, CanBubble::Yes, IsCancelable::Yes, WTFMove(view), 0)
     , m_inputType(inputType)
     , m_data(data)
     , m_shouldSmartReplace(false)
@@ -82,7 +82,7 @@ TextEvent::TextEvent(RefPtr<WindowProxy>&& view, const String& data, TextEventIn
 }
 
 TextEvent::TextEvent(RefPtr<WindowProxy>&& view, const String& data, RefPtr<DocumentFragment>&& pastingFragment, bool shouldSmartReplace, bool shouldMatchStyle, MailBlockquoteHandling mailBlockquoteHandling)
-    : UIEvent(eventNames().textInputEvent, true, true, WTFMove(view), 0)
+    : UIEvent(eventNames().textInputEvent, CanBubble::Yes, IsCancelable::Yes, WTFMove(view), 0)
     , m_inputType(TextEventInputPaste)
     , m_data(data)
     , m_pastingFragment(WTFMove(pastingFragment))
@@ -93,7 +93,7 @@ TextEvent::TextEvent(RefPtr<WindowProxy>&& view, const String& data, RefPtr<Docu
 }
 
 TextEvent::TextEvent(RefPtr<WindowProxy>&& view, const String& data, const Vector<DictationAlternative>& dictationAlternatives)
-    : UIEvent(eventNames().textInputEvent, true, true, WTFMove(view), 0)
+    : UIEvent(eventNames().textInputEvent, CanBubble::Yes, IsCancelable::Yes, WTFMove(view), 0)
     , m_inputType(TextEventInputDictation)
     , m_data(data)
     , m_shouldSmartReplace(false)
index 00237cd..292c846 100644 (file)
@@ -36,16 +36,14 @@ namespace WebCore {
 
 TouchEvent::TouchEvent() = default;
 
-TouchEvent::TouchEvent(TouchList* touches, TouchList* targetTouches,
-        TouchList* changedTouches, const AtomicString& type, 
-        RefPtr<WindowProxy>&& view, int screenX, int screenY, int pageX, int pageY,
-        bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
-    : MouseRelatedEvent(type, true, true, MonotonicTime::now(), WTFMove(view), 0, IntPoint(screenX, screenY),
-                        IntPoint(pageX, pageY),
+TouchEvent::TouchEvent(TouchList* touches, TouchList* targetTouches, TouchList* changedTouches, const AtomicString& type,
+    RefPtr<WindowProxy>&& view, int screenX, int screenY, int pageX, int pageY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
+    : MouseRelatedEvent(type, CanBubble::Yes, IsCancelable::Yes, MonotonicTime::now(), WTFMove(view), 0, IntPoint(screenX, screenY),
+        IntPoint(pageX, pageY),
 #if ENABLE(POINTER_LOCK)
-                        IntPoint(0, 0),
+        IntPoint(0, 0),
 #endif
-                        ctrlKey, altKey, shiftKey, metaKey)
+        ctrlKey, altKey, shiftKey, metaKey)
     , m_touches(touches)
     , m_targetTouches(targetTouches)
     , m_changedTouches(changedTouches)
index cf8deb9..5db09b9 100644 (file)
@@ -30,7 +30,7 @@
 namespace WebCore {
 
 TransitionEvent::TransitionEvent(const AtomicString& type, const String& propertyName, double elapsedTime, const String& pseudoElement)
-    : Event(type, true, true)
+    : Event(type, CanBubble::Yes, IsCancelable::Yes)
     , m_propertyName(propertyName)
     , m_elapsedTime(elapsedTime)
     , m_pseudoElement(pseudoElement)
index 0a6f81a..00a00cb 100644 (file)
@@ -32,15 +32,15 @@ UIEvent::UIEvent()
 {
 }
 
-UIEvent::UIEvent(const AtomicString& eventType, bool canBubbleArg, bool cancelableArg, RefPtr<WindowProxy>&& viewArg, int detailArg)
-    : Event(eventType, canBubbleArg, cancelableArg)
+UIEvent::UIEvent(const AtomicString& eventType, CanBubble canBubble, IsCancelable cancelable, RefPtr<WindowProxy>&& viewArg, int detailArg)
+    : Event(eventType, canBubble, cancelable)
     , m_view(WTFMove(viewArg))
     , m_detail(detailArg)
 {
 }
 
-UIEvent::UIEvent(const AtomicString& eventType, bool canBubbleArg, bool cancelableArg, MonotonicTime timestamp, RefPtr<WindowProxy>&& viewArg, int detailArg)
-    : Event(eventType, canBubbleArg, cancelableArg, timestamp)
+UIEvent::UIEvent(const AtomicString& eventType, CanBubble canBubble, IsCancelable cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& viewArg, int detailArg)
+    : Event(eventType, canBubble, cancelable, timestamp)
     , m_view(WTFMove(viewArg))
     , m_detail(detailArg)
 {
index 50f2d17..d5c26a4 100644 (file)
@@ -34,7 +34,7 @@ typedef WindowProxy AbstractView;
 
 class UIEvent : public Event {
 public:
-    static Ref<UIEvent> create(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<WindowProxy>&& view, int detail)
+    static Ref<UIEvent> create(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, RefPtr<WindowProxy>&& view, int detail)
     {
         return adoptRef(*new UIEvent(type, canBubble, cancelable, WTFMove(view), detail));
     }
@@ -65,8 +65,8 @@ public:
 
 protected:
     UIEvent();
-    UIEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<WindowProxy>&&, int detail);
-    UIEvent(const AtomicString& type, bool canBubble, bool cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&&, int detail);
+    UIEvent(const AtomicString& type, CanBubble, IsCancelable, RefPtr<WindowProxy>&&, int detail);
+    UIEvent(const AtomicString& type, CanBubble, IsCancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&&, int detail);
     UIEvent(const AtomicString&, const UIEventInit&, IsTrusted);
 
 private:
index 295c15b..3668364 100644 (file)
@@ -40,7 +40,7 @@ public:
 protected:
     UIEventWithKeyState() = default;
 
-    UIEventWithKeyState(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<WindowProxy>&& view, int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
+    UIEventWithKeyState(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, RefPtr<WindowProxy>&& view, int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
         : UIEvent(type, canBubble, cancelable, WTFMove(view), detail)
         , m_ctrlKey(ctrlKey)
         , m_altKey(altKey)
@@ -49,7 +49,7 @@ protected:
     {
     }
 
-    UIEventWithKeyState(const AtomicString& type, bool canBubble, bool cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& view,
+    UIEventWithKeyState(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& view,
         int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool altGraphKey, bool capsLockKey)
             : UIEvent(type, canBubble, cancelable, timestamp, WTFMove(view), detail)
             , m_ctrlKey(ctrlKey)
index 1b2ab2e..38733f9 100644 (file)
@@ -36,7 +36,7 @@ WebKitAnimationEvent::WebKitAnimationEvent(const AtomicString& type, const Init&
 }
 
 WebKitAnimationEvent::WebKitAnimationEvent(const AtomicString& type, const String& animationName, double elapsedTime)
-    : Event(type, true, true)
+    : Event(type, CanBubble::Yes, IsCancelable::Yes)
     , m_animationName(animationName)
     , m_elapsedTime(elapsedTime)
 {
index 98dce93..dab9bd1 100644 (file)
@@ -29,7 +29,7 @@
 namespace WebCore {
 
 WebKitTransitionEvent::WebKitTransitionEvent(const AtomicString& type, const String& propertyName, double elapsedTime, const String& pseudoElement)
-    : Event(type, true, true)
+    : Event(type, CanBubble::Yes, IsCancelable::Yes)
     , m_propertyName(propertyName)
     , m_elapsedTime(elapsedTime)
     , m_pseudoElement(pseudoElement)
index 537cb19..27677a8 100644 (file)
@@ -48,7 +48,7 @@ inline WheelEvent::WheelEvent(const AtomicString& type, const Init& initializer,
 }
 
 inline WheelEvent::WheelEvent(const PlatformWheelEvent& event, RefPtr<WindowProxy>&& view)
-    : MouseEvent(eventNames().wheelEvent, true, true, event.timestamp().approximateMonotonicTime(), WTFMove(view), 0, event.globalPosition(), event.position()
+    : MouseEvent(eventNames().wheelEvent, CanBubble::Yes, IsCancelable::Yes, event.timestamp().approximateMonotonicTime(), WTFMove(view), 0, event.globalPosition(), event.position()
 #if ENABLE(POINTER_LOCK)
         , { }
 #endif
index 7d26c56..1b20d78 100644 (file)
 
 namespace WebCore {
 
-static bool dispatchBeforeInputEvent(Element& element, const AtomicString& inputType, const String& data = { }, RefPtr<DataTransfer>&& dataTransfer = nullptr, const Vector<RefPtr<StaticRange>>& targetRanges = { }, bool cancelable = true)
+static bool dispatchBeforeInputEvent(Element& element, const AtomicString& inputType, const String& data = { }, RefPtr<DataTransfer>&& dataTransfer = nullptr, const Vector<RefPtr<StaticRange>>& targetRanges = { }, Event::IsCancelable cancelable = Event::IsCancelable::Yes)
 {
     if (!element.document().settings().inputEventsEnabled())
         return true;
 
-    auto event = InputEvent::create(eventNames().beforeinputEvent, inputType, true, cancelable, element.document().windowProxy(), data, WTFMove(dataTransfer), targetRanges, 0);
+    auto event = InputEvent::create(eventNames().beforeinputEvent, inputType, Event::CanBubble::Yes, cancelable, element.document().windowProxy(), data, WTFMove(dataTransfer), targetRanges, 0);
     element.dispatchEvent(event);
     return !event->defaultPrevented();
 }
@@ -127,7 +127,8 @@ static void dispatchInputEvent(Element& element, const AtomicString& inputType,
         // but TypingCommands are special in that existing TypingCommands that are applied again fire input events *from within* the scope by calling typingAddedToOpenCommand.
         // Instead, TypingCommands should always dispatch events synchronously after the end of the scoped queue in CompositeEditCommand::apply. To work around this for the
         // time being, just revert back to calling dispatchScopedEvent.
-        element.dispatchScopedEvent(InputEvent::create(eventNames().inputEvent, inputType, true, false, element.document().windowProxy(), data, WTFMove(dataTransfer), targetRanges, 0));
+        element.dispatchScopedEvent(InputEvent::create(eventNames().inputEvent, inputType, Event::CanBubble::Yes, Event::IsCancelable::No,
+            element.document().windowProxy(), data, WTFMove(dataTransfer), targetRanges, 0));
     } else
         element.dispatchInputEvent();
 }
@@ -1029,7 +1030,7 @@ static void notifyTextFromControls(Element* startRoot, Element* endRoot)
         endingTextControl->didEditInnerTextValue();
 }
 
-static bool dispatchBeforeInputEvents(RefPtr<Element> startRoot, RefPtr<Element> endRoot, const AtomicString& inputTypeName, const String& data = { }, RefPtr<DataTransfer>&& dataTransfer = nullptr, const Vector<RefPtr<StaticRange>>& targetRanges = { }, bool cancelable = true)
+static bool dispatchBeforeInputEvents(RefPtr<Element> startRoot, RefPtr<Element> endRoot, const AtomicString& inputTypeName, const String& data = { }, RefPtr<DataTransfer>&& dataTransfer = nullptr, const Vector<RefPtr<StaticRange>>& targetRanges = { }, Event::IsCancelable cancelable = Event::IsCancelable::Yes)
 {
     bool continueWithDefaultBehavior = true;
     if (startRoot)
@@ -1056,7 +1057,8 @@ bool Editor::willApplyEditing(CompositeEditCommand& command, Vector<RefPtr<Stati
     if (!composition)
         return true;
 
-    return dispatchBeforeInputEvents(composition->startingRootEditableElement(), composition->endingRootEditableElement(), command.inputEventTypeName(), command.inputEventData(), command.inputEventDataTransfer(), targetRanges, command.isBeforeInputEventCancelable());
+    return dispatchBeforeInputEvents(composition->startingRootEditableElement(), composition->endingRootEditableElement(), command.inputEventTypeName(),
+        command.inputEventData(), command.inputEventDataTransfer(), targetRanges, command.isBeforeInputEventCancelable() ? Event::IsCancelable::Yes : Event::IsCancelable::No);
 }
 
 void Editor::appliedEditing(CompositeEditCommand& command)
index 36c79ad..0c838a3 100644 (file)
@@ -353,7 +353,7 @@ bool FrameSelection::setSelectionWithoutUpdatingAppearance(const VisibleSelectio
     m_xPosForVerticalArrowNavigation = NoXPosForVerticalArrowNavigation();
     selectFrameElementInParentIfFullySelected();
     m_frame->editor().respondToChangedSelection(oldSelection, options);
-    m_frame->document()->enqueueDocumentEvent(Event::create(eventNames().selectionchangeEvent, false, false));
+    m_frame->document()->enqueueDocumentEvent(Event::create(eventNames().selectionchangeEvent, Event::CanBubble::No, Event::IsCancelable::No));
 
     return true;
 }
@@ -1965,7 +1965,7 @@ void FrameSelection::selectAll()
         return;
 
     if (selectStartTarget) {
-        auto event = Event::create(eventNames().selectstartEvent, true, true);
+        auto event = Event::create(eventNames().selectstartEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes);
         selectStartTarget->dispatchEvent(event);
         if (event->defaultPrevented())
             return;
@@ -2425,7 +2425,7 @@ bool FrameSelection::dispatchSelectStart()
     if (!selectStartTarget)
         return true;
 
-    auto event = Event::create(eventNames().selectstartEvent, true, true);
+    auto event = Event::create(eventNames().selectstartEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes);
     selectStartTarget->dispatchEvent(event);
     return !event->defaultPrevented();
 }
index 7f975f6..3aac194 100644 (file)
@@ -142,7 +142,7 @@ bool HTMLDetailsElement::isActiveSummary(const HTMLSummaryElement& summary) cons
 void HTMLDetailsElement::dispatchPendingEvent(DetailEventSender* eventSender)
 {
     ASSERT_UNUSED(eventSender, eventSender == &detailToggleEventSender());
-    dispatchEvent(Event::create(eventNames().toggleEvent, false, false));
+    dispatchEvent(Event::create(eventNames().toggleEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 void HTMLDetailsElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
index c092b82..05c62bd 100644 (file)
@@ -317,7 +317,7 @@ void HTMLFormControlElement::setChangedSinceLastFormControlChangeEvent(bool chan
 
 void HTMLFormControlElement::dispatchChangeEvent()
 {
-    dispatchScopedEvent(Event::create(eventNames().changeEvent, true, false));
+    dispatchScopedEvent(Event::create(eventNames().changeEvent, Event::CanBubble::Yes, Event::IsCancelable::No));
 }
 
 void HTMLFormControlElement::dispatchFormControlChangeEvent()
@@ -474,7 +474,7 @@ bool HTMLFormControlElement::checkValidity(Vector<RefPtr<HTMLFormControlElement>
     // An event handler can deref this object.
     Ref<HTMLFormControlElement> protectedThis(*this);
     Ref<Document> originalDocument(document());
-    auto event = Event::create(eventNames().invalidEvent, false, true);
+    auto event = Event::create(eventNames().invalidEvent, Event::CanBubble::No, Event::IsCancelable::Yes);
     dispatchEvent(event);
     if (!event->defaultPrevented() && unhandledInvalidControls && isConnected() && originalDocument.ptr() == &document())
         unhandledInvalidControls->append(this);
index d0fe7d0..bf21502 100644 (file)
@@ -283,7 +283,7 @@ void HTMLFormElement::prepareForSubmission(Event& event)
 
     auto protectedThis = makeRef(*this);
 
-    auto submitEvent = Event::create(eventNames().submitEvent, true, true);
+    auto submitEvent = Event::create(eventNames().submitEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes);
     dispatchEvent(submitEvent);
 
     // Event handling could have resulted in m_shouldSubmit becoming true as a side effect, too.
@@ -380,7 +380,7 @@ void HTMLFormElement::reset()
 
     SetForScope<bool> isInResetFunctionRestorer(m_isInResetFunction, true);
 
-    auto event = Event::create(eventNames().resetEvent, true, true);
+    auto event = Event::create(eventNames().resetEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes);
     dispatchEvent(event);
     if (!event->defaultPrevented())
         resetAssociatedFormControlElements();
index 52d4c20..cadd5cb 100644 (file)
@@ -58,7 +58,7 @@ void HTMLImageLoader::dispatchLoadEvent()
     bool errorOccurred = image()->errorOccurred();
     if (!errorOccurred && image()->response().httpStatusCode() >= 400)
         errorOccurred = is<HTMLObjectElement>(element()); // An <object> considers a 404 to be an error and should fire onerror.
-    element().dispatchEvent(Event::create(errorOccurred ? eventNames().errorEvent : eventNames().loadEvent, false, false));
+    element().dispatchEvent(Event::create(errorOccurred ? eventNames().errorEvent : eventNames().loadEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 String HTMLImageLoader::sourceURI(const AtomicString& attr) const
index 724de1d..91bae95 100644 (file)
@@ -1484,7 +1484,7 @@ void HTMLInputElement::onSearch()
 
     if (m_inputType)
         downcast<SearchInputType>(*m_inputType.get()).stopSearchEventTimer();
-    dispatchEvent(Event::create(eventNames().searchEvent, true, false));
+    dispatchEvent(Event::create(eventNames().searchEvent, Event::CanBubble::Yes, Event::IsCancelable::No));
 }
 
 void HTMLInputElement::resumeFromDocumentSuspension()
index f9ce07a..ba52d29 100644 (file)
@@ -495,9 +495,9 @@ void HTMLLinkElement::dispatchPendingEvent(LinkEventSender* eventSender)
 {
     ASSERT_UNUSED(eventSender, eventSender == &linkLoadEventSender() || eventSender == &linkErrorEventSender());
     if (m_loadedResource)
-        dispatchEvent(Event::create(eventNames().loadEvent, false, false));
+        dispatchEvent(Event::create(eventNames().loadEvent, Event::CanBubble::No, Event::IsCancelable::No));
     else
-        dispatchEvent(Event::create(eventNames().errorEvent, false, false));
+        dispatchEvent(Event::create(eventNames().errorEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 DOMTokenList& HTMLLinkElement::relList()
index 90d34d0..3588a72 100644 (file)
@@ -1091,7 +1091,7 @@ void HTMLMediaElement::mediaPlayerActiveSourceBuffersChanged(const MediaPlayer*)
 
 void HTMLMediaElement::scheduleEvent(const AtomicString& eventName)
 {
-    RefPtr<Event> event = Event::create(eventName, false, true);
+    RefPtr<Event> event = Event::create(eventName, Event::CanBubble::No, Event::IsCancelable::Yes);
 
     // Don't set the event target, the event queue will set it in GenericEventQueue::timerFired and setting it here
     // will trigger an ASSERT if this element has been marked for deletion.
@@ -1137,7 +1137,7 @@ void HTMLMediaElement::notifyAboutPlaying(PlayPromiseVector&& pendingPlayPromise
     Ref<HTMLMediaElement> protectedThis(*this); // The 'playing' event can make arbitrary DOM mutations.
     m_playbackStartedTime = currentMediaTime().toDouble();
     m_hasEverNotifiedAboutPlaying = true;
-    dispatchEvent(Event::create(eventNames().playingEvent, false, true));
+    dispatchEvent(Event::create(eventNames().playingEvent, Event::CanBubble::No, Event::IsCancelable::Yes));
     resolvePendingPlayPromises(WTFMove(pendingPlayPromises));
 
     schedulePlaybackControlsManagerUpdate();
@@ -1897,19 +1897,19 @@ void HTMLMediaElement::updateActiveTextTrackCues(const MediaTime& movieTime)
         // correctly identifies the type of the event, if the startTime is
         // less than the endTime in the cue.
         if (eventTask.second->startTime() >= eventTask.second->endTime()) {
-            auto enterEvent = Event::create(eventNames().enterEvent, false, false);
+            auto enterEvent = Event::create(eventNames().enterEvent, Event::CanBubble::No, Event::IsCancelable::No);
             enterEvent->setTarget(eventTask.second);
             m_asyncEventQueue.enqueueEvent(WTFMove(enterEvent));
 
-            auto exitEvent = Event::create(eventNames().exitEvent, false, false);
+            auto exitEvent = Event::create(eventNames().exitEvent, Event::CanBubble::No, Event::IsCancelable::No);
             exitEvent->setTarget(eventTask.second);
             m_asyncEventQueue.enqueueEvent(WTFMove(exitEvent));
         } else {
             RefPtr<Event> event;
             if (eventTask.first == eventTask.second->startMediaTime())
-                event = Event::create(eventNames().enterEvent, false, false);
+                event = Event::create(eventNames().enterEvent, Event::CanBubble::No, Event::IsCancelable::No);
             else
-                event = Event::create(eventNames().exitEvent, false, false);
+                event = Event::create(eventNames().exitEvent, Event::CanBubble::No, Event::IsCancelable::No);
             event->setTarget(eventTask.second);
             m_asyncEventQueue.enqueueEvent(WTFMove(event));
         }
@@ -1922,14 +1922,14 @@ void HTMLMediaElement::updateActiveTextTrackCues(const MediaTime& movieTime)
     // 15 - For each text track in affected tracks, in the list order, queue a
     // task to fire a simple event named cuechange at the TextTrack object, and, ...
     for (auto& affectedTrack : affectedTracks) {
-        auto event = Event::create(eventNames().cuechangeEvent, false, false);
+        auto event = Event::create(eventNames().cuechangeEvent, Event::CanBubble::No, Event::IsCancelable::No);
         event->setTarget(affectedTrack);
         m_asyncEventQueue.enqueueEvent(WTFMove(event));
 
         // ... if the text track has a corresponding track element, to then fire a
         // simple event named cuechange at the track element as well.
         if (is<LoadableTextTrack>(*affectedTrack)) {
-            auto event = Event::create(eventNames().cuechangeEvent, false, false);
+            auto event = Event::create(eventNames().cuechangeEvent, Event::CanBubble::No, Event::IsCancelable::No);
             auto trackElement = makeRefPtr(downcast<LoadableTextTrack>(*affectedTrack).trackElement());
             ASSERT(trackElement);
             event->setTarget(trackElement);
@@ -4395,7 +4395,7 @@ void HTMLMediaElement::layoutSizeChanged()
     if (auto frameView = makeRefPtr(document().view())) {
         auto task = [this, protectedThis = makeRef(*this)] {
             if (auto root = userAgentShadowRoot())
-                root->dispatchEvent(Event::create("resize", false, false));
+                root->dispatchEvent(Event::create("resize", Event::CanBubble::No, Event::IsCancelable::No));
         };
         frameView->queuePostLayoutCallback(WTFMove(task));
     }
index 136259a..3213c44 100644 (file)
@@ -612,7 +612,7 @@ void HTMLPlugInImageElement::checkSnapshotStatus()
     }
     
     // Notify the shadow root that the size changed so that we may update the overlay layout.
-    ensureUserAgentShadowRoot().dispatchEvent(Event::create(eventNames().resizeEvent, true, false));
+    ensureUserAgentShadowRoot().dispatchEvent(Event::create(eventNames().resizeEvent, Event::CanBubble::Yes, Event::IsCancelable::No));
 }
     
 void HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn(const URL& url)
index e0e6bf6..6061098 100644 (file)
@@ -176,7 +176,7 @@ void HTMLScriptElement::dispatchLoadEvent()
     ASSERT(!haveFiredLoadEvent());
     setHaveFiredLoadEvent(true);
 
-    dispatchEvent(Event::create(eventNames().loadEvent, false, false));
+    dispatchEvent(Event::create(eventNames().loadEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 Ref<Element> HTMLScriptElement::cloneElementWithoutAttributesAndChildren(Document& targetDocument)
index 1688887..89da68a 100644 (file)
@@ -142,9 +142,7 @@ void HTMLSlotElement::dispatchSlotChangeEvent()
 {
     m_inSignalSlotList = false;
 
-    bool bubbles = true;
-    bool cancelable = false;
-    Ref<Event> event = Event::create(eventNames().slotchangeEvent, bubbles, cancelable);
+    Ref<Event> event = Event::create(eventNames().slotchangeEvent, Event::CanBubble::Yes, Event::IsCancelable::No);
     event->setTarget(this);
     dispatchEvent(event);
 }
index 7d66df9..d3e88d3 100644 (file)
@@ -115,7 +115,7 @@ void HTMLSourceElement::cancelPendingErrorEvent()
 void HTMLSourceElement::errorEventTimerFired()
 {
     LOG(Media, "HTMLSourceElement::errorEventTimerFired - %p", this);
-    dispatchEvent(Event::create(eventNames().errorEvent, false, true));
+    dispatchEvent(Event::create(eventNames().errorEvent, Event::CanBubble::No, Event::IsCancelable::Yes));
 }
 
 bool HTMLSourceElement::isURLAttribute(const Attribute& attribute) const
index 14ea570..a233ace 100644 (file)
@@ -130,9 +130,9 @@ void HTMLStyleElement::dispatchPendingEvent(StyleEventSender* eventSender)
 {
     ASSERT_UNUSED(eventSender, eventSender == &styleLoadEventSender());
     if (m_loadedSheet)
-        dispatchEvent(Event::create(eventNames().loadEvent, false, false));
+        dispatchEvent(Event::create(eventNames().loadEvent, Event::CanBubble::No, Event::IsCancelable::No));
     else
-        dispatchEvent(Event::create(eventNames().errorEvent, false, false));
+        dispatchEvent(Event::create(eventNames().errorEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 void HTMLStyleElement::notifyLoadedSheetAndAllCriticalSubresources(bool errorOccurred)
index 85644fb..94eab76 100644 (file)
@@ -490,7 +490,7 @@ void HTMLTextFormControlElement::selectionChanged(bool shouldFireSelectEvent)
     cacheSelection(computeSelectionStart(), computeSelectionEnd(), computeSelectionDirection());
     
     if (shouldFireSelectEvent && m_cachedSelectionStart != m_cachedSelectionEnd)
-        dispatchEvent(Event::create(eventNames().selectEvent, true, false));
+        dispatchEvent(Event::create(eventNames().selectEvent, Event::CanBubble::Yes, Event::IsCancelable::No));
 }
 
 void HTMLTextFormControlElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
index 7cd0c92..011c16d 100644 (file)
@@ -247,7 +247,7 @@ void HTMLTrackElement::didCompleteLoad(LoadStatus status)
 
     if (status == Failure) {
         setReadyState(HTMLTrackElement::TRACK_ERROR);
-        dispatchEvent(Event::create(eventNames().errorEvent, false, false));
+        dispatchEvent(Event::create(eventNames().errorEvent, Event::CanBubble::No, Event::IsCancelable::No));
         return;
     }
 
@@ -258,7 +258,7 @@ void HTMLTrackElement::didCompleteLoad(LoadStatus status)
 
     //     2. If the file was successfully processed, fire a simple event named load at the 
     //        track element.
-    dispatchEvent(Event::create(eventNames().loadEvent, false, false));
+    dispatchEvent(Event::create(eventNames().loadEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 // NOTE: The values in the TextTrack::ReadinessState enum must stay in sync with those in HTMLTrackElement::ReadyState.
index d45d17a..ea84c1f 100644 (file)
@@ -532,7 +532,7 @@ bool MediaController::hasEnded() const
 
 void MediaController::scheduleEvent(const AtomicString& eventName)
 {
-    m_pendingEvents.append(Event::create(eventName, false, true));
+    m_pendingEvents.append(Event::create(eventName, Event::CanBubble::No, Event::IsCancelable::Yes));
     if (!m_asyncEventTimer.isActive())
         m_asyncEventTimer.startOneShot(0_s);
 }
index e018b9c..41a6ea6 100644 (file)
@@ -30,7 +30,7 @@
 
 namespace WebCore {
 
-WebGLContextEvent::WebGLContextEvent(const AtomicString& type, bool canBubble, bool cancelable, const String& statusMessage)
+WebGLContextEvent::WebGLContextEvent(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, const String& statusMessage)
     : Event(type, canBubble, cancelable)
     , m_statusMessage(statusMessage)
 {
index 4ba1ba4..99aad7e 100644 (file)
@@ -31,7 +31,7 @@ namespace WebCore {
 
 class WebGLContextEvent final : public Event {
 public:
-    static Ref<WebGLContextEvent> create(const AtomicString& type, bool canBubble, bool cancelable, const String& statusMessage)
+    static Ref<WebGLContextEvent> create(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, const String& statusMessage)
     {
         return adoptRef(*new WebGLContextEvent(type, canBubble, cancelable, statusMessage));
     }
@@ -51,7 +51,7 @@ public:
     EventInterface eventInterface() const override;
 
 private:
-    WebGLContextEvent(const AtomicString& type, bool canBubble, bool cancelable, const String& statusMessage);
+    WebGLContextEvent(const AtomicString& type, CanBubble, IsCancelable, const String& statusMessage);
     WebGLContextEvent(const AtomicString&, const Init&, IsTrusted);
 
     String m_statusMessage;
index b34933b..cdef7cc 100644 (file)
@@ -538,7 +538,8 @@ std::unique_ptr<WebGLRenderingContextBase> WebGLRenderingContextBase::create(Can
         // The FrameLoaderClient might block creation of a new WebGL context despite the page settings; in
         // particular, if WebGL contexts were lost one or more times via the GL_ARB_robustness extension.
         if (!frame->loader().client().allowWebGL(frame->settings().webGLEnabled())) {
-            canvasElement->dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextcreationerrorEvent, false, true, "Web page was not allowed to create a WebGL context."));
+            canvasElement->dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextcreationerrorEvent,
+                Event::CanBubble::No, Event::IsCancelable::Yes, "Web page was not allowed to create a WebGL context."));
             return nullptr;
         }
 
@@ -601,8 +602,10 @@ std::unique_ptr<WebGLRenderingContextBase> WebGLRenderingContextBase::create(Can
 
     auto context = GraphicsContext3D::create(attributes, hostWindow);
     if (!context || !context->makeContextCurrent()) {
-        if (canvasElement)
-            canvasElement->dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextcreationerrorEvent, false, true, "Could not create a WebGL context."));
+        if (canvasElement) {
+            canvasElement->dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextcreationerrorEvent,
+                Event::CanBubble::No, Event::IsCancelable::Yes, "Could not create a WebGL context."));
+        }
         return nullptr;
     }
 
@@ -6017,7 +6020,7 @@ void WebGLRenderingContextBase::dispatchContextLostEvent()
     if (!canvas)
         return;
 
-    Ref<WebGLContextEvent> event = WebGLContextEvent::create(eventNames().webglcontextlostEvent, false, true, emptyString());
+    Ref<WebGLContextEvent> event = WebGLContextEvent::create(eventNames().webglcontextlostEvent, Event::CanBubble::No, Event::IsCancelable::Yes, emptyString());
     canvas->dispatchEvent(event);
     m_restoreAllowed = event->defaultPrevented();
     if (m_contextLostMode == RealLostContext && m_restoreAllowed)
@@ -6103,7 +6106,7 @@ void WebGLRenderingContextBase::maybeRestoreContext()
     setupFlags();
     initializeNewContext();
     initializeVertexArrayObjects();
-    canvas->dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextrestoredEvent, false, true, emptyString()));
+    canvas->dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextrestoredEvent, Event::CanBubble::No, Event::IsCancelable::Yes, emptyString()));
 }
 
 void WebGLRenderingContextBase::dispatchContextChangedEvent()
@@ -6112,7 +6115,7 @@ void WebGLRenderingContextBase::dispatchContextChangedEvent()
     if (!canvas)
         return;
 
-    canvas->dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextchangedEvent, false, true, emptyString()));
+    canvas->dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextchangedEvent, Event::CanBubble::No, Event::IsCancelable::Yes, emptyString()));
 }
 
 void WebGLRenderingContextBase::simulateContextChanged()
index 1a38b13..a246454 100644 (file)
@@ -85,7 +85,7 @@ static URL documentURLForScriptExecution(Document* document)
 
 inline Ref<Event> createScriptLoadEvent()
 {
-    return Event::create(eventNames().loadEvent, false, false);
+    return Event::create(eventNames().loadEvent, Event::CanBubble::No, Event::IsCancelable::No);
 }
 
 bool HTMLScriptRunner::isPendingScriptReady(const PendingScript& script)
index cbf97a5..15404ac 100644 (file)
@@ -48,7 +48,7 @@ static inline std::optional<TrackEvent::TrackEventTrack> convertToTrackEventTrac
     return std::nullopt;
 }
 
-TrackEvent::TrackEvent(const AtomicString& type, bool canBubble, bool cancelable, Ref<TrackBase>&& track)
+TrackEvent::TrackEvent(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, Ref<TrackBase>&& track)
     : Event(type, canBubble, cancelable)
     , m_track(convertToTrackEventTrack(WTFMove(track)))
 {
index 8432633..61e7ed6 100644 (file)
@@ -38,7 +38,7 @@ class TrackEvent final : public Event {
 public:
     virtual ~TrackEvent();
 
-    static Ref<TrackEvent> create(const AtomicString& type, bool canBubble, bool cancelable, Ref<TrackBase>&& track)
+    static Ref<TrackEvent> create(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, Ref<TrackBase>&& track)
     {
         return adoptRef(*new TrackEvent(type, canBubble, cancelable, WTFMove(track)));
     }
@@ -57,7 +57,7 @@ public:
     std::optional<TrackEventTrack> track() const { return m_track; }
 
 private:
-    TrackEvent(const AtomicString& type, bool canBubble, bool cancelable, Ref<TrackBase>&&);
+    TrackEvent(const AtomicString& type, CanBubble, IsCancelable, Ref<TrackBase>&&);
     TrackEvent(const AtomicString& type, Init&& initializer, IsTrusted);
 
     EventInterface eventInterface() const override;
index 147700f..dd79453 100644 (file)
@@ -95,7 +95,7 @@ bool TrackListBase::contains(TrackBase& track) const
 
 void TrackListBase::scheduleTrackEvent(const AtomicString& eventName, Ref<TrackBase>&& track)
 {
-    m_asyncEventQueue.enqueueEvent(TrackEvent::create(eventName, false, false, WTFMove(track)));
+    m_asyncEventQueue.enqueueEvent(TrackEvent::create(eventName, Event::CanBubble::No, Event::IsCancelable::No, WTFMove(track)));
 }
 
 void TrackListBase::scheduleAddTrackEvent(Ref<TrackBase>&& track)
@@ -158,7 +158,7 @@ void TrackListBase::scheduleChangeEvent()
     // Whenever a track in a VideoTrackList that was previously not selected is
     // selected, the user agent must queue a task to fire a simple event named
     // change at the VideoTrackList object.
-    m_asyncEventQueue.enqueueEvent(Event::create(eventNames().changeEvent, false, false));
+    m_asyncEventQueue.enqueueEvent(Event::create(eventNames().changeEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 bool TrackListBase::isChangeEventScheduled() const
index 4426daf..234749f 100644 (file)
@@ -731,7 +731,7 @@ void DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied(
     InspectorInstrumentation::continueAfterXFrameOptionsDenied(*m_frame, identifier, *this, response);
     m_frame->document()->enforceSandboxFlags(SandboxOrigin);
     if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement())
-        ownerElement->dispatchEvent(Event::create(eventNames().loadEvent, false, false));
+        ownerElement->dispatchEvent(Event::create(eventNames().loadEvent, Event::CanBubble::No, Event::IsCancelable::No));
 
     // The load event might have detached this frame. In that case, the load will already have been cancelled during detach.
     if (FrameLoader* frameLoader = this->frameLoader())
index e2feb9b..92742bc 100644 (file)
@@ -3155,7 +3155,7 @@ void FrameLoader::dispatchUnloadEvents(UnloadEventPolicy unloadEventPolicy)
             // https://bugs.webkit.org/show_bug.cgi?id=116770
 
             if (m_frame.document()->pageCacheState() == Document::NotInPageCache) {
-                Ref<Event> unloadEvent(Event::create(eventNames().unloadEvent, false, false));
+                Ref<Event> unloadEvent(Event::create(eventNames().unloadEvent, Event::CanBubble::No, Event::IsCancelable::No));
                 // The DocumentLoader (and thus its LoadTiming) might get destroyed
                 // while dispatching the event, so protect it to prevent writing the end
                 // time into freed memory.
index b4d588f..3c499aa 100644 (file)
@@ -505,7 +505,7 @@ void ImageLoader::dispatchPendingErrorEvent()
         return;
     m_hasPendingErrorEvent = false;
     if (element().document().hasLivingRenderTree())
-        element().dispatchEvent(Event::create(eventNames().errorEvent, false, false));
+        element().dispatchEvent(Event::create(eventNames().errorEvent, Event::CanBubble::No, Event::IsCancelable::No));
 
     // Only consider updating the protection ref-count of the Element immediately before returning
     // from this function as doing so might result in the destruction of this ImageLoader.
index 4e0eedc..43285d0 100644 (file)
@@ -132,7 +132,7 @@ void PolicyChecker::checkNavigationPolicy(ResourceRequest&& request, const Resou
         if (m_frame.ownerElement()) {
             // Fire a load event (even though we were blocked by CSP) as timing attacks would otherwise
             // reveal that the frame was blocked. This way, it looks like any other cross-origin page load.
-            m_frame.ownerElement()->dispatchEvent(Event::create(eventNames().loadEvent, false, false));
+            m_frame.ownerElement()->dispatchEvent(Event::create(eventNames().loadEvent, Event::CanBubble::No, Event::IsCancelable::No));
         }
         function(WTFMove(request), { }, ShouldContinue::No);
         return;
index bbf088d..755f1a2 100644 (file)
@@ -374,7 +374,7 @@ static Ref<Event> createApplicationCacheEvent(const AtomicString& eventType, int
 {
     if (eventType == eventNames().progressEvent)
         return ProgressEvent::create(eventType, true, done, total);
-    return Event::create(eventType, false, false);
+    return Event::create(eventType, Event::CanBubble::No, Event::IsCancelable::No);
 }
 
 void ApplicationCacheHost::dispatchDOMEvent(const AtomicString& eventType, int total, int done)
index ab53a37..53b2be6 100644 (file)
@@ -307,7 +307,7 @@ void DOMWindow::dispatchAllPendingUnloadEvents()
             continue;
 
         window->dispatchEvent(PageTransitionEvent::create(eventNames().pagehideEvent, false), window->document());
-        window->dispatchEvent(Event::create(eventNames().unloadEvent, false, false), window->document());
+        window->dispatchEvent(Event::create(eventNames().unloadEvent, Event::CanBubble::No, Event::IsCancelable::No), window->document());
 
         window->enableSuddenTermination();
     }
@@ -1989,7 +1989,7 @@ bool DOMWindow::removeEventListener(const AtomicString& eventType, EventListener
 void DOMWindow::languagesChanged()
 {
     if (auto* document = this->document())
-        document->enqueueWindowEvent(Event::create(eventNames().languagechangeEvent, false, false));
+        document->enqueueWindowEvent(Event::create(eventNames().languagechangeEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 void DOMWindow::dispatchLoadEvent()
@@ -2003,7 +2003,7 @@ void DOMWindow::dispatchLoadEvent()
     if (shouldMarkLoadEventTimes)
         protectedLoader->timing().markLoadEventStart();
 
-    dispatchEvent(Event::create(eventNames().loadEvent, false, false), document());
+    dispatchEvent(Event::create(eventNames().loadEvent, Event::CanBubble::No, Event::IsCancelable::No), document());
 
     if (shouldMarkLoadEventTimes)
         protectedLoader->timing().markLoadEventEnd();
@@ -2011,7 +2011,7 @@ void DOMWindow::dispatchLoadEvent()
     // Send a separate load event to the element that owns this frame.
     if (frame()) {
         if (auto* owner = frame()->ownerElement())
-            owner->dispatchEvent(Event::create(eventNames().loadEvent, false, false));
+            owner->dispatchEvent(Event::create(eventNames().loadEvent, Event::CanBubble::No, Event::IsCancelable::No));
     }
 
     InspectorInstrumentation::loadEventFired(frame());
index a8df771..0631a11 100644 (file)
@@ -473,7 +473,7 @@ static inline bool dispatchSelectStart(Node* node)
     if (!node || !node->renderer())
         return true;
 
-    auto event = Event::create(eventNames().selectstartEvent, true, true);
+    auto event = Event::create(eventNames().selectstartEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes);
     node->dispatchEvent(event);
     return !event->defaultPrevented();
 }
@@ -2214,7 +2214,7 @@ bool EventHandler::dispatchDragEvent(const AtomicString& eventType, Element& dra
 
     view->disableLayerFlushThrottlingTemporarilyForInteraction();
     Ref<MouseEvent> me = MouseEvent::create(eventType,
-        true, true, event.timestamp().approximateMonotonicTime(), &m_frame.windowProxy(),
+        Event::CanBubble::Yes, Event::IsCancelable::Yes, event.timestamp().approximateMonotonicTime(), &m_frame.windowProxy(),
         0, event.globalPosition().x(), event.globalPosition().y(), event.position().x(), event.position().y(),
 #if ENABLE(POINTER_LOCK)
         event.movementDelta().x(), event.movementDelta().y(),
index d881b2e..30859eb 100644 (file)
@@ -140,7 +140,7 @@ void EventSource::scheduleReconnect()
 {
     m_state = CONNECTING;
     m_connectTimer.startOneShot(1_ms * m_reconnectDelay);
-    dispatchEvent(Event::create(eventNames().errorEvent, false, false));
+    dispatchEvent(Event::create(eventNames().errorEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 void EventSource::close()
@@ -196,13 +196,13 @@ void EventSource::didReceiveResponse(unsigned long, const ResourceResponse& resp
 
     if (!responseIsValid(response)) {
         m_loader->cancel();
-        dispatchEvent(Event::create(eventNames().errorEvent, false, false));
+        dispatchEvent(Event::create(eventNames().errorEvent, Event::CanBubble::No, Event::IsCancelable::No));
         return;
     }
 
     m_eventStreamOrigin = SecurityOriginData::fromURL(response.url()).toString();
     m_state = OPEN;
-    dispatchEvent(Event::create(eventNames().openEvent, false, false));
+    dispatchEvent(Event::create(eventNames().openEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 void EventSource::didReceiveData(const char* data, int length)
@@ -264,7 +264,7 @@ void EventSource::abortConnectionAttempt()
     }
 
     ASSERT(m_state == CLOSED);
-    dispatchEvent(Event::create(eventNames().errorEvent, false, false));
+    dispatchEvent(Event::create(eventNames().errorEvent, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 void EventSource::parseEventStream()
index 83ad52e..d7fd42e 100644 (file)
@@ -278,7 +278,7 @@ static inline void dispatchEventsOnWindowAndFocusedElement(Document* document, b
 
     if (!focused && document->focusedElement())
         document->focusedElement()->dispatchBlurEvent(nullptr);
-    document->dispatchWindowEvent(Event::create(focused ? eventNames().focusEvent : eventNames().blurEvent, false, false));
+    document->dispatchWindowEvent(Event::create(focused ? eventNames().focusEvent : eventNames().blurEvent, Event::CanBubble::No, Event::IsCancelable::No));
     if (focused && document->focusedElement())
         document->focusedElement()->dispatchFocusEvent(nullptr, FocusDirectionNone);
 }
@@ -331,12 +331,12 @@ void FocusController::setFocusedFrame(Frame* frame)
     // Now that the frame is updated, fire events and update the selection focused states of both frames.
     if (oldFrame && oldFrame->view()) {
         oldFrame->selection().setFocused(false);
-        oldFrame->document()->dispatchWindowEvent(Event::create(eventNames().blurEvent, false, false));
+        oldFrame->document()->dispatchWindowEvent(Event::create(eventNames().blurEvent, Event::CanBubble::No, Event::IsCancelable::No));
     }
 
     if (newFrame && newFrame->view() && isFocused()) {
         newFrame->selection().setFocused(true);
-        newFrame->document()->dispatchWindowEvent(Event::create(eventNames().focusEvent, false, false));
+        newFrame->document()->dispatchWindowEvent(Event::create(eventNames().focusEvent, Event::CanBubble::No, Event::IsCancelable::No));
     }
 
     m_page.chrome().focusedFrameChanged(newFrame.get());
index dc24c52..eec77f7 100644 (file)
@@ -3323,7 +3323,7 @@ void FrameView::sendResizeEventIfNeeded()
 
     LOG(Events, "FrameView %p sendResizeEventIfNeeded sending resize event, size %dx%d (canSendResizeEventSynchronously %d)", this, currentSize.width(), currentSize.height(), canSendResizeEventSynchronously);
 
-    Ref<Event> resizeEvent = Event::create(eventNames().resizeEvent, false, false);
+    Ref<Event> resizeEvent = Event::create(eventNames().resizeEvent, Event::CanBubble::No, Event::IsCancelable::No);
     if (canSendResizeEventSynchronously)
         frame().document()->dispatchWindowEvent(resizeEvent);
     else {
index 47b8641..8c5a779 100644 (file)
@@ -188,7 +188,7 @@ static void networkStateChanged(bool isOnLine)
     for (auto& frame : frames) {
         if (!frame->document())
             continue;
-        frame->document()->dispatchWindowEvent(Event::create(eventName, false, false));
+        frame->document()->dispatchWindowEvent(Event::create(eventName, Event::CanBubble::No, Event::IsCancelable::No));
     }
 }
 
index 5a9c636..01b1d72 100644 (file)
@@ -215,7 +215,7 @@ void Performance::resourceTimingBufferFullTimerFired()
         ASSERT(m_backupResourceTimingBuffer.isEmpty());
 
         m_resourceTimingBufferFullFlag = true;
-        dispatchEvent(Event::create(eventNames().resourcetimingbufferfullEvent, true, false));
+        dispatchEvent(Event::create(eventNames().resourcetimingbufferfullEvent, Event::CanBubble::Yes, Event::IsCancelable::No));
 
         if (m_resourceTimingBufferFullFlag) {
             for (auto& entry : backupBuffer)
index d70f0dd..4926394 100644 (file)
@@ -207,7 +207,7 @@ void PointerLockController::enqueueEvent(const AtomicString& type, Element* elem
 void PointerLockController::enqueueEvent(const AtomicString& type, Document* document)
 {
     if (document)
-        document->enqueueDocumentEvent(Event::create(type, true, false));
+        document->enqueueDocumentEvent(Event::create(type, Event::CanBubble::Yes, Event::IsCancelable::No));
 }
 
 } // namespace WebCore
index 21c1c3f..e5a138a 100644 (file)
@@ -180,9 +180,7 @@ void VisualViewport::enqueueResizeEvent()
     if (!m_frame)
         return;
 
-    bool bubbles = false;
-    bool cancelable = false;
-    m_frame->document()->eventQueue().enqueueResizeEvent(*this, bubbles, cancelable);
+    m_frame->document()->eventQueue().enqueueResizeEvent(*this, Event::CanBubble::No, Event::IsCancelable::No);
 }
 
 void VisualViewport::enqueueScrollEvent()
@@ -190,9 +188,7 @@ void VisualViewport::enqueueScrollEvent()
     if (!m_frame)
         return;
 
-    bool bubbles = false;
-    bool cancelable = false;
-    m_frame->document()->eventQueue().enqueueScrollEvent(*this, bubbles, cancelable);
+    m_frame->document()->eventQueue().enqueueScrollEvent(*this, Event::CanBubble::No, Event::IsCancelable::No);
 }
 
 } // namespace WebCore
index f09b14f..c7068af 100644 (file)
@@ -50,7 +50,7 @@ Ref<StorageEvent> StorageEvent::create(const AtomicString& type, const Init& ini
 }
 
 StorageEvent::StorageEvent(const AtomicString& type, const String& key, const String& oldValue, const String& newValue, const String& url, Storage* storageArea)
-    : Event(type, false, false)
+    : Event(type, CanBubble::No, IsCancelable::No)
     , m_key(key)
     , m_oldValue(oldValue)
     , m_newValue(newValue)
index fd59656..6094fc0 100644 (file)
@@ -603,7 +603,7 @@ void SVGElement::sendSVGLoadEventIfPossible(bool sendParentLoadEvents)
         if (sendParentLoadEvents)
             parent = currentTarget->parentOrShadowHostElement(); // save the next parent to dispatch too incase dispatching the event changes the tree
         if (hasLoadListener(currentTarget.get()))
-            currentTarget->dispatchEvent(Event::create(eventNames().loadEvent, false, false));
+            currentTarget->dispatchEvent(Event::create(eventNames().loadEvent, Event::CanBubble::No, Event::IsCancelable::No));
         currentTarget = (parent && parent->isSVGElement()) ? static_pointer_cast<SVGElement>(parent) : RefPtr<SVGElement>();
         SVGElement* element = currentTarget.get();
         if (!element || !element->isOutermostSVGSVGElement())
index 3276882..99996e0 100644 (file)
@@ -39,7 +39,7 @@ SVGImageLoader::~SVGImageLoader() = default;
 void SVGImageLoader::dispatchLoadEvent()
 {
     if (image()->errorOccurred())
-        element().dispatchEvent(Event::create(eventNames().errorEvent, false, false));
+        element().dispatchEvent(Event::create(eventNames().errorEvent, Event::CanBubble::No, Event::IsCancelable::No));
     else {
         if (downcast<SVGImageElement>(element()).externalResourcesRequired())
             downcast<SVGImageElement>(ImageLoader::element()).sendSVGLoadEventIfPossible(true);
index f7e2344..3aa4cd7 100644 (file)
@@ -559,7 +559,7 @@ void SVGUseElement::notifyFinished(CachedResource& resource)
     ASSERT(ScriptDisallowedScope::InMainThread::isScriptAllowed());
     invalidateShadowTree();
     if (resource.errorOccurred())
-        dispatchEvent(Event::create(eventNames().errorEvent, false, false));
+        dispatchEvent(Event::create(eventNames().errorEvent, Event::CanBubble::No, Event::IsCancelable::No));
     else if (!resource.wasCanceled())
         SVGExternalResourcesRequired::dispatchLoadEvent();
 }
index f508613..e5af76c 100644 (file)
@@ -1222,7 +1222,7 @@ void SVGSMILElement::dispatchPendingEvent(SMILEventSender* eventSender)
 {
     ASSERT(eventSender == &smilBeginEventSender() || eventSender == &smilEndEventSender());
     const AtomicString& eventType = eventSender->eventType();
-    dispatchEvent(Event::create(eventType, false, false));
+    dispatchEvent(Event::create(eventType, Event::CanBubble::No, Event::IsCancelable::No));
 }
 
 }
index 3824474..409ee1a 100644 (file)
@@ -181,7 +181,7 @@ void Worker::notifyFinished()
     PAL::SessionID sessionID = context ? context->sessionID() : PAL::SessionID();
 
     if (m_scriptLoader->failed() || !sessionID.isValid())
-        dispatchEvent(Event::create(eventNames().errorEvent, false, true));
+        dispatchEvent(Event::create(eventNames().errorEvent, Event::CanBubble::No, Event::IsCancelable::Yes));
     else {
         bool isOnline = platformStrategies()->loaderStrategy()->isOnLine();
         const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders = m_contentSecurityPolicyResponseHeaders ? m_contentSecurityPolicyResponseHeaders.value() : scriptExecutionContext()->contentSecurityPolicy()->responseHeaders();
index 1540d77..f366462 100644 (file)
@@ -227,7 +227,7 @@ void WorkerMessagingProxy::notifyNetworkStateChange(bool isOnline)
     m_workerThread->runLoop().postTask([isOnline] (ScriptExecutionContext& context) {
         auto& globalScope = downcast<WorkerGlobalScope>(context);
         globalScope.setIsOnline(isOnline);
-        globalScope.dispatchEvent(Event::create(isOnline ? eventNames().onlineEvent : eventNames().offlineEvent, false, false));
+        globalScope.dispatchEvent(Event::create(isOnline ? eventNames().onlineEvent : eventNames().offlineEvent, Event::CanBubble::No, Event::IsCancelable::No));
     });
 }
 
index e219561..79679f9 100644 (file)
@@ -39,8 +39,8 @@ ExtendableEvent::ExtendableEvent(const AtomicString& type, const ExtendableEvent
 {
 }
 
-ExtendableEvent::ExtendableEvent(const AtomicString& type, bool bubbles, bool cancelable)
-    : Event(type, bubbles, cancelable)
+ExtendableEvent::ExtendableEvent(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable)
+    : Event(type, canBubble, cancelable)
 {
 }
 
index 9038caa..baaf13e 100644 (file)
@@ -53,7 +53,7 @@ public:
 
 protected:
     WEBCORE_EXPORT ExtendableEvent(const AtomicString&, const ExtendableEventInit&, IsTrusted);
-    ExtendableEvent(const AtomicString&, bool bubbles, bool cancelable);
+    ExtendableEvent(const AtomicString&, CanBubble, IsCancelable);
 
     void addExtendLifetimePromise(Ref<DOMPromise>&&);
 
index 280ca6a..efbcab4 100644 (file)
@@ -48,7 +48,7 @@ ExtendableMessageEvent::ExtendableMessageEvent(JSC::ExecState& state, const Atom
 }
 
 ExtendableMessageEvent::ExtendableMessageEvent(RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, std::optional<ExtendableMessageEventSource>&& source, Vector<RefPtr<MessagePort>>&& ports)
-    : ExtendableEvent(eventNames().messageEvent, false, false)
+    : ExtendableEvent(eventNames().messageEvent, CanBubble::No, IsCancelable::No)
     , m_data(WTFMove(data))
     , m_origin(origin)
     , m_lastEventId(lastEventId)
index c2799f8..22b4ee6 100644 (file)
@@ -86,7 +86,7 @@ void ServiceWorker::scheduleTaskToUpdateState(State state)
         m_data.state = state;
         if (state != State::Installing && !m_isStopped) {
             ASSERT(m_pendingActivityForEventDispatch);
-            dispatchEvent(Event::create(eventNames().statechangeEvent, false, false));
+            dispatchEvent(Event::create(eventNames().statechangeEvent, Event::CanBubble::No, Event::IsCancelable::No));
         }
 
         updatePendingActivityForEventDispatch();
index 12313af..40d40da 100644 (file)
@@ -611,7 +611,7 @@ void ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent()
         if (m_isStopped)
             return;
 
-        dispatchEvent(Event::create(eventNames().controllerchangeEvent, false, false));
+        dispatchEvent(Event::create(eventNames().controllerchangeEvent, Event::CanBubble::No, Event::IsCancelable::No));
     });
 }
 
index 8fea629..ad73fa3 100644 (file)
@@ -215,7 +215,7 @@ void ServiceWorkerRegistration::scheduleTaskToFireUpdateFoundEvent()
         REGISTRATION_RELEASE_LOG_IF_ALLOWED("scheduleTaskToFireUpdateFoundEvent: Firing updatefound event for registration %llu", identifier().toUInt64());
 
         ASSERT(m_pendingActivityForEventDispatch);
-        dispatchEvent(Event::create(eventNames().updatefoundEvent, false, false));
+        dispatchEvent(Event::create(eventNames().updatefoundEvent, Event::CanBubble::No, Event::IsCancelable::No));
     });
 }
 
index c1469ad..72da981 100644 (file)
@@ -181,7 +181,7 @@ void ServiceWorkerThreadProxy::notifyNetworkStateChange(bool isOnline)
     postTaskForModeToWorkerGlobalScope([isOnline] (ScriptExecutionContext& context) {
         auto& globalScope = downcast<WorkerGlobalScope>(context);
         globalScope.setIsOnline(isOnline);
-        globalScope.dispatchEvent(Event::create(isOnline ? eventNames().onlineEvent : eventNames().offlineEvent, false, false));
+        globalScope.dispatchEvent(Event::create(isOnline ? eventNames().onlineEvent : eventNames().offlineEvent, Event::CanBubble::No, Event::IsCancelable::No));
     }, WorkerRunLoop::defaultMode());
 }
 
index 7e6d191..fc1ab20 100644 (file)
@@ -302,8 +302,10 @@ void XMLHttpRequest::callReadyStateChangeListener()
     // Check whether sending load and loadend events before sending readystatechange event, as it may change m_error/m_state values.
     bool shouldSendLoadEvent = (m_state == DONE && !m_error);
 
-    if (m_async || (m_state <= OPENED || m_state == DONE))
-        m_progressEventThrottle.dispatchReadyStateChangeEvent(Event::create(eventNames().readystatechangeEvent, false, false), m_state == DONE ? FlushProgressEvent : DoNotFlushProgressEvent);
+    if (m_async || (m_state <= OPENED || m_state == DONE)) {
+        m_progressEventThrottle.dispatchReadyStateChangeEvent(Event::create(eventNames().readystatechangeEvent, Event::CanBubble::No, Event::IsCancelable::No),
+            m_state == DONE ? FlushProgressEvent : DoNotFlushProgressEvent);
+    }
 
     if (shouldSendLoadEvent) {
         m_progressEventThrottle.dispatchProgressEvent(eventNames().loadEvent);
index 9a0427e..ac352a4 100644 (file)
@@ -1,3 +1,13 @@
+2018-08-16  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Replace canBubble and cancelable booleans in Event by enum classes
+        https://bugs.webkit.org/show_bug.cgi?id=188692
+
+        Reviewed by Alex Christensen.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
+
 2018-08-17  Andy Estes  <aestes@apple.com>
 
         [Xcode] Fix up file reference paths in Source/WebKit/NetworkProcess
index 2ba98b6..dff88dc 100644 (file)
@@ -1333,7 +1333,8 @@ void WebPage::navigateToPDFLinkWithSimulatedClick(const String& url, IntPoint do
         return;
 
     const int singleClick = 1;
-    RefPtr<MouseEvent> mouseEvent = MouseEvent::create(eventNames().clickEvent, true, true, MonotonicTime::now(), nullptr, singleClick, screenPoint.x(), screenPoint.y(), documentPoint.x(), documentPoint.y(),
+    RefPtr<MouseEvent> mouseEvent = MouseEvent::create(eventNames().clickEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes,
+        MonotonicTime::now(), nullptr, singleClick, screenPoint.x(), screenPoint.y(), documentPoint.x(), documentPoint.y(),
 #if ENABLE(POINTER_LOCK)
         0, 0,
 #endif
index 9e05282..2fe7fe9 100644 (file)
@@ -1,3 +1,13 @@
+2018-08-16  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Replace canBubble and cancelable booleans in Event by enum classes
+        https://bugs.webkit.org/show_bug.cgi?id=188692
+
+        Reviewed by Alex Christensen.
+
+        * WebView/WebPDFViewPlaceholder.mm:
+        (-[WebPDFViewPlaceholder simulateClickOnLinkToURL:]):
+
 2018-08-13  Alex Christensen  <achristensen@webkit.org>
 
         Use a 1-byte enum class for TextDirection
index 29d1e46..6332a80 100644 (file)
@@ -479,7 +479,7 @@ static const float PAGE_HEIGHT_INSET = 4.0f * 2.0f;
         return;
 
     // Construct an event to simulate a click.
-    RefPtr<Event> event = MouseEvent::create(eventNames().clickEvent, true, true, MonotonicTime::now(), 0, 1, 0, 0, 0, 0,
+    RefPtr<Event> event = MouseEvent::create(eventNames().clickEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes, MonotonicTime::now(), 0, 1, 0, 0, 0, 0,
 #if ENABLE(POINTER_LOCK)
         0, 0,
 #endif
index 2739595..582bfc9 100644 (file)
@@ -1,3 +1,15 @@
+2018-08-16  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Replace canBubble and cancelable booleans in Event by enum classes
+        https://bugs.webkit.org/show_bug.cgi?id=188692
+
+        Reviewed by Alex Christensen.
+
+        * WebView/WebPDFView.mm:
+        (-[WebPDFView PDFViewWillClickOnLink:withURL:]):
+        * WebView/WebView.mm:
+        (-[WebView _dispatchUnloadEvent]):
+
 2018-08-16  Jer Noble  <jer.noble@apple.com>
 
         Add Experimental Feature support for SourceBuffer.changeType()
index 9ab2338..ceb9390 100644 (file)
@@ -1030,7 +1030,7 @@ static BOOL isFrameInRange(WebFrame *frame, DOMRange *range)
         break;
     }
     if (button != noButton) {
-        event = MouseEvent::create(eventNames().clickEvent, true, true, MonotonicTime::now(), 0, [nsEvent clickCount], 0, 0, 0, 0,
+        event = MouseEvent::create(eventNames().clickEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes, MonotonicTime::now(), 0, [nsEvent clickCount], 0, 0, 0, 0,
 #if ENABLE(POINTER_LOCK)
             0, 0,
 #endif
index 7923346..5617fb7 100644 (file)
@@ -2144,7 +2144,7 @@ static NSMutableSet *knownPluginMIMETypes()
         if (coreMainFrame) {
             Document *document = coreMainFrame->document();
             if (document)
-                document->dispatchWindowEvent(Event::create(eventNames().unloadEvent, false, false));
+                document->dispatchWindowEvent(Event::create(eventNames().unloadEvent, Event::CanBubble::No, Event::IsCancelable::No));
         }
     });
 }