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

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

Issue 1586563005: Add Event.scoped (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modify Use Counter Created 4 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 return &referenceNode; 47 return &referenceNode;
48 } 48 }
49 49
50 static inline bool shouldStopAtShadowRoot(Event& event, ShadowRoot& shadowRoot, EventTarget& target) 50 static inline bool shouldStopAtShadowRoot(Event& event, ShadowRoot& shadowRoot, EventTarget& target)
51 { 51 {
52 // WebKit never allowed selectstart event to cross the the shadow DOM bounda ry. 52 // WebKit never allowed selectstart event to cross the the shadow DOM bounda ry.
53 // Changing this breaks existing sites. 53 // Changing this breaks existing sites.
54 // See https://bugs.webkit.org/show_bug.cgi?id=52195 for details. 54 // See https://bugs.webkit.org/show_bug.cgi?id=52195 for details.
55 const AtomicString eventType = event.type(); 55 const AtomicString eventType = event.type();
56 return target.toNode() && target.toNode()->shadowHost() == shadowRoot.host() 56 return target.toNode() && target.toNode()->shadowHost() == shadowRoot.host()
57 && (eventType == EventTypeNames::abort 57 && event.scoped();
58 || eventType == EventTypeNames::change
59 || eventType == EventTypeNames::error
60 || eventType == EventTypeNames::load
61 || eventType == EventTypeNames::reset
62 || eventType == EventTypeNames::resize
63 || eventType == EventTypeNames::scroll
64 || eventType == EventTypeNames::select
65 || eventType == EventTypeNames::selectstart);
66 } 58 }
67 59
68 EventPath::EventPath(Node& node, Event* event) 60 EventPath::EventPath(Node& node, Event* event)
69 : m_node(node) 61 : m_node(node)
70 , m_event(event) 62 , m_event(event)
71 { 63 {
72 initialize(); 64 initialize();
73 } 65 }
74 66
75 void EventPath::initializeWith(Node& node, Event* event) 67 void EventPath::initializeWith(Node& node, Event* event)
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 #if ENABLE(OILPAN) 371 #if ENABLE(OILPAN)
380 visitor->trace(m_nodeEventContexts); 372 visitor->trace(m_nodeEventContexts);
381 visitor->trace(m_node); 373 visitor->trace(m_node);
382 visitor->trace(m_event); 374 visitor->trace(m_event);
383 visitor->trace(m_treeScopeEventContexts); 375 visitor->trace(m_treeScopeEventContexts);
384 visitor->trace(m_windowEventContext); 376 visitor->trace(m_windowEventContext);
385 #endif 377 #endif
386 } 378 }
387 379
388 } // namespace 380 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698