Changeset 196400 in webkit
- Timestamp:
- Feb 10, 2016, 4:03:11 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 100 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r196396 r196400 1 2016-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 1 247 2016-02-10 Ryan Haddad <ryanhaddad@apple.com> 2 248 -
trunk/Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp
r194819 r196400 41 41 } 42 42 43 WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent()44 {45 }46 47 43 WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent(const AtomicString& eventType, bool available) 48 44 : Event(eventType, false, false) -
trunk/Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h
r180416 r196400 34 34 35 35 struct WebKitPlaybackTargetAvailabilityEventInit : public EventInit { 36 WebKitPlaybackTargetAvailabilityEventInit()37 {38 };39 40 36 String availability; 41 37 }; … … 45 41 ~WebKitPlaybackTargetAvailabilityEvent() { } 46 42 47 static Ref<WebKitPlaybackTargetAvailabilityEvent> create()48 {49 return adoptRef(*new WebKitPlaybackTargetAvailabilityEvent);50 }51 52 43 static Ref<WebKitPlaybackTargetAvailabilityEvent> create(const AtomicString& eventType, bool available) 53 44 { … … 55 46 } 56 47 57 static Ref<WebKitPlaybackTargetAvailabilityEvent> create (const AtomicString& eventType, const WebKitPlaybackTargetAvailabilityEventInit& initializer)48 static Ref<WebKitPlaybackTargetAvailabilityEvent> createForBindings(const AtomicString& eventType, const WebKitPlaybackTargetAvailabilityEventInit& initializer) 58 49 { 59 50 return adoptRef(*new WebKitPlaybackTargetAvailabilityEvent(eventType, initializer)); … … 65 56 66 57 private: 67 WebKitPlaybackTargetAvailabilityEvent();68 58 explicit WebKitPlaybackTargetAvailabilityEvent(const AtomicString& eventType, bool available); 69 59 WebKitPlaybackTargetAvailabilityEvent(const AtomicString& eventType, const WebKitPlaybackTargetAvailabilityEventInit&); -
trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.cpp
r165676 r196400 35 35 namespace WebCore { 36 36 37 MediaKeyMessageEventInit::MediaKeyMessageEventInit() 37 MediaKeyMessageEvent::MediaKeyMessageEvent(const AtomicString& type, Uint8Array* message, const String& destinationURL) 38 : Event(type, false, false) 39 , m_message(message) 40 , m_destinationURL(destinationURL) 38 41 { 39 42 } 40 43 41 MediaKeyMessageEvent::MediaKeyMessageEvent()42 {43 }44 44 45 45 MediaKeyMessageEvent::MediaKeyMessageEvent(const AtomicString& type, const MediaKeyMessageEventInit& initializer) -
trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.h
r177264 r196400 36 36 37 37 struct MediaKeyMessageEventInit : public EventInit { 38 MediaKeyMessageEventInit();39 40 38 RefPtr<Uint8Array> message; 41 39 String destinationURL; … … 46 44 virtual ~MediaKeyMessageEvent(); 47 45 48 static Ref<MediaKeyMessageEvent> create( )46 static Ref<MediaKeyMessageEvent> create(const AtomicString& type, Uint8Array* message, const String& destinationURL) 49 47 { 50 return adoptRef(*new MediaKeyMessageEvent );48 return adoptRef(*new MediaKeyMessageEvent(type, message, destinationURL)); 51 49 } 52 50 53 static Ref<MediaKeyMessageEvent> create (const AtomicString& type, const MediaKeyMessageEventInit& initializer)51 static Ref<MediaKeyMessageEvent> createForBindings(const AtomicString& type, const MediaKeyMessageEventInit& initializer) 54 52 { 55 53 return adoptRef(*new MediaKeyMessageEvent(type, initializer)); … … 62 60 63 61 private: 64 MediaKeyMessageEvent( );62 MediaKeyMessageEvent(const AtomicString& type, Uint8Array* message, const String& destinationURL); 65 63 MediaKeyMessageEvent(const AtomicString& type, const MediaKeyMessageEventInit& initializer); 66 64 -
trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.cpp
r165676 r196400 35 35 namespace WebCore { 36 36 37 MediaKeyNeededEventInit::MediaKeyNeededEventInit() 38 { 39 } 40 41 MediaKeyNeededEvent::MediaKeyNeededEvent() 37 MediaKeyNeededEvent::MediaKeyNeededEvent(const AtomicString& type, Uint8Array* initData) 38 : Event(type, false, false) 39 , m_initData(initData) 42 40 { 43 41 } -
trunk/Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.h
r177264 r196400 35 35 36 36 struct MediaKeyNeededEventInit : public EventInit { 37 MediaKeyNeededEventInit();38 39 37 RefPtr<Uint8Array> initData; 40 38 }; … … 44 42 virtual ~MediaKeyNeededEvent(); 45 43 46 static Ref<MediaKeyNeededEvent> create( )44 static Ref<MediaKeyNeededEvent> create(const AtomicString& type, Uint8Array* initData) 47 45 { 48 return adoptRef(*new MediaKeyNeededEvent );46 return adoptRef(*new MediaKeyNeededEvent(type, initData)); 49 47 } 50 48 51 static Ref<MediaKeyNeededEvent> create (const AtomicString& type, const MediaKeyNeededEventInit& initializer)49 static Ref<MediaKeyNeededEvent> createForBindings(const AtomicString& type, const MediaKeyNeededEventInit& initializer) 52 50 { 53 51 return adoptRef(*new MediaKeyNeededEvent(type, initializer)); … … 59 57 60 58 private: 61 MediaKeyNeededEvent( );59 MediaKeyNeededEvent(const AtomicString& type, Uint8Array* initData); 62 60 MediaKeyNeededEvent(const AtomicString& type, const MediaKeyNeededEventInit& initializer); 63 61 -
trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp
r195410 r196400 210 210 void MediaKeySession::sendMessage(Uint8Array* message, String destinationURL) 211 211 { 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); 218 213 event->setTarget(this); 219 214 m_asyncEventQueue.enqueueEvent(event.release()); -
trunk/Source/WebCore/Modules/gamepad/GamepadEvent.cpp
r172890 r196400 30 30 namespace WebCore { 31 31 32 GamepadEvent::GamepadEvent()33 {34 }35 36 32 GamepadEvent::GamepadEvent(const AtomicString& eventType, Gamepad& gamepad) 37 33 : Event(eventType, false, false) -
trunk/Source/WebCore/Modules/gamepad/GamepadEvent.h
r177264 r196400 35 35 36 36 struct GamepadEventInit : public EventInit { 37 GamepadEventInit()38 {39 }40 41 37 RefPtr<Gamepad> gamepad; 42 38 }; … … 46 42 ~GamepadEvent() { } 47 43 48 static Ref<GamepadEvent> create()49 {50 return adoptRef(*new GamepadEvent);51 }52 53 44 static Ref<GamepadEvent> create(const AtomicString& eventType, Gamepad& gamepad) 54 45 { … … 56 47 } 57 48 58 static Ref<GamepadEvent> create (const AtomicString& eventType, const GamepadEventInit& initializer)49 static Ref<GamepadEvent> createForBindings(const AtomicString& eventType, const GamepadEventInit& initializer) 59 50 { 60 51 return adoptRef(*new GamepadEvent(eventType, initializer)); … … 66 57 67 58 private: 68 GamepadEvent();69 59 explicit GamepadEvent(const AtomicString& eventType, Gamepad&); 70 60 GamepadEvent(const AtomicString& eventType, const GamepadEventInit&); -
trunk/Source/WebCore/Modules/indieui/UIRequestEvent.cpp
r194896 r196400 31 31 namespace WebCore { 32 32 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) 33 Ref<UIRequestEvent> UIRequestEvent::createForBindings(const AtomicString& type, const UIRequestEventInit& initializer) 45 34 { 46 35 return adoptRef(*new UIRequestEvent(type, initializer)); … … 53 42 54 43 UIRequestEvent::UIRequestEvent(const AtomicString& type, const UIRequestEventInit& initializer) 55 : UIEvent(type, initializer .bubbles, initializer.cancelable, initializer.view.get(), initializer.detail)44 : UIEvent(type, initializer) 56 45 , m_receiver(initializer.receiver) 57 46 { … … 61 50 : UIEvent(type, bubbles, cancelable, view, detail) 62 51 , m_receiver(receiver) 63 {64 }65 66 UIRequestEvent::UIRequestEvent()67 : m_receiver(nullptr)68 52 { 69 53 } -
trunk/Source/WebCore/Modules/indieui/UIRequestEvent.h
r194896 r196400 35 35 36 36 struct UIRequestEventInit : public UIEventInit { 37 UIRequestEventInit();38 39 37 RefPtr<EventTarget> receiver; 40 38 }; … … 42 40 class UIRequestEvent : public UIEvent { 43 41 public: 44 static Ref<UIRequestEvent> create();45 42 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&); 48 44 49 45 virtual ~UIRequestEvent(); … … 55 51 56 52 UIRequestEvent(const AtomicString& type, const UIRequestEventInit&); 57 58 UIRequestEvent();59 53 60 54 EventInterface eventInterface() const override; -
trunk/Source/WebCore/Modules/mediastream/MediaStreamEvent.cpp
r185336 r196400 33 33 namespace WebCore { 34 34 35 MediaStreamEventInit::MediaStreamEventInit()36 : stream(nullptr)37 {38 }39 40 Ref<MediaStreamEvent> MediaStreamEvent::create()41 {42 return adoptRef(*new MediaStreamEvent);43 }44 45 35 Ref<MediaStreamEvent> MediaStreamEvent::create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStream> stream) 46 36 { … … 48 38 } 49 39 50 Ref<MediaStreamEvent> MediaStreamEvent::create (const AtomicString& type, const MediaStreamEventInit& initializer)40 Ref<MediaStreamEvent> MediaStreamEvent::createForBindings(const AtomicString& type, const MediaStreamEventInit& initializer) 51 41 { 52 42 return adoptRef(*new MediaStreamEvent(type, initializer)); 53 }54 55 MediaStreamEvent::MediaStreamEvent()56 {57 43 } 58 44 -
trunk/Source/WebCore/Modules/mediastream/MediaStreamEvent.h
r177264 r196400 35 35 36 36 struct MediaStreamEventInit : public EventInit { 37 MediaStreamEventInit();38 39 37 RefPtr<MediaStream> stream; 40 38 }; … … 44 42 virtual ~MediaStreamEvent(); 45 43 46 static Ref<MediaStreamEvent> create();47 44 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); 49 46 50 47 MediaStream* stream() const; … … 53 50 54 51 private: 55 MediaStreamEvent();56 52 MediaStreamEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStream>); 57 53 MediaStreamEvent(const AtomicString& type, const MediaStreamEventInit&); -
trunk/Source/WebCore/Modules/mediastream/MediaStreamTrackEvent.cpp
r185336 r196400 33 33 namespace WebCore { 34 34 35 MediaStreamTrackEventInit::MediaStreamTrackEventInit()36 : track(nullptr)37 {38 }39 40 Ref<MediaStreamTrackEvent> MediaStreamTrackEvent::create()41 {42 return adoptRef(*new MediaStreamTrackEvent);43 }44 45 35 Ref<MediaStreamTrackEvent> MediaStreamTrackEvent::create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStreamTrack> track) 46 36 { … … 48 38 } 49 39 50 Ref<MediaStreamTrackEvent> MediaStreamTrackEvent::create (const AtomicString& type, const MediaStreamTrackEventInit& initializer)40 Ref<MediaStreamTrackEvent> MediaStreamTrackEvent::createForBindings(const AtomicString& type, const MediaStreamTrackEventInit& initializer) 51 41 { 52 42 return adoptRef(*new MediaStreamTrackEvent(type, initializer)); 53 }54 55 MediaStreamTrackEvent::MediaStreamTrackEvent()56 {57 43 } 58 44 -
trunk/Source/WebCore/Modules/mediastream/MediaStreamTrackEvent.h
r177264 r196400 36 36 37 37 struct MediaStreamTrackEventInit : public EventInit { 38 MediaStreamTrackEventInit();39 40 38 RefPtr<MediaStreamTrack> track; 41 39 }; … … 45 43 virtual ~MediaStreamTrackEvent(); 46 44 47 static Ref<MediaStreamTrackEvent> create();48 45 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); 50 47 51 48 MediaStreamTrack* track() const; … … 55 52 56 53 private: 57 MediaStreamTrackEvent();58 54 MediaStreamTrackEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStreamTrack>); 59 55 MediaStreamTrackEvent(const AtomicString& type, const MediaStreamTrackEventInit&); -
trunk/Source/WebCore/Modules/mediastream/RTCDTMFToneChangeEvent.cpp
r177264 r196400 33 33 namespace WebCore { 34 34 35 Ref<RTCDTMFToneChangeEvent> RTCDTMFToneChangeEvent::create()36 {37 return adoptRef(*new RTCDTMFToneChangeEvent);38 }39 40 35 Ref<RTCDTMFToneChangeEvent> RTCDTMFToneChangeEvent::create(const String& tone) 41 36 { … … 43 38 } 44 39 45 Ref<RTCDTMFToneChangeEvent> RTCDTMFToneChangeEvent::create (const AtomicString& type, const RTCDTMFToneChangeEventInit& initializer)40 Ref<RTCDTMFToneChangeEvent> RTCDTMFToneChangeEvent::createForBindings(const AtomicString& type, const RTCDTMFToneChangeEventInit& initializer) 46 41 { 47 42 ASSERT_UNUSED(type, type == eventNames().tonechangeEvent); 48 43 return adoptRef(*new RTCDTMFToneChangeEvent(initializer)); 49 }50 51 RTCDTMFToneChangeEvent::RTCDTMFToneChangeEvent()52 {53 44 } 54 45 -
trunk/Source/WebCore/Modules/mediastream/RTCDTMFToneChangeEvent.h
r177264 r196400 42 42 virtual ~RTCDTMFToneChangeEvent(); 43 43 44 static Ref<RTCDTMFToneChangeEvent> create();45 44 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); 47 46 48 47 const String& tone() const; … … 51 50 52 51 private: 53 RTCDTMFToneChangeEvent();54 52 explicit RTCDTMFToneChangeEvent(const String& tone); 55 53 explicit RTCDTMFToneChangeEvent(const RTCDTMFToneChangeEventInit&); -
trunk/Source/WebCore/Modules/mediastream/RTCDataChannelEvent.cpp
r177264 r196400 33 33 namespace WebCore { 34 34 35 Ref<RTCDataChannelEvent> RTCDataChannelEvent::create()36 {37 return adoptRef(*new RTCDataChannelEvent);38 }39 40 35 Ref<RTCDataChannelEvent> RTCDataChannelEvent::create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<RTCDataChannel> channel) 41 36 { 42 37 return adoptRef(*new RTCDataChannelEvent(type, canBubble, cancelable, channel)); 43 }44 45 RTCDataChannelEvent::RTCDataChannelEvent()46 {47 38 } 48 39 -
trunk/Source/WebCore/Modules/mediastream/RTCDataChannelEvent.h
r177264 r196400 38 38 virtual ~RTCDataChannelEvent(); 39 39 40 static Ref<RTCDataChannelEvent> create();41 40 static Ref<RTCDataChannelEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<RTCDataChannel>); 42 41 … … 46 45 47 46 private: 48 RTCDataChannelEvent();49 47 RTCDataChannelEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<RTCDataChannel>); 50 48 -
trunk/Source/WebCore/Modules/mediastream/RTCIceCandidateEvent.cpp
r194496 r196400 34 34 namespace WebCore { 35 35 36 Ref<RTCIceCandidateEvent> RTCIceCandidateEvent::create()37 {38 return adoptRef(*new RTCIceCandidateEvent);39 }40 41 36 Ref<RTCIceCandidateEvent> RTCIceCandidateEvent::create(bool canBubble, bool cancelable, RefPtr<RTCIceCandidate>&& candidate) 42 37 { 43 38 return adoptRef(*new RTCIceCandidateEvent(canBubble, cancelable, WTFMove(candidate))); 44 }45 46 RTCIceCandidateEvent::RTCIceCandidateEvent()47 {48 39 } 49 40 -
trunk/Source/WebCore/Modules/mediastream/RTCIceCandidateEvent.h
r192464 r196400 38 38 virtual ~RTCIceCandidateEvent(); 39 39 40 static Ref<RTCIceCandidateEvent> create();41 40 static Ref<RTCIceCandidateEvent> create(bool canBubble, bool cancelable, RefPtr<RTCIceCandidate>&&); 42 41 … … 46 45 47 46 private: 48 RTCIceCandidateEvent();49 47 RTCIceCandidateEvent(bool canBubble, bool cancelable, RefPtr<RTCIceCandidate>&&); 50 48 -
trunk/Source/WebCore/Modules/mediastream/RTCTrackEvent.cpp
r194496 r196400 40 40 namespace WebCore { 41 41 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 53 42 Ref<RTCTrackEvent> RTCTrackEvent::create(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<RTCRtpReceiver>&& receiver, RefPtr<MediaStreamTrack>&& track) 54 43 { … … 56 45 } 57 46 58 Ref<RTCTrackEvent> RTCTrackEvent::create (const AtomicString& type, const RTCTrackEventInit& initializer)47 Ref<RTCTrackEvent> RTCTrackEvent::createForBindings(const AtomicString& type, const RTCTrackEventInit& initializer) 59 48 { 60 49 return adoptRef(*new RTCTrackEvent(type, initializer)); 61 }62 63 RTCTrackEvent::RTCTrackEvent()64 {65 50 } 66 51 -
trunk/Source/WebCore/Modules/mediastream/RTCTrackEvent.h
r192464 r196400 43 43 44 44 struct RTCTrackEventInit : public EventInit { 45 RTCTrackEventInit();46 47 45 RefPtr<RTCRtpReceiver> receiver; 48 46 RefPtr<MediaStreamTrack> track; … … 51 49 class RTCTrackEvent : public Event { 52 50 public: 53 static Ref<RTCTrackEvent> create();54 51 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&); 56 53 57 54 RTCRtpReceiver* receiver() const { return m_receiver.get(); } … … 61 58 62 59 private: 63 RTCTrackEvent();64 60 RTCTrackEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<RTCRtpReceiver>&&, RefPtr<MediaStreamTrack>&&); 65 61 RTCTrackEvent(const AtomicString& type, const RTCTrackEventInit&); -
trunk/Source/WebCore/Modules/speech/SpeechSynthesisEvent.cpp
r177264 r196400 30 30 31 31 namespace WebCore { 32 33 Ref<SpeechSynthesisEvent> SpeechSynthesisEvent::create()34 {35 return adoptRef(*new SpeechSynthesisEvent());36 }37 32 38 Ref<SpeechSynthesisEvent> SpeechSynthesisEvent::create(const AtomicString& type, unsigned longcharIndex, float elapsedTime, const String& name)33 Ref<SpeechSynthesisEvent> SpeechSynthesisEvent::create(const AtomicString& type, unsigned charIndex, float elapsedTime, const String& name) 39 34 { 40 35 return adoptRef(*new SpeechSynthesisEvent(type, charIndex, elapsedTime, name)); 41 36 } 42 37 43 SpeechSynthesisEvent::SpeechSynthesisEvent() 44 { 45 } 46 47 SpeechSynthesisEvent::SpeechSynthesisEvent(const AtomicString& type, unsigned long charIndex, float elapsedTime, const String& name) 38 SpeechSynthesisEvent::SpeechSynthesisEvent(const AtomicString& type, unsigned charIndex, float elapsedTime, const String& name) 48 39 : Event(type, false, false) 49 40 , m_charIndex(charIndex) -
trunk/Source/WebCore/Modules/speech/SpeechSynthesisEvent.h
r177264 r196400 36 36 class SpeechSynthesisEvent : public Event { 37 37 public: 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); 40 39 41 40 unsigned long charIndex() const { return m_charIndex; } … … 46 45 47 46 private: 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); 50 48 51 49 unsigned long m_charIndex; -
trunk/Source/WebCore/Modules/webaudio/AudioProcessingEvent.cpp
r177264 r196400 34 34 namespace WebCore { 35 35 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 46 36 AudioProcessingEvent::AudioProcessingEvent() 47 37 { -
trunk/Source/WebCore/Modules/webaudio/AudioProcessingEvent.h
r177264 r196400 37 37 class AudioProcessingEvent : public Event { 38 38 public: 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 } 41 48 42 49 virtual ~AudioProcessingEvent(); -
trunk/Source/WebCore/Modules/webaudio/OfflineAudioCompletionEvent.cpp
r177264 r196400 34 34 namespace WebCore { 35 35 36 Ref<OfflineAudioCompletionEvent> OfflineAudioCompletionEvent::create()37 {38 return adoptRef(*new OfflineAudioCompletionEvent);39 }40 41 36 Ref<OfflineAudioCompletionEvent> OfflineAudioCompletionEvent::create(PassRefPtr<AudioBuffer> renderedBuffer) 42 37 { 43 38 return adoptRef(*new OfflineAudioCompletionEvent(renderedBuffer)); 44 39 } 45 46 OfflineAudioCompletionEvent::OfflineAudioCompletionEvent()47 {48 }49 50 40 51 41 OfflineAudioCompletionEvent::OfflineAudioCompletionEvent(PassRefPtr<AudioBuffer> renderedBuffer) -
trunk/Source/WebCore/Modules/webaudio/OfflineAudioCompletionEvent.h
r177264 r196400 37 37 class OfflineAudioCompletionEvent : public Event { 38 38 public: 39 static Ref<OfflineAudioCompletionEvent> create();40 39 static Ref<OfflineAudioCompletionEvent> create(PassRefPtr<AudioBuffer> renderedBuffer); 41 40 … … 47 46 48 47 private: 49 OfflineAudioCompletionEvent();50 48 explicit OfflineAudioCompletionEvent(PassRefPtr<AudioBuffer> renderedBuffer); 51 49 -
trunk/Source/WebCore/Modules/websockets/CloseEvent.h
r177264 r196400 38 38 39 39 struct 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 }; 48 42 String reason; 49 43 }; … … 51 45 class CloseEvent : public Event { 52 46 public: 53 static Ref<CloseEvent> create()54 {55 return adoptRef(*new CloseEvent());56 }57 58 47 static Ref<CloseEvent> create(bool wasClean, unsigned short code, const String& reason) 59 48 { … … 61 50 } 62 51 63 static Ref<CloseEvent> create (const AtomicString& type, const CloseEventInit& initializer)52 static Ref<CloseEvent> createForBindings(const AtomicString& type, const CloseEventInit& initializer) 64 53 { 65 54 return adoptRef(*new CloseEvent(type, initializer)); … … 74 63 75 64 private: 76 CloseEvent()77 : Event(eventNames().closeEvent, false, false)78 , m_wasClean(false)79 , m_code(0)80 {81 }82 83 65 CloseEvent(bool wasClean, int code, const String& reason) 84 66 : Event(eventNames().closeEvent, false, false) -
trunk/Source/WebCore/bindings/objc/DOM.mm
r191887 r196400 519 519 return nil; 520 520 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(); 522 524 return kit(page->focusController().nextFocusableElement(FocusNavigationScope::focusNavigationScopeOf(&core(self)->document()), core(self), key.get())); 523 525 } … … 529 531 return nil; 530 532 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(); 532 536 return kit(page->focusController().previousFocusableElement(FocusNavigationScope::focusNavigationScopeOf(&core(self)->document()), core(self), key.get())); 533 537 } -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r196392 r196400 4767 4767 } 4768 4768 4769 RefPtr<${interfaceName}> event = ${interfaceName}::create (eventType, eventInit);4769 RefPtr<${interfaceName}> event = ${interfaceName}::createForBindings(eventType, eventInit); 4770 4770 return JSValue::encode(toJS(state, jsConstructor->globalObject(), event.get())); 4771 4771 } -
trunk/Source/WebCore/dom/AnimationEvent.cpp
r180441 r196400 30 30 31 31 namespace WebCore { 32 33 AnimationEventInit::AnimationEventInit()34 : animationName()35 , elapsedTime(0)36 {37 }38 39 AnimationEvent::AnimationEvent()40 : m_elapsedTime(0)41 {42 }43 32 44 33 AnimationEvent::AnimationEvent(const AtomicString& type, const AnimationEventInit& initializer) -
trunk/Source/WebCore/dom/AnimationEvent.h
r180441 r196400 32 32 33 33 struct AnimationEventInit : public EventInit { 34 AnimationEventInit();35 36 34 String animationName; 37 double elapsedTime ;35 double elapsedTime { 0 }; 38 36 }; 39 37 40 38 class AnimationEvent final : public Event { 41 39 public: 42 static Ref<AnimationEvent> create()43 {44 return adoptRef(*new AnimationEvent);45 }46 40 static Ref<AnimationEvent> create(const AtomicString& type, const String& animationName, double elapsedTime) 47 41 { 48 42 return adoptRef(*new AnimationEvent(type, animationName, elapsedTime)); 49 43 } 50 static Ref<AnimationEvent> create(const AtomicString& type, const AnimationEventInit& initializer) 44 45 static Ref<AnimationEvent> createForBindings(const AtomicString& type, const AnimationEventInit& initializer) 51 46 { 52 47 return adoptRef(*new AnimationEvent(type, initializer)); … … 61 56 62 57 private: 63 AnimationEvent();64 58 AnimationEvent(const AtomicString& type, const String& animationName, double elapsedTime); 65 59 AnimationEvent(const AtomicString&, const AnimationEventInit&); -
trunk/Source/WebCore/dom/BeforeLoadEvent.h
r177264 r196400 34 34 35 35 struct BeforeLoadEventInit : public EventInit { 36 BeforeLoadEventInit()37 {38 }39 40 36 String url; 41 37 }; … … 43 39 class BeforeLoadEvent final : public Event { 44 40 public: 45 static Ref<BeforeLoadEvent> create()46 {47 return adoptRef(*new BeforeLoadEvent);48 }49 50 41 static Ref<BeforeLoadEvent> create(const String& url) 51 42 { … … 53 44 } 54 45 55 static Ref<BeforeLoadEvent> create (const AtomicString& type, const BeforeLoadEventInit& initializer)46 static Ref<BeforeLoadEvent> createForBindings(const AtomicString& type, const BeforeLoadEventInit& initializer) 56 47 { 57 48 return adoptRef(*new BeforeLoadEvent(type, initializer)); … … 63 54 64 55 private: 65 BeforeLoadEvent()66 {67 }68 69 56 explicit BeforeLoadEvent(const String& url) 70 57 : Event(eventNames().beforeloadEvent, false, true) -
trunk/Source/WebCore/dom/ClipboardEvent.cpp
r193408 r196400 29 29 namespace WebCore { 30 30 31 ClipboardEvent::ClipboardEvent()32 {33 }34 35 31 ClipboardEvent::ClipboardEvent(const AtomicString& eventType, bool canBubble, bool cancelable, DataTransfer* dataTransfer) 36 32 : Event(eventType, canBubble, cancelable), m_dataTransfer(dataTransfer) -
trunk/Source/WebCore/dom/ClipboardEvent.h
r193408 r196400 35 35 virtual ~ClipboardEvent(); 36 36 37 static Ref<ClipboardEvent> create()38 {39 return adoptRef(*new ClipboardEvent);40 }41 37 static Ref<ClipboardEvent> create(const AtomicString& type, bool canBubbleArg, bool cancelableArg, DataTransfer* clipboardArg) 42 38 { … … 47 43 48 44 private: 49 ClipboardEvent();50 45 ClipboardEvent(const AtomicString& type, bool canBubbleArg, bool cancelableArg, DataTransfer*); 51 46 -
trunk/Source/WebCore/dom/CompositionEvent.cpp
r193408 r196400 31 31 32 32 namespace WebCore { 33 34 CompositionEventInit::CompositionEventInit()35 {36 }37 33 38 34 CompositionEvent::CompositionEvent() -
trunk/Source/WebCore/dom/CompositionEvent.h
r193408 r196400 33 33 34 34 struct CompositionEventInit : UIEventInit { 35 CompositionEventInit();36 37 35 String data; 38 36 }; … … 40 38 class CompositionEvent final : public UIEvent { 41 39 public: 42 static Ref<CompositionEvent> create()43 {44 return adoptRef(*new CompositionEvent);45 }46 47 40 static Ref<CompositionEvent> create(const AtomicString& type, AbstractView* view, const String& data) 48 41 { … … 50 43 } 51 44 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) 53 51 { 54 52 return adoptRef(*new CompositionEvent(type, initializer)); -
trunk/Source/WebCore/dom/CustomEvent.cpp
r186955 r196400 31 31 32 32 namespace WebCore { 33 34 CustomEventInit::CustomEventInit()35 {36 }37 33 38 34 CustomEvent::CustomEvent() -
trunk/Source/WebCore/dom/CustomEvent.h
r186955 r196400 34 34 35 35 struct CustomEventInit : public EventInit { 36 CustomEventInit();37 38 36 Deprecated::ScriptValue detail; 39 37 }; … … 43 41 virtual ~CustomEvent(); 44 42 45 static Ref<CustomEvent> create ()43 static Ref<CustomEvent> createForBindings() 46 44 { 47 45 return adoptRef(*new CustomEvent); 48 46 } 49 47 50 static Ref<CustomEvent> create (const AtomicString& type, const CustomEventInit& initializer)48 static Ref<CustomEvent> createForBindings(const AtomicString& type, const CustomEventInit& initializer) 51 49 { 52 50 return adoptRef(*new CustomEvent(type, initializer)); -
trunk/Source/WebCore/dom/DeviceMotionEvent.h
r180441 r196400 36 36 public: 37 37 virtual ~DeviceMotionEvent(); 38 static Ref<DeviceMotionEvent> create() 39 { 40 return adoptRef(*new DeviceMotionEvent); 41 } 38 42 39 static Ref<DeviceMotionEvent> create(const AtomicString& eventType, DeviceMotionData* deviceMotionData) 43 40 { 44 41 return adoptRef(*new DeviceMotionEvent(eventType, deviceMotionData)); 42 } 43 44 static Ref<DeviceMotionEvent> createForBindings() 45 { 46 return adoptRef(*new DeviceMotionEvent); 45 47 } 46 48 -
trunk/Source/WebCore/dom/DeviceOrientationEvent.h
r177264 r196400 36 36 public: 37 37 virtual ~DeviceOrientationEvent(); 38 static Ref<DeviceOrientationEvent> create()39 {40 return adoptRef(*new DeviceOrientationEvent);41 }42 38 static Ref<DeviceOrientationEvent> create(const AtomicString& eventType, DeviceOrientationData* orientation) 43 39 { 44 40 return adoptRef(*new DeviceOrientationEvent(eventType, orientation)); 41 } 42 43 static Ref<DeviceOrientationEvent> createForBindings() 44 { 45 return adoptRef(*new DeviceOrientationEvent); 45 46 } 46 47 -
trunk/Source/WebCore/dom/Document.cpp
r196242 r196400 4146 4146 4147 4147 if (equalLettersIgnoringASCIICase(type, "customevent")) 4148 return CustomEvent::create ();4148 return CustomEvent::createForBindings(); 4149 4149 if (equalLettersIgnoringASCIICase(type, "event") || equalLettersIgnoringASCIICase(type, "events") || equalLettersIgnoringASCIICase(type, "htmlevents")) 4150 return Event::create ();4150 return Event::createForBindings(); 4151 4151 if (equalLettersIgnoringASCIICase(type, "keyboardevent") || equalLettersIgnoringASCIICase(type, "keyboardevents")) 4152 return KeyboardEvent::create ();4152 return KeyboardEvent::createForBindings(); 4153 4153 if (equalLettersIgnoringASCIICase(type, "messageevent")) 4154 return MessageEvent::create ();4154 return MessageEvent::createForBindings(); 4155 4155 if (equalLettersIgnoringASCIICase(type, "mouseevent") || equalLettersIgnoringASCIICase(type, "mouseevents")) 4156 return MouseEvent::create ();4156 return MouseEvent::createForBindings(); 4157 4157 if (equalLettersIgnoringASCIICase(type, "uievent") || equalLettersIgnoringASCIICase(type, "uievents")) 4158 return UIEvent::create ();4158 return UIEvent::createForBindings(); 4159 4159 4160 4160 #if ENABLE(TOUCH_EVENTS) 4161 4161 if (equalLettersIgnoringASCIICase(type, "touchevent")) 4162 return TouchEvent::create ();4162 return TouchEvent::createForBindings(); 4163 4163 #endif 4164 4164 … … 4170 4170 4171 4171 if (equalLettersIgnoringASCIICase(type, "svgzoomevents")) 4172 return SVGZoomEvent::create ();4172 return SVGZoomEvent::createForBindings(); 4173 4173 4174 4174 // The following strings are for event classes where WebKit supplies an init function. … … 4180 4180 4181 4181 if (equalLettersIgnoringASCIICase(type, "compositionevent")) 4182 return CompositionEvent::create ();4182 return CompositionEvent::createForBindings(); 4183 4183 if (equalLettersIgnoringASCIICase(type, "hashchangeevent")) 4184 return HashChangeEvent::create ();4184 return HashChangeEvent::createForBindings(); 4185 4185 if (equalLettersIgnoringASCIICase(type, "mutationevent") || equalLettersIgnoringASCIICase(type, "mutationevents")) 4186 return MutationEvent::create ();4186 return MutationEvent::createForBindings(); 4187 4187 if (equalLettersIgnoringASCIICase(type, "overflowevent")) 4188 return OverflowEvent::create ();4188 return OverflowEvent::createForBindings(); 4189 4189 if (equalLettersIgnoringASCIICase(type, "storageevent")) 4190 return StorageEvent::create ();4190 return StorageEvent::createForBindings(); 4191 4191 if (equalLettersIgnoringASCIICase(type, "textevent")) 4192 return TextEvent::create ();4192 return TextEvent::createForBindings(); 4193 4193 if (equalLettersIgnoringASCIICase(type, "wheelevent")) 4194 return WheelEvent::create ();4194 return WheelEvent::createForBindings(); 4195 4195 4196 4196 #if ENABLE(DEVICE_ORIENTATION) 4197 4197 if (equalLettersIgnoringASCIICase(type, "devicemotionevent")) 4198 return DeviceMotionEvent::create ();4198 return DeviceMotionEvent::createForBindings(); 4199 4199 if (equalLettersIgnoringASCIICase(type, "deviceorientationevent")) 4200 return DeviceOrientationEvent::create ();4200 return DeviceOrientationEvent::createForBindings(); 4201 4201 #endif 4202 4202 -
trunk/Source/WebCore/dom/Element.cpp
r196383 r196400 269 269 // of the DOM specs, but is used for compatibility with the ondblclick="" attribute. This is treated 270 270 // 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, 273 272 mouseEvent->bubbles(), mouseEvent->cancelable(), mouseEvent->view(), mouseEvent->detail(), 274 273 mouseEvent->screenX(), mouseEvent->screenY(), mouseEvent->clientX(), mouseEvent->clientY(), -
trunk/Source/WebCore/dom/ErrorEvent.cpp
r164184 r196400 36 36 namespace WebCore { 37 37 38 ErrorEventInit::ErrorEventInit()39 : message()40 , filename()41 , lineno(0)42 , colno(0)43 {44 }45 46 ErrorEvent::ErrorEvent()47 {48 }49 50 38 ErrorEvent::ErrorEvent(const AtomicString& type, const ErrorEventInit& initializer) 51 39 : Event(type, initializer) -
trunk/Source/WebCore/dom/ErrorEvent.h
r177264 r196400 38 38 39 39 struct ErrorEventInit : public EventInit { 40 ErrorEventInit();41 42 40 String message; 43 41 String filename; 44 unsigned lineno ;45 unsigned colno ;42 unsigned lineno { 0 }; 43 unsigned colno { 0 }; 46 44 }; 47 45 48 46 class ErrorEvent final : public Event { 49 47 public: 50 static Ref<ErrorEvent> create()51 {52 return adoptRef(*new ErrorEvent);53 }54 48 static Ref<ErrorEvent> create(const String& message, const String& fileName, unsigned lineNumber, unsigned columnNumber) 55 49 { 56 50 return adoptRef(*new ErrorEvent(message, fileName, lineNumber, columnNumber)); 57 51 } 58 static Ref<ErrorEvent> create(const AtomicString& type, const ErrorEventInit& initializer) 52 53 static Ref<ErrorEvent> createForBindings(const AtomicString& type, const ErrorEventInit& initializer) 59 54 { 60 55 return adoptRef(*new ErrorEvent(type, initializer)); 61 56 } 57 62 58 virtual ~ErrorEvent(); 63 59 … … 70 66 71 67 private: 72 ErrorEvent();73 68 ErrorEvent(const String& message, const String& fileName, unsigned lineNumber, unsigned columnNumber); 74 69 ErrorEvent(const AtomicString&, const ErrorEventInit&); -
trunk/Source/WebCore/dom/Event.cpp
r195927 r196400 29 29 30 30 namespace 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 }43 31 44 32 Event::Event() -
trunk/Source/WebCore/dom/Event.h
r195927 r196400 41 41 42 42 struct EventInit { 43 EventInit(); 44 EventInit(bool bubbles, bool cancelable); 45 46 bool bubbles; 47 bool cancelable; 43 bool bubbles { false }; 44 bool cancelable { false }; 48 45 }; 49 46 … … 84 81 }; 85 82 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() 87 89 { 88 90 return adoptRef(*new Event); 89 91 } 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) 96 94 { 97 95 return adoptRef(*new Event(type, initializer)); -
trunk/Source/WebCore/dom/FocusEvent.cpp
r194896 r196400 31 31 namespace WebCore { 32 32 33 FocusEventInit::FocusEventInit()34 {35 }36 37 33 EventInterface FocusEvent::eventInterface() const 38 34 { … … 43 39 { 44 40 return true; 45 }46 47 FocusEvent::FocusEvent()48 {49 41 } 50 42 -
trunk/Source/WebCore/dom/FocusEvent.h
r194896 r196400 35 35 36 36 struct FocusEventInit : public UIEventInit { 37 FocusEventInit();38 39 37 RefPtr<EventTarget> relatedTarget; 40 38 }; … … 42 40 class FocusEvent final : public UIEvent { 43 41 public: 44 static Ref<FocusEvent> create()45 {46 return adoptRef(*new FocusEvent);47 }48 49 42 static Ref<FocusEvent> create(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view, int detail, RefPtr<EventTarget>&& relatedTarget) 50 43 { … … 52 45 } 53 46 54 static Ref<FocusEvent> create (const AtomicString& type, const FocusEventInit& initializer)47 static Ref<FocusEvent> createForBindings(const AtomicString& type, const FocusEventInit& initializer) 55 48 { 56 49 return adoptRef(*new FocusEvent(type, initializer)); … … 63 56 64 57 private: 65 FocusEvent();66 58 FocusEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView*, int, RefPtr<EventTarget>&&); 67 59 FocusEvent(const AtomicString& type, const FocusEventInit&); -
trunk/Source/WebCore/dom/HashChangeEvent.h
r177264 r196400 28 28 29 29 struct HashChangeEventInit : public EventInit { 30 HashChangeEventInit()31 {32 };33 34 30 String oldURL; 35 31 String newURL; … … 38 34 class HashChangeEvent final : public Event { 39 35 public: 40 static Ref<HashChangeEvent> create()41 {42 return adoptRef(*new HashChangeEvent);43 }44 45 36 static Ref<HashChangeEvent> create(const String& oldURL, const String& newURL) 46 37 { … … 48 39 } 49 40 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) 51 47 { 52 48 return adoptRef(*new HashChangeEvent(type, initializer)); -
trunk/Source/WebCore/dom/KeyboardEvent.cpp
r194896 r196400 91 91 } 92 92 93 KeyboardEventInit::KeyboardEventInit()94 : location(0)95 , ctrlKey(false)96 , altKey(false)97 , shiftKey(false)98 , metaKey(false)99 {100 }101 102 93 KeyboardEvent::KeyboardEvent() 103 94 : m_location(DOM_KEY_LOCATION_STANDARD) … … 127 118 } 128 119 120 // FIXME: This method should be get ride of in the future. 121 // DO NOT USE IT! 122 KeyboardEvent::KeyboardEvent(WTF::HashTableDeletedValueType) 123 { 124 } 125 129 126 KeyboardEvent::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) 131 128 , m_keyIdentifier(initializer.keyIdentifier) 132 129 , m_location(initializer.location) -
trunk/Source/WebCore/dom/KeyboardEvent.h
r177264 r196400 35 35 class PlatformKeyboardEvent; 36 36 37 struct KeyboardEventInit : public UIEventInit { 38 KeyboardEventInit(); 39 37 struct KeyboardEventInit : public UIEventWithKeyStateInit { 40 38 String keyIdentifier; 41 unsigned location; 42 bool ctrlKey; 43 bool altKey; 44 bool shiftKey; 45 bool metaKey; 39 unsigned location { 0 }; 46 40 }; 47 41 … … 57 51 // DOM_KEY_LOCATION_JOYSTICK = 0x05 58 52 }; 59 60 static Ref<KeyboardEvent> create()61 {62 return adoptRef(*new KeyboardEvent);63 }64 53 65 54 static Ref<KeyboardEvent> create(const PlatformKeyboardEvent& platformEvent, AbstractView* view) … … 68 57 } 69 58 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) 71 65 { 72 66 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)); 73 74 } 74 75 … … 107 108 WEBCORE_EXPORT KeyboardEvent(const PlatformKeyboardEvent&, AbstractView*); 108 109 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); 109 113 110 114 std::unique_ptr<PlatformKeyboardEvent> m_keyEvent; -
trunk/Source/WebCore/dom/MessageEvent.cpp
r194496 r196400 36 36 { 37 37 return !source || source->toDOMWindow() || source->isMessagePort(); 38 }39 40 MessageEventInit::MessageEventInit()41 {42 38 } 43 39 … … 80 76 { 81 77 ASSERT(isValidSource(m_source.get())); 78 } 79 80 MessageEvent::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 { 82 87 } 83 88 -
trunk/Source/WebCore/dom/MessageEvent.h
r194496 r196400 43 43 44 44 struct MessageEventInit : public EventInit { 45 MessageEventInit();46 47 45 Deprecated::ScriptValue data; 48 46 String origin; … … 54 52 class MessageEvent final : public Event { 55 53 public: 56 static Ref<MessageEvent> create()57 {58 return adoptRef(*new MessageEvent);59 }60 54 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) 61 55 { … … 65 59 { 66 60 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)); 67 65 } 68 66 static Ref<MessageEvent> create(const String& data, const String& origin = String()) … … 78 76 return adoptRef(*new MessageEvent(data, origin)); 79 77 } 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) 81 83 { 82 84 return adoptRef(*new MessageEvent(type, initializer)); … … 122 124 MessageEvent(const Deprecated::ScriptValue& data, const String& origin, const String& lastEventId, PassRefPtr<EventTarget> source, std::unique_ptr<MessagePortArray>); 123 125 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); 124 127 125 128 explicit MessageEvent(const String& data, const String& origin); -
trunk/Source/WebCore/dom/MouseEvent.cpp
r195927 r196400 34 34 namespace WebCore { 35 35 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) 36 Ref<MouseEvent> MouseEvent::createForBindings(const AtomicString& type, const MouseEventInit& initializer) 50 37 { 51 38 return adoptRef(*new MouseEvent(type, initializer)); … … 67 54 } 68 55 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, 56 Ref<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, AbstractView* view, int detail, int screenX, int screenY, int pageX, int pageY, 71 57 #if ENABLE(POINTER_LOCK) 72 58 int movementX, int movementY, 73 59 #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) 76 61 77 62 { … … 84 69 } 85 70 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, 71 Ref<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, AbstractView* view, int detail, int screenX, int screenY, int pageX, int pageY, 88 72 #if ENABLE(POINTER_LOCK) 89 73 int movementX, int movementY, 90 74 #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) 93 76 { 94 77 return adoptRef(*new MouseEvent(type, canBubble, cancelable, timestamp, view, … … 98 81 #endif 99 82 ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, force, dataTransfer, isSimulated)); 83 } 84 85 Ref<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)); 100 88 } 101 89 … … 128 116 } 129 117 118 MouseEvent::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 130 131 MouseEvent::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) 137 133 , m_button(initializer.button == (unsigned short)-1 ? 0 : initializer.button) 138 134 , m_buttonDown(initializer.button != (unsigned short)-1) … … 241 237 { 242 238 ASSERT(iframe); 243 Ref<MouseEvent> clonedMouseEvent = MouseEvent::create();244 239 Frame* frame = iframe->document().frame(); 245 240 FrameView* frameView = frame ? frame->view() : nullptr; 246 clonedMouseEvent->initMouseEvent(type(), bubbles(), cancelable(),241 Ref<MouseEvent> clonedMouseEvent = MouseEvent::create(type(), bubbles(), cancelable(), 247 242 iframe->document().defaultView(), 248 243 detail(), screenX(), screenY(), -
trunk/Source/WebCore/dom/MouseEvent.h
r195524 r196400 32 32 class PlatformMouseEvent; 33 33 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; 34 struct MouseEventInit : public MouseRelatedEventInit { 35 int clientX {0}; 36 int clientY {0}; 37 unsigned short button {0}; 46 38 RefPtr<EventTarget> relatedTarget; 47 39 }; … … 49 41 class MouseEvent : public MouseRelatedEvent { 50 42 public: 51 static Ref<MouseEvent> create()52 {53 return adoptRef(*new MouseEvent);54 }55 56 43 static Ref<MouseEvent> create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, AbstractView*, 57 44 int detail, int screenX, int screenY, int pageX, int pageY, … … 72 59 WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& eventType, AbstractView*, const PlatformMouseEvent&, int detail, PassRefPtr<Node> relatedTarget); 73 60 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&); 75 72 76 73 virtual ~MouseEvent(); … … 116 113 PassRefPtr<EventTarget> relatedTarget, double force, PassRefPtr<DataTransfer>, bool isSimulated); 117 114 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 118 120 MouseEvent(const AtomicString& type, const MouseEventInit&); 119 121 -
trunk/Source/WebCore/dom/MouseRelatedEvent.cpp
r194896 r196400 69 69 , m_isSimulated(isSimulated) 70 70 { 71 init(isSimulated, windowLocation); 72 } 73 74 MouseRelatedEvent::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 85 void MouseRelatedEvent::init(bool isSimulated, const IntPoint& windowLocation) 86 { 71 87 LayoutPoint adjustedPageLocation; 72 88 LayoutPoint scrollPosition; -
trunk/Source/WebCore/dom/MouseRelatedEvent.h
r194896 r196400 30 30 namespace WebCore { 31 31 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(); } 32 struct 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. 38 class MouseRelatedEvent : public UIEventWithKeyState { 39 public: 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(); } 42 47 #if ENABLE(POINTER_LOCK) 43 44 48 int movementX() const { return m_movementDelta.x(); } 49 int movementY() const { return m_movementDelta.y(); } 45 50 #endif 46 47 48 49 50 51 52 53 54 55 56 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; 57 62 58 59 60 61 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; } 62 67 63 64 65 66 68 protected: 69 MouseRelatedEvent(); 70 MouseRelatedEvent(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, AbstractView*, 71 int detail, const IntPoint& screenLocation, const IntPoint& windowLocation, 67 72 #if ENABLE(POINTER_LOCK) 68 73 const IntPoint& movementDelta, 69 74 #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&); 71 77 72 73 74 78 void initCoordinates(); 79 void initCoordinates(const LayoutPoint& clientLocation); 80 virtual void receivedTarget() override final; 75 81 76 77 82 void computePageLocation(); 83 void computeRelativePosition(); 78 84 79 80 81 85 // Expose these so MouseEvent::initMouseEvent can set them. 86 IntPoint m_screenLocation; 87 LayoutPoint m_clientLocation; 82 88 #if ENABLE(POINTER_LOCK) 83 89 LayoutPoint m_movementDelta; 84 90 #endif 85 91 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 }; 92 private: 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 }; 94 102 95 103 } // namespace WebCore -
trunk/Source/WebCore/dom/MutationEvent.h
r191955 r196400 40 40 }; 41 41 42 static Ref<MutationEvent> create()43 {44 return adoptRef(*new MutationEvent);45 }46 47 42 static Ref<MutationEvent> create(const AtomicString& type, bool canBubble, PassRefPtr<Node> relatedNode = nullptr, 48 43 const String& prevValue = String(), const String& newValue = String(), const String& attrName = String(), unsigned short attrChange = 0) 49 44 { 50 45 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); 51 51 } 52 52 -
trunk/Source/WebCore/dom/OverflowEvent.cpp
r165676 r196400 31 31 namespace WebCore { 32 32 33 OverflowEventInit::OverflowEventInit()34 : orient(0)35 , horizontalOverflow(false)36 , verticalOverflow(false)37 {38 }39 40 33 OverflowEvent::OverflowEvent() 41 : Event(eventNames().overflowchangedEvent, false, false) 42 , m_orient(VERTICAL) 34 : m_orient(VERTICAL) 43 35 , m_horizontalOverflow(false) 44 36 , m_verticalOverflow(false) … … 79 71 return; 80 72 73 initEvent(eventNames().overflowchangedEvent, false, false); 74 81 75 m_orient = orient; 82 76 m_horizontalOverflow = horizontalOverflow; -
trunk/Source/WebCore/dom/OverflowEvent.h
r177264 r196400 32 32 33 33 struct 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 }; 39 37 }; 40 38 … … 47 45 }; 48 46 49 static Ref<OverflowEvent> create()50 {51 return adoptRef(*new OverflowEvent);52 }53 47 static Ref<OverflowEvent> create(bool horizontalOverflowChanged, bool horizontalOverflow, bool verticalOverflowChanged, bool verticalOverflow) 54 48 { 55 49 return adoptRef(*new OverflowEvent(horizontalOverflowChanged, horizontalOverflow, verticalOverflowChanged, verticalOverflow)); 56 50 } 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) 58 56 { 59 57 return adoptRef(*new OverflowEvent(type, initializer)); -
trunk/Source/WebCore/dom/PageTransitionEvent.cpp
r156241 r196400 31 31 namespace WebCore { 32 32 33 PageTransitionEventInit::PageTransitionEventInit()34 : persisted(false)35 {36 }37 38 PageTransitionEvent::PageTransitionEvent()39 : m_persisted(false)40 {41 }42 43 33 PageTransitionEvent::PageTransitionEvent(const AtomicString& type, bool persisted) 44 34 : Event(type, true, true) -
trunk/Source/WebCore/dom/PageTransitionEvent.h
r177264 r196400 32 32 33 33 struct PageTransitionEventInit : public EventInit { 34 PageTransitionEventInit(); 35 36 bool persisted; 34 bool persisted { false }; 37 35 }; 38 36 39 37 class PageTransitionEvent final : public Event { 40 38 public: 41 static Ref<PageTransitionEvent> create()42 {43 return adoptRef(*new PageTransitionEvent);44 }45 39 static Ref<PageTransitionEvent> create(const AtomicString& type, bool persisted) 46 40 { 47 41 return adoptRef(*new PageTransitionEvent(type, persisted)); 48 42 } 49 static Ref<PageTransitionEvent> create (const AtomicString& type, const PageTransitionEventInit& initializer)43 static Ref<PageTransitionEvent> createForBindings(const AtomicString& type, const PageTransitionEventInit& initializer) 50 44 { 51 45 return adoptRef(*new PageTransitionEvent(type, initializer)); … … 59 53 60 54 private: 61 PageTransitionEvent();62 55 PageTransitionEvent(const AtomicString& type, bool persisted); 63 56 PageTransitionEvent(const AtomicString&, const PageTransitionEventInit&); -
trunk/Source/WebCore/dom/PopStateEvent.cpp
r195927 r196400 34 34 namespace WebCore { 35 35 36 PopStateEventInit::PopStateEventInit()37 {38 }39 40 PopStateEvent::PopStateEvent()41 : Event(eventNames().popstateEvent, false, true)42 {43 }44 45 36 PopStateEvent::PopStateEvent(const AtomicString& type, const PopStateEventInit& initializer) 46 37 : Event(type, initializer) … … 60 51 } 61 52 62 Ref<PopStateEvent> PopStateEvent::create()63 {64 return adoptRef(*new PopStateEvent);65 }66 67 53 Ref<PopStateEvent> PopStateEvent::create(RefPtr<SerializedScriptValue>&& serializedState, PassRefPtr<History> history) 68 54 { … … 70 56 } 71 57 72 Ref<PopStateEvent> PopStateEvent::create (const AtomicString& type, const PopStateEventInit& initializer)58 Ref<PopStateEvent> PopStateEvent::createForBindings(const AtomicString& type, const PopStateEventInit& initializer) 73 59 { 74 60 return adoptRef(*new PopStateEvent(type, initializer)); -
trunk/Source/WebCore/dom/PopStateEvent.h
r195927 r196400 35 35 36 36 struct PopStateEventInit : public EventInit { 37 PopStateEventInit();38 39 37 Deprecated::ScriptValue state; 40 38 }; … … 46 44 public: 47 45 virtual ~PopStateEvent(); 48 static Ref<PopStateEvent> create();49 46 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&); 51 48 52 49 PassRefPtr<SerializedScriptValue> serializedState() const { ASSERT(m_serializedState); return m_serializedState; } … … 60 57 61 58 private: 62 PopStateEvent();63 59 PopStateEvent(const AtomicString&, const PopStateEventInit&); 64 60 explicit PopStateEvent(PassRefPtr<SerializedScriptValue>, PassRefPtr<History>); -
trunk/Source/WebCore/dom/ProgressEvent.cpp
r165676 r196400 31 31 namespace WebCore { 32 32 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 47 33 ProgressEvent::ProgressEvent(const AtomicString& type, const ProgressEventInit& initializer) 48 34 : Event(type, initializer) -
trunk/Source/WebCore/dom/ProgressEvent.h
r177264 r196400 32 32 33 33 struct 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 }; 39 37 }; 40 38 41 39 class ProgressEvent : public Event { 42 40 public: 43 static Ref<ProgressEvent> create()44 {45 return adoptRef(*new ProgressEvent);46 }47 41 static Ref<ProgressEvent> create(const AtomicString& type, bool lengthComputable, unsigned long long loaded, unsigned long long total) 48 42 { 49 43 return adoptRef(*new ProgressEvent(type, lengthComputable, loaded, total)); 50 44 } 51 static Ref<ProgressEvent> create (const AtomicString& type, const ProgressEventInit& initializer)45 static Ref<ProgressEvent> createForBindings(const AtomicString& type, const ProgressEventInit& initializer) 52 46 { 53 47 return adoptRef(*new ProgressEvent(type, initializer)); … … 61 55 62 56 protected: 63 ProgressEvent();64 57 ProgressEvent(const AtomicString& type, bool lengthComputable, unsigned long long loaded, unsigned long long total); 65 58 ProgressEvent(const AtomicString&, const ProgressEventInit&); -
trunk/Source/WebCore/dom/SecurityPolicyViolationEvent.h
r184225 r196400 33 33 34 34 struct SecurityPolicyViolationEventInit : public EventInit { 35 SecurityPolicyViolationEventInit()36 {37 }38 39 35 String documentURI; 40 36 String referrer; … … 44 40 String originalPolicy; 45 41 String sourceFile; 46 int lineNumber ;42 int lineNumber { 0 }; 47 43 }; 48 44 49 45 class SecurityPolicyViolationEvent final : public Event { 50 46 public: 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() 52 53 { 53 54 return adoptRef(*new SecurityPolicyViolationEvent()); 54 55 } 55 56 56 static Ref<SecurityPolicyViolationEvent> create (const AtomicString& type, const SecurityPolicyViolationEventInit& initializer)57 static Ref<SecurityPolicyViolationEvent> createForBindings(const AtomicString& type, const SecurityPolicyViolationEventInit& initializer) 57 58 { 58 59 return adoptRef(*new SecurityPolicyViolationEvent(type, initializer)); … … 72 73 private: 73 74 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) 74 88 { 75 89 } -
trunk/Source/WebCore/dom/TextEvent.cpp
r195927 r196400 33 33 namespace WebCore { 34 34 35 Ref<TextEvent> TextEvent::create ()35 Ref<TextEvent> TextEvent::createForBindings() 36 36 { 37 37 return adoptRef(*new TextEvent); -
trunk/Source/WebCore/dom/TextEvent.h
r195927 r196400 40 40 class TextEvent final : public UIEvent { 41 41 public: 42 43 static Ref<TextEvent> create();44 42 static Ref<TextEvent> create(AbstractView*, const String& data, TextEventInputType = TextEventInputKeyboard); 43 static Ref<TextEvent> createForBindings(); 45 44 static Ref<TextEvent> createForPlainTextPaste(AbstractView*, const String& data, bool shouldSmartReplace); 46 45 static Ref<TextEvent> createForFragmentPaste(AbstractView*, RefPtr<DocumentFragment>&& data, bool shouldSmartReplace, bool shouldMatchStyle, MailBlockquoteHandling); -
trunk/Source/WebCore/dom/TouchEvent.h
r195899 r196400 41 41 virtual ~TouchEvent(); 42 42 43 static Ref<TouchEvent> create()44 {45 return adoptRef(*new TouchEvent);46 }47 43 static Ref<TouchEvent> create(TouchList* touches, 48 44 TouchList* targetTouches, TouchList* changedTouches, … … 54 50 type, view, screenX, screenY, pageX, pageY, 55 51 ctrlKey, altKey, shiftKey, metaKey)); 52 } 53 static Ref<TouchEvent> createForBindings() 54 { 55 return adoptRef(*new TouchEvent); 56 56 } 57 57 -
trunk/Source/WebCore/dom/TransitionEvent.cpp
r165676 r196400 31 31 32 32 namespace WebCore { 33 34 TransitionEventInit::TransitionEventInit()35 : elapsedTime(0)36 {37 }38 39 TransitionEvent::TransitionEvent()40 : m_elapsedTime(0)41 {42 }43 33 44 34 TransitionEvent::TransitionEvent(const AtomicString& type, const String& propertyName, double elapsedTime, const String& pseudoElement) -
trunk/Source/WebCore/dom/TransitionEvent.h
r177264 r196400 33 33 34 34 struct TransitionEventInit : public EventInit { 35 TransitionEventInit();36 37 35 String propertyName; 38 double elapsedTime ;36 double elapsedTime { 0 }; 39 37 String pseudoElement; 40 38 }; … … 42 40 class TransitionEvent final : public Event { 43 41 public: 44 static Ref<TransitionEvent> create()45 {46 return adoptRef(*new TransitionEvent);47 }48 42 static Ref<TransitionEvent> create(const AtomicString& type, const String& propertyName, double elapsedTime, const String& pseudoElement) 49 43 { 50 44 return adoptRef(*new TransitionEvent(type, propertyName, elapsedTime, pseudoElement)); 51 45 } 52 static Ref<TransitionEvent> create (const AtomicString& type, const TransitionEventInit& initializer)46 static Ref<TransitionEvent> createForBindings(const AtomicString& type, const TransitionEventInit& initializer) 53 47 { 54 48 return adoptRef(*new TransitionEvent(type, initializer)); … … 64 58 65 59 private: 66 TransitionEvent();67 60 TransitionEvent(const AtomicString& type, const String& propertyName, double elapsedTime, const String& pseudoElement); 68 61 TransitionEvent(const AtomicString& type, const TransitionEventInit& initializer); -
trunk/Source/WebCore/dom/UIEvent.cpp
r194896 r196400 27 27 28 28 namespace 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 41 29 42 30 UIEvent::UIEvent() -
trunk/Source/WebCore/dom/UIEvent.h
r194896 r196400 33 33 34 34 struct UIEventInit : public EventInit { 35 UIEventInit();36 UIEventInit(bool bubbles, bool cancelable);37 38 35 RefPtr<AbstractView> view; 39 int detail ;36 int detail { 0 }; 40 37 }; 41 38 42 39 class UIEvent : public Event { 43 40 public: 44 static Ref<UIEvent> create()45 {46 return adoptRef(*new UIEvent);47 }48 41 static Ref<UIEvent> create(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view, int detail) 49 42 { 50 43 return adoptRef(*new UIEvent(type, canBubble, cancelable, view, detail)); 51 44 } 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) 53 50 { 54 51 return adoptRef(*new UIEvent(type, initializer)); -
trunk/Source/WebCore/dom/UIEventWithKeyState.h
r194896 r196400 29 29 namespace WebCore { 30 30 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; } 31 struct UIEventWithKeyStateInit : public UIEventInit { 32 bool ctrlKey { false }; 33 bool altKey { false }; 34 bool shiftKey { false }; 35 bool metaKey { false }; 36 }; 37 37 38 protected: 39 UIEventWithKeyState() 40 : m_ctrlKey(false) 41 , m_altKey(false) 42 , m_shiftKey(false) 43 , m_metaKey(false) 44 { 45 } 38 class UIEventWithKeyState : public UIEvent { 39 public: 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; } 46 44 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 } 45 protected: 46 UIEventWithKeyState() 47 : m_ctrlKey(false) 48 , m_altKey(false) 49 , m_shiftKey(false) 50 , m_metaKey(false) 51 { 52 } 56 53 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 } 66 62 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 } 73 71 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 88 WEBCORE_EXPORT UIEventWithKeyState* findEventWithKeyState(Event*); 75 89 76 90 } // namespace WebCore -
trunk/Source/WebCore/dom/WebKitAnimationEvent.cpp
r165676 r196400 30 30 31 31 namespace WebCore { 32 33 WebKitAnimationEventInit::WebKitAnimationEventInit()34 : animationName()35 , elapsedTime(0.0)36 {37 }38 39 WebKitAnimationEvent::WebKitAnimationEvent()40 : m_elapsedTime(0.0)41 {42 }43 32 44 33 WebKitAnimationEvent::WebKitAnimationEvent(const AtomicString& type, const WebKitAnimationEventInit& initializer) -
trunk/Source/WebCore/dom/WebKitAnimationEvent.h
r177264 r196400 32 32 33 33 struct WebKitAnimationEventInit : public EventInit { 34 WebKitAnimationEventInit();35 36 34 String animationName; 37 double elapsedTime ;35 double elapsedTime { 0.0 }; 38 36 }; 39 37 40 38 class WebKitAnimationEvent final : public Event { 41 39 public: 42 static Ref<WebKitAnimationEvent> create()43 {44 return adoptRef(*new WebKitAnimationEvent);45 }46 40 static Ref<WebKitAnimationEvent> create(const AtomicString& type, const String& animationName, double elapsedTime) 47 41 { 48 42 return adoptRef(*new WebKitAnimationEvent(type, animationName, elapsedTime)); 49 43 } 50 static Ref<WebKitAnimationEvent> create (const AtomicString& type, const WebKitAnimationEventInit& initializer)44 static Ref<WebKitAnimationEvent> createForBindings(const AtomicString& type, const WebKitAnimationEventInit& initializer) 51 45 { 52 46 return adoptRef(*new WebKitAnimationEvent(type, initializer)); … … 61 55 62 56 private: 63 WebKitAnimationEvent();64 57 WebKitAnimationEvent(const AtomicString& type, const String& animationName, double elapsedTime); 65 58 WebKitAnimationEvent(const AtomicString&, const WebKitAnimationEventInit&); -
trunk/Source/WebCore/dom/WebKitTransitionEvent.cpp
r165676 r196400 30 30 31 31 namespace WebCore { 32 33 WebKitTransitionEventInit::WebKitTransitionEventInit()34 : elapsedTime(0)35 {36 }37 38 WebKitTransitionEvent::WebKitTransitionEvent()39 : m_elapsedTime(0)40 {41 }42 32 43 33 WebKitTransitionEvent::WebKitTransitionEvent(const AtomicString& type, const String& propertyName, double elapsedTime, const String& pseudoElement) -
trunk/Source/WebCore/dom/WebKitTransitionEvent.h
r177264 r196400 32 32 33 33 struct WebKitTransitionEventInit : public EventInit { 34 WebKitTransitionEventInit();35 36 34 String propertyName; 37 double elapsedTime ;35 double elapsedTime { 0 }; 38 36 String pseudoElement; 39 37 }; … … 41 39 class WebKitTransitionEvent final : public Event { 42 40 public: 43 static Ref<WebKitTransitionEvent> create()44 {45 return adoptRef(*new WebKitTransitionEvent);46 }47 41 static Ref<WebKitTransitionEvent> create(const AtomicString& type, const String& propertyName, double elapsedTime, const String& pseudoElement) 48 42 { 49 43 return adoptRef(*new WebKitTransitionEvent(type, propertyName, elapsedTime, pseudoElement)); 50 44 } 51 static Ref<WebKitTransitionEvent> create (const AtomicString& type, const WebKitTransitionEventInit& initializer)45 static Ref<WebKitTransitionEvent> createForBindings(const AtomicString& type, const WebKitTransitionEventInit& initializer) 52 46 { 53 47 return adoptRef(*new WebKitTransitionEvent(type, initializer)); … … 63 57 64 58 private: 65 WebKitTransitionEvent();66 59 WebKitTransitionEvent(const AtomicString& type, const String& propertyName, double elapsedTime, const String& pseudoElement); 67 60 WebKitTransitionEvent(const AtomicString& type, const WebKitTransitionEventInit& initializer); -
trunk/Source/WebCore/dom/WheelEvent.h
r194324 r196400 55 55 }; 56 56 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() 58 63 { 59 64 return adoptRef(*new WheelEvent); 60 65 } 61 66 62 static Ref<WheelEvent> create (const AtomicString& type, const WheelEventInit& initializer)67 static Ref<WheelEvent> createForBindings(const AtomicString& type, const WheelEventInit& initializer) 63 68 { 64 69 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));70 70 } 71 71 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r196135 r196400 2232 2232 void HTMLMediaElement::mediaPlayerKeyAdded(MediaPlayer*, const String& keySystem, const String& sessionId) 2233 2233 { 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); 2241 2235 event->setTarget(this); 2242 m_asyncEventQueue.enqueueEvent( event.release());2236 m_asyncEventQueue.enqueueEvent(WTFMove(event)); 2243 2237 } 2244 2238 … … 2267 2261 } 2268 2262 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); 2278 2264 event->setTarget(this); 2279 m_asyncEventQueue.enqueueEvent( event.release());2265 m_asyncEventQueue.enqueueEvent(WTFMove(event)); 2280 2266 } 2281 2267 2282 2268 void HTMLMediaElement::mediaPlayerKeyMessage(MediaPlayer*, const String& keySystem, const String& sessionId, const unsigned char* message, unsigned messageLength, const URL& defaultURL) 2283 2269 { 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); 2293 2271 event->setTarget(this); 2294 m_asyncEventQueue.enqueueEvent( event.release());2272 m_asyncEventQueue.enqueueEvent(WTFMove(event)); 2295 2273 } 2296 2274 … … 2303 2281 } 2304 2282 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); 2313 2284 event->setTarget(this); 2314 m_asyncEventQueue.enqueueEvent( event.release());2285 m_asyncEventQueue.enqueueEvent(WTFMove(event)); 2315 2286 return true; 2316 2287 } … … 2331 2302 } 2332 2303 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); 2339 2305 event->setTarget(this); 2340 2306 m_asyncEventQueue.enqueueEvent(event.release()); -
trunk/Source/WebCore/html/MediaKeyEvent.cpp
r165676 r196400 34 34 namespace WebCore { 35 35 36 MediaKeyEventInit::MediaKeyEventInit() 37 : systemCode(0) 38 { 39 } 40 41 MediaKeyEvent::MediaKeyEvent() 36 MediaKeyEvent::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) 42 45 { 43 46 } -
trunk/Source/WebCore/html/MediaKeyEvent.h
r195410 r196400 35 35 36 36 struct MediaKeyEventInit : public EventInit { 37 MediaKeyEventInit();38 39 37 String keySystem; 40 38 String sessionId; … … 43 41 String defaultURL; 44 42 RefPtr<MediaKeyError> errorCode; 45 uint32_t systemCode ;43 uint32_t systemCode { 0 }; 46 44 }; 47 45 … … 50 48 virtual ~MediaKeyEvent(); 51 49 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) 53 51 { 54 return adoptRef(*new MediaKeyEvent );52 return adoptRef(*new MediaKeyEvent(type, keySystem, sessionId, WTFMove(initData), WTFMove(message), defaultURL, WTFMove(errorCode), systemCode)); 55 53 } 56 54 57 static Ref<MediaKeyEvent> create (const AtomicString& type, const MediaKeyEventInit& initializer)55 static Ref<MediaKeyEvent> createForBindings(const AtomicString& type, const MediaKeyEventInit& initializer) 58 56 { 59 57 return adoptRef(*new MediaKeyEvent(type, initializer)); … … 71 69 72 70 private: 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 74 73 MediaKeyEvent(const AtomicString& type, const MediaKeyEventInit& initializer); 75 74 -
trunk/Source/WebCore/html/canvas/WebGLContextEvent.cpp
r156241 r196400 33 33 namespace WebCore { 34 34 35 WebGLContextEventInit::WebGLContextEventInit()36 {37 }38 39 WebGLContextEvent::WebGLContextEvent()40 {41 }42 43 35 WebGLContextEvent::WebGLContextEvent(const AtomicString& type, bool canBubble, bool cancelable, const String& statusMessage) 44 36 : Event(type, canBubble, cancelable) -
trunk/Source/WebCore/html/canvas/WebGLContextEvent.h
r177264 r196400 32 32 33 33 struct WebGLContextEventInit : public EventInit { 34 WebGLContextEventInit();35 36 34 String statusMessage; 37 35 }; … … 39 37 class WebGLContextEvent final : public Event { 40 38 public: 41 static Ref<WebGLContextEvent> create()42 {43 return adoptRef(*new WebGLContextEvent);44 }45 39 static Ref<WebGLContextEvent> create(const AtomicString& type, bool canBubble, bool cancelable, const String& statusMessage) 46 40 { 47 41 return adoptRef(*new WebGLContextEvent(type, canBubble, cancelable, statusMessage)); 48 42 } 49 static Ref<WebGLContextEvent> create (const AtomicString& type, const WebGLContextEventInit& initializer)43 static Ref<WebGLContextEvent> createForBindings(const AtomicString& type, const WebGLContextEventInit& initializer) 50 44 { 51 45 return adoptRef(*new WebGLContextEvent(type, initializer)); … … 58 52 59 53 private: 60 WebGLContextEvent();61 54 WebGLContextEvent(const AtomicString& type, bool canBubble, bool cancelable, const String& statusMessage); 62 55 WebGLContextEvent(const AtomicString&, const WebGLContextEventInit&); -
trunk/Source/WebCore/html/track/TrackEvent.cpp
r165676 r196400 34 34 namespace WebCore { 35 35 36 TrackEventInit::TrackEventInit() 37 { 38 } 39 40 41 TrackEvent::TrackEvent() 36 TrackEvent::TrackEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<TrackBase>&& track) 37 : Event(type, canBubble, cancelable) 38 , m_track(track) 42 39 { 43 40 } -
trunk/Source/WebCore/html/track/TrackEvent.h
r177264 r196400 35 35 36 36 struct TrackEventInit : public EventInit { 37 TrackEventInit();38 39 37 RefPtr<TrackBase> track; 40 38 }; … … 44 42 virtual ~TrackEvent(); 45 43 46 static Ref<TrackEvent> create( )44 static Ref<TrackEvent> create(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<TrackBase>&& track) 47 45 { 48 return adoptRef(*new TrackEvent );46 return adoptRef(*new TrackEvent(type, canBubble, cancelable, WTFMove(track))); 49 47 } 50 48 51 static Ref<TrackEvent> create (const AtomicString& type, const TrackEventInit& initializer)49 static Ref<TrackEvent> createForBindings(const AtomicString& type, const TrackEventInit& initializer) 52 50 { 53 51 return adoptRef(*new TrackEvent(type, initializer)); … … 59 57 60 58 private: 61 TrackEvent( );59 TrackEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<TrackBase>&&); 62 60 TrackEvent(const AtomicString& type, const TrackEventInit& initializer); 63 61 -
trunk/Source/WebCore/html/track/TrackListBase.cpp
r190613 r196400 82 82 void TrackListBase::scheduleTrackEvent(const AtomicString& eventName, PassRefPtr<TrackBase> track) 83 83 { 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)); 90 85 } 91 86 … … 150 145 // selected, the user agent must queue a task to fire a simple event named 151 146 // 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)); 158 148 } 159 149 -
trunk/Source/WebCore/page/EventSource.cpp
r196283 r196400 414 414 Ref<MessageEvent> EventSource::createMessageEvent() 415 415 { 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); 419 417 } 420 418 -
trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp
r196350 r196400 326 326 } 327 327 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 #endif349 350 328 void 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 351 329 { … … 364 342 if (experimentalFeaturesEnabled()) { 365 343 // 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)); 369 361 } 370 362 #endif -
trunk/Source/WebCore/storage/StorageEvent.cpp
r177264 r196400 32 32 namespace WebCore { 33 33 34 StorageEventInit::StorageEventInit() 35 { 36 } 37 38 Ref<StorageEvent> StorageEvent::create() 34 Ref<StorageEvent> StorageEvent::createForBindings() 39 35 { 40 36 return adoptRef(*new StorageEvent); … … 54 50 } 55 51 56 Ref<StorageEvent> StorageEvent::create (const AtomicString& type, const StorageEventInit& initializer)52 Ref<StorageEvent> StorageEvent::createForBindings(const AtomicString& type, const StorageEventInit& initializer) 57 53 { 58 54 return adoptRef(*new StorageEvent(type, initializer)); -
trunk/Source/WebCore/storage/StorageEvent.h
r177264 r196400 35 35 36 36 struct StorageEventInit : public EventInit { 37 StorageEventInit();38 39 37 String key; 40 38 String oldValue; … … 46 44 class StorageEvent : public Event { 47 45 public: 48 static Ref<StorageEvent> create();49 46 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&); 51 49 virtual ~StorageEvent(); 52 50 -
trunk/Source/WebCore/svg/SVGZoomEvent.h
r177264 r196400 31 31 class SVGZoomEvent : public UIEvent { 32 32 public: 33 static Ref<SVGZoomEvent> create () { return adoptRef(*new SVGZoomEvent); }33 static Ref<SVGZoomEvent> createForBindings() { return adoptRef(*new SVGZoomEvent); } 34 34 35 35 // 'SVGZoomEvent' functions -
trunk/Source/WebCore/xml/XMLHttpRequestProgressEvent.h
r177264 r196400 34 34 class XMLHttpRequestProgressEvent : public ProgressEvent { 35 35 public: 36 static Ref<XMLHttpRequestProgressEvent> create()37 {38 return adoptRef(*new XMLHttpRequestProgressEvent);39 }40 36 static Ref<XMLHttpRequestProgressEvent> create(const AtomicString& type, bool lengthComputable = false, unsigned long long loaded = 0, unsigned long long total = 0) 41 37 { 42 38 return adoptRef(*new XMLHttpRequestProgressEvent(type, lengthComputable, loaded, total)); 43 39 } 44 45 40 // Those 2 synonyms are included for compatibility with Firefox. 46 41 unsigned long long position() const { return loaded(); } … … 50 45 51 46 private: 52 XMLHttpRequestProgressEvent() { }53 47 XMLHttpRequestProgressEvent(const AtomicString& type, bool lengthComputable, unsigned long long loaded, unsigned long long total) 54 48 : ProgressEvent(type, lengthComputable, loaded, total) -
trunk/Source/WebKit2/ChangeLog
r196399 r196400 1 2016-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 1 12 2016-02-10 Anders Carlsson <andersca@apple.com> 2 13 -
trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r195769 r196400 2349 2349 return nullptr; 2350 2350 2351 RefPtr<KeyboardEvent> key = KeyboardEvent::create ();2351 RefPtr<KeyboardEvent> key = KeyboardEvent::createForBindings(); 2352 2352 2353 2353 Element* nextElement = downcast<Element>(startNode);
Note:
See TracChangeset
for help on using the changeset viewer.