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

Unified Diff: third_party/WebKit/Source/core/events/EventTarget.cpp

Issue 2851053002: Fix detached event listener attribute updating. (Closed)
Patch Set: Push Document lookup down Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/events/EventListener.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c3d395b70091abac31014faee6c00a895e1481b3..97d112492da1a432c0c20e96f7ef7dc5bb20ba4c 100644
--- a/third_party/WebKit/Source/core/events/EventTarget.cpp
+++ b/third_party/WebKit/Source/core/events/EventTarget.cpp
@@ -427,10 +427,14 @@ EventListener* EventTarget::GetAttributeEventListener(
if (!listener_vector)
return nullptr;
+ // The current-world accessibiliy check has a corner
+ // case which depends on knowing whether we're in
+ // a document parsing context or not.
+ Node* this_node = ToNode();
+ Document* document = this_node ? &this_node->GetDocument() : nullptr;
for (auto& event_listener : *listener_vector) {
EventListener* listener = event_listener.Listener();
- if (listener->IsAttribute() &&
- listener->BelongsToTheCurrentWorld(GetExecutionContext()))
+ if (listener->IsAttribute() && listener->BelongsToTheCurrentWorld(document))
return listener;
}
return nullptr;
« no previous file with comments | « third_party/WebKit/Source/core/events/EventListener.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698