Title: [197098] releases/WebKitGTK/webkit-2.12
Revision
197098
Author
carlo...@webkit.org
Date
2016-02-25 04:49:14 -0800 (Thu, 25 Feb 2016)

Log Message

Merge r196961 - REGRESSION (r196563): Images not loading on https://klim.co.nz/blog/paypal-sans-design-information/
https://bugs.webkit.org/show_bug.cgi?id=154547
<rdar://problem/24772167>

Reviewed by Gavin Barraclough.

Source/WebCore:

The Website was doing the following:
$ var e = window.addEventListener;
$ e("eventname", handler)

In such case, the jsEventTargetPrototypeFunctionDispatchEvent() bindings
implementation was caused with a thisValue which is a JSLexicalEnvironment
and the implementation did not know how to convert it into a global object.
The previous implementation on JSDOMWindow used to handle tis correctly
because it was always calling JSValue::toThis() on the thisValue before
trying to cast it to a JSDOMWindow, and JSLexicalEnvironment::toThis()
gets the globalThisValue. This patch updates the EventTarget bindings
code to call always call toThis() on the thisValue before trying to
cast it. This should correctly deal with JSLexicalEnvironment and be a
no-op in usual cases.

No new tests, extended existing test.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateFunctionCastedThis):

LayoutTests:

Add regression test for <rdar://problem/24772167>.

* fast/dom/Window/addEventListener-implicit-this-expected.txt:
* fast/dom/Window/addEventListener-implicit-this.html:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog (197097 => 197098)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-02-25 12:01:32 UTC (rev 197097)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-02-25 12:49:14 UTC (rev 197098)
@@ -1,3 +1,16 @@
+2016-02-22  Chris Dumez  <cdu...@apple.com>
+
+        REGRESSION (r196563): Images not loading on https://klim.co.nz/blog/paypal-sans-design-information/
+        https://bugs.webkit.org/show_bug.cgi?id=154547
+        <rdar://problem/24772167>
+
+        Reviewed by Gavin Barraclough.
+
+        Add regression test for <rdar://problem/24772167>.
+
+        * fast/dom/Window/addEventListener-implicit-this-expected.txt:
+        * fast/dom/Window/addEventListener-implicit-this.html:
+
 2016-02-22  Simon Fraser  <simon.fra...@apple.com>
 
         Repeated background images have the wrong position when using bottom/right-relative background-position

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/fast/dom/Window/addEventListener-implicit-this-expected.txt (197097 => 197098)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/fast/dom/Window/addEventListener-implicit-this-expected.txt	2016-02-25 12:01:32 UTC (rev 197097)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/fast/dom/Window/addEventListener-implicit-this-expected.txt	2016-02-25 12:49:14 UTC (rev 197098)
@@ -10,6 +10,9 @@
 PASS wasWindowEventListenerCalled is true
 PASS xhrDispatchEventFunction.call(undefined, new Event('myevent')) is true
 PASS wasWindowEventListenerCalled is true
+PASS addEventListenerFunction('myevent2', function() { wasWindowEventListenerCalled = true; }); did not throw exception.
+PASS window.dispatchEvent(new Event('myevent2')) is true
+PASS wasWindowEventListenerCalled is true
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/fast/dom/Window/addEventListener-implicit-this.html (197097 => 197098)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/fast/dom/Window/addEventListener-implicit-this.html	2016-02-25 12:01:32 UTC (rev 197097)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/fast/dom/Window/addEventListener-implicit-this.html	2016-02-25 12:49:14 UTC (rev 197098)
@@ -32,6 +32,12 @@
 
 shouldBeTrue("wasWindowEventListenerCalled");
 
+wasWindowEventListenerCalled = false;
+shouldNotThrow("addEventListenerFunction('myevent2', function() { wasWindowEventListenerCalled = true; });");
+shouldBeTrue("window.dispatchEvent(new Event('myevent2'))");
+shouldBeTrue("wasWindowEventListenerCalled");
+
+
 </script>
 <script src=""
 </body>

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog (197097 => 197098)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-02-25 12:01:32 UTC (rev 197097)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-02-25 12:49:14 UTC (rev 197098)
@@ -1,3 +1,31 @@
+2016-02-22  Chris Dumez  <cdu...@apple.com>
+
+        REGRESSION (r196563): Images not loading on https://klim.co.nz/blog/paypal-sans-design-information/
+        https://bugs.webkit.org/show_bug.cgi?id=154547
+        <rdar://problem/24772167>
+
+        Reviewed by Gavin Barraclough.
+
+        The Website was doing the following:
+        $ var e = window.addEventListener;
+        $ e("eventname", handler)
+
+        In such case, the jsEventTargetPrototypeFunctionDispatchEvent() bindings
+        implementation was caused with a thisValue which is a JSLexicalEnvironment
+        and the implementation did not know how to convert it into a global object.
+        The previous implementation on JSDOMWindow used to handle tis correctly
+        because it was always calling JSValue::toThis() on the thisValue before
+        trying to cast it to a JSDOMWindow, and JSLexicalEnvironment::toThis()
+        gets the globalThisValue. This patch updates the EventTarget bindings
+        code to call always call toThis() on the thisValue before trying to
+        cast it. This should correctly deal with JSLexicalEnvironment and be a
+        no-op in usual cases.
+
+        No new tests, extended existing test.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateFunctionCastedThis):
+
 2016-02-22  Simon Fraser  <simon.fra...@apple.com>
 
         Repeated background images have the wrong position when using bottom/right-relative background-position

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (197097 => 197098)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-02-25 12:01:32 UTC (rev 197097)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-02-25 12:49:14 UTC (rev 197098)
@@ -3233,7 +3233,7 @@
         if ($interfaceName eq "EventTarget") {
             # We allow calling the EventTarget API without an explicit 'this' value and fall back to using the global object instead.
             # As of early 2016, this matches Firefox and Chrome's behavior.
-            push(@implContent, "    auto castedThis = thisValue.isUndefinedOrNull() ? $castingHelper(thisValue.toThis(state, NotStrictMode)) : $castingHelper(thisValue);\n");
+            push(@implContent, "    auto castedThis = $castingHelper(thisValue.toThis(state, NotStrictMode));\n");
         } else {
             push(@implContent, "    auto castedThis = $castingHelper(thisValue);\n");
         }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to