Changeset 196961 in webkit
- Timestamp:
- Feb 22, 2016, 2:27:30 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/dom/Window/addEventListener-implicit-this-expected.txt (modified) (1 diff)
-
LayoutTests/fast/dom/Window/addEventListener-implicit-this.html (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r196960 r196961 1 2016-02-22 Chris Dumez <cdumez@apple.com> 2 3 REGRESSION (r196563): Images not loading on https://klim.co.nz/blog/paypal-sans-design-information/ 4 https://bugs.webkit.org/show_bug.cgi?id=154547 5 <rdar://problem/24772167> 6 7 Reviewed by Gavin Barraclough. 8 9 Add regression test for <rdar://problem/24772167>. 10 11 * fast/dom/Window/addEventListener-implicit-this-expected.txt: 12 * fast/dom/Window/addEventListener-implicit-this.html: 13 1 14 2016-02-22 Simon Fraser <simon.fraser@apple.com> 2 15 -
trunk/LayoutTests/fast/dom/Window/addEventListener-implicit-this-expected.txt
r196588 r196961 11 11 PASS xhrDispatchEventFunction.call(undefined, new Event('myevent')) is true 12 12 PASS wasWindowEventListenerCalled is true 13 PASS addEventListenerFunction('myevent2', function() { wasWindowEventListenerCalled = true; }); did not throw exception. 14 PASS window.dispatchEvent(new Event('myevent2')) is true 15 PASS wasWindowEventListenerCalled is true 13 16 PASS successfullyParsed is true 14 17 -
trunk/LayoutTests/fast/dom/Window/addEventListener-implicit-this.html
r196588 r196961 33 33 shouldBeTrue("wasWindowEventListenerCalled"); 34 34 35 wasWindowEventListenerCalled = false; 36 shouldNotThrow("addEventListenerFunction('myevent2', function() { wasWindowEventListenerCalled = true; });"); 37 shouldBeTrue("window.dispatchEvent(new Event('myevent2'))"); 38 shouldBeTrue("wasWindowEventListenerCalled"); 39 40 35 41 </script> 36 42 <script src="../../../resources/js-test-post.js"></script> -
trunk/Source/WebCore/ChangeLog
r196960 r196961 1 2016-02-22 Chris Dumez <cdumez@apple.com> 2 3 REGRESSION (r196563): Images not loading on https://klim.co.nz/blog/paypal-sans-design-information/ 4 https://bugs.webkit.org/show_bug.cgi?id=154547 5 <rdar://problem/24772167> 6 7 Reviewed by Gavin Barraclough. 8 9 The Website was doing the following: 10 $ var e = window.addEventListener; 11 $ e("eventname", handler) 12 13 In such case, the jsEventTargetPrototypeFunctionDispatchEvent() bindings 14 implementation was caused with a thisValue which is a JSLexicalEnvironment 15 and the implementation did not know how to convert it into a global object. 16 The previous implementation on JSDOMWindow used to handle tis correctly 17 because it was always calling JSValue::toThis() on the thisValue before 18 trying to cast it to a JSDOMWindow, and JSLexicalEnvironment::toThis() 19 gets the globalThisValue. This patch updates the EventTarget bindings 20 code to call always call toThis() on the thisValue before trying to 21 cast it. This should correctly deal with JSLexicalEnvironment and be a 22 no-op in usual cases. 23 24 No new tests, extended existing test. 25 26 * bindings/scripts/CodeGeneratorJS.pm: 27 (GenerateFunctionCastedThis): 28 1 29 2016-02-22 Simon Fraser <simon.fraser@apple.com> 2 30 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r196954 r196961 3265 3265 # We allow calling the EventTarget API without an explicit 'this' value and fall back to using the global object instead. 3266 3266 # As of early 2016, this matches Firefox and Chrome's behavior. 3267 push(@implContent, " auto castedThis = thisValue.isUndefinedOrNull() ? $castingHelper(thisValue.toThis(state, NotStrictMode)) : $castingHelper(thisValue);\n");3267 push(@implContent, " auto castedThis = $castingHelper(thisValue.toThis(state, NotStrictMode));\n"); 3268 3268 } else { 3269 3269 push(@implContent, " auto castedThis = $castingHelper(thisValue);\n");
Note:
See TracChangeset
for help on using the changeset viewer.