WebKit Bugzilla
Attachment 347439 Details for
Bug 188720
: Pass in IsComposed flag to Event constructors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP
wip188720.patch (text/plain), 34.31 KB, created by
Ryosuke Niwa
on 2018-08-18 01:30:30 PDT
(
hide
)
Description:
WIP
Filename:
MIME Type:
Creator:
Ryosuke Niwa
Created:
2018-08-18 01:30:30 PDT
Size:
34.31 KB
patch
obsolete
>Index: Source/WebCore/dom/ClipboardEvent.cpp >=================================================================== >--- Source/WebCore/dom/ClipboardEvent.cpp (revision 235008) >+++ Source/WebCore/dom/ClipboardEvent.cpp (working copy) >@@ -27,6 +27,12 @@ > > namespace WebCore { > >+ClipboardEvent::ClipboardEvent(const AtomicString& type, Ref<DataTransfer>&& dataTransfer) >+ : Event(type, CanBubble::Yes, IsCancelable::Yes, IsComposed::Yes) >+ , m_clipboardData(WTFMove(dataTransfer)) >+{ >+} >+ > ClipboardEvent::ClipboardEvent(const AtomicString& type, const Init& init, IsTrusted isTrusted) > : Event(type, init, isTrusted) > , m_clipboardData(init.clipboardData) >Index: Source/WebCore/dom/ClipboardEvent.h >=================================================================== >--- Source/WebCore/dom/ClipboardEvent.h (revision 235008) >+++ Source/WebCore/dom/ClipboardEvent.h (working copy) >@@ -37,15 +37,20 @@ > RefPtr<DataTransfer> clipboardData; > }; > >+ static Ref<ClipboardEvent> create(const AtomicString& type, Ref<DataTransfer>&& dataTransfer) >+ { >+ return adoptRef(*new ClipboardEvent(type, WTFMove(dataTransfer))); >+ } >+ > static Ref<ClipboardEvent> create(const AtomicString& type, const Init& init, IsTrusted isTrusted = IsTrusted::No) > { >- auto event = adoptRef(*new ClipboardEvent(type, init, isTrusted)); >- return event; >+ return adoptRef(*new ClipboardEvent(type, init, isTrusted)); > } > > DataTransfer* clipboardData() const { return m_clipboardData.get(); } > > private: >+ ClipboardEvent(const AtomicString& type, Ref<DataTransfer>&&); > ClipboardEvent(const AtomicString& type, const Init&, IsTrusted); > > EventInterface eventInterface() const final; >Index: Source/WebCore/dom/CompositionEvent.cpp >=================================================================== >--- Source/WebCore/dom/CompositionEvent.cpp (revision 235008) >+++ Source/WebCore/dom/CompositionEvent.cpp (working copy) >@@ -32,7 +32,7 @@ > CompositionEvent::CompositionEvent() = default; > > CompositionEvent::CompositionEvent(const AtomicString& type, RefPtr<WindowProxy>&& view, const String& data) >- : UIEvent(type, CanBubble::Yes, IsCancelable::Yes, WTFMove(view), 0) >+ : UIEvent(type, CanBubble::Yes, IsCancelable::Yes, IsComposed::Yes, WTFMove(view), 0) > , m_data(data) > { > } >Index: Source/WebCore/dom/Event.cpp >=================================================================== >--- Source/WebCore/dom/Event.cpp (revision 235009) >+++ Source/WebCore/dom/Event.cpp (working copy) >@@ -57,14 +57,14 @@ > { > } > >-Event::Event(const AtomicString& eventType, CanBubble canBubble, IsCancelable isCancelable) >- : Event { MonotonicTime::now(), eventType, IsTrusted::Yes, canBubble, isCancelable, IsComposed::No } >+Event::Event(const AtomicString& eventType, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed) >+ : Event { MonotonicTime::now(), eventType, IsTrusted::Yes, canBubble, isCancelable, isComposed } > { > ASSERT(!eventType.isNull()); > } > >-Event::Event(const AtomicString& eventType, CanBubble canBubble, IsCancelable isCancelable, MonotonicTime timestamp) >- : Event { timestamp, eventType, IsTrusted::Yes, canBubble, isCancelable, IsComposed::No } >+Event::Event(const AtomicString& eventType, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed, MonotonicTime timestamp) >+ : Event { timestamp, eventType, IsTrusted::Yes, canBubble, isCancelable, isComposed } > { > ASSERT(!eventType.isNull()); > } >@@ -80,9 +80,9 @@ > > Event::~Event() = default; > >-Ref<Event> Event::create(const AtomicString& type, CanBubble canBubble, IsCancelable isCancelable) >+Ref<Event> Event::create(const AtomicString& type, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed) > { >- return adoptRef(*new Event(type, canBubble, isCancelable)); >+ return adoptRef(*new Event(type, canBubble, isCancelable, isComposed)); > } > > Ref<Event> Event::createForBindings() >@@ -122,16 +122,8 @@ > if (!isTrusted()) > return false; > >- return m_type == eventNames().inputEvent >- || m_type == eventNames().textInputEvent >- || m_type == eventNames().DOMActivateEvent >- || isCompositionEvent() >- || isClipboardEvent() >- || isFocusEvent() >- || isKeyboardEvent() >- || isMouseEvent() >- || isTouchEvent() >- || isInputEvent(); >+ return isMouseEvent() >+ || isTouchEvent(); > } > > void Event::setTarget(RefPtr<EventTarget>&& target) >Index: Source/WebCore/dom/Event.h >=================================================================== >--- Source/WebCore/dom/Event.h (revision 235009) >+++ Source/WebCore/dom/Event.h (working copy) >@@ -52,7 +52,7 @@ > BUBBLING_PHASE = 3 > }; > >- WEBCORE_EXPORT static Ref<Event> create(const AtomicString& type, CanBubble, IsCancelable); >+ WEBCORE_EXPORT static Ref<Event> create(const AtomicString& type, CanBubble, IsCancelable, IsComposed = IsComposed::No); > static Ref<Event> createForBindings(); > static Ref<Event> create(const AtomicString& type, const EventInit&, IsTrusted = IsTrusted::No); > >@@ -142,8 +142,8 @@ > > protected: > explicit Event(IsTrusted = IsTrusted::No); >- Event(const AtomicString& type, CanBubble, IsCancelable); >- Event(const AtomicString& type, CanBubble, IsCancelable, MonotonicTime timestamp); >+ Event(const AtomicString& type, CanBubble, IsCancelable, IsComposed = IsComposed::No); >+ Event(const AtomicString& type, CanBubble, IsCancelable, IsComposed, MonotonicTime timestamp); > Event(const AtomicString& type, const EventInit&, IsTrusted); > > virtual void receivedTarget() { } >Index: Source/WebCore/dom/FocusEvent.cpp >=================================================================== >--- Source/WebCore/dom/FocusEvent.cpp (revision 235008) >+++ Source/WebCore/dom/FocusEvent.cpp (working copy) >@@ -40,8 +40,8 @@ > return true; > } > >-FocusEvent::FocusEvent(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, RefPtr<WindowProxy>&& view, int detail, RefPtr<EventTarget>&& relatedTarget) >- : UIEvent(type, canBubble, cancelable, WTFMove(view), detail) >+FocusEvent::FocusEvent(const AtomicString& type, CanBubble canBubble, IsCancelable isCancelable, RefPtr<WindowProxy>&& view, int detail, RefPtr<EventTarget>&& relatedTarget) >+ : UIEvent(type, canBubble, isCancelable, IsComposed::Yes, WTFMove(view), detail) > , m_relatedTarget(WTFMove(relatedTarget)) > { > } >Index: Source/WebCore/dom/InputEvent.cpp >=================================================================== >--- Source/WebCore/dom/InputEvent.cpp (revision 235008) >+++ Source/WebCore/dom/InputEvent.cpp (working copy) >@@ -33,13 +33,13 @@ > > namespace WebCore { > >-Ref<InputEvent> InputEvent::create(const AtomicString& eventType, const String& inputType, CanBubble canBubble, IsCancelable cancelable, RefPtr<WindowProxy>&& view, const String& data, RefPtr<DataTransfer>&& dataTransfer, const Vector<RefPtr<StaticRange>>& targetRanges, int detail) >+Ref<InputEvent> InputEvent::create(const AtomicString& eventType, const String& inputType, IsCancelable cancelable, RefPtr<WindowProxy>&& view, const String& data, RefPtr<DataTransfer>&& dataTransfer, const Vector<RefPtr<StaticRange>>& targetRanges, int detail) > { >- return adoptRef(*new InputEvent(eventType, inputType, canBubble, cancelable, WTFMove(view), data, WTFMove(dataTransfer), targetRanges, detail)); >+ return adoptRef(*new InputEvent(eventType, inputType, cancelable, WTFMove(view), data, WTFMove(dataTransfer), targetRanges, detail)); > } > >-InputEvent::InputEvent(const AtomicString& eventType, const String& inputType, CanBubble canBubble, IsCancelable cancelable, RefPtr<WindowProxy>&& view, const String& data, RefPtr<DataTransfer>&& dataTransfer, const Vector<RefPtr<StaticRange>>& targetRanges, int detail) >- : UIEvent(eventType, canBubble, cancelable, WTFMove(view), detail) >+InputEvent::InputEvent(const AtomicString& eventType, const String& inputType, IsCancelable cancelable, RefPtr<WindowProxy>&& view, const String& data, RefPtr<DataTransfer>&& dataTransfer, const Vector<RefPtr<StaticRange>>& targetRanges, int detail) >+ : UIEvent(eventType, CanBubble::Yes, cancelable, IsComposed::Yes, WTFMove(view), detail) > , m_inputType(inputType) > , m_data(data) > , m_dataTransfer(dataTransfer) >Index: Source/WebCore/dom/InputEvent.h >=================================================================== >--- Source/WebCore/dom/InputEvent.h (revision 235008) >+++ Source/WebCore/dom/InputEvent.h (working copy) >@@ -39,7 +39,7 @@ > String data; > }; > >- static Ref<InputEvent> create(const AtomicString& eventType, const String& inputType, CanBubble, IsCancelable, RefPtr<WindowProxy>&& view, >+ static Ref<InputEvent> create(const AtomicString& eventType, const String& inputType, IsCancelable, RefPtr<WindowProxy>&& view, > const String& data, RefPtr<DataTransfer>&&, const Vector<RefPtr<StaticRange>>& targetRanges, int detail); > > static Ref<InputEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No) >@@ -47,9 +47,6 @@ > return adoptRef(*new InputEvent(type, initializer, isTrusted)); > } > >- InputEvent(const AtomicString& eventType, const String& inputType, CanBubble, IsCancelable, RefPtr<WindowProxy>&&, const String& data, RefPtr<DataTransfer>&&, const Vector<RefPtr<StaticRange>>& targetRanges, int detail); >- InputEvent(const AtomicString& eventType, const Init&, IsTrusted); >- > bool isInputEvent() const override { return true; } > EventInterface eventInterface() const final { return InputEventInterfaceType; } > const String& inputType() const { return m_inputType; } >@@ -58,6 +55,9 @@ > const Vector<RefPtr<StaticRange>>& getTargetRanges() { return m_targetRanges; } > > private: >+ InputEvent(const AtomicString& eventType, const String& inputType, IsCancelable, RefPtr<WindowProxy>&&, const String& data, RefPtr<DataTransfer>&&, const Vector<RefPtr<StaticRange>>& targetRanges, int detail); >+ InputEvent(const AtomicString& eventType, const Init&, IsTrusted); >+ > String m_inputType; > String m_data; > RefPtr<DataTransfer> m_dataTransfer; >Index: Source/WebCore/dom/KeyboardEvent.cpp >=================================================================== >--- Source/WebCore/dom/KeyboardEvent.cpp (revision 235008) >+++ Source/WebCore/dom/KeyboardEvent.cpp (working copy) >@@ -94,7 +94,7 @@ > inline KeyboardEvent::KeyboardEvent() = default; > > inline KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, RefPtr<WindowProxy>&& view) >- : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()), CanBubble::Yes, IsCancelable::Yes, >+ : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()), CanBubble::Yes, IsCancelable::Yes, IsComposed::Yes, > key.timestamp().approximateMonotonicTime(), view.copyRef(), 0, key.ctrlKey(), key.altKey(), key.shiftKey(), key.metaKey(), > false, key.modifiers().contains(PlatformEvent::Modifier::CapsLockKey)) > , m_underlyingPlatformEvent(std::make_unique<PlatformKeyboardEvent>(key)) >@@ -115,8 +115,8 @@ > { > } > >-inline KeyboardEvent::KeyboardEvent(const AtomicString& eventType, const Init& initializer, IsTrusted isTrusted) >- : UIEventWithKeyState(eventType, initializer, isTrusted) >+inline KeyboardEvent::KeyboardEvent(const AtomicString& eventType, const Init& initializer) >+ : UIEventWithKeyState(eventType, initializer, IsTrusted::No) > #if ENABLE(KEYBOARD_KEY_ATTRIBUTE) > , m_key(initializer.key) > #endif >@@ -145,9 +145,9 @@ > return adoptRef(*new KeyboardEvent); > } > >-Ref<KeyboardEvent> KeyboardEvent::create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted) >+Ref<KeyboardEvent> KeyboardEvent::create(const AtomicString& type, const Init& initializer) > { >- return adoptRef(*new KeyboardEvent(type, initializer, isTrusted)); >+ return adoptRef(*new KeyboardEvent(type, initializer)); > } > > void KeyboardEvent::initKeyboardEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<WindowProxy>&& view, >Index: Source/WebCore/dom/KeyboardEvent.h >=================================================================== >--- Source/WebCore/dom/KeyboardEvent.h (revision 235008) >+++ Source/WebCore/dom/KeyboardEvent.h (working copy) >@@ -61,7 +61,7 @@ > unsigned which; > }; > >- static Ref<KeyboardEvent> create(const AtomicString& type, const Init&, IsTrusted = IsTrusted::No); >+ static Ref<KeyboardEvent> create(const AtomicString& type, const Init&); > > virtual ~KeyboardEvent(); > >@@ -103,7 +103,7 @@ > private: > KeyboardEvent(); > KeyboardEvent(const PlatformKeyboardEvent&, RefPtr<WindowProxy>&&); >- KeyboardEvent(const AtomicString&, const Init&, IsTrusted); >+ KeyboardEvent(const AtomicString&, const Init&); > > std::unique_ptr<PlatformKeyboardEvent> m_underlyingPlatformEvent; > #if ENABLE(KEYBOARD_KEY_ATTRIBUTE) >Index: Source/WebCore/dom/MouseEvent.cpp >=================================================================== >--- Source/WebCore/dom/MouseEvent.cpp (revision 235008) >+++ Source/WebCore/dom/MouseEvent.cpp (working copy) >@@ -39,9 +39,9 @@ > > using namespace JSC; > >-Ref<MouseEvent> MouseEvent::create(const AtomicString& type, const MouseEventInit& initializer, IsTrusted isTrusted) >+Ref<MouseEvent> MouseEvent::create(const AtomicString& type, const MouseEventInit& initializer) > { >- return adoptRef(*new MouseEvent(type, initializer, isTrusted)); >+ return adoptRef(*new MouseEvent(type, initializer)); > } > > Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, RefPtr<WindowProxy>&& view, const PlatformMouseEvent& event, int detail, Node* relatedTarget) >@@ -65,7 +65,7 @@ > #endif > bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, unsigned short buttons, EventTarget* relatedTarget, double force, unsigned short syntheticClickType, DataTransfer* dataTransfer, bool isSimulated) > { >- return adoptRef(*new MouseEvent(type, canBubble, cancelable, timestamp, WTFMove(view), >+ return adoptRef(*new MouseEvent(type, canBubble, cancelable, IsComposed::Yes, timestamp, WTFMove(view), > detail, { screenX, screenY }, { pageX, pageY }, > #if ENABLE(POINTER_LOCK) > { movementX, movementY }, >@@ -80,12 +80,14 @@ > > MouseEvent::MouseEvent() = default; > >-MouseEvent::MouseEvent(const AtomicString& eventType, CanBubble canBubble, IsCancelable cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& view, int detail, const IntPoint& screenLocation, const IntPoint& windowLocation, >+MouseEvent::MouseEvent(const AtomicString& eventType, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed, >+ MonotonicTime timestamp, RefPtr<WindowProxy>&& view, int detail, const IntPoint& screenLocation, const IntPoint& windowLocation, > #if ENABLE(POINTER_LOCK) >- const IntPoint& movementDelta, >+ const IntPoint& movementDelta, > #endif >- bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, unsigned short buttons, EventTarget* relatedTarget, double force, unsigned short syntheticClickType, DataTransfer* dataTransfer, bool isSimulated) >- : MouseRelatedEvent(eventType, canBubble, cancelable, timestamp, WTFMove(view), detail, screenLocation, windowLocation, >+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, unsigned short buttons, >+ EventTarget* relatedTarget, double force, unsigned short syntheticClickType, DataTransfer* dataTransfer, bool isSimulated) >+ : MouseRelatedEvent(eventType, canBubble, isCancelable, isComposed, timestamp, WTFMove(view), detail, screenLocation, windowLocation, > #if ENABLE(POINTER_LOCK) > movementDelta, > #endif >@@ -115,8 +117,8 @@ > initCoordinates(clientLocation); > } > >-MouseEvent::MouseEvent(const AtomicString& eventType, const MouseEventInit& initializer, IsTrusted isTrusted) >- : MouseRelatedEvent(eventType, initializer, isTrusted) >+MouseEvent::MouseEvent(const AtomicString& eventType, const MouseEventInit& initializer) >+ : MouseRelatedEvent(eventType, initializer) > , m_button(initializer.button == (unsigned short)-1 ? 0 : initializer.button) > , m_buttons(initializer.buttons) > , m_buttonDown(initializer.button != (unsigned short)-1) >Index: Source/WebCore/dom/MouseEvent.h >=================================================================== >--- Source/WebCore/dom/MouseEvent.h (revision 235008) >+++ Source/WebCore/dom/MouseEvent.h (working copy) >@@ -50,7 +50,7 @@ > > static Ref<MouseEvent> createForBindings() { return adoptRef(*new MouseEvent); } > >- static Ref<MouseEvent> create(const AtomicString& eventType, const MouseEventInit&, IsTrusted = IsTrusted::No); >+ static Ref<MouseEvent> create(const AtomicString& eventType, const MouseEventInit&); > > virtual ~MouseEvent(); > >@@ -80,7 +80,7 @@ > int which() const final; > > protected: >- MouseEvent(const AtomicString& type, CanBubble, IsCancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&&, >+ MouseEvent(const AtomicString& type, CanBubble, IsCancelable, IsComposed, MonotonicTime timestamp, RefPtr<WindowProxy>&&, > int detail, const IntPoint& screenLocation, const IntPoint& windowLocation, > #if ENABLE(POINTER_LOCK) > const IntPoint& movementDelta, >@@ -93,7 +93,7 @@ > bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, > unsigned short button, unsigned short buttons, unsigned short syntheticClickType, EventTarget* relatedTarget); > >- MouseEvent(const AtomicString& type, const MouseEventInit&, IsTrusted); >+ MouseEvent(const AtomicString& type, const MouseEventInit&); > > MouseEvent(); > >Index: Source/WebCore/dom/MouseRelatedEvent.cpp >=================================================================== >--- Source/WebCore/dom/MouseRelatedEvent.cpp (revision 235008) >+++ Source/WebCore/dom/MouseRelatedEvent.cpp (working copy) >@@ -33,13 +33,14 @@ > > namespace WebCore { > >-MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, CanBubble canBubble, IsCancelable cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& view, >- int detail, const IntPoint& screenLocation, const IntPoint& windowLocation, >+MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed, >+ MonotonicTime timestamp, RefPtr<WindowProxy>&& view, >+ int detail, const IntPoint& screenLocation, const IntPoint& windowLocation, > #if ENABLE(POINTER_LOCK) >- const IntPoint& movementDelta, >+ const IntPoint& movementDelta, > #endif >- bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool isSimulated) >- : UIEventWithKeyState(eventType, canBubble, cancelable, timestamp, WTFMove(view), detail, ctrlKey, altKey, shiftKey, metaKey, false, false) >+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool isSimulated) >+ : UIEventWithKeyState(eventType, canBubble, isCancelable, isComposed, timestamp, WTFMove(view), detail, ctrlKey, altKey, shiftKey, metaKey, false, false) > , m_screenLocation(screenLocation) > #if ENABLE(POINTER_LOCK) > , m_movementDelta(movementDelta) >Index: Source/WebCore/dom/MouseRelatedEvent.h >=================================================================== >--- Source/WebCore/dom/MouseRelatedEvent.h (revision 235008) >+++ Source/WebCore/dom/MouseRelatedEvent.h (working copy) >@@ -74,12 +74,26 @@ > > protected: > MouseRelatedEvent() = default; >- MouseRelatedEvent(const AtomicString& type, CanBubble, IsCancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&&, >+ MouseRelatedEvent(const AtomicString& type, CanBubble canBubble, IsCancelable isCancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& view, > int detail, const IntPoint& screenLocation, const IntPoint& windowLocation, > #if ENABLE(POINTER_LOCK) > const IntPoint& movementDelta, > #endif >+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool isSimulated = false) >+ : MouseRelatedEvent(type, canBubble, isCancelable, IsComposed::Yes, timestamp, WTFMove(view), detail, screenLocation, windowLocation, >+#if ENABLE(POINTER_LOCK) >+ movementDelta, >+#endif >+ ctrlKey, altKey, shiftKey, metaKey, isSimulated) >+ { } >+ >+ MouseRelatedEvent(const AtomicString& type, CanBubble, IsCancelable, IsComposed, MonotonicTime timestamp, RefPtr<WindowProxy>&&, >+ int detail, const IntPoint& screenLocation, const IntPoint& windowLocation, >+#if ENABLE(POINTER_LOCK) >+ const IntPoint& movementDelta, >+#endif > bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool isSimulated = false); >+ > MouseRelatedEvent(const AtomicString& type, const MouseRelatedEventInit&, IsTrusted = IsTrusted::No); > > void initCoordinates(); >Index: Source/WebCore/dom/Node.cpp >=================================================================== >--- Source/WebCore/dom/Node.cpp (revision 235008) >+++ Source/WebCore/dom/Node.cpp (working copy) >@@ -2349,7 +2349,7 @@ > { > ASSERT_WITH_SECURITY_IMPLICATION(ScriptDisallowedScope::InMainThread::isScriptAllowed()); > int detail = is<UIEvent>(underlyingClickEvent) ? downcast<UIEvent>(underlyingClickEvent).detail() : 0; >- auto event = UIEvent::create(eventNames().DOMActivateEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes, document().windowProxy(), detail); >+ auto event = UIEvent::create(eventNames().DOMActivateEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes, Event::IsComposed::Yes, document().windowProxy(), detail); > event->setUnderlyingEvent(&underlyingClickEvent); > dispatchScopedEvent(event); > if (event->defaultHandled()) >@@ -2369,7 +2369,7 @@ > > void Node::dispatchInputEvent() > { >- dispatchScopedEvent(Event::create(eventNames().inputEvent, Event::CanBubble::Yes, Event::IsCancelable::No)); >+ dispatchScopedEvent(Event::create(eventNames().inputEvent, Event::CanBubble::Yes, Event::IsCancelable::No, Event::IsComposed::Yes)); > } > > void Node::defaultEventHandler(Event& event) >Index: Source/WebCore/dom/SimulatedClick.cpp >=================================================================== >--- Source/WebCore/dom/SimulatedClick.cpp (revision 235008) >+++ Source/WebCore/dom/SimulatedClick.cpp (working copy) >@@ -44,7 +44,8 @@ > > private: > SimulatedMouseEvent(const AtomicString& eventType, RefPtr<WindowProxy>&& view, RefPtr<Event>&& underlyingEvent, Element& target, SimulatedClickSource source) >- : MouseEvent(eventType, CanBubble::Yes, IsCancelable::Yes, underlyingEvent ? underlyingEvent->timeStamp() : MonotonicTime::now(), WTFMove(view), 0, { }, { }, >+ : MouseEvent(eventType, CanBubble::Yes, IsCancelable::Yes, source == SimulatedClickSource::Bindings ? IsComposed::No : IsComposed::Yes, >+ underlyingEvent ? underlyingEvent->timeStamp() : MonotonicTime::now(), WTFMove(view), 0, { }, { }, > #if ENABLE(POINTER_LOCK) > { }, > #endif >Index: Source/WebCore/dom/TextEvent.cpp >=================================================================== >--- Source/WebCore/dom/TextEvent.cpp (revision 235008) >+++ Source/WebCore/dom/TextEvent.cpp (working copy) >@@ -72,7 +72,7 @@ > } > > TextEvent::TextEvent(RefPtr<WindowProxy>&& view, const String& data, TextEventInputType inputType) >- : UIEvent(eventNames().textInputEvent, CanBubble::Yes, IsCancelable::Yes, WTFMove(view), 0) >+ : UIEvent(eventNames().textInputEvent, CanBubble::Yes, IsCancelable::Yes, IsComposed::Yes, WTFMove(view), 0) > , m_inputType(inputType) > , m_data(data) > , m_shouldSmartReplace(false) >@@ -82,7 +82,7 @@ > } > > TextEvent::TextEvent(RefPtr<WindowProxy>&& view, const String& data, RefPtr<DocumentFragment>&& pastingFragment, bool shouldSmartReplace, bool shouldMatchStyle, MailBlockquoteHandling mailBlockquoteHandling) >- : UIEvent(eventNames().textInputEvent, CanBubble::Yes, IsCancelable::Yes, WTFMove(view), 0) >+ : UIEvent(eventNames().textInputEvent, CanBubble::Yes, IsCancelable::Yes, IsComposed::Yes, WTFMove(view), 0) > , m_inputType(TextEventInputPaste) > , m_data(data) > , m_pastingFragment(WTFMove(pastingFragment)) >@@ -93,7 +93,7 @@ > } > > TextEvent::TextEvent(RefPtr<WindowProxy>&& view, const String& data, const Vector<DictationAlternative>& dictationAlternatives) >- : UIEvent(eventNames().textInputEvent, CanBubble::Yes, IsCancelable::Yes, WTFMove(view), 0) >+ : UIEvent(eventNames().textInputEvent, CanBubble::Yes, IsCancelable::Yes, IsComposed::Yes, WTFMove(view), 0) > , m_inputType(TextEventInputDictation) > , m_data(data) > , m_shouldSmartReplace(false) >Index: Source/WebCore/dom/UIEvent.cpp >=================================================================== >--- Source/WebCore/dom/UIEvent.cpp (revision 235008) >+++ Source/WebCore/dom/UIEvent.cpp (working copy) >@@ -32,15 +32,15 @@ > { > } > >-UIEvent::UIEvent(const AtomicString& eventType, CanBubble canBubble, IsCancelable cancelable, RefPtr<WindowProxy>&& viewArg, int detailArg) >- : Event(eventType, canBubble, cancelable) >+UIEvent::UIEvent(const AtomicString& eventType, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed, RefPtr<WindowProxy>&& viewArg, int detailArg) >+ : Event(eventType, canBubble, isCancelable, isComposed) > , m_view(WTFMove(viewArg)) > , m_detail(detailArg) > { > } > >-UIEvent::UIEvent(const AtomicString& eventType, CanBubble canBubble, IsCancelable cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& viewArg, int detailArg) >- : Event(eventType, canBubble, cancelable, timestamp) >+UIEvent::UIEvent(const AtomicString& eventType, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed, MonotonicTime timestamp, RefPtr<WindowProxy>&& viewArg, int detailArg) >+ : Event(eventType, canBubble, isCancelable, isComposed, timestamp) > , m_view(WTFMove(viewArg)) > , m_detail(detailArg) > { >Index: Source/WebCore/dom/UIEvent.h >=================================================================== >--- Source/WebCore/dom/UIEvent.h (revision 235008) >+++ Source/WebCore/dom/UIEvent.h (working copy) >@@ -34,9 +34,9 @@ > > class UIEvent : public Event { > public: >- static Ref<UIEvent> create(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, RefPtr<WindowProxy>&& view, int detail) >+ static Ref<UIEvent> create(const AtomicString& type, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed, RefPtr<WindowProxy>&& view, int detail) > { >- return adoptRef(*new UIEvent(type, canBubble, cancelable, WTFMove(view), detail)); >+ return adoptRef(*new UIEvent(type, canBubble, isCancelable, isComposed, WTFMove(view), detail)); > } > static Ref<UIEvent> createForBindings() > { >@@ -65,8 +65,18 @@ > > protected: > UIEvent(); >- UIEvent(const AtomicString& type, CanBubble, IsCancelable, RefPtr<WindowProxy>&&, int detail); >- UIEvent(const AtomicString& type, CanBubble, IsCancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&&, int detail); >+ >+ UIEvent(const AtomicString& type, CanBubble canBubble, IsCancelable isCancelable, RefPtr<WindowProxy>&& view, int detail) >+ : UIEvent(type, canBubble, isCancelable, IsComposed::No, WTFMove(view), detail) >+ { } >+ >+ UIEvent(const AtomicString& type, CanBubble, IsCancelable, IsComposed, RefPtr<WindowProxy>&&, int detail); >+ >+ UIEvent(const AtomicString& type, CanBubble canBubble, IsCancelable isCancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& view, int detail) >+ : UIEvent(type, canBubble, isCancelable, IsComposed::No, timestamp, WTFMove(view), detail) >+ { } >+ >+ UIEvent(const AtomicString& type, CanBubble, IsCancelable, IsComposed, MonotonicTime timestamp, RefPtr<WindowProxy>&&, int detail); > UIEvent(const AtomicString&, const UIEventInit&, IsTrusted); > > private: >Index: Source/WebCore/dom/UIEventWithKeyState.h >=================================================================== >--- Source/WebCore/dom/UIEventWithKeyState.h (revision 235008) >+++ Source/WebCore/dom/UIEventWithKeyState.h (working copy) >@@ -40,8 +40,9 @@ > protected: > UIEventWithKeyState() = default; > >- UIEventWithKeyState(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, RefPtr<WindowProxy>&& view, int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) >- : UIEvent(type, canBubble, cancelable, WTFMove(view), detail) >+ UIEventWithKeyState(const AtomicString& type, CanBubble canBubble, IsCancelable isCancelable, >+ RefPtr<WindowProxy>&& view, int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) >+ : UIEvent(type, canBubble, isCancelable, IsComposed::No, WTFMove(view), detail) > , m_ctrlKey(ctrlKey) > , m_altKey(altKey) > , m_shiftKey(shiftKey) >@@ -49,15 +50,16 @@ > { > } > >- UIEventWithKeyState(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& view, >+ UIEventWithKeyState(const AtomicString& type, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed, >+ MonotonicTime timestamp, RefPtr<WindowProxy>&& view, > int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool altGraphKey, bool capsLockKey) >- : UIEvent(type, canBubble, cancelable, timestamp, WTFMove(view), detail) >- , m_ctrlKey(ctrlKey) >- , m_altKey(altKey) >- , m_shiftKey(shiftKey) >- , m_metaKey(metaKey) >- , m_altGraphKey(altGraphKey) >- , m_capsLockKey(capsLockKey) >+ : UIEvent(type, canBubble, isCancelable, isComposed, timestamp, WTFMove(view), detail) >+ , m_ctrlKey(ctrlKey) >+ , m_altKey(altKey) >+ , m_shiftKey(shiftKey) >+ , m_metaKey(metaKey) >+ , m_altGraphKey(altGraphKey) >+ , m_capsLockKey(capsLockKey) > { > } > >Index: Source/WebCore/dom/WheelEvent.cpp >=================================================================== >--- Source/WebCore/dom/WheelEvent.cpp (revision 235008) >+++ Source/WebCore/dom/WheelEvent.cpp (working copy) >@@ -37,8 +37,8 @@ > > inline WheelEvent::WheelEvent() = default; > >-inline WheelEvent::WheelEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted) >- : MouseEvent(type, initializer, isTrusted) >+inline WheelEvent::WheelEvent(const AtomicString& type, const Init& initializer) >+ : MouseEvent(type, initializer) > , m_wheelDelta(initializer.wheelDeltaX ? initializer.wheelDeltaX : -initializer.deltaX, initializer.wheelDeltaY ? initializer.wheelDeltaY : -initializer.deltaY) > , m_deltaX(initializer.deltaX ? initializer.deltaX : -initializer.wheelDeltaX) > , m_deltaY(initializer.deltaY ? initializer.deltaY : -initializer.wheelDeltaY) >@@ -48,7 +48,8 @@ > } > > inline WheelEvent::WheelEvent(const PlatformWheelEvent& event, RefPtr<WindowProxy>&& view) >- : MouseEvent(eventNames().wheelEvent, CanBubble::Yes, IsCancelable::Yes, event.timestamp().approximateMonotonicTime(), WTFMove(view), 0, event.globalPosition(), event.position() >+ : MouseEvent(eventNames().wheelEvent, CanBubble::Yes, IsCancelable::Yes, IsComposed::Yes, >+ event.timestamp().approximateMonotonicTime(), WTFMove(view), 0, event.globalPosition(), event.position() > #if ENABLE(POINTER_LOCK) > , { } > #endif >@@ -71,9 +72,9 @@ > return adoptRef(*new WheelEvent); > } > >-Ref<WheelEvent> WheelEvent::create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted) >+Ref<WheelEvent> WheelEvent::create(const AtomicString& type, const Init& initializer) > { >- return adoptRef(*new WheelEvent(type, initializer, isTrusted)); >+ return adoptRef(*new WheelEvent(type, initializer)); > } > > void WheelEvent::initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, RefPtr<WindowProxy>&& view, int screenX, int screenY, int pageX, int pageY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) >Index: Source/WebCore/dom/WheelEvent.h >=================================================================== >--- Source/WebCore/dom/WheelEvent.h (revision 235008) >+++ Source/WebCore/dom/WheelEvent.h (working copy) >@@ -51,7 +51,7 @@ > int wheelDeltaY { 0 }; // Deprecated. > }; > >- static Ref<WheelEvent> create(const AtomicString& type, const Init&, IsTrusted = IsTrusted::No); >+ static Ref<WheelEvent> create(const AtomicString& type, const Init&); > > WEBCORE_EXPORT void initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, RefPtr<WindowProxy>&&, int screenX, int screenY, int pageX, int pageY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); > >@@ -74,7 +74,7 @@ > > private: > WheelEvent(); >- WheelEvent(const AtomicString&, const Init&, IsTrusted); >+ WheelEvent(const AtomicString&, const Init&); > WheelEvent(const PlatformWheelEvent&, RefPtr<WindowProxy>&&); > > EventInterface eventInterface() const final; >Index: Source/WebCore/editing/Editor.cpp >=================================================================== >--- Source/WebCore/editing/Editor.cpp (revision 235008) >+++ Source/WebCore/editing/Editor.cpp (working copy) >@@ -115,7 +115,7 @@ > if (!element.document().settings().inputEventsEnabled()) > return true; > >- auto event = InputEvent::create(eventNames().beforeinputEvent, inputType, Event::CanBubble::Yes, cancelable, element.document().windowProxy(), data, WTFMove(dataTransfer), targetRanges, 0); >+ auto event = InputEvent::create(eventNames().beforeinputEvent, inputType, cancelable, element.document().windowProxy(), data, WTFMove(dataTransfer), targetRanges, 0); > element.dispatchEvent(event); > return !event->defaultPrevented(); > } >@@ -127,7 +127,7 @@ > // but TypingCommands are special in that existing TypingCommands that are applied again fire input events *from within* the scope by calling typingAddedToOpenCommand. > // Instead, TypingCommands should always dispatch events synchronously after the end of the scoped queue in CompositeEditCommand::apply. To work around this for the > // time being, just revert back to calling dispatchScopedEvent. >- element.dispatchScopedEvent(InputEvent::create(eventNames().inputEvent, inputType, Event::CanBubble::Yes, Event::IsCancelable::No, >+ element.dispatchScopedEvent(InputEvent::create(eventNames().inputEvent, inputType, Event::IsCancelable::No, > element.document().windowProxy(), data, WTFMove(dataTransfer), targetRanges, 0)); > } else > element.dispatchInputEvent(); >@@ -390,11 +390,7 @@ > > auto dataTransfer = createDataTransferForClipboardEvent(target->document(), kind); > >- ClipboardEvent::Init init; >- init.bubbles = true; >- init.cancelable = true; >- init.clipboardData = dataTransfer.ptr(); >- auto event = ClipboardEvent::create(eventNameForClipboardEvent(kind), init, Event::IsTrusted::Yes); >+ auto event = ClipboardEvent::create(eventNameForClipboardEvent(kind), dataTransfer.copyRef()); > > target->dispatchEvent(event); > bool noDefaultProcessing = event->defaultPrevented();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188720
:
347439
|
347447
|
347910
|
347986
|
347990