| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
| 6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
| 8 * | 8 * |
| 9 * Redistribution and use in source and binary forms, with or without | 9 * Redistribution and use in source and binary forms, with or without |
| 10 * modification, are permitted provided that the following conditions | 10 * modification, are permitted provided that the following conditions |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 static const double kBlockedWarningThresholdMillis = 100.0; | 62 static const double kBlockedWarningThresholdMillis = 100.0; |
| 63 | 63 |
| 64 enum PassiveForcedListenerResultType { | 64 enum PassiveForcedListenerResultType { |
| 65 PreventDefaultNotCalled, | 65 PreventDefaultNotCalled, |
| 66 DocumentLevelTouchPreventDefaultCalled, | 66 DocumentLevelTouchPreventDefaultCalled, |
| 67 PassiveForcedListenerResultTypeMax | 67 PassiveForcedListenerResultTypeMax |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 Event::PassiveMode eventPassiveMode( | 70 Event::PassiveMode eventPassiveMode( |
| 71 const RegisteredEventListener& eventListener) { | 71 const RegisteredEventListener& eventListener) { |
| 72 if (!eventListener.passive()) | 72 if (!eventListener.passive()) { |
| 73 return Event::PassiveMode::NotPassive; | 73 if (eventListener.passiveSpecified()) |
| 74 return Event::PassiveMode::NotPassive; |
| 75 return Event::PassiveMode::NotPassiveDefault; |
| 76 } |
| 74 if (eventListener.passiveForcedForDocumentTarget()) | 77 if (eventListener.passiveForcedForDocumentTarget()) |
| 75 return Event::PassiveMode::PassiveForcedDocumentLevel; | 78 return Event::PassiveMode::PassiveForcedDocumentLevel; |
| 76 return Event::PassiveMode::Passive; | 79 if (eventListener.passiveSpecified()) |
| 80 return Event::PassiveMode::Passive; |
| 81 return Event::PassiveMode::PassiveDefault; |
| 77 } | 82 } |
| 78 | 83 |
| 79 Settings* windowSettings(LocalDOMWindow* executingWindow) { | 84 Settings* windowSettings(LocalDOMWindow* executingWindow) { |
| 80 if (executingWindow) { | 85 if (executingWindow) { |
| 81 if (LocalFrame* frame = executingWindow->frame()) { | 86 if (LocalFrame* frame = executingWindow->frame()) { |
| 82 return frame->settings(); | 87 return frame->settings(); |
| 83 } | 88 } |
| 84 } | 89 } |
| 85 return nullptr; | 90 return nullptr; |
| 86 } | 91 } |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 190 |
| 186 inline LocalDOMWindow* EventTarget::executingWindow() { | 191 inline LocalDOMWindow* EventTarget::executingWindow() { |
| 187 if (ExecutionContext* context = getExecutionContext()) | 192 if (ExecutionContext* context = getExecutionContext()) |
| 188 return context->executingWindow(); | 193 return context->executingWindow(); |
| 189 return nullptr; | 194 return nullptr; |
| 190 } | 195 } |
| 191 | 196 |
| 192 void EventTarget::setDefaultAddEventListenerOptions( | 197 void EventTarget::setDefaultAddEventListenerOptions( |
| 193 const AtomicString& eventType, | 198 const AtomicString& eventType, |
| 194 AddEventListenerOptionsResolved& options) { | 199 AddEventListenerOptionsResolved& options) { |
| 200 options.setPassiveSpecified(options.hasPassive()); |
| 201 |
| 195 if (!isScrollBlockingEvent(eventType)) { | 202 if (!isScrollBlockingEvent(eventType)) { |
| 196 if (!options.hasPassive()) | 203 if (!options.hasPassive()) |
| 197 options.setPassive(false); | 204 options.setPassive(false); |
| 198 return; | 205 return; |
| 199 } | 206 } |
| 200 | 207 |
| 201 if (LocalDOMWindow* executingWindow = this->executingWindow()) { | 208 if (LocalDOMWindow* executingWindow = this->executingWindow()) { |
| 202 if (options.hasPassive()) { | 209 if (options.hasPassive()) { |
| 203 UseCounter::count(executingWindow->document(), | 210 UseCounter::count(executingWindow->document(), |
| 204 options.passive() | 211 options.passive() |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 // they have one less listener to invoke. | 765 // they have one less listener to invoke. |
| 759 if (d->firingEventIterators) { | 766 if (d->firingEventIterators) { |
| 760 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { | 767 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { |
| 761 d->firingEventIterators->at(i).iterator = 0; | 768 d->firingEventIterators->at(i).iterator = 0; |
| 762 d->firingEventIterators->at(i).end = 0; | 769 d->firingEventIterators->at(i).end = 0; |
| 763 } | 770 } |
| 764 } | 771 } |
| 765 } | 772 } |
| 766 | 773 |
| 767 } // namespace blink | 774 } // namespace blink |
| OLD | NEW |