| 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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 } else if (EventUtil::IsPointerEventType(event_type)) { | 329 } else if (EventUtil::IsPointerEventType(event_type)) { |
| 330 if (LocalDOMWindow* executing_window = this->ExecutingWindow()) { | 330 if (LocalDOMWindow* executing_window = this->ExecutingWindow()) { |
| 331 UseCounter::Count(executing_window->document(), | 331 UseCounter::Count(executing_window->document(), |
| 332 UseCounter::kPointerEventAddListenerCount); | 332 UseCounter::kPointerEventAddListenerCount); |
| 333 } | 333 } |
| 334 } else if (event_type == EventTypeNames::slotchange) { | 334 } else if (event_type == EventTypeNames::slotchange) { |
| 335 if (LocalDOMWindow* executing_window = this->ExecutingWindow()) { | 335 if (LocalDOMWindow* executing_window = this->ExecutingWindow()) { |
| 336 UseCounter::Count(executing_window->document(), | 336 UseCounter::Count(executing_window->document(), |
| 337 UseCounter::kSlotChangeEventAddListener); | 337 UseCounter::kSlotChangeEventAddListener); |
| 338 } | 338 } |
| 339 } else if (EventUtil::IsDOMMutationEventType(event_type)) { |
| 340 if (ExecutionContext* context = GetExecutionContext()) { |
| 341 String message_text = String::Format( |
| 342 "Added synchronous DOM mutation listener to a '%s' event. " |
| 343 "Consider using MutationObserver to make the page more responsive.", |
| 344 event_type.GetString().Utf8().data()); |
| 345 PerformanceMonitor::ReportGenericViolation( |
| 346 context, PerformanceMonitor::kDiscouragedAPIUse, message_text, 0, |
| 347 nullptr); |
| 348 } |
| 339 } | 349 } |
| 340 } | 350 } |
| 341 | 351 |
| 342 bool EventTarget::removeEventListener(const AtomicString& event_type, | 352 bool EventTarget::removeEventListener(const AtomicString& event_type, |
| 343 const EventListener* listener, | 353 const EventListener* listener, |
| 344 bool use_capture) { | 354 bool use_capture) { |
| 345 EventListenerOptions options; | 355 EventListenerOptions options; |
| 346 options.setCapture(use_capture); | 356 options.setCapture(use_capture); |
| 347 return RemoveEventListenerInternal(event_type, listener, options); | 357 return RemoveEventListenerInternal(event_type, listener, options); |
| 348 } | 358 } |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 // they have one less listener to invoke. | 785 // they have one less listener to invoke. |
| 776 if (d->firing_event_iterators) { | 786 if (d->firing_event_iterators) { |
| 777 for (const auto& iterator : *d->firing_event_iterators) { | 787 for (const auto& iterator : *d->firing_event_iterators) { |
| 778 iterator.iterator = 0; | 788 iterator.iterator = 0; |
| 779 iterator.end = 0; | 789 iterator.end = 0; |
| 780 } | 790 } |
| 781 } | 791 } |
| 782 } | 792 } |
| 783 | 793 |
| 784 } // namespace blink | 794 } // namespace blink |
| OLD | NEW |