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

Side by Side Diff: Source/core/frame/LocalDOMWindow.cpp

Issue 823263002: ScriptState used by EventListener::handleEvent() is wrong (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 16 matching lines...) Expand all
27 #include "config.h" 27 #include "config.h"
28 #include "core/frame/LocalDOMWindow.h" 28 #include "core/frame/LocalDOMWindow.h"
29 29
30 #include "bindings/core/v8/Dictionary.h" 30 #include "bindings/core/v8/Dictionary.h"
31 #include "bindings/core/v8/ExceptionMessages.h" 31 #include "bindings/core/v8/ExceptionMessages.h"
32 #include "bindings/core/v8/ExceptionState.h" 32 #include "bindings/core/v8/ExceptionState.h"
33 #include "bindings/core/v8/ExceptionStatePlaceholder.h" 33 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
34 #include "bindings/core/v8/ScriptCallStackFactory.h" 34 #include "bindings/core/v8/ScriptCallStackFactory.h"
35 #include "bindings/core/v8/ScriptController.h" 35 #include "bindings/core/v8/ScriptController.h"
36 #include "bindings/core/v8/SerializedScriptValue.h" 36 #include "bindings/core/v8/SerializedScriptValue.h"
37 #include "bindings/core/v8/V8AbstractEventListener.h"
37 #include "bindings/core/v8/V8DOMActivityLogger.h" 38 #include "bindings/core/v8/V8DOMActivityLogger.h"
38 #include "core/css/CSSComputedStyleDeclaration.h" 39 #include "core/css/CSSComputedStyleDeclaration.h"
39 #include "core/css/CSSRuleList.h" 40 #include "core/css/CSSRuleList.h"
40 #include "core/css/DOMWindowCSS.h" 41 #include "core/css/DOMWindowCSS.h"
41 #include "core/css/MediaQueryList.h" 42 #include "core/css/MediaQueryList.h"
42 #include "core/css/MediaQueryMatcher.h" 43 #include "core/css/MediaQueryMatcher.h"
43 #include "core/css/StyleMedia.h" 44 #include "core/css/StyleMedia.h"
44 #include "core/css/resolver/StyleResolver.h" 45 #include "core/css/resolver/StyleResolver.h"
45 #include "core/dom/ContextFeatures.h" 46 #include "core/dom/ContextFeatures.h"
46 #include "core/dom/DOMImplementation.h" 47 #include "core/dom/DOMImplementation.h"
(...skipping 1516 matching lines...) Expand 10 before | Expand all | Expand 10 after
1563 d->cancelAnimationFrame(id); 1564 d->cancelAnimationFrame(id);
1564 } 1565 }
1565 1566
1566 DOMWindowCSS* LocalDOMWindow::css() const 1567 DOMWindowCSS* LocalDOMWindow::css() const
1567 { 1568 {
1568 if (!m_css) 1569 if (!m_css)
1569 m_css = DOMWindowCSS::create(); 1570 m_css = DOMWindowCSS::create();
1570 return m_css.get(); 1571 return m_css.get();
1571 } 1572 }
1572 1573
1573 bool LocalDOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr< EventListener> listener, bool useCapture) 1574 bool LocalDOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr< EventListener> prpListener, bool useCapture)
1574 { 1575 {
1576 RefPtr<EventListener> listener = prpListener;
1575 if (!EventTarget::addEventListener(eventType, listener, useCapture)) 1577 if (!EventTarget::addEventListener(eventType, listener, useCapture))
1576 return false; 1578 return false;
1577 1579
1578 if (frame() && frame()->host()) 1580 if (frame() && frame()->host())
1579 frame()->host()->eventHandlerRegistry().didAddEventHandler(*this, eventT ype); 1581 frame()->host()->eventHandlerRegistry().didAddEventHandler(*this, eventT ype);
1580 1582
1581 if (Document* document = this->document()) { 1583 if (Document* document = this->document()) {
1582 document->addListenerTypeIfNeeded(eventType); 1584 document->addListenerTypeIfNeeded(eventType);
1583 } 1585 }
1584 1586
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
1968 return m_frameObserver->frame(); 1970 return m_frameObserver->frame();
1969 } 1971 }
1970 1972
1971 v8::Handle<v8::Object> LocalDOMWindow::wrap(v8::Handle<v8::Object> creationConte xt, v8::Isolate* isolate) 1973 v8::Handle<v8::Object> LocalDOMWindow::wrap(v8::Handle<v8::Object> creationConte xt, v8::Isolate* isolate)
1972 { 1974 {
1973 ASSERT_NOT_REACHED(); // LocalDOMWindow has [Custom=ToV8]. 1975 ASSERT_NOT_REACHED(); // LocalDOMWindow has [Custom=ToV8].
1974 return v8::Handle<v8::Object>(); 1976 return v8::Handle<v8::Object>();
1975 } 1977 }
1976 1978
1977 } // namespace blink 1979 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698