WebKit Bugzilla
Attachment 347990 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]
Fixed iOS builds
bug-188720-20180823222309.patch (text/plain), 60.35 KB, created by
Ryosuke Niwa
on 2018-08-23 22:23:10 PDT
(
hide
)
Description:
Fixed iOS builds
Filename:
MIME Type:
Creator:
Ryosuke Niwa
Created:
2018-08-23 22:23:10 PDT
Size:
60.35 KB
patch
obsolete
>Subversion Revision: 235273 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 50081f9500ade7fbaff3c9b8b769845e7b737a23..2a3fddde32174c71ea3dd94a7ad25c49275c7e4a 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,88 @@ >+2018-08-23 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Pass in IsComposed flag to Event constructors >+ https://bugs.webkit.org/show_bug.cgi?id=188720 >+ <rdar://problem/43580387> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch replaces the logic in Event::isComposed to decide whether an event is composed or not by >+ explicitly passing IsComposed flag to Event constructor. This decouples being composed from whether >+ an event is trusted and of a partciular event type, paving our way to make synthetic click event >+ dispatched by an author script composable in webkit.org/b/170211. >+ >+ This patch also removes IsTrusted from the argument list of event constructors and create functions >+ to systematically eliminate the possibility of this patch making an event uncomposed by not setting >+ IsComposed flag. >+ >+ No new tests since there should be no behavioral change. >+ >+ * dom/ClipboardEvent.cpp: >+ (WebCore::ClipboardEvent::ClipboardEvent): A trusted ClipboardEvent is composed. >+ * dom/ClipboardEvent.h: >+ (WebCore::ClipboardEvent::ClipboardEvent): Removed IsTrusted from the variant which takes Init object >+ to make sure this refactoring is correct. >+ (WebCore::ClipboardEvent::create): Ditto. >+ * dom/CompositionEvent.cpp: >+ (WebCore::CompositionEvent::CompositionEvent): A trusted CompositionEvent is composed. >+ * dom/CompositionEvent.h: >+ * dom/Element.cpp: >+ (WebCore::Element::dispatchMouseEvent): A trusted dblclick event is composed (this is a non-standard >+ event but virtually every mouse event is composed so it makes sense to make this composed). >+ * dom/Event.cpp: >+ (WebCore::Event::Event): >+ (WebCore::Event::create): >+ (WebCore::Event::composed const): Deleted. The trival implementation moved to the header file. >+ * dom/Event.h: >+ (WebCore::Event::composed const): >+ * dom/FocusEvent.cpp: >+ (WebCore::FocusEvent::FocusEvent): A trusted Focus event is composed. >+ * dom/FocusEvent.h: >+ (WebCore::FocusEvent::create): Removed IsTrusted from Init variant for the correctness guarantee. >+ (WebCore::FocusEvent::FocusEvent): Ditto. >+ * dom/InputEvent.cpp: >+ (WebCore::InputEvent::create): Removed IsTrusted from Init variant for the correctness guarantee. >+ (WebCore::InputEvent::InputEvent): A trsuted InputEvent is composed. >+ * dom/InputEvent.h: >+ * dom/KeyboardEvent.cpp: >+ (WebCore::KeyboardEvent::KeyboardEvent): A trsuted KeyboardEvent is composed. >+ (WebCore::KeyboardEvent::create): Removed IsTrusted from Init variant for the correctness guarantee. >+ * dom/KeyboardEvent.h: >+ * dom/MouseEvent.cpp: >+ (WebCore::MouseEvent::create): Removed IsTrusted from Init variant for the correctness guarantee. >+ (WebCore::MouseEvent::MouseEvent): Explicitly take IsComposed flag from subclasses since simulated click >+ does not currently compose. >+ * dom/MouseEvent.h: >+ * dom/MouseRelatedEvent.cpp: >+ (WebCore::MouseRelatedEvent::MouseRelatedEvent): A trusted touch event is composed. >+ * dom/MouseRelatedEvent.h: >+ * dom/Node.cpp: >+ (WebCore::Node::dispatchDOMActivateEvent): A trusted DOMActivateEvent event is composed. >+ (WebCore::Node::dispatchInputEvent): A trusted input event is composed. >+ * dom/SimulatedClick.cpp: >+ (SimulatedMouseEvent::SimulatedMouseEvent): A simulated click is composed if it's a trusted event for now. >+ This is the bug to be fixed in webkit.org/b/170211. >+ * dom/TextEvent.cpp: >+ (WebCore::TextEvent::TextEvent): A trsuted textInput event is composed. >+ * dom/UIEvent.cpp: >+ (WebCore::UIEvent::UIEvent): Added IsComposed as an argument to the variant which creates a trusted event, >+ and removed IsTrusted from Init variant for the correctness guarantee. >+ * dom/UIEvent.h: >+ (WebCore::UIEvent::create): Ditto. >+ * dom/UIEventWithKeyState.h: >+ (WebCore::UIEventWithKeyState::UIEventWithKeyState): Ditto. >+ * dom/WheelEvent.cpp: >+ (WebCore::WheelEvent::WheelEvent): A trusted Wheel event, which is a subclass of MouseEvent, is composed. >+ (WebCore::WheelEvent::create): Removed IsTrusted from Init variant for the correctness guarantee. >+ * dom/WheelEvent.h: >+ * editing/Editor.cpp: >+ (WebCore::dispatchBeforeInputEvent): >+ (WebCore::dispatchInputEvent): >+ (WebCore::dispatchClipboardEvent): Call the newly added variant which takes DataTransfer directly so that >+ we can remove IsTrusted from the variant which takes Init for the correctness guarantee. >+ * page/EventHandler.cpp: >+ (WebCore::EventHandler::dispatchDragEvent): A trusted mouse event is composed. >+ > 2018-08-23 Simon Fraser <simon.fraser@apple.com> > > Add support for dumping GC heap snapshots, and a viewer >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 7ebaa9980b0dd6adf31360ee003feccb9c419e75..3f6f004b7fbcb07a172682f8bcc32e81ab646747 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,15 @@ >+2018-08-23 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Pass in IsComposed flag to Event constructors >+ https://bugs.webkit.org/show_bug.cgi?id=188720 >+ <rdar://problem/43580387> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick): A trusted click event is composed regardless of >+ whether it's simulated or not. >+ > 2018-08-23 Tim Horton <timothy_horton@apple.com> > > Use unified build for UIProcess >diff --git a/Source/WebKitLegacy/ios/ChangeLog b/Source/WebKitLegacy/ios/ChangeLog >index 8043219c0f35a9404dd4b90ebc1f302817b1c04e..29037271d7c00ffb3c8bfceb937ec9e57d818369 100644 >--- a/Source/WebKitLegacy/ios/ChangeLog >+++ b/Source/WebKitLegacy/ios/ChangeLog >@@ -1,3 +1,15 @@ >+2018-08-23 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Pass in IsComposed flag to Event constructors >+ https://bugs.webkit.org/show_bug.cgi?id=188720 >+ <rdar://problem/43580387> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebView/WebPDFViewPlaceholder.mm: >+ (-[WebPDFViewPlaceholder simulateClickOnLinkToURL:]): A trusted click event is composed regardless >+ of whether it's simulated or not. >+ > 2018-08-21 Ryosuke Niwa <rniwa@webkit.org> > > Replace booleans for modifier keys in UIEventWithKeyState with OptionSet<Modifier> >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index dee686d4d4ab0520c5acc024330bef65776c1bec..9b4c49060580cb25ba8d3cb7db0a7d93d3487ae2 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,15 @@ >+2018-08-23 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Pass in IsComposed flag to Event constructors >+ https://bugs.webkit.org/show_bug.cgi?id=188720 >+ <rdar://problem/43580387> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebView/WebPDFView.mm: >+ (-[WebPDFView PDFViewWillClickOnLink:withURL:]): A trusted click event is composed regardless of >+ whether it's simulated or not. >+ > 2018-08-23 Mark Lam <mark.lam@apple.com> > > Move vmEntryGlobalObject() to VM from CallFrame. >diff --git a/Source/WebCore/dom/ClipboardEvent.cpp b/Source/WebCore/dom/ClipboardEvent.cpp >index b9ae45d8f8b440e740bcfe57a220bd9d54a613b2..3caadcf24c5fe5569c70378faf5e72ff0f4d1e50 100644 >--- a/Source/WebCore/dom/ClipboardEvent.cpp >+++ b/Source/WebCore/dom/ClipboardEvent.cpp >@@ -27,8 +27,14 @@ > > namespace WebCore { > >-ClipboardEvent::ClipboardEvent(const AtomicString& type, const Init& init, IsTrusted isTrusted) >- : Event(type, init, isTrusted) >+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) >+ : Event(type, init, IsTrusted::No) > , m_clipboardData(init.clipboardData) > { > } >diff --git a/Source/WebCore/dom/ClipboardEvent.h b/Source/WebCore/dom/ClipboardEvent.h >index c4993558a42ba3b90dfdad1ba7550873ef634840..7906be0d3801a7cb71460dfa988e1e705836ce10 100644 >--- a/Source/WebCore/dom/ClipboardEvent.h >+++ b/Source/WebCore/dom/ClipboardEvent.h >@@ -37,16 +37,21 @@ public: > RefPtr<DataTransfer> clipboardData; > }; > >- static Ref<ClipboardEvent> create(const AtomicString& type, const Init& init, IsTrusted isTrusted = IsTrusted::No) >+ static Ref<ClipboardEvent> create(const AtomicString& type, Ref<DataTransfer>&& dataTransfer) > { >- auto event = adoptRef(*new ClipboardEvent(type, init, isTrusted)); >- return event; >+ return adoptRef(*new ClipboardEvent(type, WTFMove(dataTransfer))); >+ } >+ >+ static Ref<ClipboardEvent> create(const AtomicString& type, const Init& init) >+ { >+ return adoptRef(*new ClipboardEvent(type, init)); > } > > DataTransfer* clipboardData() const { return m_clipboardData.get(); } > > private: >- ClipboardEvent(const AtomicString& type, const Init&, IsTrusted); >+ ClipboardEvent(const AtomicString& type, Ref<DataTransfer>&&); >+ ClipboardEvent(const AtomicString& type, const Init&); > > EventInterface eventInterface() const final; > bool isClipboardEvent() const final; >diff --git a/Source/WebCore/dom/CompositionEvent.cpp b/Source/WebCore/dom/CompositionEvent.cpp >index b7125fc6b90d05e7724d3e2a2b715083966c97d2..1d04795de82787052b6c961b79ee0f8e161ffb8a 100644 >--- a/Source/WebCore/dom/CompositionEvent.cpp >+++ b/Source/WebCore/dom/CompositionEvent.cpp >@@ -32,13 +32,13 @@ namespace WebCore { > 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) > { > } > >-CompositionEvent::CompositionEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted) >- : UIEvent(type, initializer, isTrusted) >+CompositionEvent::CompositionEvent(const AtomicString& type, const Init& initializer) >+ : UIEvent(type, initializer) > , m_data(initializer.data) > { > } >diff --git a/Source/WebCore/dom/CompositionEvent.h b/Source/WebCore/dom/CompositionEvent.h >index 3b1c46d635ecaf6cd0919098f508fc41e64cebcf..223b8605949ca2e52c4f3c62295f38567aa6d223 100644 >--- a/Source/WebCore/dom/CompositionEvent.h >+++ b/Source/WebCore/dom/CompositionEvent.h >@@ -46,9 +46,9 @@ public: > String data; > }; > >- static Ref<CompositionEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No) >+ static Ref<CompositionEvent> create(const AtomicString& type, const Init& initializer) > { >- return adoptRef(*new CompositionEvent(type, initializer, isTrusted)); >+ return adoptRef(*new CompositionEvent(type, initializer)); > } > > virtual ~CompositionEvent(); >@@ -62,7 +62,7 @@ public: > private: > CompositionEvent(); > CompositionEvent(const AtomicString& type, RefPtr<WindowProxy>&&, const String&); >- CompositionEvent(const AtomicString& type, const Init&, IsTrusted); >+ CompositionEvent(const AtomicString& type, const Init&); > > bool isCompositionEvent() const override; > >diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp >index d9cbf3821f7f9b7f6d639cf8fe50a0256e85d00a..9481ce9f26d9a2eae6a5fee2ccd11b901bcc6a56 100644 >--- a/Source/WebCore/dom/Element.cpp >+++ b/Source/WebCore/dom/Element.cpp >@@ -292,7 +292,9 @@ bool Element::dispatchMouseEvent(const PlatformMouseEvent& platformEvent, const > // as a separate event in other DOM-compliant browsers like Firefox, and so we do the same. > // FIXME: Is it okay that mouseEvent may have been mutated by scripts via initMouseEvent in dispatchEvent above? > Ref<MouseEvent> doubleClickEvent = MouseEvent::create(eventNames().dblclickEvent, >- mouseEvent->bubbles() ? Event::CanBubble::Yes : Event::CanBubble::No, mouseEvent->cancelable() ? Event::IsCancelable::Yes : Event::IsCancelable::No, >+ mouseEvent->bubbles() ? Event::CanBubble::Yes : Event::CanBubble::No, >+ mouseEvent->cancelable() ? Event::IsCancelable::Yes : Event::IsCancelable::No, >+ Event::IsComposed::Yes, > mouseEvent->view(), mouseEvent->detail(), > mouseEvent->screenX(), mouseEvent->screenY(), mouseEvent->clientX(), mouseEvent->clientY(), > mouseEvent->modifierKeys(), mouseEvent->button(), mouseEvent->buttons(), mouseEvent->syntheticClickType(), relatedTarget); >diff --git a/Source/WebCore/dom/Event.cpp b/Source/WebCore/dom/Event.cpp >index 008417c8d9637f7f864329775c2d3d76301e3ba1..fa446447c3abb949902faaef351605f32934b54a 100644 >--- a/Source/WebCore/dom/Event.cpp >+++ b/Source/WebCore/dom/Event.cpp >@@ -57,14 +57,14 @@ Event::Event(IsTrusted isTrusted) > { > } > >-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(const AtomicString& eventType, const EventInit& initializer, IsTrus > > 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() >@@ -113,27 +113,6 @@ void Event::initEvent(const AtomicString& eventTypeArg, bool canBubbleArg, bool > m_underlyingEvent = nullptr; > } > >-bool Event::composed() const >-{ >- if (m_composed) >- return true; >- >- // http://w3c.github.io/webcomponents/spec/shadow/#scoped-flag >- if (!isTrusted()) >- return false; >- >- return m_type == eventNames().inputEvent >- || m_type == eventNames().textInputEvent >- || m_type == eventNames().DOMActivateEvent >- || isCompositionEvent() >- || isClipboardEvent() >- || isFocusEvent() >- || isKeyboardEvent() >- || isMouseEvent() >- || isTouchEvent() >- || isInputEvent(); >-} >- > void Event::setTarget(RefPtr<EventTarget>&& target) > { > if (m_target == target) >diff --git a/Source/WebCore/dom/Event.h b/Source/WebCore/dom/Event.h >index f4b7afe2402f13ed165f34c7ef1a351a8d4c3f82..9554eef5059a49bb7356c079428f8644156af5fb 100644 >--- a/Source/WebCore/dom/Event.h >+++ b/Source/WebCore/dom/Event.h >@@ -52,7 +52,7 @@ public: > 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); > >@@ -76,7 +76,7 @@ public: > > bool bubbles() const { return m_canBubble; } > bool cancelable() const { return m_cancelable; } >- WEBCORE_EXPORT bool composed() const; >+ bool composed() const { return m_composed; } > > DOMHighResTimeStamp timeStampForBindings(ScriptExecutionContext&) const; > MonotonicTime timeStamp() const { return m_createTime; } >@@ -142,8 +142,8 @@ public: > > 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() { } >diff --git a/Source/WebCore/dom/FocusEvent.cpp b/Source/WebCore/dom/FocusEvent.cpp >index 1ea55fc01f421e59ed93ced3ddc1572bdd02b23e..826361549c2e3b030cc8f9d633e954417b7898c5 100644 >--- a/Source/WebCore/dom/FocusEvent.cpp >+++ b/Source/WebCore/dom/FocusEvent.cpp >@@ -40,14 +40,14 @@ bool FocusEvent::isFocusEvent() const > 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)) > { > } > >-FocusEvent::FocusEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted) >- : UIEvent(type, initializer, isTrusted) >+FocusEvent::FocusEvent(const AtomicString& type, const Init& initializer) >+ : UIEvent(type, initializer) > , m_relatedTarget(initializer.relatedTarget) > { > } >diff --git a/Source/WebCore/dom/FocusEvent.h b/Source/WebCore/dom/FocusEvent.h >index ddd53114dd5e8490f2833f7ab7c57161fc20611f..867a008d5ca3b7e9d9ec537e1320bbaeef361526 100644 >--- a/Source/WebCore/dom/FocusEvent.h >+++ b/Source/WebCore/dom/FocusEvent.h >@@ -49,9 +49,9 @@ public: > RefPtr<EventTarget> relatedTarget; > }; > >- static Ref<FocusEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No) >+ static Ref<FocusEvent> create(const AtomicString& type, const Init& initializer) > { >- return adoptRef(*new FocusEvent(type, initializer, isTrusted)); >+ return adoptRef(*new FocusEvent(type, initializer)); > } > > EventTarget* relatedTarget() const final { return m_relatedTarget.get(); } >@@ -59,7 +59,7 @@ public: > private: > FocusEvent() = default; > FocusEvent(const AtomicString& type, CanBubble, IsCancelable, RefPtr<WindowProxy>&&, int, RefPtr<EventTarget>&&); >- FocusEvent(const AtomicString& type, const Init&, IsTrusted); >+ FocusEvent(const AtomicString& type, const Init&); > > EventInterface eventInterface() const final; > bool isFocusEvent() const final; >diff --git a/Source/WebCore/dom/InputEvent.cpp b/Source/WebCore/dom/InputEvent.cpp >index 8556203cc59a55377a2fbe1708100db5ef969e4e..040e5d5f268525b755b0102d06929a1e090d2015 100644 >--- a/Source/WebCore/dom/InputEvent.cpp >+++ b/Source/WebCore/dom/InputEvent.cpp >@@ -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) >@@ -47,8 +47,8 @@ InputEvent::InputEvent(const AtomicString& eventType, const String& inputType, C > { > } > >-InputEvent::InputEvent(const AtomicString& eventType, const Init& initializer, IsTrusted isTrusted) >- : UIEvent(eventType, initializer, isTrusted) >+InputEvent::InputEvent(const AtomicString& eventType, const Init& initializer) >+ : UIEvent(eventType, initializer) > , m_inputType(emptyString()) > , m_data(initializer.data) > { >diff --git a/Source/WebCore/dom/InputEvent.h b/Source/WebCore/dom/InputEvent.h >index 631dc6dfaa23ae79ee7a23413a47c212cf97927e..b333bfe90af219d2597dabe36383cd96ab6b8e51 100644 >--- a/Source/WebCore/dom/InputEvent.h >+++ b/Source/WebCore/dom/InputEvent.h >@@ -39,17 +39,14 @@ public: > 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) >+ static Ref<InputEvent> create(const AtomicString& type, const Init& initializer) > { >- return adoptRef(*new InputEvent(type, initializer, isTrusted)); >+ return adoptRef(*new InputEvent(type, initializer)); > } > >- 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 @@ public: > 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&); >+ > String m_inputType; > String m_data; > RefPtr<DataTransfer> m_dataTransfer; >diff --git a/Source/WebCore/dom/KeyboardEvent.cpp b/Source/WebCore/dom/KeyboardEvent.cpp >index 3b5e9c9849988ad25336611ea33e2a8d4e7e3526..baf97318ff7591f8d4b2ed0189e942e974cd8f49 100644 >--- a/Source/WebCore/dom/KeyboardEvent.cpp >+++ b/Source/WebCore/dom/KeyboardEvent.cpp >@@ -94,7 +94,7 @@ static inline KeyboardEvent::KeyLocationCode keyLocationCode(const PlatformKeybo > 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.modifiers()) > , m_underlyingPlatformEvent(std::make_unique<PlatformKeyboardEvent>(key)) > #if ENABLE(KEYBOARD_KEY_ATTRIBUTE) >@@ -114,8 +114,8 @@ inline KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, RefPtr<Win > { > } > >-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) > #if ENABLE(KEYBOARD_KEY_ATTRIBUTE) > , m_key(initializer.key) > #endif >@@ -144,9 +144,9 @@ Ref<KeyboardEvent> KeyboardEvent::createForBindings() > 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, >diff --git a/Source/WebCore/dom/KeyboardEvent.h b/Source/WebCore/dom/KeyboardEvent.h >index 1d3cc243799b19a744ee978a187eaeaec8805fb1..4007ea277a0511d7b1e8db745be5563de5fe5ece 100644 >--- a/Source/WebCore/dom/KeyboardEvent.h >+++ b/Source/WebCore/dom/KeyboardEvent.h >@@ -61,7 +61,7 @@ public: > 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 @@ public: > 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) >diff --git a/Source/WebCore/dom/MouseEvent.cpp b/Source/WebCore/dom/MouseEvent.cpp >index 7f8476440f261425ae84b685afaf43ac99da709f..632e13d9ddaf86c8b92644535ba2a9d32bf33960 100644 >--- a/Source/WebCore/dom/MouseEvent.cpp >+++ b/Source/WebCore/dom/MouseEvent.cpp >@@ -39,9 +39,9 @@ namespace WebCore { > > 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) >@@ -50,7 +50,7 @@ Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, RefPtr<WindowP > auto isCancelable = eventType != eventNames().mousemoveEvent && !isMouseEnterOrLeave ? IsCancelable::Yes : IsCancelable::No; > auto canBubble = !isMouseEnterOrLeave ? CanBubble::Yes : CanBubble::No; > >- return MouseEvent::create(eventType, canBubble, isCancelable, event.timestamp().approximateMonotonicTime(), WTFMove(view), detail, >+ return MouseEvent::create(eventType, canBubble, isCancelable, IsComposed::Yes, event.timestamp().approximateMonotonicTime(), WTFMove(view), detail, > event.globalPosition(), event.position(), > #if ENABLE(POINTER_LOCK) > event.movementDelta(), >@@ -60,27 +60,28 @@ Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, RefPtr<WindowP > event.modifiers(), event.button(), event.buttons(), relatedTarget, event.force(), event.syntheticClickType()); > } > >-Ref<MouseEvent> MouseEvent::create(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& view, int detail, >+Ref<MouseEvent> MouseEvent::create(const AtomicString& type, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed, MonotonicTime timestamp, RefPtr<WindowProxy>&& view, int detail, > const IntPoint& screenLocation, const IntPoint& windowLocation, const IntPoint& movementDelta, OptionSet<Modifier> modifiers, unsigned short button, unsigned short buttons, > EventTarget* relatedTarget, double force, unsigned short syntheticClickType, DataTransfer* dataTransfer, IsSimulated isSimulated) > { >- return adoptRef(*new MouseEvent(type, canBubble, cancelable, timestamp, WTFMove(view), detail, >+ return adoptRef(*new MouseEvent(type, canBubble, isCancelable, isComposed, timestamp, WTFMove(view), detail, > screenLocation, windowLocation, movementDelta, modifiers, button, buttons, relatedTarget, force, syntheticClickType, dataTransfer, isSimulated)); > } > >-Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, CanBubble canBubble, IsCancelable cancelable, RefPtr<WindowProxy>&& view, int detail, >+Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed, RefPtr<WindowProxy>&& view, int detail, > int screenX, int screenY, int clientX, int clientY, OptionSet<Modifier> modifiers, unsigned short button, unsigned short buttons, > unsigned short syntheticClickType, EventTarget* relatedTarget) > { >- return adoptRef(*new MouseEvent(eventType, canBubble, cancelable, WTFMove(view), detail, { screenX, screenY }, { clientX, clientY }, modifiers, button, buttons, syntheticClickType, relatedTarget)); >+ return adoptRef(*new MouseEvent(eventType, canBubble, isCancelable, isComposed, WTFMove(view), detail, { screenX, screenY }, { clientX, clientY }, modifiers, button, buttons, syntheticClickType, relatedTarget)); > } > > MouseEvent::MouseEvent() = default; > >-MouseEvent::MouseEvent(const AtomicString& eventType, CanBubble canBubble, IsCancelable cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& view, int detail, >+MouseEvent::MouseEvent(const AtomicString& eventType, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed, >+ MonotonicTime timestamp, RefPtr<WindowProxy>&& view, int detail, > const IntPoint& screenLocation, const IntPoint& windowLocation, const IntPoint& movementDelta, OptionSet<Modifier> modifiers, unsigned short button, unsigned short buttons, > EventTarget* relatedTarget, double force, unsigned short syntheticClickType, DataTransfer* dataTransfer, IsSimulated isSimulated) >- : MouseRelatedEvent(eventType, canBubble, cancelable, timestamp, WTFMove(view), detail, screenLocation, windowLocation, movementDelta, modifiers, isSimulated) >+ : MouseRelatedEvent(eventType, canBubble, isCancelable, isComposed, timestamp, WTFMove(view), detail, screenLocation, windowLocation, movementDelta, modifiers, isSimulated) > , m_button(button == (unsigned short)-1 ? 0 : button) > , m_buttons(buttons) > , m_syntheticClickType(button == (unsigned short)-1 ? 0 : syntheticClickType) >@@ -91,9 +92,10 @@ MouseEvent::MouseEvent(const AtomicString& eventType, CanBubble canBubble, IsCan > { > } > >-MouseEvent::MouseEvent(const AtomicString& eventType, CanBubble canBubble, IsCancelable cancelable, RefPtr<WindowProxy>&& view, int detail, >- const IntPoint& screenLocation, const IntPoint& clientLocation, OptionSet<Modifier> modifiers, unsigned short button, unsigned short buttons, unsigned short syntheticClickType, EventTarget* relatedTarget) >- : MouseRelatedEvent(eventType, canBubble, cancelable, MonotonicTime::now(), WTFMove(view), detail, screenLocation, { }, { }, modifiers, IsSimulated::No) >+MouseEvent::MouseEvent(const AtomicString& eventType, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed, >+ RefPtr<WindowProxy>&& view, int detail, const IntPoint& screenLocation, const IntPoint& clientLocation, >+ OptionSet<Modifier> modifiers, unsigned short button, unsigned short buttons, unsigned short syntheticClickType, EventTarget* relatedTarget) >+ : MouseRelatedEvent(eventType, canBubble, isCancelable, isComposed, MonotonicTime::now(), WTFMove(view), detail, screenLocation, { }, { }, modifiers, IsSimulated::No) > , m_button(button == (unsigned short)-1 ? 0 : button) > , m_buttons(buttons) > , m_syntheticClickType(button == (unsigned short)-1 ? 0 : syntheticClickType) >@@ -103,8 +105,8 @@ MouseEvent::MouseEvent(const AtomicString& eventType, CanBubble canBubble, IsCan > 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) >diff --git a/Source/WebCore/dom/MouseEvent.h b/Source/WebCore/dom/MouseEvent.h >index 02d35c67319f42185a9b7b7bd7742b6096e67fc5..8849911db63b738193c0d97e1171e17b1cf7f40e 100644 >--- a/Source/WebCore/dom/MouseEvent.h >+++ b/Source/WebCore/dom/MouseEvent.h >@@ -34,19 +34,19 @@ class PlatformMouseEvent; > > class MouseEvent : public MouseRelatedEvent { > public: >- WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& type, CanBubble, IsCancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&&, int detail, >+ WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& type, CanBubble, IsCancelable, IsComposed, MonotonicTime timestamp, RefPtr<WindowProxy>&&, int detail, > const IntPoint& screenLocation, const IntPoint& windowLocation, const IntPoint& movementDelta, OptionSet<Modifier>, unsigned short button, unsigned short buttons, > EventTarget* relatedTarget, double force, unsigned short syntheticClickType, DataTransfer* = nullptr, IsSimulated = IsSimulated::No); > > WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& eventType, RefPtr<WindowProxy>&&, const PlatformMouseEvent&, int detail, Node* relatedTarget); > >- static Ref<MouseEvent> create(const AtomicString& eventType, CanBubble, IsCancelable, RefPtr<WindowProxy>&&, >- int detail, int screenX, int screenY, int clientX, int clientY, OptionSet<Modifier>, >- unsigned short button, unsigned short buttons, unsigned short syntheticClickType, EventTarget* relatedTarget); >+ static Ref<MouseEvent> create(const AtomicString& eventType, CanBubble, IsCancelable, IsComposed, RefPtr<WindowProxy>&&, int detail, >+ int screenX, int screenY, int clientX, int clientY, OptionSet<Modifier>, unsigned short button, unsigned short buttons, >+ unsigned short syntheticClickType, EventTarget* relatedTarget); > > 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(); > >@@ -76,15 +76,15 @@ public: > int which() const final; > > protected: >- MouseEvent(const AtomicString& type, CanBubble, IsCancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&&, int detail, >+ MouseEvent(const AtomicString& type, CanBubble, IsCancelable, IsComposed, MonotonicTime timestamp, RefPtr<WindowProxy>&&, int detail, > const IntPoint& screenLocation, const IntPoint& windowLocation, const IntPoint& movementDelta, OptionSet<Modifier>, unsigned short button, unsigned short buttons, > EventTarget* relatedTarget, double force, unsigned short syntheticClickType, DataTransfer*, IsSimulated); > >- MouseEvent(const AtomicString& type, CanBubble, IsCancelable, RefPtr<WindowProxy>&&, >- int detail, const IntPoint& screenLocation, const IntPoint& clientLocation, >- OptionSet<Modifier>, unsigned short button, unsigned short buttons, unsigned short syntheticClickType, EventTarget* relatedTarget); >+ MouseEvent(const AtomicString& type, CanBubble, IsCancelable, IsComposed, RefPtr<WindowProxy>&&, int detail, >+ const IntPoint& screenLocation, const IntPoint& clientLocation, OptionSet<Modifier>, 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(); > >diff --git a/Source/WebCore/dom/MouseRelatedEvent.cpp b/Source/WebCore/dom/MouseRelatedEvent.cpp >index 893cc28d18116411dbef4a43f82db7f26537b66b..3b8ddf5753ccb61b18e3379447081e34ec2406a1 100644 >--- a/Source/WebCore/dom/MouseRelatedEvent.cpp >+++ b/Source/WebCore/dom/MouseRelatedEvent.cpp >@@ -33,9 +33,10 @@ > > namespace WebCore { > >-MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, CanBubble canBubble, IsCancelable isCancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& view, int detail, >+MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed, >+ MonotonicTime timestamp, RefPtr<WindowProxy>&& view, int detail, > const IntPoint& screenLocation, const IntPoint& windowLocation, const IntPoint& movementDelta, OptionSet<Modifier> modifiers, IsSimulated isSimulated) >- : UIEventWithKeyState(eventType, canBubble, isCancelable, timestamp, WTFMove(view), detail, modifiers) >+ : UIEventWithKeyState(eventType, canBubble, isCancelable, isComposed, timestamp, WTFMove(view), detail, modifiers) > , m_screenLocation(screenLocation) > #if ENABLE(POINTER_LOCK) > , m_movementDelta(movementDelta) >@@ -49,17 +50,19 @@ MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, CanBubble ca > } > > MouseRelatedEvent::MouseRelatedEvent(const AtomicString& type, IsCancelable isCancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& view, const IntPoint& globalLocation, OptionSet<Modifier> modifiers) >- : MouseRelatedEvent(type, CanBubble::Yes, isCancelable, timestamp, WTFMove(view), 0, globalLocation, globalLocation /* Converted in init */, { }, modifiers, IsSimulated::No) >+ : MouseRelatedEvent(type, CanBubble::Yes, isCancelable, IsComposed::Yes, timestamp, >+ WTFMove(view), 0, globalLocation, globalLocation /* Converted in init */, { }, modifiers, IsSimulated::No) > { > } > > MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, const MouseRelatedEventInit& initializer, IsTrusted isTrusted) >- : UIEventWithKeyState(eventType, initializer, isTrusted) >+ : UIEventWithKeyState(eventType, initializer) > , m_screenLocation(IntPoint(initializer.screenX, initializer.screenY)) > #if ENABLE(POINTER_LOCK) > , m_movementDelta(IntPoint(0, 0)) > #endif > { >+ ASSERT_UNUSED(isTrusted, isTrusted == IsTrusted::No); > init(false, IntPoint(0, 0)); > } > >diff --git a/Source/WebCore/dom/MouseRelatedEvent.h b/Source/WebCore/dom/MouseRelatedEvent.h >index 7663a1a06e82f6959d5540b75f889c20867f81cc..132c1671e8b016923092e6dea361281776366869 100644 >--- a/Source/WebCore/dom/MouseRelatedEvent.h >+++ b/Source/WebCore/dom/MouseRelatedEvent.h >@@ -76,7 +76,7 @@ public: > > protected: > MouseRelatedEvent() = default; >- MouseRelatedEvent(const AtomicString& type, CanBubble, IsCancelable, MonotonicTime, RefPtr<WindowProxy>&&, int detail, >+ MouseRelatedEvent(const AtomicString& type, CanBubble, IsCancelable, IsComposed, MonotonicTime, RefPtr<WindowProxy>&&, int detail, > const IntPoint& screenLocation, const IntPoint& windowLocation, const IntPoint& movementDelta, OptionSet<Modifier> modifiers, IsSimulated = IsSimulated::No); > MouseRelatedEvent(const AtomicString& type, IsCancelable, MonotonicTime, RefPtr<WindowProxy>&&, const IntPoint& globalLocation, OptionSet<Modifier>); > MouseRelatedEvent(const AtomicString& type, const MouseRelatedEventInit&, IsTrusted = IsTrusted::No); >diff --git a/Source/WebCore/dom/Node.cpp b/Source/WebCore/dom/Node.cpp >index 6b4f204a6d72ca26ee06a50c440406b1826b02d8..2fb001a2bfd23ac5db8866219d10b53937fa9fa8 100644 >--- a/Source/WebCore/dom/Node.cpp >+++ b/Source/WebCore/dom/Node.cpp >@@ -2349,7 +2349,7 @@ void Node::dispatchDOMActivateEvent(Event& underlyingClickEvent) > { > ASSERT_WITH_SECURITY_IMPLICATION(ScriptDisallowedScope::InMainThread::isScriptAllowed()); > int detail = is<UIEvent>(underlyingClickEvent) ? downcast<UIEvent>(underlyingClickEvent).detail() : 0; >- auto event = UIEvent::create(eventNames().DOMActivateEvent, 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 @@ bool Node::dispatchBeforeLoadEvent(const String& sourceURL) > > 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) >diff --git a/Source/WebCore/dom/SimulatedClick.cpp b/Source/WebCore/dom/SimulatedClick.cpp >index f506faf8d16bc7440ea740d5df8755187bb24d67..3e3746919922077a6ba191f451e4b2fa342bcb58 100644 >--- a/Source/WebCore/dom/SimulatedClick.cpp >+++ b/Source/WebCore/dom/SimulatedClick.cpp >@@ -44,7 +44,8 @@ public: > > 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), /* detail */ 0, >+ : MouseEvent(eventType, CanBubble::Yes, IsCancelable::Yes, source == SimulatedClickSource::Bindings ? IsComposed::No : IsComposed::Yes, >+ underlyingEvent ? underlyingEvent->timeStamp() : MonotonicTime::now(), WTFMove(view), /* detail */ 0, > { }, { }, { }, modifiersFromUnderlyingEvent(underlyingEvent), 0, 0, nullptr, 0, 0, nullptr, IsSimulated::Yes) > { > if (source == SimulatedClickSource::Bindings) >diff --git a/Source/WebCore/dom/TextEvent.cpp b/Source/WebCore/dom/TextEvent.cpp >index 225db427e3900853993af803b6e84cd4378456ce..6a041e8244bfafaead8ad15e24d41d99c29f63e6 100644 >--- a/Source/WebCore/dom/TextEvent.cpp >+++ b/Source/WebCore/dom/TextEvent.cpp >@@ -72,7 +72,7 @@ TextEvent::TextEvent() > } > > 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, TextEventIn > } > > 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, RefPtr<Docu > } > > 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) >diff --git a/Source/WebCore/dom/UIEvent.cpp b/Source/WebCore/dom/UIEvent.cpp >index 00a00cbebd170a20594b5a0af7e6d487a22e5a13..3c9ac43a29570ff872cf537e93ede675610c894b 100644 >--- a/Source/WebCore/dom/UIEvent.cpp >+++ b/Source/WebCore/dom/UIEvent.cpp >@@ -32,22 +32,22 @@ UIEvent::UIEvent() > { > } > >-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) > { > } > >-UIEvent::UIEvent(const AtomicString& eventType, const UIEventInit& initializer, IsTrusted isTrusted) >- : Event(eventType, initializer, isTrusted) >+UIEvent::UIEvent(const AtomicString& eventType, const UIEventInit& initializer) >+ : Event(eventType, initializer, IsTrusted::No) > , m_view(initializer.view.get()) > , m_detail(initializer.detail) > { >diff --git a/Source/WebCore/dom/UIEvent.h b/Source/WebCore/dom/UIEvent.h >index d5c26a454e6c8caeea848e4ffcff8ca5a7c0538d..6ffbb51c4653e8e461ab86af35a598f285fde15a 100644 >--- a/Source/WebCore/dom/UIEvent.h >+++ b/Source/WebCore/dom/UIEvent.h >@@ -34,17 +34,17 @@ typedef WindowProxy AbstractView; > > 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() > { > return adoptRef(*new UIEvent); > } >- static Ref<UIEvent> create(const AtomicString& type, const UIEventInit& initializer, IsTrusted isTrusted = IsTrusted::No) >+ static Ref<UIEvent> create(const AtomicString& type, const UIEventInit& initializer) > { >- return adoptRef(*new UIEvent(type, initializer, isTrusted)); >+ return adoptRef(*new UIEvent(type, initializer)); > } > virtual ~UIEvent(); > >@@ -65,9 +65,10 @@ public: > > 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&, const UIEventInit&, IsTrusted); >+ >+ UIEvent(const AtomicString& type, CanBubble, IsCancelable, IsComposed, RefPtr<WindowProxy>&&, int detail); >+ UIEvent(const AtomicString& type, CanBubble, IsCancelable, IsComposed, MonotonicTime timestamp, RefPtr<WindowProxy>&&, int detail); >+ UIEvent(const AtomicString&, const UIEventInit&); > > private: > bool isUIEvent() const final; >diff --git a/Source/WebCore/dom/UIEventWithKeyState.h b/Source/WebCore/dom/UIEventWithKeyState.h >index c59cac4fa962b363ad507941897877a134df0a5d..c794453cf5f1d33b3030fba777e845b17b160128 100644 >--- a/Source/WebCore/dom/UIEventWithKeyState.h >+++ b/Source/WebCore/dom/UIEventWithKeyState.h >@@ -45,20 +45,22 @@ public: > protected: > UIEventWithKeyState() = default; > >- UIEventWithKeyState(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, RefPtr<WindowProxy>&& view, int detail, OptionSet<Modifier> modifiers) >- : UIEvent(type, canBubble, cancelable, WTFMove(view), detail) >+ UIEventWithKeyState(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, IsComposed isComposed, >+ RefPtr<WindowProxy>&& view, int detail, OptionSet<Modifier> modifiers) >+ : UIEvent(type, canBubble, cancelable, isComposed, WTFMove(view), detail) > , m_modifiers(modifiers) > { > } > >- UIEventWithKeyState(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& view, int detail, OptionSet<Modifier> modifiers) >- : UIEvent(type, canBubble, cancelable, timestamp, WTFMove(view), detail) >+ UIEventWithKeyState(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, IsComposed isComposed, >+ MonotonicTime timestamp, RefPtr<WindowProxy>&& view, int detail, OptionSet<Modifier> modifiers) >+ : UIEvent(type, canBubble, cancelable, isComposed, timestamp, WTFMove(view), detail) > , m_modifiers(modifiers) > { > } > >- UIEventWithKeyState(const AtomicString& type, const EventModifierInit& initializer, IsTrusted isTrusted) >- : UIEvent(type, initializer, isTrusted) >+ UIEventWithKeyState(const AtomicString& type, const EventModifierInit& initializer) >+ : UIEvent(type, initializer) > , m_modifiers(modifiersFromInitializer(initializer)) > { > } >diff --git a/Source/WebCore/dom/WheelEvent.cpp b/Source/WebCore/dom/WheelEvent.cpp >index 07223b95495f3c94cd7049dd46fba78cce1b7443..81f072991915822ce93c0e32f627e96b57966b76 100644 >--- a/Source/WebCore/dom/WheelEvent.cpp >+++ b/Source/WebCore/dom/WheelEvent.cpp >@@ -37,8 +37,8 @@ inline static unsigned determineDeltaMode(const PlatformWheelEvent& event) > > 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,7 @@ inline WheelEvent::WheelEvent(const AtomicString& type, const Init& initializer, > } > > 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() , { } > , event.modifiers(), 0, 0, nullptr, 0, 0, nullptr, IsSimulated::No) > , m_wheelDelta(event.wheelTicksX() * TickMultiplier, event.wheelTicksY() * TickMultiplier) > , m_deltaX(-event.deltaX()) >@@ -68,9 +68,9 @@ Ref<WheelEvent> WheelEvent::createForBindings() > 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) >diff --git a/Source/WebCore/dom/WheelEvent.h b/Source/WebCore/dom/WheelEvent.h >index 10b62e05c70156076ffe5cf127397ec1323dd2d1..66997dff3be12338a69a301fa8c5c50c378433a1 100644 >--- a/Source/WebCore/dom/WheelEvent.h >+++ b/Source/WebCore/dom/WheelEvent.h >@@ -51,7 +51,7 @@ public: > 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 @@ public: > > private: > WheelEvent(); >- WheelEvent(const AtomicString&, const Init&, IsTrusted); >+ WheelEvent(const AtomicString&, const Init&); > WheelEvent(const PlatformWheelEvent&, RefPtr<WindowProxy>&&); > > EventInterface eventInterface() const final; >diff --git a/Source/WebCore/editing/Editor.cpp b/Source/WebCore/editing/Editor.cpp >index 07009487af3e662160f41c281d4f0ab1c2be9714..176a4a0528bc59facba2f113b5e6426d8f3d6b31 100644 >--- a/Source/WebCore/editing/Editor.cpp >+++ b/Source/WebCore/editing/Editor.cpp >@@ -115,7 +115,7 @@ static bool dispatchBeforeInputEvent(Element& element, const AtomicString& input > 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 @@ static void dispatchInputEvent(Element& element, const AtomicString& inputType, > // but TypingCommands are special in that existing TypingCommands that are applied again fire input events *from within* the scope by calling typingAddedToOpenCommand. > // Instead, TypingCommands should always dispatch events synchronously after the end of the scoped queue in CompositeEditCommand::apply. To work around this for the > // time being, just revert back to calling dispatchScopedEvent. >- element.dispatchScopedEvent(InputEvent::create(eventNames().inputEvent, inputType, 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 @@ static bool dispatchClipboardEvent(RefPtr<Element>&& target, ClipboardEventKind > > 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(); >diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp >index fe66ecb777722138989e323b77164287124f1d34..36504769757ba13922ba6c8ef9f8f89e3f086adf 100644 >--- a/Source/WebCore/page/EventHandler.cpp >+++ b/Source/WebCore/page/EventHandler.cpp >@@ -2214,7 +2214,8 @@ bool EventHandler::dispatchDragEvent(const AtomicString& eventType, Element& dra > > view->disableLayerFlushThrottlingTemporarilyForInteraction(); > // FIXME: Use MouseEvent::create which takes PlatformMouseEvent. >- Ref<MouseEvent> me = MouseEvent::create(eventType, Event::CanBubble::Yes, Event::IsCancelable::Yes, event.timestamp().approximateMonotonicTime(), &m_frame.windowProxy(), 0, >+ Ref<MouseEvent> me = MouseEvent::create(eventType, Event::CanBubble::Yes, Event::IsCancelable::Yes, Event::IsComposed::Yes, >+ event.timestamp().approximateMonotonicTime(), &m_frame.windowProxy(), 0, > event.globalPosition(), event.position(), > #if ENABLE(POINTER_LOCK) > event.movementDelta(), >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index de29f9599dd3511abe6ed678934d9c0ab01232fe..9af688cfb9143c5ca53523f7f7e1fcbea5899f8e 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -1337,7 +1337,7 @@ void WebPage::navigateToPDFLinkWithSimulatedClick(const String& url, IntPoint do > const int singleClick = 1; > // FIXME: Set modifier keys. > // FIXME: This should probably set IsSimulated::Yes. >- RefPtr<MouseEvent> mouseEvent = MouseEvent::create(eventNames().clickEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes, >+ RefPtr<MouseEvent> mouseEvent = MouseEvent::create(eventNames().clickEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes, Event::IsComposed::Yes, > MonotonicTime::now(), nullptr, singleClick, screenPoint, documentPoint, { }, { }, 0, 0, nullptr, 0, WebCore::NoTap, nullptr); > > mainFrame->loader().urlSelected(mainFrameDocument->completeURL(url), emptyString(), mouseEvent.get(), LockHistory::No, LockBackForwardList::No, ShouldSendReferrer::MaybeSendReferrer, ShouldOpenExternalURLsPolicy::ShouldNotAllow); >diff --git a/Source/WebKitLegacy/ios/WebView/WebPDFViewPlaceholder.mm b/Source/WebKitLegacy/ios/WebView/WebPDFViewPlaceholder.mm >index 4adf2f728a5d82ffcbef60112a9015717867f7ac..bf68f3a504bc5065c3a498da340ab666f03e300c 100644 >--- a/Source/WebKitLegacy/ios/WebView/WebPDFViewPlaceholder.mm >+++ b/Source/WebKitLegacy/ios/WebView/WebPDFViewPlaceholder.mm >@@ -478,9 +478,8 @@ static const float PAGE_HEIGHT_INSET = 4.0f * 2.0f; > if (!URL) > return; > >- // Construct an event to simulate a click. >- RefPtr<Event> event = MouseEvent::create(eventNames().clickEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes, MonotonicTime::now(), nullptr, 1, >- { }, { }, { }, { }, 0, 0, nullptr, 0, 0, nullptr, MouseEvent::IsSimulated::Yes); >+ RefPtr<Event> event = MouseEvent::create(eventNames().clickEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes, Event::IsComposed::Yes, >+ MonotonicTime::now(), nullptr, 1, { }, { }, { }, { }, 0, 0, nullptr, 0, 0, nullptr, MouseEvent::IsSimulated::Yes); > > // Call to the frame loader because this is where our security checks are made. > Frame* frame = core([_dataSource webFrame]); >diff --git a/Source/WebKitLegacy/mac/WebView/WebPDFView.mm b/Source/WebKitLegacy/mac/WebView/WebPDFView.mm >index 3e12dfba7da741ae3a837d4f02a30a4aba719da4..24dac9e3a8fb8934a64d19cb1cd31ab91cb7fd85 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebPDFView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebPDFView.mm >@@ -1031,8 +1031,9 @@ static BOOL isFrameInRange(WebFrame *frame, DOMRange *range) > } > if (button != noButton) { > // FIXME: Use createPlatformMouseEvent instead. >- event = MouseEvent::create(eventNames().clickEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes, MonotonicTime::now(), nullptr, [nsEvent clickCount], { }, { }, { }, >- modifiersForEvent(nsEvent), button, [NSEvent pressedMouseButtons], nullptr, WebCore::ForceAtClick, 0, nullptr, MouseEvent::IsSimulated::Yes); >+ event = MouseEvent::create(eventNames().clickEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes, Event::IsComposed::Yes, >+ MonotonicTime::now(), nullptr, [nsEvent clickCount], { }, { }, { }, modifiersForEvent(nsEvent), >+ button, [NSEvent pressedMouseButtons], nullptr, WebCore::ForceAtClick, 0, nullptr, MouseEvent::IsSimulated::Yes); > } > > // Call to the frame loader because this is where our security checks are made.
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188720
:
347439
|
347447
|
347910
|
347986
| 347990