Changeset 102656 in webkit
- Timestamp:
- Dec 12, 2011 8:07:48 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r102655 r102656 1 2011-12-12 Konrad Piascik <kpiascik@rim.com> 2 3 2011-12-12 Konrad Piascik <kpiascik@rim.com> 4 5 Implement the JavaScriptCore bindings for eventListenerHandlerLocation 6 https://bugs.webkit.org/show_bug.cgi?id=74313 7 8 Reviewed by Geoffrey Garen. 9 10 Open any page in Web Inspector and look at the event listeners. They should now 11 link to the script which created them. 12 13 * bindings/js/ScriptEventListener.cpp: 14 (WebCore::eventListenerHandlerLocation): 15 1 16 2011-12-12 Yosifumi Inoue <yosin@chromium.org> 2 17 -
trunk/Source/WebCore/bindings/js/ScriptEventListener.cpp
r102653 r102656 1 1 /* 2 2 * Copyright (C) 2009 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 37 38 #include "JSNode.h" 38 39 #include "Frame.h" 40 #include <runtime/Executable.h> 41 #include <runtime/JSFunction.h> 39 42 #include <runtime/JSLock.h> 40 43 … … 104 107 } 105 108 106 bool eventListenerHandlerLocation(Document* , EventListener*, String&, int&)109 bool eventListenerHandlerLocation(Document* document, EventListener* eventListener, String& sourceName, int& lineNumber) 107 110 { 108 // FIXME: Add support for getting function location. 109 return false; 111 const JSEventListener* jsListener = JSEventListener::cast(eventListener); 112 if (!jsListener) 113 return false; 114 JSC::JSObject* jsObject = jsListener->jsFunction(document); 115 if (!jsObject) 116 return false; 117 JSC::JSFunction* jsFunction = static_cast<JSFunction*>(jsObject); 118 if (!jsFunction || jsFunction->isHostFunction()) 119 return false; 120 JSC::FunctionExecutable* funcExecutable = jsFunction->jsExecutable(); 121 if (!funcExecutable) 122 return false; 123 lineNumber = funcExecutable->lineNo(); 124 sourceName = ustringToString(funcExecutable->sourceURL()); 125 return true; 110 126 } 111 127
Note: See TracChangeset
for help on using the changeset viewer.