Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: third_party/WebKit/Source/core/events/Event.cpp

Issue 1897953004: Report passive prevent defaulted event listeners correctly to the console. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 } 224 }
225 225
226 bool Event::isBeforeUnloadEvent() const 226 bool Event::isBeforeUnloadEvent() const
227 { 227 {
228 return false; 228 return false;
229 } 229 }
230 230
231 void Event::preventDefault() 231 void Event::preventDefault()
232 { 232 {
233 if (m_handlingPassive) { 233 if (m_handlingPassive) {
234 const LocalDOMWindow* window = m_currentTarget ? m_currentTarget->toDOMW indow() : 0; 234 const LocalDOMWindow* window = m_eventPath ? m_eventPath->windowEventCon text().window() : 0;
235 if (window) 235 if (window)
236 window->printErrorMessage("Unable to preventDefault inside passive e vent listener invocation."); 236 window->printErrorMessage("Unable to preventDefault inside passive e vent listener invocation.");
237 return; 237 return;
238 } 238 }
239 239
240 if (m_cancelable) 240 if (m_cancelable)
241 m_defaultPrevented = true; 241 m_defaultPrevented = true;
242 } 242 }
243 243
244 void Event::setTarget(EventTarget* target) 244 void Event::setTarget(EventTarget* target)
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 357
358 DEFINE_TRACE(Event) 358 DEFINE_TRACE(Event)
359 { 359 {
360 visitor->trace(m_currentTarget); 360 visitor->trace(m_currentTarget);
361 visitor->trace(m_target); 361 visitor->trace(m_target);
362 visitor->trace(m_underlyingEvent); 362 visitor->trace(m_underlyingEvent);
363 visitor->trace(m_eventPath); 363 visitor->trace(m_eventPath);
364 } 364 }
365 365
366 } // namespace blink 366 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698