Changeset 109599 in webkit
- Timestamp:
- Mar 2, 2012 12:30:59 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r109597 r109599 1 2012-03-02 Erik Arvidsson <arv@chromium.org> 2 3 [V8] Make inline event attributes use evt for SVG and event otherwise 4 https://bugs.webkit.org/show_bug.cgi?id=80167 5 6 Reviewed by Ojan Vafai. 7 8 * fast/dom/inline-event-attributes-event-param-name-expected.txt: Added. 9 * fast/dom/inline-event-attributes-event-param-name.html: Added. 10 1 11 2012-03-02 Dirk Pranke <dpranke@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r109598 r109599 1 2012-03-02 Erik Arvidsson <arv@chromium.org> 2 3 [V8] Make inline event attributes use evt for SVG and event otherwise 4 https://bugs.webkit.org/show_bug.cgi?id=80167 5 6 Reviewed by Ojan Vafai. 7 8 Test: fast/dom/inline-event-attributes-event-param-name.html 9 10 * bindings/v8/V8LazyEventListener.cpp: 11 (WebCore::V8LazyEventListener::prepareListenerObject): 12 1 13 2012-03-02 Gavin Peters <gavinp@chromium.org> 2 14 -
trunk/Source/WebCore/bindings/v8/V8LazyEventListener.cpp
r106680 r109599 116 116 // Don't use new lines so that lines in the modified handler 117 117 // have the same numbers as in the original code. 118 // FIXME: What about m_eventParameterName from JSLazyEventListener?119 118 // FIXME: This approach is a giant hack! What if m_code escapes to run 120 119 // arbitrary script? 121 String code = "(function (evt) {" \ 120 String eventParameterName = m_isSVGEvent ? "evt" : "event"; 121 String code = "(function("; 122 code.append(eventParameterName); 123 code.append(") {" \ 122 124 "with (this.ownerDocument ? this.ownerDocument : {}) {" \ 123 125 "with (this.form ? this.form : {}) {" \ 124 126 "with (this) {" \ 125 "return (function(evt){"; 127 "return (function("); 128 code.append(eventParameterName); 129 code.append("){"); 126 130 code.append(m_code); 127 131 // Insert '\n' otherwise //-style comments could break the handler. 128 code.append( "\n}).call(this, evt);}}}})"); 132 code.append("\n}).call(this, "); 133 code.append(eventParameterName); 134 code.append(");}}}})"); 129 135 v8::Handle<v8::String> codeExternalString = v8ExternalString(code); 130 136 v8::Handle<v8::Script> script = V8Proxy::compileScript(codeExternalString, m_sourceURL, m_position); … … 157 163 toStringResult.append(m_functionName); 158 164 toStringResult.append("("); 159 toStringResult.append( m_isSVGEvent ? "evt" : "event");165 toStringResult.append(eventParameterName); 160 166 toStringResult.append(") {\n "); 161 167 toStringResult.append(m_code);
Note: See TracChangeset
for help on using the changeset viewer.