Changeset 196400 in webkit


Ignore:
Timestamp:
Feb 10, 2016, 4:03:11 PM (10 years ago)
Author:
jiewen_tan@apple.com
Message:

Rename *Event::create* which creates events for bindings to *Event::createForBindings* and cleanup corresponding paths
https://bugs.webkit.org/show_bug.cgi?id=153903
<rdar://problem/24518146>

Reviewed by Darin Adler.

Source/WebCore:

Rename Event::create(const AtomicString&, const EventInit&) to Event::createForBindings
(const AtomicString&, const EventInit&) and for all the subclasses as well in order to
support Event.isTrusted. Besides, some of the subclasses use the create method for bindings
to create events not for bindings and vice versa. Therefore, this patch also cleanup
corresponding paths to ensure no misuse of the create mehtod. The same for Event::create()
as it is combined with Event::initEvent to create an event for bindings for legacy content.

After this patch, all call sites of *Event::create* are supposed to use *Event::create
to create events for user agent and *Event::createForBindings for bindings.

No change in behavior.

  • Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:

(WebCore::WebKitPlaybackTargetAvailabilityEvent::create):
(WebCore::WebKitPlaybackTargetAvailabilityEvent::createForBindings):
(WebCore::WebKitPlaybackTargetAvailabilityEventInit::WebKitPlaybackTargetAvailabilityEventInit): Deleted.

  • Modules/encryptedmedia/MediaKeyMessageEvent.cpp:

(WebCore::MediaKeyMessageEvent::MediaKeyMessageEvent):
(WebCore::MediaKeyMessageEventInit::MediaKeyMessageEventInit): Deleted.

  • Modules/encryptedmedia/MediaKeyMessageEvent.h:

(WebCore::MediaKeyMessageEvent::create):
(WebCore::MediaKeyMessageEvent::createForBindings):

  • Modules/encryptedmedia/MediaKeyNeededEvent.cpp:

(WebCore::MediaKeyNeededEvent::MediaKeyNeededEvent):
(WebCore::MediaKeyNeededEventInit::MediaKeyNeededEventInit): Deleted.

  • Modules/encryptedmedia/MediaKeyNeededEvent.h:

(WebCore::MediaKeyNeededEvent::create):
(WebCore::MediaKeyNeededEvent::createForBindings):

  • Modules/encryptedmedia/MediaKeySession.cpp:

(WebCore::MediaKeySession::sendMessage):

  • Modules/gamepad/GamepadEvent.h:

(WebCore::GamepadEvent::create):
(WebCore::GamepadEvent::createForBindings):
(WebCore::GamepadEventInit::GamepadEventInit): Deleted.

  • Modules/indieui/UIRequestEvent.cpp:

(WebCore::UIRequestEvent::createForBindings):
(WebCore::UIRequestEvent::UIRequestEvent):
(WebCore::UIRequestEventInit::UIRequestEventInit): Deleted.
(WebCore::UIRequestEvent::create): Deleted.

  • Modules/indieui/UIRequestEvent.h:
  • Modules/mediastream/MediaStreamEvent.cpp:

(WebCore::MediaStreamEvent::createForBindings):
(WebCore::MediaStreamEventInit::MediaStreamEventInit): Deleted.
(WebCore::MediaStreamEvent::create): Deleted.

  • Modules/mediastream/MediaStreamEvent.h:
  • Modules/mediastream/MediaStreamTrackEvent.cpp:

(WebCore::MediaStreamTrackEvent::createForBindings):
(WebCore::MediaStreamTrackEventInit::MediaStreamTrackEventInit): Deleted.
(WebCore::MediaStreamTrackEvent::create): Deleted.

  • Modules/mediastream/MediaStreamTrackEvent.h:
  • Modules/mediastream/RTCDTMFToneChangeEvent.cpp:

(WebCore::RTCDTMFToneChangeEvent::createForBindings):
(WebCore::RTCDTMFToneChangeEvent::create): Deleted.

  • Modules/mediastream/RTCDTMFToneChangeEvent.h:
  • Modules/mediastream/RTCDataChannelEvent.cpp:

(WebCore::RTCDataChannelEvent::createForBindings):
(WebCore::RTCDataChannelEvent::create): Deleted.

  • Modules/mediastream/RTCDataChannelEvent.h:
  • Modules/mediastream/RTCIceCandidateEvent.cpp:

(WebCore::RTCIceCandidateEvent::createForBindings):
(WebCore::RTCIceCandidateEvent::create): Deleted.

  • Modules/mediastream/RTCIceCandidateEvent.h:
  • Modules/mediastream/RTCTrackEvent.cpp:

(WebCore::RTCTrackEvent::createForBindings):
(WebCore::RTCTrackEventInit::RTCTrackEventInit): Deleted.
(WebCore::RTCTrackEvent::create): Deleted.

  • Modules/mediastream/RTCTrackEvent.h:
  • Modules/speech/SpeechSynthesisEvent.cpp:

(WebCore::SpeechSynthesisEvent::createForBindings):
(WebCore::SpeechSynthesisEvent::create):
(WebCore::SpeechSynthesisEvent::SpeechSynthesisEvent):

  • Modules/speech/SpeechSynthesisEvent.h:
  • Modules/webaudio/AudioProcessingEvent.cpp:

(WebCore::AudioProcessingEvent::create): Deleted.

  • Modules/webaudio/AudioProcessingEvent.h:

(WebCore::AudioProcessingEvent::create):
(WebCore::AudioProcessingEvent::createForBindings):

  • Modules/webaudio/OfflineAudioCompletionEvent.cpp:

(WebCore::OfflineAudioCompletionEvent::createForBindings):
(WebCore::OfflineAudioCompletionEvent::create): Deleted.

  • Modules/webaudio/OfflineAudioCompletionEvent.h:
  • Modules/websockets/CloseEvent.h:

(WebCore::CloseEvent::create):
(WebCore::CloseEvent::createForBindings):
(WebCore::CloseEvent::CloseEvent):
(WebCore::CloseEventInit::CloseEventInit): Deleted.

  • bindings/objc/DOM.mm:

(-[DOMNode nextFocusNode]):
(-[DOMNode previousFocusNode]):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateConstructorDefinition):

  • dom/AnimationEvent.cpp:

(WebCore::AnimationEventInit::AnimationEventInit): Deleted.

  • dom/AnimationEvent.h:
  • dom/BeforeLoadEvent.h:

(WebCore::BeforeLoadEventInit::BeforeLoadEventInit): Deleted.

  • dom/ClipboardEvent.h:
  • dom/CompositionEvent.cpp:

(WebCore::CompositionEventInit::CompositionEventInit): Deleted.

  • dom/CompositionEvent.h:
  • dom/CustomEvent.cpp:

(WebCore::CustomEventInit::CustomEventInit): Deleted.

  • dom/CustomEvent.h:
  • dom/DeviceMotionEvent.h:
  • dom/DeviceOrientationEvent.h:
  • dom/Document.cpp:

(WebCore::Document::createEvent):

  • dom/Element.cpp:

(WebCore::Element::dispatchMouseEvent):

  • dom/ErrorEvent.cpp:

(WebCore::ErrorEventInit::ErrorEventInit): Deleted.

  • dom/ErrorEvent.h:
  • dom/Event.cpp:

(WebCore::EventInit::EventInit): Deleted.

  • dom/Event.h:

(WebCore::Event::createForBindings):
(WebCore::Event::create): Deleted.

  • dom/FocusEvent.cpp:

(WebCore::FocusEventInit::FocusEventInit): Deleted.

  • dom/FocusEvent.h:
  • dom/HashChangeEvent.h:

(WebCore::HashChangeEventInit::HashChangeEventInit): Deleted.

  • dom/KeyboardEvent.cpp:

(WebCore::KeyboardEvent::KeyboardEvent):
(WebCore::KeyboardEventInit::KeyboardEventInit): Deleted.

  • dom/KeyboardEvent.h:
  • dom/MessageEvent.cpp:

(WebCore::MessageEvent::MessageEvent):
(WebCore::MessageEventInit::MessageEventInit): Deleted.

  • dom/MessageEvent.h:
  • dom/MouseEvent.cpp:

(WebCore::MouseEvent::createForBindings):
(WebCore::MouseEvent::create):
(WebCore::MouseEvent::MouseEvent):
(WebCore::MouseEvent::cloneFor):
(WebCore::MouseEventInit::MouseEventInit): Deleted.

  • dom/MouseEvent.h:

(WebCore::MouseEvent::createForBindings):
(WebCore::MouseEvent::create): Deleted.

  • dom/MouseRelatedEvent.cpp:

(WebCore::MouseRelatedEvent::MouseRelatedEvent):
(WebCore::MouseRelatedEvent::init):

  • dom/MouseRelatedEvent.h:

(WebCore::MouseRelatedEvent::screenX):
(WebCore::MouseRelatedEvent::screenY):
(WebCore::MouseRelatedEvent::screenLocation):
(WebCore::MouseRelatedEvent::clientX):
(WebCore::MouseRelatedEvent::clientY):
(WebCore::MouseRelatedEvent::movementX):
(WebCore::MouseRelatedEvent::movementY):
(WebCore::MouseRelatedEvent::clientLocation):
(WebCore::MouseRelatedEvent::isSimulated):
(WebCore::MouseRelatedEvent::absoluteLocation):
(WebCore::MouseRelatedEvent::setAbsoluteLocation):

  • dom/MutationEvent.h:
  • dom/OverflowEvent.cpp:

(WebCore::OverflowEvent::OverflowEvent):
(WebCore::OverflowEvent::initOverflowEvent):
(WebCore::OverflowEventInit::OverflowEventInit): Deleted.

  • dom/OverflowEvent.h:
  • dom/PageTransitionEvent.cpp:

(WebCore::PageTransitionEventInit::PageTransitionEventInit): Deleted.

  • dom/PageTransitionEvent.h:
  • dom/PopStateEvent.cpp:

(WebCore::PopStateEvent::createForBindings):
(WebCore::PopStateEventInit::PopStateEventInit): Deleted.
(WebCore::PopStateEvent::PopStateEvent): Deleted.
(WebCore::PopStateEvent::create): Deleted.

  • dom/PopStateEvent.h:
  • dom/ProgressEvent.cpp:

(WebCore::ProgressEventInit::ProgressEventInit): Deleted.

  • dom/ProgressEvent.h:

(WebCore::ProgressEvent::createForBindings):
(WebCore::ProgressEvent::create): Deleted.

  • dom/SecurityPolicyViolationEvent.h:

(WebCore::SecurityPolicyViolationEventInit::SecurityPolicyViolationEventInit): Deleted.

  • dom/TextEvent.cpp:

(WebCore::TextEvent::createForBindings):
(WebCore::TextEvent::create): Deleted.

  • dom/TextEvent.h:
  • dom/TouchEvent.h:
  • dom/TransitionEvent.cpp:

(WebCore::TransitionEventInit::TransitionEventInit): Deleted.

  • dom/TransitionEvent.h:
  • dom/UIEvent.cpp:

(WebCore::UIEventInit::UIEventInit): Deleted.

  • dom/UIEvent.h:

(WebCore::UIEvent::createForBindings):
(WebCore::UIEvent::create): Deleted.

  • dom/UIEventWithKeyState.h:

(WebCore::UIEventWithKeyState::ctrlKey):
(WebCore::UIEventWithKeyState::shiftKey):
(WebCore::UIEventWithKeyState::altKey):
(WebCore::UIEventWithKeyState::metaKey):
(WebCore::UIEventWithKeyState::UIEventWithKeyState):

  • dom/WebKitAnimationEvent.cpp:

(WebCore::WebKitAnimationEventInit::WebKitAnimationEventInit): Deleted.

  • dom/WebKitAnimationEvent.h:
  • dom/WebKitTransitionEvent.cpp:

(WebCore::WebKitTransitionEventInit::WebKitTransitionEventInit): Deleted.

  • dom/WebKitTransitionEvent.h:
  • dom/WheelEvent.h:
  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::mediaPlayerKeyAdded):
(WebCore::HTMLMediaElement::mediaPlayerKeyError):
(WebCore::HTMLMediaElement::mediaPlayerKeyMessage):
(WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):

  • html/MediaKeyEvent.cpp:

(WebCore::MediaKeyEvent::MediaKeyEvent):
(WebCore::MediaKeyEventInit::MediaKeyEventInit): Deleted.

  • html/MediaKeyEvent.h:
  • html/canvas/WebGLContextEvent.cpp:

(WebCore::WebGLContextEventInit::WebGLContextEventInit): Deleted.

  • html/canvas/WebGLContextEvent.h:
  • html/track/TrackEvent.cpp:

(WebCore::TrackEvent::TrackEvent):
(WebCore::TrackEventInit::TrackEventInit): Deleted.

  • html/track/TrackEvent.h:
  • html/track/TrackListBase.cpp:

(TrackListBase::scheduleTrackEvent):
(TrackListBase::scheduleChangeEvent):

  • page/EventSource.cpp:

(WebCore::EventSource::createMessageEvent):

  • page/csp/ContentSecurityPolicy.cpp:

(WebCore::ContentSecurityPolicy::reportViolation):
(WebCore::gatherSecurityPolicyViolationEventData): Deleted.

  • storage/StorageEvent.cpp:

(WebCore::StorageEvent::createForBindings):
(WebCore::StorageEventInit::StorageEventInit): Deleted.
(WebCore::StorageEvent::create): Deleted.

  • storage/StorageEvent.h:
  • svg/SVGZoomEvent.h:

(WebCore::SVGZoomEvent::createForBindings):
(WebCore::SVGZoomEvent::create): Deleted.

  • xml/XMLHttpRequestProgressEvent.h:

(WebCore::XMLHttpRequestProgressEvent::createForBindings):
(WebCore::XMLHttpRequestProgressEvent::create): Deleted.

Source/WebKit2:

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::nextAssistableElement):

Location:
trunk/Source
Files:
100 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r196396 r196400  
     12016-02-10  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        Rename *Event::create* which creates events for bindings to *Event::createForBindings* and cleanup corresponding paths
     4        https://bugs.webkit.org/show_bug.cgi?id=153903
     5        <rdar://problem/24518146>
     6
     7        Reviewed by Darin Adler.
     8
     9        Rename Event::create(const AtomicString&, const EventInit&) to Event::createForBindings
     10        (const AtomicString&, const EventInit&) and for all the subclasses as well in order to
     11        support Event.isTrusted. Besides, some of the subclasses use the create method for bindings
     12        to create events not for bindings and vice versa. Therefore, this patch also cleanup
     13        corresponding paths to ensure no misuse of the create mehtod. The same for Event::create()
     14        as it is combined with Event::initEvent to create an event for bindings for legacy content.
     15
     16        After this patch, all call sites of *Event::create* are supposed to use *Event::create
     17        to create events for user agent and *Event::createForBindings for bindings.
     18
     19        No change in behavior.
     20
     21        * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
     22        (WebCore::WebKitPlaybackTargetAvailabilityEvent::create):
     23        (WebCore::WebKitPlaybackTargetAvailabilityEvent::createForBindings):
     24        (WebCore::WebKitPlaybackTargetAvailabilityEventInit::WebKitPlaybackTargetAvailabilityEventInit): Deleted.
     25        * Modules/encryptedmedia/MediaKeyMessageEvent.cpp:
     26        (WebCore::MediaKeyMessageEvent::MediaKeyMessageEvent):
     27        (WebCore::MediaKeyMessageEventInit::MediaKeyMessageEventInit): Deleted.
     28        * Modules/encryptedmedia/MediaKeyMessageEvent.h:
     29        (WebCore::MediaKeyMessageEvent::create):
     30        (WebCore::MediaKeyMessageEvent::createForBindings):
     31        * Modules/encryptedmedia/MediaKeyNeededEvent.cpp:
     32        (WebCore::MediaKeyNeededEvent::MediaKeyNeededEvent):
     33        (WebCore::MediaKeyNeededEventInit::MediaKeyNeededEventInit): Deleted.
     34        * Modules/encryptedmedia/MediaKeyNeededEvent.h:
     35        (WebCore::MediaKeyNeededEvent::create):
     36        (WebCore::MediaKeyNeededEvent::createForBindings):
     37        * Modules/encryptedmedia/MediaKeySession.cpp:
     38        (WebCore::MediaKeySession::sendMessage):
     39        * Modules/gamepad/GamepadEvent.h:
     40        (WebCore::GamepadEvent::create):
     41        (WebCore::GamepadEvent::createForBindings):
     42        (WebCore::GamepadEventInit::GamepadEventInit): Deleted.
     43        * Modules/indieui/UIRequestEvent.cpp:
     44        (WebCore::UIRequestEvent::createForBindings):
     45        (WebCore::UIRequestEvent::UIRequestEvent):
     46        (WebCore::UIRequestEventInit::UIRequestEventInit): Deleted.
     47        (WebCore::UIRequestEvent::create): Deleted.
     48        * Modules/indieui/UIRequestEvent.h:
     49        * Modules/mediastream/MediaStreamEvent.cpp:
     50        (WebCore::MediaStreamEvent::createForBindings):
     51        (WebCore::MediaStreamEventInit::MediaStreamEventInit): Deleted.
     52        (WebCore::MediaStreamEvent::create): Deleted.
     53        * Modules/mediastream/MediaStreamEvent.h:
     54        * Modules/mediastream/MediaStreamTrackEvent.cpp:
     55        (WebCore::MediaStreamTrackEvent::createForBindings):
     56        (WebCore::MediaStreamTrackEventInit::MediaStreamTrackEventInit): Deleted.
     57        (WebCore::MediaStreamTrackEvent::create): Deleted.
     58        * Modules/mediastream/MediaStreamTrackEvent.h:
     59        * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
     60        (WebCore::RTCDTMFToneChangeEvent::createForBindings):
     61        (WebCore::RTCDTMFToneChangeEvent::create): Deleted.
     62        * Modules/mediastream/RTCDTMFToneChangeEvent.h:
     63        * Modules/mediastream/RTCDataChannelEvent.cpp:
     64        (WebCore::RTCDataChannelEvent::createForBindings):
     65        (WebCore::RTCDataChannelEvent::create): Deleted.
     66        * Modules/mediastream/RTCDataChannelEvent.h:
     67        * Modules/mediastream/RTCIceCandidateEvent.cpp:
     68        (WebCore::RTCIceCandidateEvent::createForBindings):
     69        (WebCore::RTCIceCandidateEvent::create): Deleted.
     70        * Modules/mediastream/RTCIceCandidateEvent.h:
     71        * Modules/mediastream/RTCTrackEvent.cpp:
     72        (WebCore::RTCTrackEvent::createForBindings):
     73        (WebCore::RTCTrackEventInit::RTCTrackEventInit): Deleted.
     74        (WebCore::RTCTrackEvent::create): Deleted.
     75        * Modules/mediastream/RTCTrackEvent.h:
     76        * Modules/speech/SpeechSynthesisEvent.cpp:
     77        (WebCore::SpeechSynthesisEvent::createForBindings):
     78        (WebCore::SpeechSynthesisEvent::create):
     79        (WebCore::SpeechSynthesisEvent::SpeechSynthesisEvent):
     80        * Modules/speech/SpeechSynthesisEvent.h:
     81        * Modules/webaudio/AudioProcessingEvent.cpp:
     82        (WebCore::AudioProcessingEvent::create): Deleted.
     83        * Modules/webaudio/AudioProcessingEvent.h:
     84        (WebCore::AudioProcessingEvent::create):
     85        (WebCore::AudioProcessingEvent::createForBindings):
     86        * Modules/webaudio/OfflineAudioCompletionEvent.cpp:
     87        (WebCore::OfflineAudioCompletionEvent::createForBindings):
     88        (WebCore::OfflineAudioCompletionEvent::create): Deleted.
     89        * Modules/webaudio/OfflineAudioCompletionEvent.h:
     90        * Modules/websockets/CloseEvent.h:
     91        (WebCore::CloseEvent::create):
     92        (WebCore::CloseEvent::createForBindings):
     93        (WebCore::CloseEvent::CloseEvent):
     94        (WebCore::CloseEventInit::CloseEventInit): Deleted.
     95        * bindings/objc/DOM.mm:
     96        (-[DOMNode nextFocusNode]):
     97        (-[DOMNode previousFocusNode]):
     98        * bindings/scripts/CodeGeneratorJS.pm:
     99        (GenerateConstructorDefinition):
     100        * dom/AnimationEvent.cpp:
     101        (WebCore::AnimationEventInit::AnimationEventInit): Deleted.
     102        * dom/AnimationEvent.h:
     103        * dom/BeforeLoadEvent.h:
     104        (WebCore::BeforeLoadEventInit::BeforeLoadEventInit): Deleted.
     105        * dom/ClipboardEvent.h:
     106        * dom/CompositionEvent.cpp:
     107        (WebCore::CompositionEventInit::CompositionEventInit): Deleted.
     108        * dom/CompositionEvent.h:
     109        * dom/CustomEvent.cpp:
     110        (WebCore::CustomEventInit::CustomEventInit): Deleted.
     111        * dom/CustomEvent.h:
     112        * dom/DeviceMotionEvent.h:
     113        * dom/DeviceOrientationEvent.h:
     114        * dom/Document.cpp:
     115        (WebCore::Document::createEvent):
     116        * dom/Element.cpp:
     117        (WebCore::Element::dispatchMouseEvent):
     118        * dom/ErrorEvent.cpp:
     119        (WebCore::ErrorEventInit::ErrorEventInit): Deleted.
     120        * dom/ErrorEvent.h:
     121        * dom/Event.cpp:
     122        (WebCore::EventInit::EventInit): Deleted.
     123        * dom/Event.h:
     124        (WebCore::Event::createForBindings):
     125        (WebCore::Event::create): Deleted.
     126        * dom/FocusEvent.cpp:
     127        (WebCore::FocusEventInit::FocusEventInit): Deleted.
     128        * dom/FocusEvent.h:
     129        * dom/HashChangeEvent.h:
     130        (WebCore::HashChangeEventInit::HashChangeEventInit): Deleted.
     131        * dom/KeyboardEvent.cpp:
     132        (WebCore::KeyboardEvent::KeyboardEvent):
     133        (WebCore::KeyboardEventInit::KeyboardEventInit): Deleted.
     134        * dom/KeyboardEvent.h:
     135        * dom/MessageEvent.cpp:
     136        (WebCore::MessageEvent::MessageEvent):
     137        (WebCore::MessageEventInit::MessageEventInit): Deleted.
     138        * dom/MessageEvent.h:
     139        * dom/MouseEvent.cpp:
     140        (WebCore::MouseEvent::createForBindings):
     141        (WebCore::MouseEvent::create):
     142        (WebCore::MouseEvent::MouseEvent):
     143        (WebCore::MouseEvent::cloneFor):
     144        (WebCore::MouseEventInit::MouseEventInit): Deleted.
     145        * dom/MouseEvent.h:
     146        (WebCore::MouseEvent::createForBindings):
     147        (WebCore::MouseEvent::create): Deleted.
     148        * dom/MouseRelatedEvent.cpp:
     149        (WebCore::MouseRelatedEvent::MouseRelatedEvent):
     150        (WebCore::MouseRelatedEvent::init):
     151        * dom/MouseRelatedEvent.h:
     152        (WebCore::MouseRelatedEvent::screenX):
     153        (WebCore::MouseRelatedEvent::screenY):
     154        (WebCore::MouseRelatedEvent::screenLocation):
     155        (WebCore::MouseRelatedEvent::clientX):
     156        (WebCore::MouseRelatedEvent::clientY):
     157        (WebCore::MouseRelatedEvent::movementX):
     158        (WebCore::MouseRelatedEvent::movementY):
     159        (WebCore::MouseRelatedEvent::clientLocation):
     160        (WebCore::MouseRelatedEvent::isSimulated):
     161        (WebCore::MouseRelatedEvent::absoluteLocation):
     162        (WebCore::MouseRelatedEvent::setAbsoluteLocation):
     163        * dom/MutationEvent.h:
     164        * dom/OverflowEvent.cpp:
     165        (WebCore::OverflowEvent::OverflowEvent):
     166        (WebCore::OverflowEvent::initOverflowEvent):
     167        (WebCore::OverflowEventInit::OverflowEventInit): Deleted.
     168        * dom/OverflowEvent.h:
     169        * dom/PageTransitionEvent.cpp:
     170        (WebCore::PageTransitionEventInit::PageTransitionEventInit): Deleted.
     171        * dom/PageTransitionEvent.h:
     172        * dom/PopStateEvent.cpp:
     173        (WebCore::PopStateEvent::createForBindings):
     174        (WebCore::PopStateEventInit::PopStateEventInit): Deleted.
     175        (WebCore::PopStateEvent::PopStateEvent): Deleted.
     176        (WebCore::PopStateEvent::create): Deleted.
     177        * dom/PopStateEvent.h:
     178        * dom/ProgressEvent.cpp:
     179        (WebCore::ProgressEventInit::ProgressEventInit): Deleted.
     180        * dom/ProgressEvent.h:
     181        (WebCore::ProgressEvent::createForBindings):
     182        (WebCore::ProgressEvent::create): Deleted.
     183        * dom/SecurityPolicyViolationEvent.h:
     184        (WebCore::SecurityPolicyViolationEventInit::SecurityPolicyViolationEventInit): Deleted.
     185        * dom/TextEvent.cpp:
     186        (WebCore::TextEvent::createForBindings):
     187        (WebCore::TextEvent::create): Deleted.
     188        * dom/TextEvent.h:
     189        * dom/TouchEvent.h:
     190        * dom/TransitionEvent.cpp:
     191        (WebCore::TransitionEventInit::TransitionEventInit): Deleted.
     192        * dom/TransitionEvent.h:
     193        * dom/UIEvent.cpp:
     194        (WebCore::UIEventInit::UIEventInit): Deleted.
     195        * dom/UIEvent.h:
     196        (WebCore::UIEvent::createForBindings):
     197        (WebCore::UIEvent::create): Deleted.
     198        * dom/UIEventWithKeyState.h:
     199        (WebCore::UIEventWithKeyState::ctrlKey):
     200        (WebCore::UIEventWithKeyState::shiftKey):
     201        (WebCore::UIEventWithKeyState::altKey):
     202        (WebCore::UIEventWithKeyState::metaKey):
     203        (WebCore::UIEventWithKeyState::UIEventWithKeyState):
     204        * dom/WebKitAnimationEvent.cpp:
     205        (WebCore::WebKitAnimationEventInit::WebKitAnimationEventInit): Deleted.
     206        * dom/WebKitAnimationEvent.h:
     207        * dom/WebKitTransitionEvent.cpp:
     208        (WebCore::WebKitTransitionEventInit::WebKitTransitionEventInit): Deleted.
     209        * dom/WebKitTransitionEvent.h:
     210        * dom/WheelEvent.h:
     211        * html/HTMLMediaElement.cpp:
     212        (WebCore::HTMLMediaElement::mediaPlayerKeyAdded):
     213        (WebCore::HTMLMediaElement::mediaPlayerKeyError):
     214        (WebCore::HTMLMediaElement::mediaPlayerKeyMessage):
     215        (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
     216        * html/MediaKeyEvent.cpp:
     217        (WebCore::MediaKeyEvent::MediaKeyEvent):
     218        (WebCore::MediaKeyEventInit::MediaKeyEventInit): Deleted.
     219        * html/MediaKeyEvent.h:
     220        * html/canvas/WebGLContextEvent.cpp:
     221        (WebCore::WebGLContextEventInit::WebGLContextEventInit): Deleted.
     222        * html/canvas/WebGLContextEvent.h:
     223        * html/track/TrackEvent.cpp:
     224        (WebCore::TrackEvent::TrackEvent):
     225        (WebCore::TrackEventInit::TrackEventInit): Deleted.
     226        * html/track/TrackEvent.h:
     227        * html/track/TrackListBase.cpp:
     228        (TrackListBase::scheduleTrackEvent):
     229        (TrackListBase::scheduleChangeEvent):
     230        * page/EventSource.cpp:
     231        (WebCore::EventSource::createMessageEvent):
     232        * page/csp/ContentSecurityPolicy.cpp:
     233        (WebCore::ContentSecurityPolicy::reportViolation):
     234        (WebCore::gatherSecurityPolicyViolationEventData): Deleted.
     235        * storage/StorageEvent.cpp:
     236        (WebCore::StorageEvent::createForBindings):
     237        (WebCore::StorageEventInit::StorageEventInit): Deleted.
     238        (WebCore::StorageEvent::create): Deleted.
     239        * storage/StorageEvent.h:
     240        * svg/SVGZoomEvent.h:
     241        (WebCore::SVGZoomEvent::createForBindings):
     242        (WebCore::SVGZoomEvent::create): Deleted.
     243        * xml/XMLHttpRequestProgressEvent.h:
     244        (WebCore::XMLHttpRequestProgressEvent::createForBindings):
     245        (WebCore::XMLHttpRequestProgressEvent::create): Deleted.
     246
    12472016-02-10  Ryan Haddad  <ryanhaddad@apple.com>
    2248
  • trunk/Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp

    r194819 r196400  
    4141}
    4242
    43 WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent()
    44 {
    45 }
    46 
    4743WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent(const AtomicString& eventType, bool available)
    4844    : Event(eventType, false, false)
  • trunk/Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h

    r180416 r196400  
    3434
    3535struct WebKitPlaybackTargetAvailabilityEventInit : public EventInit {
    36     WebKitPlaybackTargetAvailabilityEventInit()
    37     {
    38     };
    39 
    4036    String availability;
    4137};
     
    4541    ~WebKitPlaybackTargetAvailabilityEvent() { }
    4642
    47     static Ref<WebKitPlaybackTargetAvailabilityEvent> create()
    48     {
    49         return adoptRef(*new WebKitPlaybackTargetAvailabilityEvent);
    50     }
    51 
    5243    static Ref<WebKitPlaybackTargetAvailabilityEvent> create(const AtomicString& eventType, bool available)
    5344    {
     
    5546    }
    5647
    57     static Ref<WebKitPlaybackTargetAvailabilityEvent> create(const AtomicString& eventType, const WebKitPlaybackTargetAvailabilityEventInit& initializer)
     48    static Ref<WebKitPlaybackTargetAvailabilityEvent> createForBindings(const AtomicString& eventType, const WebKitPlaybackTargetAvailabilityEventInit& initializer)
    5849    {
    5950        return adoptRef(*new WebKitPlaybackTargetAvailabilityEvent(eventType, initializer));
     
    6556
    6657private:
    67     WebKitPlaybackTargetAvailabilityEvent();
    6858    explicit WebKitPlaybackTargetAvailabilityEvent(const AtomicString& eventType, bool available);
    6959    WebKitPlaybackTargetAvailabilityEvent(const AtomicString& eventType, const WebKitPlaybackTargetAvailabilityEventInit&);
  • trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.cpp

    r165676 r196400  
    3535namespace WebCore {
    3636
    37 MediaKeyMessageEventInit::MediaKeyMessageEventInit()
     37MediaKeyMessageEvent::MediaKeyMessageEvent(const AtomicString& type, Uint8Array* message, const String& destinationURL)
     38    : Event(type, false, false)
     39    , m_message(message)
     40    , m_destinationURL(destinationURL)
    3841{
    3942}
    4043
    41 MediaKeyMessageEvent::MediaKeyMessageEvent()
    42 {
    43 }
    4444
    4545MediaKeyMessageEvent::MediaKeyMessageEvent(const AtomicString& type, const MediaKeyMessageEventInit& initializer)
  • trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.h

    r177264 r196400  
    3636
    3737struct MediaKeyMessageEventInit : public EventInit {
    38     MediaKeyMessageEventInit();
    39 
    4038    RefPtr<Uint8Array> message;
    4139    String destinationURL;
     
    4644    virtual ~MediaKeyMessageEvent();
    4745
    48     static Ref<MediaKeyMessageEvent> create()
     46    static Ref<MediaKeyMessageEvent> create(const AtomicString& type, Uint8Array* message, const String& destinationURL)
    4947    {
    50         return adoptRef(*new MediaKeyMessageEvent);
     48        return adoptRef(*new MediaKeyMessageEvent(type, message, destinationURL));
    5149    }
    5250
    53     static Ref<MediaKeyMessageEvent> create(const AtomicString& type, const MediaKeyMessageEventInit& initializer)
     51    static Ref<MediaKeyMessageEvent> createForBindings(const AtomicString& type, const MediaKeyMessageEventInit& initializer)
    5452    {
    5553        return adoptRef(*new MediaKeyMessageEvent(type, initializer));
     
    6260
    6361private:
    64     MediaKeyMessageEvent();
     62    MediaKeyMessageEvent(const AtomicString& type, Uint8Array* message, const String& destinationURL);
    6563    MediaKeyMessageEvent(const AtomicString& type, const MediaKeyMessageEventInit& initializer);
    6664
  • trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.cpp

    r165676 r196400  
    3535namespace WebCore {
    3636
    37 MediaKeyNeededEventInit::MediaKeyNeededEventInit()
    38 {
    39 }
    40 
    41 MediaKeyNeededEvent::MediaKeyNeededEvent()
     37MediaKeyNeededEvent::MediaKeyNeededEvent(const AtomicString& type, Uint8Array* initData)
     38    : Event(type, false, false)
     39    , m_initData(initData)
    4240{
    4341}
  • trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.h

    r177264 r196400  
    3535
    3636struct MediaKeyNeededEventInit : public EventInit {
    37     MediaKeyNeededEventInit();
    38 
    3937    RefPtr<Uint8Array> initData;
    4038};
     
    4442    virtual ~MediaKeyNeededEvent();
    4543
    46     static Ref<MediaKeyNeededEvent> create()
     44    static Ref<MediaKeyNeededEvent> create(const AtomicString& type, Uint8Array* initData)
    4745    {
    48         return adoptRef(*new MediaKeyNeededEvent);
     46        return adoptRef(*new MediaKeyNeededEvent(type, initData));
    4947    }
    5048
    51     static Ref<MediaKeyNeededEvent> create(const AtomicString& type, const MediaKeyNeededEventInit& initializer)
     49    static Ref<MediaKeyNeededEvent> createForBindings(const AtomicString& type, const MediaKeyNeededEventInit& initializer)
    5250    {
    5351        return adoptRef(*new MediaKeyNeededEvent(type, initializer));
     
    5957
    6058private:
    61     MediaKeyNeededEvent();
     59    MediaKeyNeededEvent(const AtomicString& type, Uint8Array* initData);
    6260    MediaKeyNeededEvent(const AtomicString& type, const MediaKeyNeededEventInit& initializer);
    6361
  • trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp

    r195410 r196400  
    210210void MediaKeySession::sendMessage(Uint8Array* message, String destinationURL)
    211211{
    212     MediaKeyMessageEventInit init;
    213     init.bubbles = false;
    214     init.cancelable = false;
    215     init.message = message;
    216     init.destinationURL = destinationURL;
    217     RefPtr<MediaKeyMessageEvent> event = MediaKeyMessageEvent::create(eventNames().webkitkeymessageEvent, init);
     212    RefPtr<MediaKeyMessageEvent> event = MediaKeyMessageEvent::create(eventNames().webkitkeymessageEvent, message, destinationURL);
    218213    event->setTarget(this);
    219214    m_asyncEventQueue.enqueueEvent(event.release());
  • trunk/Source/WebCore/Modules/gamepad/GamepadEvent.cpp

    r172890 r196400  
    3030namespace WebCore {
    3131
    32 GamepadEvent::GamepadEvent()
    33 {
    34 }
    35 
    3632GamepadEvent::GamepadEvent(const AtomicString& eventType, Gamepad& gamepad)
    3733    : Event(eventType, false, false)
  • trunk/Source/WebCore/Modules/gamepad/GamepadEvent.h

    r177264 r196400  
    3535
    3636struct GamepadEventInit : public EventInit {
    37     GamepadEventInit()
    38     {
    39     }
    40 
    4137    RefPtr<Gamepad> gamepad;
    4238};
     
    4642    ~GamepadEvent() { }
    4743
    48     static Ref<GamepadEvent> create()
    49     {
    50         return adoptRef(*new GamepadEvent);
    51     }
    52 
    5344    static Ref<GamepadEvent> create(const AtomicString& eventType, Gamepad& gamepad)
    5445    {
     
    5647    }
    5748
    58     static Ref<GamepadEvent> create(const AtomicString& eventType, const GamepadEventInit& initializer)
     49    static Ref<GamepadEvent> createForBindings(const AtomicString& eventType, const GamepadEventInit& initializer)
    5950    {
    6051        return adoptRef(*new GamepadEvent(eventType, initializer));
     
    6657
    6758private:
    68     GamepadEvent();
    6959    explicit GamepadEvent(const AtomicString& eventType, Gamepad&);
    7060    GamepadEvent(const AtomicString& eventType, const GamepadEventInit&);
  • trunk/Source/WebCore/Modules/indieui/UIRequestEvent.cpp

    r194896 r196400  
    3131namespace WebCore {
    3232
    33 UIRequestEventInit::UIRequestEventInit()
    34     : UIEventInit(true, true)
    35     , receiver(nullptr)
    36 {
    37 }
    38    
    39 Ref<UIRequestEvent> UIRequestEvent::create()
    40 {
    41     return adoptRef(*new UIRequestEvent);
    42 }
    43    
    44 Ref<UIRequestEvent> UIRequestEvent::create(const AtomicString& type, const UIRequestEventInit& initializer)
     33Ref<UIRequestEvent> UIRequestEvent::createForBindings(const AtomicString& type, const UIRequestEventInit& initializer)
    4534{
    4635    return adoptRef(*new UIRequestEvent(type, initializer));
     
    5342
    5443UIRequestEvent::UIRequestEvent(const AtomicString& type, const UIRequestEventInit& initializer)
    55     : UIEvent(type, initializer.bubbles, initializer.cancelable, initializer.view.get(), initializer.detail)
     44    : UIEvent(type, initializer)
    5645    , m_receiver(initializer.receiver)
    5746{
     
    6150    : UIEvent(type, bubbles, cancelable, view, detail)
    6251    , m_receiver(receiver)
    63 {
    64 }
    65 
    66 UIRequestEvent::UIRequestEvent()
    67     : m_receiver(nullptr)
    6852{
    6953}
  • trunk/Source/WebCore/Modules/indieui/UIRequestEvent.h

    r194896 r196400  
    3535   
    3636struct UIRequestEventInit : public UIEventInit {
    37     UIRequestEventInit();
    38    
    3937    RefPtr<EventTarget> receiver;
    4038};
     
    4240class UIRequestEvent : public UIEvent {
    4341public:
    44     static Ref<UIRequestEvent> create();
    4542    static Ref<UIRequestEvent> create(const AtomicString& type, bool bubbles, bool cancelable, AbstractView*, int detail, PassRefPtr<EventTarget> receiver);
    46    
    47     static Ref<UIRequestEvent> create(const AtomicString& eventType, const UIRequestEventInit&);
     43    static Ref<UIRequestEvent> createForBindings(const AtomicString& eventType, const UIRequestEventInit&);
    4844   
    4945    virtual ~UIRequestEvent();
     
    5551   
    5652    UIRequestEvent(const AtomicString& type, const UIRequestEventInit&);
    57    
    58     UIRequestEvent();
    5953   
    6054    EventInterface eventInterface() const override;
  • trunk/Source/WebCore/Modules/mediastream/MediaStreamEvent.cpp

    r185336 r196400  
    3333namespace WebCore {
    3434
    35 MediaStreamEventInit::MediaStreamEventInit()
    36     : stream(nullptr)
    37 {
    38 }
    39 
    40 Ref<MediaStreamEvent> MediaStreamEvent::create()
    41 {
    42     return adoptRef(*new MediaStreamEvent);
    43 }
    44 
    4535Ref<MediaStreamEvent> MediaStreamEvent::create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStream> stream)
    4636{
     
    4838}
    4939
    50 Ref<MediaStreamEvent> MediaStreamEvent::create(const AtomicString& type, const MediaStreamEventInit& initializer)
     40Ref<MediaStreamEvent> MediaStreamEvent::createForBindings(const AtomicString& type, const MediaStreamEventInit& initializer)
    5141{
    5242    return adoptRef(*new MediaStreamEvent(type, initializer));
    53 }
    54 
    55 MediaStreamEvent::MediaStreamEvent()
    56 {
    5743}
    5844
  • trunk/Source/WebCore/Modules/mediastream/MediaStreamEvent.h

    r177264 r196400  
    3535
    3636struct MediaStreamEventInit : public EventInit {
    37     MediaStreamEventInit();
    38 
    3937    RefPtr<MediaStream> stream;
    4038};
     
    4442    virtual ~MediaStreamEvent();
    4543
    46     static Ref<MediaStreamEvent> create();
    4744    static Ref<MediaStreamEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStream>);
    48     static Ref<MediaStreamEvent> create(const AtomicString& type, const MediaStreamEventInit& initializer);
     45    static Ref<MediaStreamEvent> createForBindings(const AtomicString& type, const MediaStreamEventInit& initializer);
    4946
    5047    MediaStream* stream() const;
     
    5350
    5451private:
    55     MediaStreamEvent();
    5652    MediaStreamEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStream>);
    5753    MediaStreamEvent(const AtomicString& type, const MediaStreamEventInit&);
  • trunk/Source/WebCore/Modules/mediastream/MediaStreamTrackEvent.cpp

    r185336 r196400  
    3333namespace WebCore {
    3434
    35 MediaStreamTrackEventInit::MediaStreamTrackEventInit()
    36     : track(nullptr)
    37 {
    38 }
    39 
    40 Ref<MediaStreamTrackEvent> MediaStreamTrackEvent::create()
    41 {
    42     return adoptRef(*new MediaStreamTrackEvent);
    43 }
    44 
    4535Ref<MediaStreamTrackEvent> MediaStreamTrackEvent::create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStreamTrack> track)
    4636{
     
    4838}
    4939
    50 Ref<MediaStreamTrackEvent> MediaStreamTrackEvent::create(const AtomicString& type, const MediaStreamTrackEventInit& initializer)
     40Ref<MediaStreamTrackEvent> MediaStreamTrackEvent::createForBindings(const AtomicString& type, const MediaStreamTrackEventInit& initializer)
    5141{
    5242    return adoptRef(*new MediaStreamTrackEvent(type, initializer));
    53 }
    54 
    55 MediaStreamTrackEvent::MediaStreamTrackEvent()
    56 {
    5743}
    5844
  • trunk/Source/WebCore/Modules/mediastream/MediaStreamTrackEvent.h

    r177264 r196400  
    3636
    3737struct MediaStreamTrackEventInit : public EventInit {
    38     MediaStreamTrackEventInit();
    39    
    4038    RefPtr<MediaStreamTrack> track;
    4139};
     
    4543    virtual ~MediaStreamTrackEvent();
    4644
    47     static Ref<MediaStreamTrackEvent> create();
    4845    static Ref<MediaStreamTrackEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStreamTrack>);
    49     static Ref<MediaStreamTrackEvent> create(const AtomicString& type, const MediaStreamTrackEventInit& initializer);
     46    static Ref<MediaStreamTrackEvent> createForBindings(const AtomicString& type, const MediaStreamTrackEventInit& initializer);
    5047
    5148    MediaStreamTrack* track() const;
     
    5552
    5653private:
    57     MediaStreamTrackEvent();
    5854    MediaStreamTrackEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStreamTrack>);
    5955    MediaStreamTrackEvent(const AtomicString& type, const MediaStreamTrackEventInit&);
  • trunk/Source/WebCore/Modules/mediastream/RTCDTMFToneChangeEvent.cpp

    r177264 r196400  
    3333namespace WebCore {
    3434
    35 Ref<RTCDTMFToneChangeEvent> RTCDTMFToneChangeEvent::create()
    36 {
    37     return adoptRef(*new RTCDTMFToneChangeEvent);
    38 }
    39 
    4035Ref<RTCDTMFToneChangeEvent> RTCDTMFToneChangeEvent::create(const String& tone)
    4136{
     
    4338}
    4439
    45 Ref<RTCDTMFToneChangeEvent> RTCDTMFToneChangeEvent::create(const AtomicString& type, const RTCDTMFToneChangeEventInit& initializer)
     40Ref<RTCDTMFToneChangeEvent> RTCDTMFToneChangeEvent::createForBindings(const AtomicString& type, const RTCDTMFToneChangeEventInit& initializer)
    4641{
    4742    ASSERT_UNUSED(type, type == eventNames().tonechangeEvent);
    4843    return adoptRef(*new RTCDTMFToneChangeEvent(initializer));
    49 }
    50 
    51 RTCDTMFToneChangeEvent::RTCDTMFToneChangeEvent()
    52 {
    5344}
    5445
  • trunk/Source/WebCore/Modules/mediastream/RTCDTMFToneChangeEvent.h

    r177264 r196400  
    4242    virtual ~RTCDTMFToneChangeEvent();
    4343
    44     static Ref<RTCDTMFToneChangeEvent> create();
    4544    static Ref<RTCDTMFToneChangeEvent> create(const String& tone);
    46     static Ref<RTCDTMFToneChangeEvent> create(const AtomicString& type, const RTCDTMFToneChangeEventInit& initializer);
     45    static Ref<RTCDTMFToneChangeEvent> createForBindings(const AtomicString& type, const RTCDTMFToneChangeEventInit& initializer);
    4746
    4847    const String& tone() const;
     
    5150
    5251private:
    53     RTCDTMFToneChangeEvent();
    5452    explicit RTCDTMFToneChangeEvent(const String& tone);
    5553    explicit RTCDTMFToneChangeEvent(const RTCDTMFToneChangeEventInit&);
  • trunk/Source/WebCore/Modules/mediastream/RTCDataChannelEvent.cpp

    r177264 r196400  
    3333namespace WebCore {
    3434
    35 Ref<RTCDataChannelEvent> RTCDataChannelEvent::create()
    36 {
    37     return adoptRef(*new RTCDataChannelEvent);
    38 }
    39 
    4035Ref<RTCDataChannelEvent> RTCDataChannelEvent::create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<RTCDataChannel> channel)
    4136{
    4237    return adoptRef(*new RTCDataChannelEvent(type, canBubble, cancelable, channel));
    43 }
    44 
    45 RTCDataChannelEvent::RTCDataChannelEvent()
    46 {
    4738}
    4839
  • trunk/Source/WebCore/Modules/mediastream/RTCDataChannelEvent.h

    r177264 r196400  
    3838    virtual ~RTCDataChannelEvent();
    3939
    40     static Ref<RTCDataChannelEvent> create();
    4140    static Ref<RTCDataChannelEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<RTCDataChannel>);
    4241
     
    4645
    4746private:
    48     RTCDataChannelEvent();
    4947    RTCDataChannelEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<RTCDataChannel>);
    5048
  • trunk/Source/WebCore/Modules/mediastream/RTCIceCandidateEvent.cpp

    r194496 r196400  
    3434namespace WebCore {
    3535
    36 Ref<RTCIceCandidateEvent> RTCIceCandidateEvent::create()
    37 {
    38     return adoptRef(*new RTCIceCandidateEvent);
    39 }
    40 
    4136Ref<RTCIceCandidateEvent> RTCIceCandidateEvent::create(bool canBubble, bool cancelable, RefPtr<RTCIceCandidate>&& candidate)
    4237{
    4338    return adoptRef(*new RTCIceCandidateEvent(canBubble, cancelable, WTFMove(candidate)));
    44 }
    45 
    46 RTCIceCandidateEvent::RTCIceCandidateEvent()
    47 {
    4839}
    4940
  • trunk/Source/WebCore/Modules/mediastream/RTCIceCandidateEvent.h

    r192464 r196400  
    3838    virtual ~RTCIceCandidateEvent();
    3939
    40     static Ref<RTCIceCandidateEvent> create();
    4140    static Ref<RTCIceCandidateEvent> create(bool canBubble, bool cancelable, RefPtr<RTCIceCandidate>&&);
    4241
     
    4645
    4746private:
    48     RTCIceCandidateEvent();
    4947    RTCIceCandidateEvent(bool canBubble, bool cancelable, RefPtr<RTCIceCandidate>&&);
    5048
  • trunk/Source/WebCore/Modules/mediastream/RTCTrackEvent.cpp

    r194496 r196400  
    4040namespace WebCore {
    4141
    42 RTCTrackEventInit::RTCTrackEventInit()
    43     : receiver(nullptr)
    44     , track(nullptr)
    45 {
    46 }
    47 
    48 Ref<RTCTrackEvent> RTCTrackEvent::create()
    49 {
    50     return adoptRef(*new RTCTrackEvent);
    51 }
    52 
    5342Ref<RTCTrackEvent> RTCTrackEvent::create(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<RTCRtpReceiver>&& receiver, RefPtr<MediaStreamTrack>&& track)
    5443{
     
    5645}
    5746
    58 Ref<RTCTrackEvent> RTCTrackEvent::create(const AtomicString& type, const RTCTrackEventInit& initializer)
     47Ref<RTCTrackEvent> RTCTrackEvent::createForBindings(const AtomicString& type, const RTCTrackEventInit& initializer)
    5948{
    6049    return adoptRef(*new RTCTrackEvent(type, initializer));
    61 }
    62 
    63 RTCTrackEvent::RTCTrackEvent()
    64 {
    6550}
    6651
  • trunk/Source/WebCore/Modules/mediastream/RTCTrackEvent.h

    r192464 r196400  
    4343
    4444struct RTCTrackEventInit : public EventInit {
    45     RTCTrackEventInit();
    46 
    4745    RefPtr<RTCRtpReceiver> receiver;
    4846    RefPtr<MediaStreamTrack> track;
     
    5149class RTCTrackEvent : public Event {
    5250public:
    53     static Ref<RTCTrackEvent> create();
    5451    static Ref<RTCTrackEvent> create(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<RTCRtpReceiver>&&, RefPtr<MediaStreamTrack>&&);
    55     static Ref<RTCTrackEvent> create(const AtomicString& type, const RTCTrackEventInit&);
     52    static Ref<RTCTrackEvent> createForBindings(const AtomicString& type, const RTCTrackEventInit&);
    5653
    5754    RTCRtpReceiver* receiver() const { return m_receiver.get(); }
     
    6158
    6259private:
    63     RTCTrackEvent();
    6460    RTCTrackEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<RTCRtpReceiver>&&, RefPtr<MediaStreamTrack>&&);
    6561    RTCTrackEvent(const AtomicString& type, const RTCTrackEventInit&);
  • trunk/Source/WebCore/Modules/speech/SpeechSynthesisEvent.cpp

    r177264 r196400  
    3030
    3131namespace WebCore {
    32    
    33 Ref<SpeechSynthesisEvent> SpeechSynthesisEvent::create()
    34 {
    35     return adoptRef(*new SpeechSynthesisEvent());
    36 }
    3732
    38 Ref<SpeechSynthesisEvent> SpeechSynthesisEvent::create(const AtomicString& type, unsigned long charIndex, float elapsedTime, const String& name)
     33Ref<SpeechSynthesisEvent> SpeechSynthesisEvent::create(const AtomicString& type, unsigned charIndex, float elapsedTime, const String& name)
    3934{
    4035    return adoptRef(*new SpeechSynthesisEvent(type, charIndex, elapsedTime, name));
    4136}
    4237
    43 SpeechSynthesisEvent::SpeechSynthesisEvent()
    44 {
    45 }
    46 
    47 SpeechSynthesisEvent::SpeechSynthesisEvent(const AtomicString& type, unsigned long charIndex, float elapsedTime, const String& name)
     38SpeechSynthesisEvent::SpeechSynthesisEvent(const AtomicString& type, unsigned charIndex, float elapsedTime, const String& name)
    4839    : Event(type, false, false)
    4940    , m_charIndex(charIndex)
  • trunk/Source/WebCore/Modules/speech/SpeechSynthesisEvent.h

    r177264 r196400  
    3636class SpeechSynthesisEvent : public Event {
    3737public:
    38     static Ref<SpeechSynthesisEvent> create();
    39     static Ref<SpeechSynthesisEvent> create(const AtomicString& type, unsigned long charIndex, float elapsedTime, const String& name);
     38    static Ref<SpeechSynthesisEvent> create(const AtomicString& type, unsigned charIndex, float elapsedTime, const String& name);
    4039   
    4140    unsigned long charIndex() const { return m_charIndex; }
     
    4645   
    4746private:
    48     SpeechSynthesisEvent();
    49     SpeechSynthesisEvent(const AtomicString& type, unsigned long charIndex, float elapsedTime, const String& name);
     47    SpeechSynthesisEvent(const AtomicString& type, unsigned charIndex, float elapsedTime, const String& name);
    5048
    5149    unsigned long m_charIndex;
  • trunk/Source/WebCore/Modules/webaudio/AudioProcessingEvent.cpp

    r177264 r196400  
    3434namespace WebCore {
    3535
    36 Ref<AudioProcessingEvent> AudioProcessingEvent::create()
    37 {
    38     return adoptRef(*new AudioProcessingEvent);
    39 }
    40 
    41 Ref<AudioProcessingEvent> AudioProcessingEvent::create(PassRefPtr<AudioBuffer> inputBuffer, PassRefPtr<AudioBuffer> outputBuffer, double playbackTime)
    42 {
    43     return adoptRef(*new AudioProcessingEvent(inputBuffer, outputBuffer, playbackTime));
    44 }
    45 
    4636AudioProcessingEvent::AudioProcessingEvent()
    4737{
  • trunk/Source/WebCore/Modules/webaudio/AudioProcessingEvent.h

    r177264 r196400  
    3737class AudioProcessingEvent : public Event {
    3838public:
    39     static Ref<AudioProcessingEvent> create();
    40     static Ref<AudioProcessingEvent> create(PassRefPtr<AudioBuffer> inputBuffer, PassRefPtr<AudioBuffer> outputBuffer, double playbackTime);
     39    static Ref<AudioProcessingEvent> create(PassRefPtr<AudioBuffer> inputBuffer, PassRefPtr<AudioBuffer> outputBuffer, double playbackTime)
     40    {
     41        return adoptRef(*new AudioProcessingEvent(inputBuffer, outputBuffer, playbackTime));
     42    }
     43
     44    static Ref<AudioProcessingEvent> createForBindings()
     45    {
     46        return adoptRef(*new AudioProcessingEvent);
     47    }
    4148   
    4249    virtual ~AudioProcessingEvent();
  • trunk/Source/WebCore/Modules/webaudio/OfflineAudioCompletionEvent.cpp

    r177264 r196400  
    3434namespace WebCore {
    3535
    36 Ref<OfflineAudioCompletionEvent> OfflineAudioCompletionEvent::create()
    37 {
    38     return adoptRef(*new OfflineAudioCompletionEvent);
    39 }
    40 
    4136Ref<OfflineAudioCompletionEvent> OfflineAudioCompletionEvent::create(PassRefPtr<AudioBuffer> renderedBuffer)
    4237{
    4338    return adoptRef(*new OfflineAudioCompletionEvent(renderedBuffer));
    4439}
    45 
    46 OfflineAudioCompletionEvent::OfflineAudioCompletionEvent()
    47 {
    48 }
    49 
    5040
    5141OfflineAudioCompletionEvent::OfflineAudioCompletionEvent(PassRefPtr<AudioBuffer> renderedBuffer)
  • trunk/Source/WebCore/Modules/webaudio/OfflineAudioCompletionEvent.h

    r177264 r196400  
    3737class OfflineAudioCompletionEvent : public Event {
    3838public:
    39     static Ref<OfflineAudioCompletionEvent> create();
    4039    static Ref<OfflineAudioCompletionEvent> create(PassRefPtr<AudioBuffer> renderedBuffer);
    4140   
     
    4746
    4847private:
    49     OfflineAudioCompletionEvent();
    5048    explicit OfflineAudioCompletionEvent(PassRefPtr<AudioBuffer> renderedBuffer);
    5149
  • trunk/Source/WebCore/Modules/websockets/CloseEvent.h

    r177264 r196400  
    3838
    3939struct CloseEventInit : public EventInit {
    40     CloseEventInit()
    41         : wasClean(false)
    42         , code(0)
    43     {
    44     };
    45 
    46     bool wasClean;
    47     unsigned short code;
     40    bool wasClean { false };
     41    unsigned short code { 0 };
    4842    String reason;
    4943};
     
    5145class CloseEvent : public Event {
    5246public:
    53     static Ref<CloseEvent> create()
    54     {
    55         return adoptRef(*new CloseEvent());
    56     }
    57 
    5847    static Ref<CloseEvent> create(bool wasClean, unsigned short code, const String& reason)
    5948    {
     
    6150    }
    6251
    63     static Ref<CloseEvent> create(const AtomicString& type, const CloseEventInit& initializer)
     52    static Ref<CloseEvent> createForBindings(const AtomicString& type, const CloseEventInit& initializer)
    6453    {
    6554        return adoptRef(*new CloseEvent(type, initializer));
     
    7463
    7564private:
    76     CloseEvent()
    77         : Event(eventNames().closeEvent, false, false)
    78         , m_wasClean(false)
    79         , m_code(0)
    80     {
    81     }
    82 
    8365    CloseEvent(bool wasClean, int code, const String& reason)
    8466        : Event(eventNames().closeEvent, false, false)
  • trunk/Source/WebCore/bindings/objc/DOM.mm

    r191887 r196400  
    519519        return nil;
    520520
    521     RefPtr<KeyboardEvent> key = KeyboardEvent::create();
     521    // FIXME: using KeyboardEvent::createForDummy() here should be deprecated,
     522    // should use one that is not for bindings.
     523    RefPtr<KeyboardEvent> key = KeyboardEvent::createForDummy();
    522524    return kit(page->focusController().nextFocusableElement(FocusNavigationScope::focusNavigationScopeOf(&core(self)->document()), core(self), key.get()));
    523525}
     
    529531        return nil;
    530532
    531     RefPtr<KeyboardEvent> key = KeyboardEvent::create();
     533    // FIXME: using KeyboardEvent::createForDummy() here should be deprecated,
     534    // should use one that is not for bindings.
     535    RefPtr<KeyboardEvent> key = KeyboardEvent::createForDummy();
    532536    return kit(page->focusController().previousFocusableElement(FocusNavigationScope::focusNavigationScopeOf(&core(self)->document()), core(self), key.get()));
    533537}
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r196392 r196400  
    47674767    }
    47684768
    4769     RefPtr<${interfaceName}> event = ${interfaceName}::create(eventType, eventInit);
     4769    RefPtr<${interfaceName}> event = ${interfaceName}::createForBindings(eventType, eventInit);
    47704770    return JSValue::encode(toJS(state, jsConstructor->globalObject(), event.get()));
    47714771}
  • trunk/Source/WebCore/dom/AnimationEvent.cpp

    r180441 r196400  
    3030
    3131namespace WebCore {
    32 
    33 AnimationEventInit::AnimationEventInit()
    34     : animationName()
    35     , elapsedTime(0)
    36 {
    37 }
    38 
    39 AnimationEvent::AnimationEvent()
    40     : m_elapsedTime(0)
    41 {
    42 }
    4332
    4433AnimationEvent::AnimationEvent(const AtomicString& type, const AnimationEventInit& initializer)
  • trunk/Source/WebCore/dom/AnimationEvent.h

    r180441 r196400  
    3232
    3333struct AnimationEventInit : public EventInit {
    34     AnimationEventInit();
    35 
    3634    String animationName;
    37     double elapsedTime;
     35    double elapsedTime { 0 };
    3836};
    3937
    4038class AnimationEvent final : public Event {
    4139public:
    42     static Ref<AnimationEvent> create()
    43     {
    44         return adoptRef(*new AnimationEvent);
    45     }
    4640    static Ref<AnimationEvent> create(const AtomicString& type, const String& animationName, double elapsedTime)
    4741    {
    4842        return adoptRef(*new AnimationEvent(type, animationName, elapsedTime));
    4943    }
    50     static Ref<AnimationEvent> create(const AtomicString& type, const AnimationEventInit& initializer)
     44
     45    static Ref<AnimationEvent> createForBindings(const AtomicString& type, const AnimationEventInit& initializer)
    5146    {
    5247        return adoptRef(*new AnimationEvent(type, initializer));
     
    6156
    6257private:
    63     AnimationEvent();
    6458    AnimationEvent(const AtomicString& type, const String& animationName, double elapsedTime);
    6559    AnimationEvent(const AtomicString&, const AnimationEventInit&);
  • trunk/Source/WebCore/dom/BeforeLoadEvent.h

    r177264 r196400  
    3434
    3535struct BeforeLoadEventInit : public EventInit {
    36     BeforeLoadEventInit()
    37     {
    38     }
    39 
    4036    String url;
    4137};
     
    4339class BeforeLoadEvent final : public Event {
    4440public:
    45     static Ref<BeforeLoadEvent> create()
    46     {
    47         return adoptRef(*new BeforeLoadEvent);
    48     }
    49 
    5041    static Ref<BeforeLoadEvent> create(const String& url)
    5142    {
     
    5344    }
    5445
    55     static Ref<BeforeLoadEvent> create(const AtomicString& type, const BeforeLoadEventInit& initializer)
     46    static Ref<BeforeLoadEvent> createForBindings(const AtomicString& type, const BeforeLoadEventInit& initializer)
    5647    {
    5748        return adoptRef(*new BeforeLoadEvent(type, initializer));
     
    6354
    6455private:
    65     BeforeLoadEvent()
    66     {
    67     }
    68 
    6956    explicit BeforeLoadEvent(const String& url)
    7057        : Event(eventNames().beforeloadEvent, false, true)
  • trunk/Source/WebCore/dom/ClipboardEvent.cpp

    r193408 r196400  
    2929namespace WebCore {
    3030
    31 ClipboardEvent::ClipboardEvent()
    32 {
    33 }
    34 
    3531ClipboardEvent::ClipboardEvent(const AtomicString& eventType, bool canBubble, bool cancelable, DataTransfer* dataTransfer)
    3632    : Event(eventType, canBubble, cancelable), m_dataTransfer(dataTransfer)
  • trunk/Source/WebCore/dom/ClipboardEvent.h

    r193408 r196400  
    3535        virtual ~ClipboardEvent();
    3636
    37         static Ref<ClipboardEvent> create()
    38         {
    39             return adoptRef(*new ClipboardEvent);
    40         }
    4137        static Ref<ClipboardEvent> create(const AtomicString& type, bool canBubbleArg, bool cancelableArg, DataTransfer* clipboardArg)
    4238        {
     
    4743
    4844    private:
    49         ClipboardEvent();
    5045        ClipboardEvent(const AtomicString& type, bool canBubbleArg, bool cancelableArg, DataTransfer*);
    5146
  • trunk/Source/WebCore/dom/CompositionEvent.cpp

    r193408 r196400  
    3131
    3232namespace WebCore {
    33 
    34 CompositionEventInit::CompositionEventInit()
    35 {
    36 }
    3733
    3834CompositionEvent::CompositionEvent()
  • trunk/Source/WebCore/dom/CompositionEvent.h

    r193408 r196400  
    3333
    3434struct CompositionEventInit : UIEventInit {
    35     CompositionEventInit();
    36 
    3735    String data;
    3836};
     
    4038class CompositionEvent final : public UIEvent {
    4139public:
    42     static Ref<CompositionEvent> create()
    43     {
    44         return adoptRef(*new CompositionEvent);
    45     }
    46 
    4740    static Ref<CompositionEvent> create(const AtomicString& type, AbstractView* view, const String& data)
    4841    {
     
    5043    }
    5144
    52     static Ref<CompositionEvent> create(const AtomicString& type, const CompositionEventInit& initializer)
     45    static Ref<CompositionEvent> createForBindings()
     46    {
     47        return adoptRef(*new CompositionEvent);
     48    }
     49
     50    static Ref<CompositionEvent> createForBindings(const AtomicString& type, const CompositionEventInit& initializer)
    5351    {
    5452        return adoptRef(*new CompositionEvent(type, initializer));
  • trunk/Source/WebCore/dom/CustomEvent.cpp

    r186955 r196400  
    3131
    3232namespace WebCore {
    33 
    34 CustomEventInit::CustomEventInit()
    35 {
    36 }
    3733
    3834CustomEvent::CustomEvent()
  • trunk/Source/WebCore/dom/CustomEvent.h

    r186955 r196400  
    3434
    3535struct CustomEventInit : public EventInit {
    36     CustomEventInit();
    37 
    3836    Deprecated::ScriptValue detail;
    3937};
     
    4341    virtual ~CustomEvent();
    4442
    45     static Ref<CustomEvent> create()
     43    static Ref<CustomEvent> createForBindings()
    4644    {
    4745        return adoptRef(*new CustomEvent);
    4846    }
    4947
    50     static Ref<CustomEvent> create(const AtomicString& type, const CustomEventInit& initializer)
     48    static Ref<CustomEvent> createForBindings(const AtomicString& type, const CustomEventInit& initializer)
    5149    {
    5250        return adoptRef(*new CustomEvent(type, initializer));
  • trunk/Source/WebCore/dom/DeviceMotionEvent.h

    r180441 r196400  
    3636public:
    3737    virtual ~DeviceMotionEvent();
    38     static Ref<DeviceMotionEvent> create()
    39     {
    40         return adoptRef(*new DeviceMotionEvent);
    41     }
     38
    4239    static Ref<DeviceMotionEvent> create(const AtomicString& eventType, DeviceMotionData* deviceMotionData)
    4340    {
    4441        return adoptRef(*new DeviceMotionEvent(eventType, deviceMotionData));
     42    }
     43
     44    static Ref<DeviceMotionEvent> createForBindings()
     45    {
     46        return adoptRef(*new DeviceMotionEvent);
    4547    }
    4648
  • trunk/Source/WebCore/dom/DeviceOrientationEvent.h

    r177264 r196400  
    3636public:
    3737    virtual ~DeviceOrientationEvent();
    38     static Ref<DeviceOrientationEvent> create()
    39     {
    40         return adoptRef(*new DeviceOrientationEvent);
    41     }
    4238    static Ref<DeviceOrientationEvent> create(const AtomicString& eventType, DeviceOrientationData* orientation)
    4339    {
    4440        return adoptRef(*new DeviceOrientationEvent(eventType, orientation));
     41    }
     42
     43    static Ref<DeviceOrientationEvent> createForBindings()
     44    {
     45        return adoptRef(*new DeviceOrientationEvent);
    4546    }
    4647
  • trunk/Source/WebCore/dom/Document.cpp

    r196242 r196400  
    41464146
    41474147    if (equalLettersIgnoringASCIICase(type, "customevent"))
    4148         return CustomEvent::create();
     4148        return CustomEvent::createForBindings();
    41494149    if (equalLettersIgnoringASCIICase(type, "event") || equalLettersIgnoringASCIICase(type, "events") || equalLettersIgnoringASCIICase(type, "htmlevents"))
    4150         return Event::create();
     4150        return Event::createForBindings();
    41514151    if (equalLettersIgnoringASCIICase(type, "keyboardevent") || equalLettersIgnoringASCIICase(type, "keyboardevents"))
    4152         return KeyboardEvent::create();
     4152        return KeyboardEvent::createForBindings();
    41534153    if (equalLettersIgnoringASCIICase(type, "messageevent"))
    4154         return MessageEvent::create();
     4154        return MessageEvent::createForBindings();
    41554155    if (equalLettersIgnoringASCIICase(type, "mouseevent") || equalLettersIgnoringASCIICase(type, "mouseevents"))
    4156         return MouseEvent::create();
     4156        return MouseEvent::createForBindings();
    41574157    if (equalLettersIgnoringASCIICase(type, "uievent") || equalLettersIgnoringASCIICase(type, "uievents"))
    4158         return UIEvent::create();
     4158        return UIEvent::createForBindings();
    41594159
    41604160#if ENABLE(TOUCH_EVENTS)
    41614161    if (equalLettersIgnoringASCIICase(type, "touchevent"))
    4162         return TouchEvent::create();
     4162        return TouchEvent::createForBindings();
    41634163#endif
    41644164
     
    41704170
    41714171    if (equalLettersIgnoringASCIICase(type, "svgzoomevents"))
    4172         return SVGZoomEvent::create();
     4172        return SVGZoomEvent::createForBindings();
    41734173
    41744174    // The following strings are for event classes where WebKit supplies an init function.
     
    41804180
    41814181    if (equalLettersIgnoringASCIICase(type, "compositionevent"))
    4182         return CompositionEvent::create();
     4182        return CompositionEvent::createForBindings();
    41834183    if (equalLettersIgnoringASCIICase(type, "hashchangeevent"))
    4184         return HashChangeEvent::create();
     4184        return HashChangeEvent::createForBindings();
    41854185    if (equalLettersIgnoringASCIICase(type, "mutationevent") || equalLettersIgnoringASCIICase(type, "mutationevents"))
    4186         return MutationEvent::create();
     4186        return MutationEvent::createForBindings();
    41874187    if (equalLettersIgnoringASCIICase(type, "overflowevent"))
    4188         return OverflowEvent::create();
     4188        return OverflowEvent::createForBindings();
    41894189    if (equalLettersIgnoringASCIICase(type, "storageevent"))
    4190         return StorageEvent::create();
     4190        return StorageEvent::createForBindings();
    41914191    if (equalLettersIgnoringASCIICase(type, "textevent"))
    4192         return TextEvent::create();
     4192        return TextEvent::createForBindings();
    41934193    if (equalLettersIgnoringASCIICase(type, "wheelevent"))
    4194         return WheelEvent::create();
     4194        return WheelEvent::createForBindings();
    41954195
    41964196#if ENABLE(DEVICE_ORIENTATION)
    41974197    if (equalLettersIgnoringASCIICase(type, "devicemotionevent"))
    4198         return DeviceMotionEvent::create();
     4198        return DeviceMotionEvent::createForBindings();
    41994199    if (equalLettersIgnoringASCIICase(type, "deviceorientationevent"))
    4200         return DeviceOrientationEvent::create();
     4200        return DeviceOrientationEvent::createForBindings();
    42014201#endif
    42024202
  • trunk/Source/WebCore/dom/Element.cpp

    r196383 r196400  
    269269        // of the DOM specs, but is used for compatibility with the ondblclick="" attribute. This is treated
    270270        // as a separate event in other DOM-compliant browsers like Firefox, and so we do the same.
    271         Ref<MouseEvent> doubleClickEvent = MouseEvent::create();
    272         doubleClickEvent->initMouseEvent(eventNames().dblclickEvent,
     271        Ref<MouseEvent> doubleClickEvent = MouseEvent::create(eventNames().dblclickEvent,
    273272            mouseEvent->bubbles(), mouseEvent->cancelable(), mouseEvent->view(), mouseEvent->detail(),
    274273            mouseEvent->screenX(), mouseEvent->screenY(), mouseEvent->clientX(), mouseEvent->clientY(),
  • trunk/Source/WebCore/dom/ErrorEvent.cpp

    r164184 r196400  
    3636namespace WebCore {
    3737
    38 ErrorEventInit::ErrorEventInit()
    39     : message()
    40     , filename()
    41     , lineno(0)
    42     , colno(0)
    43 {
    44 }
    45 
    46 ErrorEvent::ErrorEvent()
    47 {
    48 }
    49 
    5038ErrorEvent::ErrorEvent(const AtomicString& type, const ErrorEventInit& initializer)
    5139    : Event(type, initializer)
  • trunk/Source/WebCore/dom/ErrorEvent.h

    r177264 r196400  
    3838
    3939struct ErrorEventInit : public EventInit {
    40     ErrorEventInit();
    41 
    4240    String message;
    4341    String filename;
    44     unsigned lineno;
    45     unsigned colno;
     42    unsigned lineno { 0 };
     43    unsigned colno { 0 };
    4644};
    4745
    4846class ErrorEvent final : public Event {
    4947public:
    50     static Ref<ErrorEvent> create()
    51     {
    52         return adoptRef(*new ErrorEvent);
    53     }
    5448    static Ref<ErrorEvent> create(const String& message, const String& fileName, unsigned lineNumber, unsigned columnNumber)
    5549    {
    5650        return adoptRef(*new ErrorEvent(message, fileName, lineNumber, columnNumber));
    5751    }
    58     static Ref<ErrorEvent> create(const AtomicString& type, const ErrorEventInit& initializer)
     52
     53    static Ref<ErrorEvent> createForBindings(const AtomicString& type, const ErrorEventInit& initializer)
    5954    {
    6055        return adoptRef(*new ErrorEvent(type, initializer));
    6156    }
     57
    6258    virtual ~ErrorEvent();
    6359
     
    7066
    7167private:
    72     ErrorEvent();
    7368    ErrorEvent(const String& message, const String& fileName, unsigned lineNumber, unsigned columnNumber);
    7469    ErrorEvent(const AtomicString&, const ErrorEventInit&);
  • trunk/Source/WebCore/dom/Event.cpp

    r195927 r196400  
    2929
    3030namespace WebCore {
    31 
    32 EventInit::EventInit()
    33     : bubbles(false)
    34     , cancelable(false)
    35 {
    36 }
    37 
    38 EventInit::EventInit(bool b, bool c)
    39     : bubbles(b)
    40     , cancelable(c)
    41 {
    42 }
    4331
    4432Event::Event()
  • trunk/Source/WebCore/dom/Event.h

    r195927 r196400  
    4141
    4242struct EventInit {
    43     EventInit();
    44     EventInit(bool bubbles, bool cancelable);
    45 
    46     bool bubbles;
    47     bool cancelable;
     43    bool bubbles { false };
     44    bool cancelable { false };
    4845};
    4946
     
    8481    };
    8582
    86     static Ref<Event> create()
     83    static Ref<Event> create(const AtomicString& type, bool canBubble, bool cancelable)
     84    {
     85        return adoptRef(*new Event(type, canBubble, cancelable));
     86    }
     87
     88    static Ref<Event> createForBindings()
    8789    {
    8890        return adoptRef(*new Event);
    8991    }
    90     static Ref<Event> create(const AtomicString& type, bool canBubble, bool cancelable)
    91     {
    92         return adoptRef(*new Event(type, canBubble, cancelable));
    93     }
    94 
    95     static Ref<Event> create(const AtomicString& type, const EventInit& initializer)
     92
     93    static Ref<Event> createForBindings(const AtomicString& type, const EventInit& initializer)
    9694    {
    9795        return adoptRef(*new Event(type, initializer));
  • trunk/Source/WebCore/dom/FocusEvent.cpp

    r194896 r196400  
    3131namespace WebCore {
    3232
    33 FocusEventInit::FocusEventInit()
    34 {
    35 }
    36 
    3733EventInterface FocusEvent::eventInterface() const
    3834{
     
    4339{
    4440    return true;
    45 }
    46 
    47 FocusEvent::FocusEvent()
    48 {
    4941}
    5042
  • trunk/Source/WebCore/dom/FocusEvent.h

    r194896 r196400  
    3535
    3636struct FocusEventInit : public UIEventInit {
    37     FocusEventInit();
    38 
    3937    RefPtr<EventTarget> relatedTarget;
    4038};
     
    4240class FocusEvent final : public UIEvent {
    4341public:
    44     static Ref<FocusEvent> create()
    45     {
    46         return adoptRef(*new FocusEvent);
    47     }
    48 
    4942    static Ref<FocusEvent> create(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view, int detail, RefPtr<EventTarget>&& relatedTarget)
    5043    {
     
    5245    }
    5346
    54     static Ref<FocusEvent> create(const AtomicString& type, const FocusEventInit& initializer)
     47    static Ref<FocusEvent> createForBindings(const AtomicString& type, const FocusEventInit& initializer)
    5548    {
    5649        return adoptRef(*new FocusEvent(type, initializer));
     
    6356
    6457private:
    65     FocusEvent();
    6658    FocusEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView*, int, RefPtr<EventTarget>&&);
    6759    FocusEvent(const AtomicString& type, const FocusEventInit&);
  • trunk/Source/WebCore/dom/HashChangeEvent.h

    r177264 r196400  
    2828
    2929struct HashChangeEventInit : public EventInit {
    30     HashChangeEventInit()
    31     {
    32     };
    33 
    3430    String oldURL;
    3531    String newURL;
     
    3834class HashChangeEvent final : public Event {
    3935public:
    40     static Ref<HashChangeEvent> create()
    41     {
    42         return adoptRef(*new HashChangeEvent);
    43     }
    44 
    4536    static Ref<HashChangeEvent> create(const String& oldURL, const String& newURL)
    4637    {
     
    4839    }
    4940
    50     static Ref<HashChangeEvent> create(const AtomicString& type, const HashChangeEventInit& initializer)
     41    static Ref<HashChangeEvent> createForBindings()
     42    {
     43        return adoptRef(*new HashChangeEvent);
     44    }
     45
     46    static Ref<HashChangeEvent> createForBindings(const AtomicString& type, const HashChangeEventInit& initializer)
    5147    {
    5248        return adoptRef(*new HashChangeEvent(type, initializer));
  • trunk/Source/WebCore/dom/KeyboardEvent.cpp

    r194896 r196400  
    9191}
    9292
    93 KeyboardEventInit::KeyboardEventInit()
    94     : location(0)
    95     , ctrlKey(false)
    96     , altKey(false)
    97     , shiftKey(false)
    98     , metaKey(false)
    99 {
    100 }
    101 
    10293KeyboardEvent::KeyboardEvent()
    10394    : m_location(DOM_KEY_LOCATION_STANDARD)
     
    127118}
    128119
     120// FIXME: This method should be get ride of in the future.
     121// DO NOT USE IT!
     122KeyboardEvent::KeyboardEvent(WTF::HashTableDeletedValueType)
     123{
     124}
     125
    129126KeyboardEvent::KeyboardEvent(const AtomicString& eventType, const KeyboardEventInit& initializer)
    130     : UIEventWithKeyState(eventType, initializer.bubbles, initializer.cancelable, initializer.view.get(), initializer.detail, initializer.ctrlKey, initializer.altKey, initializer.shiftKey, initializer.metaKey)
     127    : UIEventWithKeyState(eventType, initializer)
    131128    , m_keyIdentifier(initializer.keyIdentifier)
    132129    , m_location(initializer.location)
  • trunk/Source/WebCore/dom/KeyboardEvent.h

    r177264 r196400  
    3535class PlatformKeyboardEvent;
    3636
    37 struct KeyboardEventInit : public UIEventInit {
    38     KeyboardEventInit();
    39 
     37struct KeyboardEventInit : public UIEventWithKeyStateInit {
    4038    String keyIdentifier;
    41     unsigned location;
    42     bool ctrlKey;
    43     bool altKey;
    44     bool shiftKey;
    45     bool metaKey;
     39    unsigned location { 0 };
    4640};
    4741
     
    5751        // DOM_KEY_LOCATION_JOYSTICK   = 0x05
    5852    };
    59        
    60     static Ref<KeyboardEvent> create()
    61     {
    62         return adoptRef(*new KeyboardEvent);
    63     }
    6453
    6554    static Ref<KeyboardEvent> create(const PlatformKeyboardEvent& platformEvent, AbstractView* view)
     
    6857    }
    6958
    70     static Ref<KeyboardEvent> create(const AtomicString& type, const KeyboardEventInit& initializer)
     59    static Ref<KeyboardEvent> createForBindings()
     60    {
     61        return adoptRef(*new KeyboardEvent);
     62    }
     63
     64    static Ref<KeyboardEvent> createForBindings(const AtomicString& type, const KeyboardEventInit& initializer)
    7165    {
    7266        return adoptRef(*new KeyboardEvent(type, initializer));
     67    }
     68
     69    // FIXME: This method should be get ride of in the future.
     70    // DO NOT USE IT!
     71    static Ref<KeyboardEvent> createForDummy()
     72    {
     73        return adoptRef(*new KeyboardEvent(WTF::HashTableDeletedValue));
    7374    }
    7475
     
    107108    WEBCORE_EXPORT KeyboardEvent(const PlatformKeyboardEvent&, AbstractView*);
    108109    KeyboardEvent(const AtomicString&, const KeyboardEventInit&);
     110    // FIXME: This method should be get ride of in the future.
     111    // DO NOT USE IT!
     112    KeyboardEvent(WTF::HashTableDeletedValueType);
    109113
    110114    std::unique_ptr<PlatformKeyboardEvent> m_keyEvent;
  • trunk/Source/WebCore/dom/MessageEvent.cpp

    r194496 r196400  
    3636{
    3737    return !source || source->toDOMWindow() || source->isMessagePort();
    38 }
    39 
    40 MessageEventInit::MessageEventInit()
    41 {
    4238}
    4339
     
    8076{
    8177    ASSERT(isValidSource(m_source.get()));
     78}
     79
     80MessageEvent::MessageEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId)
     81    : Event(type, canBubble, cancelable)
     82    , m_dataType(DataTypeSerializedScriptValue)
     83    , m_dataAsSerializedScriptValue(data)
     84    , m_origin(origin)
     85    , m_lastEventId(lastEventId)
     86{
    8287}
    8388
  • trunk/Source/WebCore/dom/MessageEvent.h

    r194496 r196400  
    4343
    4444struct MessageEventInit : public EventInit {
    45     MessageEventInit();
    46 
    4745    Deprecated::ScriptValue data;
    4846    String origin;
     
    5452class MessageEvent final : public Event {
    5553public:
    56     static Ref<MessageEvent> create()
    57     {
    58         return adoptRef(*new MessageEvent);
    59     }
    6054    static Ref<MessageEvent> create(std::unique_ptr<MessagePortArray> ports, const Deprecated::ScriptValue& data = Deprecated::ScriptValue(), const String& origin = String(), const String& lastEventId = String(), PassRefPtr<EventTarget> source = nullptr)
    6155    {
     
    6559    {
    6660        return adoptRef(*new MessageEvent(data, origin, lastEventId, source, WTFMove(ports)));
     61    }
     62    static Ref<MessageEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId)
     63    {
     64        return adoptRef(*new MessageEvent(type, canBubble, cancelable, data, origin, lastEventId));
    6765    }
    6866    static Ref<MessageEvent> create(const String& data, const String& origin = String())
     
    7876        return adoptRef(*new MessageEvent(data, origin));
    7977    }
    80     static Ref<MessageEvent> create(const AtomicString& type, const MessageEventInit& initializer)
     78    static Ref<MessageEvent> createForBindings()
     79    {
     80        return adoptRef(*new MessageEvent);
     81    }
     82    static Ref<MessageEvent> createForBindings(const AtomicString& type, const MessageEventInit& initializer)
    8183    {
    8284        return adoptRef(*new MessageEvent(type, initializer));
     
    122124    MessageEvent(const Deprecated::ScriptValue& data, const String& origin, const String& lastEventId, PassRefPtr<EventTarget> source, std::unique_ptr<MessagePortArray>);
    123125    MessageEvent(PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, PassRefPtr<EventTarget> source, std::unique_ptr<MessagePortArray>);
     126    MessageEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId);
    124127
    125128    explicit MessageEvent(const String& data, const String& origin);
  • trunk/Source/WebCore/dom/MouseEvent.cpp

    r195927 r196400  
    3434namespace WebCore {
    3535
    36 MouseEventInit::MouseEventInit()
    37     : screenX(0)
    38     , screenY(0)
    39     , clientX(0)
    40     , clientY(0)
    41     , ctrlKey(false)
    42     , altKey(false)
    43     , shiftKey(false)
    44     , metaKey(false)
    45     , button(0)
    46 {
    47 }
    48 
    49 Ref<MouseEvent> MouseEvent::create(const AtomicString& type, const MouseEventInit& initializer)
     36Ref<MouseEvent> MouseEvent::createForBindings(const AtomicString& type, const MouseEventInit& initializer)
    5037{
    5138    return adoptRef(*new MouseEvent(type, initializer));
     
    6754}
    6855
    69 Ref<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, AbstractView* view,
    70     int detail, int screenX, int screenY, int pageX, int pageY,
     56Ref<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, AbstractView* view, int detail, int screenX, int screenY, int pageX, int pageY,
    7157#if ENABLE(POINTER_LOCK)
    7258    int movementX, int movementY,
    7359#endif
    74     bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
    75     PassRefPtr<EventTarget> relatedTarget, double force)
     60    bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, PassRefPtr<EventTarget> relatedTarget, double force)
    7661
    7762{
     
    8469}
    8570
    86 Ref<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, AbstractView* view,
    87     int detail, int screenX, int screenY, int pageX, int pageY,
     71Ref<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, AbstractView* view, int detail, int screenX, int screenY, int pageX, int pageY,
    8872#if ENABLE(POINTER_LOCK)
    8973    int movementX, int movementY,
    9074#endif
    91     bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
    92     PassRefPtr<EventTarget> relatedTarget, double force, PassRefPtr<DataTransfer> dataTransfer, bool isSimulated)
     75    bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, PassRefPtr<EventTarget> relatedTarget, double force, PassRefPtr<DataTransfer> dataTransfer, bool isSimulated)
    9376{
    9477    return adoptRef(*new MouseEvent(type, canBubble, cancelable, timestamp, view,
     
    9881#endif
    9982        ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, force, dataTransfer, isSimulated));
     83}
     84
     85Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, bool canBubble, bool cancelable, AbstractView* view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, PassRefPtr<EventTarget> relatedTarget)
     86{
     87    return adoptRef(*new MouseEvent(eventType, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget));
    10088}
    10189
     
    128116}
    129117
     118MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cancelable, AbstractView* view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, PassRefPtr<EventTarget> relatedTarget)
     119    : MouseRelatedEvent(eventType, canBubble, cancelable, WTF::currentTime(), view, detail, IntPoint(screenX, screenY), IntPoint(0, 0),
     120#if ENABLE(POINTER_LOCK)
     121        IntPoint(0, 0),
     122#endif
     123        ctrlKey, altKey, shiftKey, metaKey, false)
     124    , m_button(button == (unsigned short)-1 ? 0 : button)
     125    , m_buttonDown(button != (unsigned short)-1)
     126    , m_relatedTarget(relatedTarget)
     127{
     128    initCoordinates(IntPoint(clientX, clientY));
     129}
     130
    130131MouseEvent::MouseEvent(const AtomicString& eventType, const MouseEventInit& initializer)
    131     : MouseRelatedEvent(eventType, initializer.bubbles, initializer.cancelable, currentTime(), initializer.view.get(), initializer.detail, IntPoint(initializer.screenX, initializer.screenY),
    132         IntPoint(0 /* pageX */, 0 /* pageY */),
    133 #if ENABLE(POINTER_LOCK)
    134         IntPoint(0 /* movementX */, 0 /* movementY */),
    135 #endif
    136         initializer.ctrlKey, initializer.altKey, initializer.shiftKey, initializer.metaKey, false /* isSimulated */)
     132    : MouseRelatedEvent(eventType, initializer)
    137133    , m_button(initializer.button == (unsigned short)-1 ? 0 : initializer.button)
    138134    , m_buttonDown(initializer.button != (unsigned short)-1)
     
    241237{
    242238    ASSERT(iframe);
    243     Ref<MouseEvent> clonedMouseEvent = MouseEvent::create();
    244239    Frame* frame = iframe->document().frame();
    245240    FrameView* frameView = frame ? frame->view() : nullptr;
    246     clonedMouseEvent->initMouseEvent(type(), bubbles(), cancelable(),
     241    Ref<MouseEvent> clonedMouseEvent = MouseEvent::create(type(), bubbles(), cancelable(),
    247242        iframe->document().defaultView(),
    248243        detail(), screenX(), screenY(),
  • trunk/Source/WebCore/dom/MouseEvent.h

    r195524 r196400  
    3232class PlatformMouseEvent;
    3333
    34 struct MouseEventInit : public UIEventInit {
    35     MouseEventInit();
    36 
    37     int screenX;
    38     int screenY;
    39     int clientX;
    40     int clientY;
    41     bool ctrlKey;
    42     bool altKey;
    43     bool shiftKey;
    44     bool metaKey;
    45     unsigned short button;
     34struct MouseEventInit : public MouseRelatedEventInit {
     35    int clientX {0};
     36    int clientY {0};
     37    unsigned short button {0};
    4638    RefPtr<EventTarget> relatedTarget;
    4739};
     
    4941class MouseEvent : public MouseRelatedEvent {
    5042public:
    51     static Ref<MouseEvent> create()
    52     {
    53         return adoptRef(*new MouseEvent);
    54     }
    55 
    5643    static Ref<MouseEvent> create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, AbstractView*,
    5744        int detail, int screenX, int screenY, int pageX, int pageY,
     
    7259    WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& eventType, AbstractView*, const PlatformMouseEvent&, int detail, PassRefPtr<Node> relatedTarget);
    7360
    74     static Ref<MouseEvent> create(const AtomicString& eventType, const MouseEventInit&);
     61    static Ref<MouseEvent> create(const AtomicString& eventType, bool canBubble, bool cancelable, AbstractView*,
     62        int detail, int screenX, int screenY, int clientX, int clientY,
     63        bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
     64        unsigned short button, PassRefPtr<EventTarget> relatedTarget);
     65
     66    static Ref<MouseEvent> createForBindings()
     67    {
     68        return adoptRef(*new MouseEvent);
     69    }
     70
     71    static Ref<MouseEvent> createForBindings(const AtomicString& eventType, const MouseEventInit&);
    7572
    7673    virtual ~MouseEvent();
     
    116113        PassRefPtr<EventTarget> relatedTarget, double force, PassRefPtr<DataTransfer>, bool isSimulated);
    117114
     115    MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView*,
     116        int detail, int screenX, int screenY, int clientX, int clientY,
     117        bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
     118        unsigned short button, PassRefPtr<EventTarget> relatedTarget);
     119
    118120    MouseEvent(const AtomicString& type, const MouseEventInit&);
    119121
  • trunk/Source/WebCore/dom/MouseRelatedEvent.cpp

    r194896 r196400  
    6969    , m_isSimulated(isSimulated)
    7070{
     71    init(isSimulated, windowLocation);
     72}
     73
     74MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, const MouseRelatedEventInit& initializer)
     75    : UIEventWithKeyState(eventType, initializer)
     76    , m_screenLocation(IntPoint(initializer.screenX, initializer.screenY))
     77#if ENABLE(POINTER_LOCK)
     78    , m_movementDelta(IntPoint(0, 0))
     79#endif
     80    , m_isSimulated(false)
     81{
     82    init(false, IntPoint(0, 0));
     83}
     84
     85void MouseRelatedEvent::init(bool isSimulated, const IntPoint& windowLocation)
     86{
    7187    LayoutPoint adjustedPageLocation;
    7288    LayoutPoint scrollPosition;
  • trunk/Source/WebCore/dom/MouseRelatedEvent.h

    r194896 r196400  
    3030namespace WebCore {
    3131
    32     // Internal only: Helper class for what's common between mouse and wheel events.
    33     class MouseRelatedEvent : public UIEventWithKeyState {
    34     public:
    35         // Note that these values are adjusted to counter the effects of zoom, so that values
    36         // exposed via DOM APIs are invariant under zooming.
    37         int screenX() const { return m_screenLocation.x(); }
    38         int screenY() const { return m_screenLocation.y(); }
    39         const IntPoint& screenLocation() const { return m_screenLocation; }
    40         int clientX() const { return m_clientLocation.x(); }
    41         int clientY() const { return m_clientLocation.y(); }
     32struct MouseRelatedEventInit : public UIEventWithKeyStateInit {
     33    int screenX { 0 };
     34    int screenY { 0 };
     35};
     36
     37// Internal only: Helper class for what's common between mouse and wheel events.
     38class MouseRelatedEvent : public UIEventWithKeyState {
     39public:
     40    // Note that these values are adjusted to counter the effects of zoom, so that values
     41    // exposed via DOM APIs are invariant under zooming.
     42    int screenX() const { return m_screenLocation.x(); }
     43    int screenY() const { return m_screenLocation.y(); }
     44    const IntPoint& screenLocation() const { return m_screenLocation; }
     45    int clientX() const { return m_clientLocation.x(); }
     46    int clientY() const { return m_clientLocation.y(); }
    4247#if ENABLE(POINTER_LOCK)
    43         int movementX() const { return m_movementDelta.x(); }
    44         int movementY() const { return m_movementDelta.y(); }
     48    int movementX() const { return m_movementDelta.x(); }
     49    int movementY() const { return m_movementDelta.y(); }
    4550#endif
    46         const LayoutPoint& clientLocation() const { return m_clientLocation; }
    47         virtual int layerX() override;
    48         virtual int layerY() override;
    49         WEBCORE_EXPORT int offsetX();
    50         WEBCORE_EXPORT int offsetY();
    51         bool isSimulated() const { return m_isSimulated; }
    52         virtual int pageX() const override final;
    53         virtual int pageY() const override final;
    54         virtual const LayoutPoint& pageLocation() const;
    55         int x() const;
    56         int y() const;
     51    const LayoutPoint& clientLocation() const { return m_clientLocation; }
     52    virtual int layerX() override;
     53    virtual int layerY() override;
     54    WEBCORE_EXPORT int offsetX();
     55    WEBCORE_EXPORT int offsetY();
     56    bool isSimulated() const { return m_isSimulated; }
     57    virtual int pageX() const override final;
     58    virtual int pageY() const override final;
     59    virtual const LayoutPoint& pageLocation() const;
     60    int x() const;
     61    int y() const;
    5762
    58         // Page point in "absolute" coordinates (i.e. post-zoomed, page-relative coords,
    59         // usable with RenderObject::absoluteToLocal).
    60         const LayoutPoint& absoluteLocation() const { return m_absoluteLocation; }
    61         void setAbsoluteLocation(const LayoutPoint& p) { m_absoluteLocation = p; }
     63    // Page point in "absolute" coordinates (i.e. post-zoomed, page-relative coords,
     64    // usable with RenderObject::absoluteToLocal).
     65    const LayoutPoint& absoluteLocation() const { return m_absoluteLocation; }
     66    void setAbsoluteLocation(const LayoutPoint& p) { m_absoluteLocation = p; }
    6267
    63     protected:
    64         MouseRelatedEvent();
    65         MouseRelatedEvent(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, AbstractView*,
    66                           int detail, const IntPoint& screenLocation, const IntPoint& windowLocation,
     68protected:
     69    MouseRelatedEvent();
     70    MouseRelatedEvent(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, AbstractView*,
     71        int detail, const IntPoint& screenLocation, const IntPoint& windowLocation,
    6772#if ENABLE(POINTER_LOCK)
    68                           const IntPoint& movementDelta,
     73        const IntPoint& movementDelta,
    6974#endif
    70                           bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool isSimulated = false);
     75        bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool isSimulated = false);
     76    MouseRelatedEvent(const AtomicString& type, const MouseRelatedEventInit&);
    7177
    72         void initCoordinates();
    73         void initCoordinates(const LayoutPoint& clientLocation);
    74         virtual void receivedTarget() override final;
     78    void initCoordinates();
     79    void initCoordinates(const LayoutPoint& clientLocation);
     80    virtual void receivedTarget() override final;
    7581
    76         void computePageLocation();
    77         void computeRelativePosition();
     82    void computePageLocation();
     83    void computeRelativePosition();
    7884
    79         // Expose these so MouseEvent::initMouseEvent can set them.
    80         IntPoint m_screenLocation;
    81         LayoutPoint m_clientLocation;
     85    // Expose these so MouseEvent::initMouseEvent can set them.
     86    IntPoint m_screenLocation;
     87    LayoutPoint m_clientLocation;
    8288#if ENABLE(POINTER_LOCK)
    83         LayoutPoint m_movementDelta;
     89    LayoutPoint m_movementDelta;
    8490#endif
    8591
    86     private:
    87         LayoutPoint m_pageLocation;
    88         LayoutPoint m_layerLocation;
    89         LayoutPoint m_offsetLocation;
    90         LayoutPoint m_absoluteLocation;
    91         bool m_isSimulated;
    92         bool m_hasCachedRelativePosition;
    93     };
     92private:
     93    void init(bool isSimulated, const IntPoint&);
     94
     95    LayoutPoint m_pageLocation;
     96    LayoutPoint m_layerLocation;
     97    LayoutPoint m_offsetLocation;
     98    LayoutPoint m_absoluteLocation;
     99    bool m_isSimulated;
     100    bool m_hasCachedRelativePosition;
     101};
    94102
    95103} // namespace WebCore
  • trunk/Source/WebCore/dom/MutationEvent.h

    r191955 r196400  
    4040        };
    4141
    42         static Ref<MutationEvent> create()
    43         {
    44             return adoptRef(*new MutationEvent);
    45         }
    46 
    4742        static Ref<MutationEvent> create(const AtomicString& type, bool canBubble, PassRefPtr<Node> relatedNode = nullptr,
    4843            const String& prevValue = String(), const String& newValue = String(), const String& attrName = String(), unsigned short attrChange = 0)
    4944        {
    5045            return adoptRef(*new MutationEvent(type, canBubble, false, relatedNode, prevValue, newValue, attrName, attrChange));
     46        }
     47
     48        static Ref<MutationEvent> createForBindings()
     49        {
     50            return adoptRef(*new MutationEvent);
    5151        }
    5252
  • trunk/Source/WebCore/dom/OverflowEvent.cpp

    r165676 r196400  
    3131namespace WebCore {
    3232
    33 OverflowEventInit::OverflowEventInit()
    34     : orient(0)
    35     , horizontalOverflow(false)
    36     , verticalOverflow(false)
    37 {
    38 }
    39 
    4033OverflowEvent::OverflowEvent()
    41     : Event(eventNames().overflowchangedEvent, false, false)
    42     , m_orient(VERTICAL)
     34    : m_orient(VERTICAL)
    4335    , m_horizontalOverflow(false)
    4436    , m_verticalOverflow(false)
     
    7971        return;
    8072
     73    initEvent(eventNames().overflowchangedEvent, false, false);
     74   
    8175    m_orient = orient;
    8276    m_horizontalOverflow = horizontalOverflow;
  • trunk/Source/WebCore/dom/OverflowEvent.h

    r177264 r196400  
    3232
    3333struct OverflowEventInit : public EventInit {
    34     OverflowEventInit();
    35 
    36     unsigned short orient;
    37     bool horizontalOverflow;
    38     bool verticalOverflow;
     34    unsigned short orient { 0 };
     35    bool horizontalOverflow { false };
     36    bool verticalOverflow { false };
    3937};
    4038
     
    4745    };
    4846
    49     static Ref<OverflowEvent> create()
    50     {
    51         return adoptRef(*new OverflowEvent);
    52     }
    5347    static Ref<OverflowEvent> create(bool horizontalOverflowChanged, bool horizontalOverflow, bool verticalOverflowChanged, bool verticalOverflow)
    5448    {
    5549        return adoptRef(*new OverflowEvent(horizontalOverflowChanged, horizontalOverflow, verticalOverflowChanged, verticalOverflow));
    5650    }
    57     static Ref<OverflowEvent> create(const AtomicString& type, const OverflowEventInit& initializer)
     51    static Ref<OverflowEvent> createForBindings()
     52    {
     53        return adoptRef(*new OverflowEvent);
     54    }
     55    static Ref<OverflowEvent> createForBindings(const AtomicString& type, const OverflowEventInit& initializer)
    5856    {
    5957        return adoptRef(*new OverflowEvent(type, initializer));
  • trunk/Source/WebCore/dom/PageTransitionEvent.cpp

    r156241 r196400  
    3131namespace WebCore {
    3232
    33 PageTransitionEventInit::PageTransitionEventInit()
    34     : persisted(false)
    35 {
    36 }
    37 
    38 PageTransitionEvent::PageTransitionEvent()
    39     : m_persisted(false)
    40 {
    41 }
    42 
    4333PageTransitionEvent::PageTransitionEvent(const AtomicString& type, bool persisted)
    4434    : Event(type, true, true)
  • trunk/Source/WebCore/dom/PageTransitionEvent.h

    r177264 r196400  
    3232
    3333struct PageTransitionEventInit : public EventInit {
    34     PageTransitionEventInit();
    35 
    36     bool persisted;
     34    bool persisted { false };
    3735};
    3836
    3937class PageTransitionEvent final : public Event {
    4038public:
    41     static Ref<PageTransitionEvent> create()
    42     {
    43         return adoptRef(*new PageTransitionEvent);
    44     }
    4539    static Ref<PageTransitionEvent> create(const AtomicString& type, bool persisted)
    4640    {
    4741        return adoptRef(*new PageTransitionEvent(type, persisted));
    4842    }
    49     static Ref<PageTransitionEvent> create(const AtomicString& type, const PageTransitionEventInit& initializer)
     43    static Ref<PageTransitionEvent> createForBindings(const AtomicString& type, const PageTransitionEventInit& initializer)
    5044    {
    5145        return adoptRef(*new PageTransitionEvent(type, initializer));
     
    5953
    6054private:
    61     PageTransitionEvent();
    6255    PageTransitionEvent(const AtomicString& type, bool persisted);
    6356    PageTransitionEvent(const AtomicString&, const PageTransitionEventInit&);
  • trunk/Source/WebCore/dom/PopStateEvent.cpp

    r195927 r196400  
    3434namespace WebCore {
    3535
    36 PopStateEventInit::PopStateEventInit()
    37 {
    38 }
    39 
    40 PopStateEvent::PopStateEvent()
    41     : Event(eventNames().popstateEvent, false, true)
    42 {
    43 }
    44 
    4536PopStateEvent::PopStateEvent(const AtomicString& type, const PopStateEventInit& initializer)
    4637    : Event(type, initializer)
     
    6051}
    6152
    62 Ref<PopStateEvent> PopStateEvent::create()
    63 {
    64     return adoptRef(*new PopStateEvent);
    65 }
    66 
    6753Ref<PopStateEvent> PopStateEvent::create(RefPtr<SerializedScriptValue>&& serializedState, PassRefPtr<History> history)
    6854{
     
    7056}
    7157
    72 Ref<PopStateEvent> PopStateEvent::create(const AtomicString& type, const PopStateEventInit& initializer)
     58Ref<PopStateEvent> PopStateEvent::createForBindings(const AtomicString& type, const PopStateEventInit& initializer)
    7359{
    7460    return adoptRef(*new PopStateEvent(type, initializer));
  • trunk/Source/WebCore/dom/PopStateEvent.h

    r195927 r196400  
    3535
    3636struct PopStateEventInit : public EventInit {
    37     PopStateEventInit();
    38 
    3937    Deprecated::ScriptValue state;
    4038};
     
    4644public:
    4745    virtual ~PopStateEvent();
    48     static Ref<PopStateEvent> create();
    4946    static Ref<PopStateEvent> create(RefPtr<SerializedScriptValue>&&, PassRefPtr<History>);
    50     static Ref<PopStateEvent> create(const AtomicString&, const PopStateEventInit&);
     47    static Ref<PopStateEvent> createForBindings(const AtomicString&, const PopStateEventInit&);
    5148
    5249    PassRefPtr<SerializedScriptValue> serializedState() const { ASSERT(m_serializedState); return m_serializedState; }
     
    6057
    6158private:
    62     PopStateEvent();
    6359    PopStateEvent(const AtomicString&, const PopStateEventInit&);
    6460    explicit PopStateEvent(PassRefPtr<SerializedScriptValue>, PassRefPtr<History>);
  • trunk/Source/WebCore/dom/ProgressEvent.cpp

    r165676 r196400  
    3131namespace WebCore {
    3232
    33 ProgressEventInit::ProgressEventInit()
    34     : lengthComputable(false)
    35     , loaded(0)
    36     , total(0)
    37 {
    38 }
    39 
    40 ProgressEvent::ProgressEvent()
    41     : m_lengthComputable(false)
    42     , m_loaded(0)
    43     , m_total(0)
    44 {
    45 }
    46 
    4733ProgressEvent::ProgressEvent(const AtomicString& type, const ProgressEventInit& initializer)
    4834    : Event(type, initializer)
  • trunk/Source/WebCore/dom/ProgressEvent.h

    r177264 r196400  
    3232
    3333struct ProgressEventInit : public EventInit {
    34     ProgressEventInit();
    35 
    36     bool lengthComputable;
    37     unsigned long long loaded;
    38     unsigned long long total;
     34    bool lengthComputable { false };
     35    unsigned long long loaded { 0 };
     36    unsigned long long total { 0 };
    3937};
    4038
    4139class ProgressEvent : public Event {
    4240public:
    43     static Ref<ProgressEvent> create()
    44     {
    45         return adoptRef(*new ProgressEvent);
    46     }
    4741    static Ref<ProgressEvent> create(const AtomicString& type, bool lengthComputable, unsigned long long loaded, unsigned long long total)
    4842    {
    4943        return adoptRef(*new ProgressEvent(type, lengthComputable, loaded, total));
    5044    }
    51     static Ref<ProgressEvent> create(const AtomicString& type, const ProgressEventInit& initializer)
     45    static Ref<ProgressEvent> createForBindings(const AtomicString& type, const ProgressEventInit& initializer)
    5246    {
    5347        return adoptRef(*new ProgressEvent(type, initializer));
     
    6155
    6256protected:
    63     ProgressEvent();
    6457    ProgressEvent(const AtomicString& type, bool lengthComputable, unsigned long long loaded, unsigned long long total);
    6558    ProgressEvent(const AtomicString&, const ProgressEventInit&);
  • trunk/Source/WebCore/dom/SecurityPolicyViolationEvent.h

    r184225 r196400  
    3333
    3434struct SecurityPolicyViolationEventInit : public EventInit {
    35     SecurityPolicyViolationEventInit()
    36     {
    37     }
    38 
    3935    String documentURI;
    4036    String referrer;
     
    4440    String originalPolicy;
    4541    String sourceFile;
    46     int lineNumber;
     42    int lineNumber { 0 };
    4743};
    4844
    4945class SecurityPolicyViolationEvent final : public Event {
    5046public:
    51     static Ref<SecurityPolicyViolationEvent> create()
     47    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, int lineNumber)
     48    {
     49        return adoptRef(*new SecurityPolicyViolationEvent(type, canBubble, cancelable, documentURI, referrer, blockedURI, violatedDirective, effectiveDirective, originalPolicy, sourceFile, lineNumber));
     50    }
     51
     52    static Ref<SecurityPolicyViolationEvent> createForBindings()
    5253    {
    5354        return adoptRef(*new SecurityPolicyViolationEvent());
    5455    }
    5556
    56     static Ref<SecurityPolicyViolationEvent> create(const AtomicString& type, const SecurityPolicyViolationEventInit& initializer)
     57    static Ref<SecurityPolicyViolationEvent> createForBindings(const AtomicString& type, const SecurityPolicyViolationEventInit& initializer)
    5758    {
    5859        return adoptRef(*new SecurityPolicyViolationEvent(type, initializer));
     
    7273private:
    7374    SecurityPolicyViolationEvent()
     75    {
     76    }
     77
     78    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, int lineNumber)
     79        : Event(type, canBubble, cancelable)
     80        , m_documentURI(documentURI)
     81        , m_referrer(referrer)
     82        , m_blockedURI(blockedURI)
     83        , m_violatedDirective(violatedDirective)
     84        , m_effectiveDirective(effectiveDirective)
     85        , m_originalPolicy(originalPolicy)
     86        , m_sourceFile(sourceFile)
     87        , m_lineNumber(lineNumber)
    7488    {
    7589    }
  • trunk/Source/WebCore/dom/TextEvent.cpp

    r195927 r196400  
    3333namespace WebCore {
    3434
    35 Ref<TextEvent> TextEvent::create()
     35Ref<TextEvent> TextEvent::createForBindings()
    3636{
    3737    return adoptRef(*new TextEvent);
  • trunk/Source/WebCore/dom/TextEvent.h

    r195927 r196400  
    4040    class TextEvent final : public UIEvent {
    4141    public:
    42 
    43         static Ref<TextEvent> create();
    4442        static Ref<TextEvent> create(AbstractView*, const String& data, TextEventInputType = TextEventInputKeyboard);
     43        static Ref<TextEvent> createForBindings();
    4544        static Ref<TextEvent> createForPlainTextPaste(AbstractView*, const String& data, bool shouldSmartReplace);
    4645        static Ref<TextEvent> createForFragmentPaste(AbstractView*, RefPtr<DocumentFragment>&& data, bool shouldSmartReplace, bool shouldMatchStyle, MailBlockquoteHandling);
  • trunk/Source/WebCore/dom/TouchEvent.h

    r195899 r196400  
    4141    virtual ~TouchEvent();
    4242
    43     static Ref<TouchEvent> create()
    44     {
    45         return adoptRef(*new TouchEvent);
    46     }
    4743    static Ref<TouchEvent> create(TouchList* touches,
    4844            TouchList* targetTouches, TouchList* changedTouches,
     
    5450                type, view, screenX, screenY, pageX, pageY,
    5551                ctrlKey, altKey, shiftKey, metaKey));
     52    }
     53    static Ref<TouchEvent> createForBindings()
     54    {
     55        return adoptRef(*new TouchEvent);
    5656    }
    5757
  • trunk/Source/WebCore/dom/TransitionEvent.cpp

    r165676 r196400  
    3131
    3232namespace WebCore {
    33 
    34 TransitionEventInit::TransitionEventInit()
    35     : elapsedTime(0)
    36 {
    37 }
    38 
    39 TransitionEvent::TransitionEvent()
    40     : m_elapsedTime(0)
    41 {
    42 }
    4333
    4434TransitionEvent::TransitionEvent(const AtomicString& type, const String& propertyName, double elapsedTime, const String& pseudoElement)
  • trunk/Source/WebCore/dom/TransitionEvent.h

    r177264 r196400  
    3333
    3434struct TransitionEventInit : public EventInit {
    35     TransitionEventInit();
    36 
    3735    String propertyName;
    38     double elapsedTime;
     36    double elapsedTime { 0 };
    3937    String pseudoElement;
    4038};
     
    4240class TransitionEvent final : public Event {
    4341public:
    44     static Ref<TransitionEvent> create()
    45     {
    46         return adoptRef(*new TransitionEvent);
    47     }
    4842    static Ref<TransitionEvent> create(const AtomicString& type, const String& propertyName, double elapsedTime, const String& pseudoElement)
    4943    {
    5044        return adoptRef(*new TransitionEvent(type, propertyName, elapsedTime, pseudoElement));
    5145    }
    52     static Ref<TransitionEvent> create(const AtomicString& type, const TransitionEventInit& initializer)
     46    static Ref<TransitionEvent> createForBindings(const AtomicString& type, const TransitionEventInit& initializer)
    5347    {
    5448        return adoptRef(*new TransitionEvent(type, initializer));
     
    6458
    6559private:
    66     TransitionEvent();
    6760    TransitionEvent(const AtomicString& type, const String& propertyName, double elapsedTime, const String& pseudoElement);
    6861    TransitionEvent(const AtomicString& type, const TransitionEventInit& initializer);
  • trunk/Source/WebCore/dom/UIEvent.cpp

    r194896 r196400  
    2727
    2828namespace WebCore {
    29 
    30 UIEventInit::UIEventInit()
    31     : detail(0)
    32 {
    33 }
    34 
    35 UIEventInit::UIEventInit(bool bubbles, bool cancelable)
    36     : EventInit(bubbles, cancelable)
    37     , detail(0)
    38 {
    39 }
    40 
    4129   
    4230UIEvent::UIEvent()
  • trunk/Source/WebCore/dom/UIEvent.h

    r194896 r196400  
    3333
    3434struct UIEventInit : public EventInit {
    35     UIEventInit();
    36     UIEventInit(bool bubbles, bool cancelable);
    37 
    3835    RefPtr<AbstractView> view;
    39     int detail;
     36    int detail { 0 };
    4037};
    4138
    4239class UIEvent : public Event {
    4340public:
    44     static Ref<UIEvent> create()
    45     {
    46         return adoptRef(*new UIEvent);
    47     }
    4841    static Ref<UIEvent> create(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view, int detail)
    4942    {
    5043        return adoptRef(*new UIEvent(type, canBubble, cancelable, view, detail));
    5144    }
    52     static Ref<UIEvent> create(const AtomicString& type, const UIEventInit& initializer)
     45    static Ref<UIEvent> createForBindings()
     46    {
     47        return adoptRef(*new UIEvent);
     48    }
     49    static Ref<UIEvent> createForBindings(const AtomicString& type, const UIEventInit& initializer)
    5350    {
    5451        return adoptRef(*new UIEvent(type, initializer));
  • trunk/Source/WebCore/dom/UIEventWithKeyState.h

    r194896 r196400  
    2929namespace WebCore {
    3030
    31     class UIEventWithKeyState : public UIEvent {
    32     public:
    33         bool ctrlKey() const { return m_ctrlKey; }
    34         bool shiftKey() const { return m_shiftKey; }
    35         bool altKey() const { return m_altKey; }
    36         bool metaKey() const { return m_metaKey; }
     31struct UIEventWithKeyStateInit : public UIEventInit {
     32    bool ctrlKey { false };
     33    bool altKey { false };
     34    bool shiftKey { false };
     35    bool metaKey { false };
     36};
    3737
    38     protected:
    39         UIEventWithKeyState()
    40             : m_ctrlKey(false)
    41             , m_altKey(false)
    42             , m_shiftKey(false)
    43             , m_metaKey(false)
    44         {
    45         }
     38class UIEventWithKeyState : public UIEvent {
     39public:
     40    bool ctrlKey() const { return m_ctrlKey; }
     41    bool shiftKey() const { return m_shiftKey; }
     42    bool altKey() const { return m_altKey; }
     43    bool metaKey() const { return m_metaKey; }
    4644
    47         UIEventWithKeyState(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view,
    48                             int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
    49             : UIEvent(type, canBubble, cancelable, view, detail)
    50             , m_ctrlKey(ctrlKey)
    51             , m_altKey(altKey)
    52             , m_shiftKey(shiftKey)
    53             , m_metaKey(metaKey)
    54         {
    55         }
     45protected:
     46    UIEventWithKeyState()
     47        : m_ctrlKey(false)
     48        , m_altKey(false)
     49        , m_shiftKey(false)
     50        , m_metaKey(false)
     51    {
     52    }
    5653
    57         UIEventWithKeyState(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, AbstractView* view,
    58                             int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
    59             : UIEvent(type, canBubble, cancelable, timestamp, view, detail)
    60             , m_ctrlKey(ctrlKey)
    61             , m_altKey(altKey)
    62             , m_shiftKey(shiftKey)
    63             , m_metaKey(metaKey)
    64         {
    65         }
     54    UIEventWithKeyState(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view, int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
     55        : UIEvent(type, canBubble, cancelable, view, detail)
     56        , m_ctrlKey(ctrlKey)
     57        , m_altKey(altKey)
     58        , m_shiftKey(shiftKey)
     59        , m_metaKey(metaKey)
     60    {
     61    }
    6662
    67         // Expose these so init functions can set them.
    68         bool m_ctrlKey : 1;
    69         bool m_altKey : 1;
    70         bool m_shiftKey : 1;
    71         bool m_metaKey : 1;
    72     };
     63    UIEventWithKeyState(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, AbstractView* view, int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
     64        : UIEvent(type, canBubble, cancelable, timestamp, view, detail)
     65        , m_ctrlKey(ctrlKey)
     66        , m_altKey(altKey)
     67        , m_shiftKey(shiftKey)
     68        , m_metaKey(metaKey)
     69    {
     70    }
    7371
    74     WEBCORE_EXPORT UIEventWithKeyState* findEventWithKeyState(Event*);
     72    UIEventWithKeyState(const AtomicString& type, const UIEventWithKeyStateInit& initializer)
     73        : UIEvent(type, initializer)
     74        , m_ctrlKey(initializer.ctrlKey)
     75        , m_altKey(initializer.altKey)
     76        , m_shiftKey(initializer.shiftKey)
     77        , m_metaKey(initializer.metaKey)
     78    {
     79    }
     80
     81    // Expose these so init functions can set them.
     82    bool m_ctrlKey : 1;
     83    bool m_altKey : 1;
     84    bool m_shiftKey : 1;
     85    bool m_metaKey : 1;
     86};
     87
     88WEBCORE_EXPORT UIEventWithKeyState* findEventWithKeyState(Event*);
    7589
    7690} // namespace WebCore
  • trunk/Source/WebCore/dom/WebKitAnimationEvent.cpp

    r165676 r196400  
    3030
    3131namespace WebCore {
    32 
    33 WebKitAnimationEventInit::WebKitAnimationEventInit()
    34     : animationName()
    35     , elapsedTime(0.0)
    36 {
    37 }
    38 
    39 WebKitAnimationEvent::WebKitAnimationEvent()
    40     : m_elapsedTime(0.0)
    41 {
    42 }
    4332
    4433WebKitAnimationEvent::WebKitAnimationEvent(const AtomicString& type, const WebKitAnimationEventInit& initializer)
  • trunk/Source/WebCore/dom/WebKitAnimationEvent.h

    r177264 r196400  
    3232
    3333struct WebKitAnimationEventInit : public EventInit {
    34     WebKitAnimationEventInit();
    35 
    3634    String animationName;
    37     double elapsedTime;
     35    double elapsedTime { 0.0 };
    3836};
    3937
    4038class WebKitAnimationEvent final : public Event {
    4139public:
    42     static Ref<WebKitAnimationEvent> create()
    43     {
    44         return adoptRef(*new WebKitAnimationEvent);
    45     }
    4640    static Ref<WebKitAnimationEvent> create(const AtomicString& type, const String& animationName, double elapsedTime)
    4741    {
    4842        return adoptRef(*new WebKitAnimationEvent(type, animationName, elapsedTime));
    4943    }
    50     static Ref<WebKitAnimationEvent> create(const AtomicString& type, const WebKitAnimationEventInit& initializer)
     44    static Ref<WebKitAnimationEvent> createForBindings(const AtomicString& type, const WebKitAnimationEventInit& initializer)
    5145    {
    5246        return adoptRef(*new WebKitAnimationEvent(type, initializer));
     
    6155
    6256private:
    63     WebKitAnimationEvent();
    6457    WebKitAnimationEvent(const AtomicString& type, const String& animationName, double elapsedTime);
    6558    WebKitAnimationEvent(const AtomicString&, const WebKitAnimationEventInit&);
  • trunk/Source/WebCore/dom/WebKitTransitionEvent.cpp

    r165676 r196400  
    3030
    3131namespace WebCore {
    32 
    33 WebKitTransitionEventInit::WebKitTransitionEventInit()
    34     : elapsedTime(0)
    35 {
    36 }
    37 
    38 WebKitTransitionEvent::WebKitTransitionEvent()
    39     : m_elapsedTime(0)
    40 {
    41 }
    4232
    4333WebKitTransitionEvent::WebKitTransitionEvent(const AtomicString& type, const String& propertyName, double elapsedTime, const String& pseudoElement)
  • trunk/Source/WebCore/dom/WebKitTransitionEvent.h

    r177264 r196400  
    3232
    3333struct WebKitTransitionEventInit : public EventInit {
    34     WebKitTransitionEventInit();
    35 
    3634    String propertyName;
    37     double elapsedTime;
     35    double elapsedTime { 0 };
    3836    String pseudoElement;
    3937};
     
    4139class WebKitTransitionEvent final : public Event {
    4240public:
    43     static Ref<WebKitTransitionEvent> create()
    44     {
    45         return adoptRef(*new WebKitTransitionEvent);
    46     }
    4741    static Ref<WebKitTransitionEvent> create(const AtomicString& type, const String& propertyName, double elapsedTime, const String& pseudoElement)
    4842    {
    4943        return adoptRef(*new WebKitTransitionEvent(type, propertyName, elapsedTime, pseudoElement));
    5044    }
    51     static Ref<WebKitTransitionEvent> create(const AtomicString& type, const WebKitTransitionEventInit& initializer)
     45    static Ref<WebKitTransitionEvent> createForBindings(const AtomicString& type, const WebKitTransitionEventInit& initializer)
    5246    {
    5347        return adoptRef(*new WebKitTransitionEvent(type, initializer));
     
    6357
    6458private:
    65     WebKitTransitionEvent();
    6659    WebKitTransitionEvent(const AtomicString& type, const String& propertyName, double elapsedTime, const String& pseudoElement);
    6760    WebKitTransitionEvent(const AtomicString& type, const WebKitTransitionEventInit& initializer);
  • trunk/Source/WebCore/dom/WheelEvent.h

    r194324 r196400  
    5555    };
    5656
    57     static Ref<WheelEvent> create()
     57    static Ref<WheelEvent> create(const PlatformWheelEvent& event, AbstractView* view)
     58    {
     59        return adoptRef(*new WheelEvent(event, view));
     60    }
     61
     62    static Ref<WheelEvent> createForBindings()
    5863    {
    5964        return adoptRef(*new WheelEvent);
    6065    }
    6166
    62     static Ref<WheelEvent> create(const AtomicString& type, const WheelEventInit& initializer)
     67    static Ref<WheelEvent> createForBindings(const AtomicString& type, const WheelEventInit& initializer)
    6368    {
    6469        return adoptRef(*new WheelEvent(type, initializer));
    65     }
    66 
    67     static Ref<WheelEvent> create(const PlatformWheelEvent& event, AbstractView* view)
    68     {
    69         return adoptRef(*new WheelEvent(event, view));
    7070    }
    7171
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r196135 r196400  
    22322232void HTMLMediaElement::mediaPlayerKeyAdded(MediaPlayer*, const String& keySystem, const String& sessionId)
    22332233{
    2234     MediaKeyEventInit initializer;
    2235     initializer.keySystem = keySystem;
    2236     initializer.sessionId = sessionId;
    2237     initializer.bubbles = false;
    2238     initializer.cancelable = false;
    2239 
    2240     RefPtr<Event> event = MediaKeyEvent::create(eventNames().webkitkeyaddedEvent, initializer);
     2234    Ref<Event> event = MediaKeyEvent::create(eventNames().webkitkeyaddedEvent, keySystem, sessionId, nullptr, nullptr, emptyString(), nullptr, 0);
    22412235    event->setTarget(this);
    2242     m_asyncEventQueue.enqueueEvent(event.release());
     2236    m_asyncEventQueue.enqueueEvent(WTFMove(event));
    22432237}
    22442238
     
    22672261    }
    22682262
    2269     MediaKeyEventInit initializer;
    2270     initializer.keySystem = keySystem;
    2271     initializer.sessionId = sessionId;
    2272     initializer.errorCode = MediaKeyError::create(mediaKeyErrorCode);
    2273     initializer.systemCode = systemCode;
    2274     initializer.bubbles = false;
    2275     initializer.cancelable = false;
    2276 
    2277     RefPtr<Event> event = MediaKeyEvent::create(eventNames().webkitkeyerrorEvent, initializer);
     2263    Ref<Event> event = MediaKeyEvent::create(eventNames().webkitkeyerrorEvent, keySystem, sessionId, nullptr, nullptr, emptyString(), MediaKeyError::create(mediaKeyErrorCode), systemCode);
    22782264    event->setTarget(this);
    2279     m_asyncEventQueue.enqueueEvent(event.release());
     2265    m_asyncEventQueue.enqueueEvent(WTFMove(event));
    22802266}
    22812267
    22822268void HTMLMediaElement::mediaPlayerKeyMessage(MediaPlayer*, const String& keySystem, const String& sessionId, const unsigned char* message, unsigned messageLength, const URL& defaultURL)
    22832269{
    2284     MediaKeyEventInit initializer;
    2285     initializer.keySystem = keySystem;
    2286     initializer.sessionId = sessionId;
    2287     initializer.message = Uint8Array::create(message, messageLength);
    2288     initializer.defaultURL = defaultURL;
    2289     initializer.bubbles = false;
    2290     initializer.cancelable = false;
    2291 
    2292     RefPtr<Event> event = MediaKeyEvent::create(eventNames().webkitkeymessageEvent, initializer);
     2270    Ref<Event> event = MediaKeyEvent::create(eventNames().webkitkeymessageEvent, keySystem, sessionId, nullptr, Uint8Array::create(message, messageLength), defaultURL, nullptr, 0);
    22932271    event->setTarget(this);
    2294     m_asyncEventQueue.enqueueEvent(event.release());
     2272    m_asyncEventQueue.enqueueEvent(WTFMove(event));
    22952273}
    22962274
     
    23032281    }
    23042282
    2305     MediaKeyEventInit initializer;
    2306     initializer.keySystem = keySystem;
    2307     initializer.sessionId = sessionId;
    2308     initializer.initData = Uint8Array::create(initData, initDataLength);
    2309     initializer.bubbles = false;
    2310     initializer.cancelable = false;
    2311 
    2312     RefPtr<Event> event = MediaKeyEvent::create(eventNames().webkitneedkeyEvent, initializer);
     2283    Ref<Event> event = MediaKeyEvent::create(eventNames().webkitneedkeyEvent, keySystem, sessionId, Uint8Array::create(initData, initDataLength), nullptr, emptyString(), nullptr, 0);
    23132284    event->setTarget(this);
    2314     m_asyncEventQueue.enqueueEvent(event.release());
     2285    m_asyncEventQueue.enqueueEvent(WTFMove(event));
    23152286    return true;
    23162287}
     
    23312302    }
    23322303
    2333     MediaKeyNeededEventInit initializer;
    2334     initializer.initData = initData;
    2335     initializer.bubbles = false;
    2336     initializer.cancelable = false;
    2337 
    2338     RefPtr<Event> event = MediaKeyNeededEvent::create(eventNames().webkitneedkeyEvent, initializer);
     2304    RefPtr<Event> event = MediaKeyNeededEvent::create(eventNames().webkitneedkeyEvent, initData);
    23392305    event->setTarget(this);
    23402306    m_asyncEventQueue.enqueueEvent(event.release());
  • trunk/Source/WebCore/html/MediaKeyEvent.cpp

    r165676 r196400  
    3434namespace WebCore {
    3535
    36 MediaKeyEventInit::MediaKeyEventInit()
    37     : systemCode(0)
    38 {
    39 }
    40 
    41 MediaKeyEvent::MediaKeyEvent()
     36MediaKeyEvent::MediaKeyEvent(const AtomicString& type, const String& keySystem, const String& sessionId, RefPtr<Uint8Array>&& initData, RefPtr<Uint8Array>&& message, const String& defaultURL, RefPtr<MediaKeyError>&& errorCode, uint32_t systemCode)
     37    : Event(type, false, false)
     38    , m_keySystem(keySystem)
     39    , m_sessionId(sessionId)
     40    , m_initData(initData)
     41    , m_message(message)
     42    , m_defaultURL(defaultURL)
     43    , m_errorCode(errorCode)
     44    , m_systemCode(systemCode)
    4245{
    4346}
  • trunk/Source/WebCore/html/MediaKeyEvent.h

    r195410 r196400  
    3535
    3636struct MediaKeyEventInit : public EventInit {
    37     MediaKeyEventInit();
    38 
    3937    String keySystem;
    4038    String sessionId;
     
    4341    String defaultURL;
    4442    RefPtr<MediaKeyError> errorCode;
    45     uint32_t systemCode;
     43    uint32_t systemCode { 0 };
    4644};
    4745
     
    5048    virtual ~MediaKeyEvent();
    5149
    52     static Ref<MediaKeyEvent> create()
     50    static Ref<MediaKeyEvent> create(const AtomicString& type, const String& keySystem, const String& sessionId, RefPtr<Uint8Array>&& initData, RefPtr<Uint8Array>&& message, const String& defaultURL, RefPtr<MediaKeyError>&& errorCode, uint32_t systemCode)
    5351    {
    54         return adoptRef(*new MediaKeyEvent);
     52        return adoptRef(*new MediaKeyEvent(type, keySystem, sessionId, WTFMove(initData), WTFMove(message), defaultURL, WTFMove(errorCode), systemCode));
    5553    }
    5654
    57     static Ref<MediaKeyEvent> create(const AtomicString& type, const MediaKeyEventInit& initializer)
     55    static Ref<MediaKeyEvent> createForBindings(const AtomicString& type, const MediaKeyEventInit& initializer)
    5856    {
    5957        return adoptRef(*new MediaKeyEvent(type, initializer));
     
    7169
    7270private:
    73     MediaKeyEvent();
     71    MediaKeyEvent(const AtomicString& type, const String& keySystem, const String& sessionId, RefPtr<Uint8Array>&& initData, RefPtr<Uint8Array>&& message, const String& defaultURL, RefPtr<MediaKeyError>&& errorCode, uint32_t systemCode);
     72
    7473    MediaKeyEvent(const AtomicString& type, const MediaKeyEventInit& initializer);
    7574
  • trunk/Source/WebCore/html/canvas/WebGLContextEvent.cpp

    r156241 r196400  
    3333namespace WebCore {
    3434
    35 WebGLContextEventInit::WebGLContextEventInit()
    36 {
    37 }
    38 
    39 WebGLContextEvent::WebGLContextEvent()
    40 {
    41 }
    42 
    4335WebGLContextEvent::WebGLContextEvent(const AtomicString& type, bool canBubble, bool cancelable, const String& statusMessage)
    4436    : Event(type, canBubble, cancelable)
  • trunk/Source/WebCore/html/canvas/WebGLContextEvent.h

    r177264 r196400  
    3232
    3333struct WebGLContextEventInit : public EventInit {
    34     WebGLContextEventInit();
    35 
    3634    String statusMessage;
    3735};
     
    3937class WebGLContextEvent final : public Event {
    4038public:
    41     static Ref<WebGLContextEvent> create()
    42     {
    43         return adoptRef(*new WebGLContextEvent);
    44     }
    4539    static Ref<WebGLContextEvent> create(const AtomicString& type, bool canBubble, bool cancelable, const String& statusMessage)
    4640    {
    4741        return adoptRef(*new WebGLContextEvent(type, canBubble, cancelable, statusMessage));
    4842    }
    49     static Ref<WebGLContextEvent> create(const AtomicString& type, const WebGLContextEventInit& initializer)
     43    static Ref<WebGLContextEvent> createForBindings(const AtomicString& type, const WebGLContextEventInit& initializer)
    5044    {
    5145        return adoptRef(*new WebGLContextEvent(type, initializer));
     
    5852
    5953private:
    60     WebGLContextEvent();
    6154    WebGLContextEvent(const AtomicString& type, bool canBubble, bool cancelable, const String& statusMessage);
    6255    WebGLContextEvent(const AtomicString&, const WebGLContextEventInit&);
  • trunk/Source/WebCore/html/track/TrackEvent.cpp

    r165676 r196400  
    3434namespace WebCore {
    3535
    36 TrackEventInit::TrackEventInit()
    37 {
    38 }
    39 
    40 
    41 TrackEvent::TrackEvent()
     36TrackEvent::TrackEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<TrackBase>&& track)
     37    : Event(type, canBubble, cancelable)
     38    , m_track(track)
    4239{
    4340}
  • trunk/Source/WebCore/html/track/TrackEvent.h

    r177264 r196400  
    3535
    3636struct TrackEventInit : public EventInit {
    37     TrackEventInit();
    38 
    3937    RefPtr<TrackBase> track;
    4038};
     
    4442    virtual ~TrackEvent();
    4543
    46     static Ref<TrackEvent> create()
     44    static Ref<TrackEvent> create(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<TrackBase>&& track)
    4745    {
    48         return adoptRef(*new TrackEvent);
     46        return adoptRef(*new TrackEvent(type, canBubble, cancelable, WTFMove(track)));
    4947    }
    5048
    51     static Ref<TrackEvent> create(const AtomicString& type, const TrackEventInit& initializer)
     49    static Ref<TrackEvent> createForBindings(const AtomicString& type, const TrackEventInit& initializer)
    5250    {
    5351        return adoptRef(*new TrackEvent(type, initializer));
     
    5957
    6058private:
    61     TrackEvent();
     59    TrackEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<TrackBase>&&);
    6260    TrackEvent(const AtomicString& type, const TrackEventInit& initializer);
    6361
  • trunk/Source/WebCore/html/track/TrackListBase.cpp

    r190613 r196400  
    8282void TrackListBase::scheduleTrackEvent(const AtomicString& eventName, PassRefPtr<TrackBase> track)
    8383{
    84     TrackEventInit initializer;
    85     initializer.track = track;
    86     initializer.bubbles = false;
    87     initializer.cancelable = false;
    88 
    89     m_asyncEventQueue.enqueueEvent(TrackEvent::create(eventName, initializer));
     84    m_asyncEventQueue.enqueueEvent(TrackEvent::create(eventName, false, false, track));
    9085}
    9186
     
    150145    // selected, the user agent must queue a task to fire a simple event named
    151146    // change at the VideoTrackList object.
    152 
    153     EventInit initializer;
    154     initializer.bubbles = false;
    155     initializer.cancelable = false;
    156 
    157     m_asyncEventQueue.enqueueEvent(Event::create(eventNames().changeEvent, initializer));
     147    m_asyncEventQueue.enqueueEvent(Event::create(eventNames().changeEvent, false, false));
    158148}
    159149
  • trunk/Source/WebCore/page/EventSource.cpp

    r196283 r196400  
    414414Ref<MessageEvent> EventSource::createMessageEvent()
    415415{
    416     Ref<MessageEvent> event = MessageEvent::create();
    417     event->initMessageEvent(m_eventName.isEmpty() ? eventNames().messageEvent : AtomicString(m_eventName), false, false, SerializedScriptValue::create(String::adopt(m_data)), m_eventStreamOrigin, m_lastEventId, 0, 0);
    418     return event;
     416    return MessageEvent::create(m_eventName.isEmpty() ? eventNames().messageEvent : AtomicString(m_eventName), false, false, SerializedScriptValue::create(String::adopt(m_data)), m_eventStreamOrigin, m_lastEventId);
    419417}
    420418
  • trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp

    r196350 r196400  
    326326}
    327327
    328 #if ENABLE(CSP_NEXT)
    329 static void gatherSecurityPolicyViolationEventData(SecurityPolicyViolationEventInit& init, Document& document, const String& directiveText, const String& effectiveDirective, const URL& blockedURL, const String& header)
    330 {
    331     init.documentURI = document.url().string();
    332     init.referrer = document.referrer();
    333     init.blockedURI = stripURLForUseInReport(document, blockedURL);
    334     init.violatedDirective = directiveText;
    335     init.effectiveDirective = effectiveDirective;
    336     init.originalPolicy = header;
    337     init.sourceFile = String();
    338     init.lineNumber = 0;
    339 
    340     RefPtr<ScriptCallStack> stack = createScriptCallStack(JSMainThreadExecState::currentState(), 2);
    341     const ScriptCallFrame* callFrame = stack->firstNonNativeCallFrame();
    342     if (callFrame && callFrame->lineNumber()) {
    343         URL source = URL(URL(), callFrame->sourceURL());
    344         init.sourceFile = stripURLForUseInReport(document, source);
    345         init.lineNumber = callFrame->lineNumber();
    346     }
    347 }
    348 #endif
    349 
    350328void ContentSecurityPolicy::reportViolation(const String& directiveText, const String& effectiveDirective, const String& consoleMessage, const URL& blockedURL, const Vector<String>& reportURIs, const String& header, const String& contextURL, const WTF::OrdinalNumber& contextLine, JSC::ExecState* state) const
    351329{
     
    364342    if (experimentalFeaturesEnabled()) {
    365343        // FIXME: This code means that we're gathering information like line numbers twice. Once we can bring this out from behind the flag, we should reuse the data gathered here when generating the JSON report below.
    366         SecurityPolicyViolationEventInit init;
    367         gatherSecurityPolicyViolationEventData(init, document, directiveText, effectiveDirective, blockedURL, header);
    368         document.enqueueDocumentEvent(SecurityPolicyViolationEvent::create(eventNames().securitypolicyviolationEvent, init));
     344        String documentURI = document.url().string();
     345        String referrer = document.referrer();
     346        String blockedURI = stripURLForUseInReport(document, blockedURL);
     347        String violatedDirective = directiveText;
     348        String originalPolicy = header;
     349        String sourceFile = String();
     350        int lineNumber = 0;
     351       
     352        Ref<ScriptCallStack> stack = createScriptCallStack(JSMainThreadExecState::currentState(), 2);
     353        const ScriptCallFrame* callFrame = stack->firstNonNativeCallFrame();
     354        if (callFrame && callFrame->lineNumber()) {
     355            URL source = URL(URL(), callFrame->sourceURL());
     356            sourceFile = stripURLForUseInReport(document, source);
     357            lineNumber = callFrame->lineNumber();
     358        }
     359
     360        document.enqueueDocumentEvent(SecurityPolicyViolationEvent::create(eventNames().securitypolicyviolationEvent, false, false, documentURI, referrer, blockedURI, violatedDirective, effectiveDirective, originalPolicy, sourceFile, lineNumber));
    369361    }
    370362#endif
  • trunk/Source/WebCore/storage/StorageEvent.cpp

    r177264 r196400  
    3232namespace WebCore {
    3333
    34 StorageEventInit::StorageEventInit()
    35 {
    36 }
    37 
    38 Ref<StorageEvent> StorageEvent::create()
     34Ref<StorageEvent> StorageEvent::createForBindings()
    3935{
    4036    return adoptRef(*new StorageEvent);
     
    5450}
    5551
    56 Ref<StorageEvent> StorageEvent::create(const AtomicString& type, const StorageEventInit& initializer)
     52Ref<StorageEvent> StorageEvent::createForBindings(const AtomicString& type, const StorageEventInit& initializer)
    5753{
    5854    return adoptRef(*new StorageEvent(type, initializer));
  • trunk/Source/WebCore/storage/StorageEvent.h

    r177264 r196400  
    3535
    3636struct StorageEventInit : public EventInit {
    37     StorageEventInit();
    38 
    3937    String key;
    4038    String oldValue;
     
    4644class StorageEvent : public Event {
    4745public:
    48     static Ref<StorageEvent> create();
    4946    static Ref<StorageEvent> create(const AtomicString& type, const String& key, const String& oldValue, const String& newValue, const String& url, Storage* storageArea);
    50     static Ref<StorageEvent> create(const AtomicString&, const StorageEventInit&);
     47    static Ref<StorageEvent> createForBindings();
     48    static Ref<StorageEvent> createForBindings(const AtomicString&, const StorageEventInit&);
    5149    virtual ~StorageEvent();
    5250
  • trunk/Source/WebCore/svg/SVGZoomEvent.h

    r177264 r196400  
    3131class SVGZoomEvent : public UIEvent {
    3232public:
    33     static Ref<SVGZoomEvent> create() { return adoptRef(*new SVGZoomEvent); }
     33    static Ref<SVGZoomEvent> createForBindings() { return adoptRef(*new SVGZoomEvent); }
    3434
    3535    // 'SVGZoomEvent' functions
  • trunk/Source/WebCore/xml/XMLHttpRequestProgressEvent.h

    r177264 r196400  
    3434class XMLHttpRequestProgressEvent : public ProgressEvent {
    3535public:
    36     static Ref<XMLHttpRequestProgressEvent> create()
    37     {
    38         return adoptRef(*new XMLHttpRequestProgressEvent);
    39     }
    4036    static Ref<XMLHttpRequestProgressEvent> create(const AtomicString& type, bool lengthComputable = false, unsigned long long loaded = 0, unsigned long long total = 0)
    4137    {
    4238        return adoptRef(*new XMLHttpRequestProgressEvent(type, lengthComputable, loaded, total));
    4339    }
    44 
    4540    // Those 2 synonyms are included for compatibility with Firefox.
    4641    unsigned long long position() const { return loaded(); }
     
    5045
    5146private:
    52     XMLHttpRequestProgressEvent() { }
    5347    XMLHttpRequestProgressEvent(const AtomicString& type, bool lengthComputable, unsigned long long loaded, unsigned long long total)
    5448        : ProgressEvent(type, lengthComputable, loaded, total)
  • trunk/Source/WebKit2/ChangeLog

    r196399 r196400  
     12016-02-10  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        Rename *Event::create* which creates events for bindings to *Event::createForBindings* and cleanup corresponding paths
     4        https://bugs.webkit.org/show_bug.cgi?id=153903
     5        <rdar://problem/24518146>
     6
     7        Reviewed by Darin Adler.
     8
     9        * WebProcess/WebPage/ios/WebPageIOS.mm:
     10        (WebKit::nextAssistableElement):
     11
    1122016-02-10  Anders Carlsson  <andersca@apple.com>
    213
  • trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm

    r195769 r196400  
    23492349        return nullptr;
    23502350
    2351     RefPtr<KeyboardEvent> key = KeyboardEvent::create();
     2351    RefPtr<KeyboardEvent> key = KeyboardEvent::createForBindings();
    23522352
    23532353    Element* nextElement = downcast<Element>(startNode);
Note: See TracChangeset for help on using the changeset viewer.