| Index: third_party/WebKit/Source/core/events/EventTarget.cpp
|
| diff --git a/third_party/WebKit/Source/core/events/EventTarget.cpp b/third_party/WebKit/Source/core/events/EventTarget.cpp
|
| index 55f80e05075c26069a4d01113f5e57cbda2da11d..be7d44b56131554be39135e30de53d296a8c9b3a 100644
|
| --- a/third_party/WebKit/Source/core/events/EventTarget.cpp
|
| +++ b/third_party/WebKit/Source/core/events/EventTarget.cpp
|
| @@ -52,6 +52,11 @@ namespace {
|
| void setDefaultEventListenerOptionsLegacy(EventListenerOptions& options, bool useCapture)
|
| {
|
| options.setCapture(useCapture);
|
| +}
|
| +
|
| +void setDefaultAddEventListenerOptionsLegacy(AddEventListenerOptions& options, bool useCapture)
|
| +{
|
| + setDefaultEventListenerOptionsLegacy(options, useCapture);
|
| options.setPassive(false);
|
| }
|
|
|
| @@ -64,6 +69,11 @@ void setDefaultEventListenerOptions(EventListenerOptions& options)
|
| // capture is true; with the setting on capture is false.
|
| if (!options.hasCapture())
|
| options.setCapture(!RuntimeEnabledFeatures::eventListenerOptionsEnabled());
|
| +}
|
| +
|
| +void setDefaultAddEventListenerOptions(AddEventListenerOptions& options)
|
| +{
|
| + setDefaultEventListenerOptions(options);
|
| if (!options.hasPassive())
|
| options.setPassive(false);
|
| }
|
| @@ -125,29 +135,29 @@ inline LocalDOMWindow* EventTarget::executingWindow()
|
|
|
| bool EventTarget::addEventListener(const AtomicString& eventType, EventListener* listener, bool useCapture)
|
| {
|
| - EventListenerOptions options;
|
| - setDefaultEventListenerOptionsLegacy(options, useCapture);
|
| + AddEventListenerOptions options;
|
| + setDefaultAddEventListenerOptionsLegacy(options, useCapture);
|
| return addEventListenerInternal(eventType, listener, options);
|
| }
|
|
|
| -bool EventTarget::addEventListener(const AtomicString& eventType, EventListener* listener, const EventListenerOptionsOrBoolean& optionsUnion)
|
| +bool EventTarget::addEventListener(const AtomicString& eventType, EventListener* listener, const AddEventListenerOptionsOrBoolean& optionsUnion)
|
| {
|
| if (optionsUnion.isBoolean())
|
| return addEventListener(eventType, listener, optionsUnion.getAsBoolean());
|
| - if (optionsUnion.isEventListenerOptions()) {
|
| - EventListenerOptions options = optionsUnion.getAsEventListenerOptions();
|
| + if (optionsUnion.isAddEventListenerOptions()) {
|
| + AddEventListenerOptions options = optionsUnion.getAsAddEventListenerOptions();
|
| return addEventListener(eventType, listener, options);
|
| }
|
| return addEventListener(eventType, listener);
|
| }
|
|
|
| -bool EventTarget::addEventListener(const AtomicString& eventType, EventListener* listener, EventListenerOptions& options)
|
| +bool EventTarget::addEventListener(const AtomicString& eventType, EventListener* listener, AddEventListenerOptions& options)
|
| {
|
| - setDefaultEventListenerOptions(options);
|
| + setDefaultAddEventListenerOptions(options);
|
| return addEventListenerInternal(eventType, listener, options);
|
| }
|
|
|
| -bool EventTarget::addEventListenerInternal(const AtomicString& eventType, EventListener* listener, const EventListenerOptions& options)
|
| +bool EventTarget::addEventListenerInternal(const AtomicString& eventType, EventListener* listener, const AddEventListenerOptions& options)
|
| {
|
| if (!listener)
|
| return false;
|
|
|