12012-05-20 Kentaro Hara <haraken@chromium.org>
2
3 REGRESSION r110315: Event handler throws TypeError for an input element with name="arguments"
4 https://bugs.webkit.org/show_bug.cgi?id=86991
5
6 Reviewed by Ojan Vafai.
7
8 Original Chromium bug: http://code.google.com/p/chromium/issues/detail?id=128723
9
10 Consider the following html:
11
12 <html><body><form>
13 <input type="hidden" name="arguments"></input>
14 <div onclick="onclicked()" id="divInsideForm">Click here</div>
15 </form></body>
16 <script>
17 function onclicked() {
18 alert("onclicked");
19 }
20 </script>
21 </html>
22
23 If we click "Click here", JavaScript throws "Uncaught TypeError: undefined has no properties".
24
25 This is a regression caused by r110315. V8LazyEventListener should not use
26 'arguments' to retrieve the execution contexts, since 'arguments' can be
27 being overwritten by JavaScript.
28
29 This patch changes V8LazyEventListener so that it retrieves contexts
30 by this.ownerDocument, this.form, and this.
31
32 Test: fast/forms/form-input-named-arguments.html
33
34 * bindings/v8/V8LazyEventListener.cpp:
35 (WebCore::V8LazyEventListener::prepareListenerObject):
36