Title: [179406] trunk
Revision
179406
Author
mmir...@apple.com
Date
2015-01-30 11:09:14 -0800 (Fri, 30 Jan 2015)

Log Message

Source/WebCore:
Added ClientRect as an interface that requires attributes
on instance for compatibility.
https://bugs.webkit.org/show_bug.cgi?id=141063
<rdar://problem/18437653>

Reviewed by Oliver Hunt.

Added a new test to LayoutTests/js/resources/JSON-stringify.js

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

LayoutTests:
Added a test for JSON.stringify on ClientRect.
https://bugs.webkit.org/show_bug.cgi?id=141063
<rdar://problem/18437653>

Reviewed by Oliver Hunt.

* js/resources/JSON-stringify.js:
(createTests.var):
(createTests.result):
* js/resources/JSON-stringify-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (179405 => 179406)


--- trunk/LayoutTests/ChangeLog	2015-01-30 18:26:36 UTC (rev 179405)
+++ trunk/LayoutTests/ChangeLog	2015-01-30 19:09:14 UTC (rev 179406)
@@ -1,3 +1,16 @@
+2015-01-30  Matthew Mirman  <mmir...@apple.com>
+
+        Added a test for JSON.stringify on ClientRect.
+        https://bugs.webkit.org/show_bug.cgi?id=141063
+        <rdar://problem/18437653>
+
+        Reviewed by Oliver Hunt.
+
+        * js/resources/JSON-stringify.js:
+        (createTests.var):
+        (createTests.result):
+        * js/resources/JSON-stringify-expected.txt:
+
 2015-01-30  Brent Fulgham  <bfulg...@apple.com>
 
         [Win] Switch to Apache on Windows

Modified: trunk/LayoutTests/js/dom/JSON-stringify-expected.txt (179405 => 179406)


--- trunk/LayoutTests/js/dom/JSON-stringify-expected.txt	2015-01-30 18:26:36 UTC (rev 179405)
+++ trunk/LayoutTests/js/dom/JSON-stringify-expected.txt	2015-01-30 19:09:14 UTC (rev 179406)
@@ -353,14 +353,26 @@
     }
 PASS tests[i](nativeJSON) is tests[i](JSON)
 function (jsonObject) {
+            return jsonObject.stringify(clientRect);
+    }
+PASS tests[i](nativeJSON) is tests[i].expected
+function (jsonObject) {
         return jsonObject.stringify(objectWithSideEffectGetter);
     }
-FAIL tests[i](nativeJSON) should be {"foo":1}. Was {}.
+PASS tests[i](nativeJSON) is tests[i].expected
 function (jsonObject) {
+        return jsonObject.stringify(objectWithSideEffectGetter);
+    }
+PASS tests[i](nativeJSON) is tests[i](JSON)
+function (jsonObject) {
         return jsonObject.stringify(objectWithSideEffectGetterAndProto);
     }
-FAIL tests[i](nativeJSON) should be {"foo":1}. Was {}.
+PASS tests[i](nativeJSON) is tests[i].expected
 function (jsonObject) {
+        return jsonObject.stringify(objectWithSideEffectGetterAndProto);
+    }
+PASS tests[i](nativeJSON) is tests[i](JSON)
+function (jsonObject) {
         return jsonObject.stringify(arrayWithSideEffectGetter);
     }
 PASS tests[i](nativeJSON) is tests[i](JSON)

Modified: trunk/LayoutTests/js/resources/JSON-stringify.js (179405 => 179406)


--- trunk/LayoutTests/js/resources/JSON-stringify.js	2015-01-30 18:26:36 UTC (rev 179405)
+++ trunk/LayoutTests/js/resources/JSON-stringify.js	2015-01-30 19:09:14 UTC (rev 179406)
@@ -57,6 +57,7 @@
     result.push(function(jsonObject){
         return jsonObject.stringify(new Boolean(true));
     });
+
     result.push(function(jsonObject){
         var value = new Number(1);
         value.valueOf = function() { return 2; }
@@ -306,13 +307,26 @@
     result.push(function(jsonObject){
         return jsonObject.stringify(complexObjectWithProto, null, 4);
     });
+    var clientRect = document.body.getBoundingClientRect();
     result.push(function(jsonObject){
+            return jsonObject.stringify(clientRect);
+    });
+    result[result.length - 1].expected = JSON.stringify({top : clientRect.top, right : clientRect.right, bottom: clientRect.bottom, left : clientRect.left, width : clientRect.width, height : clientRect.height });
+    result.push(function(jsonObject){
         return jsonObject.stringify(objectWithSideEffectGetter);
     });
+    result[result.length - 1].expected = JSON.stringify({});
     result.push(function(jsonObject){
+        return jsonObject.stringify(objectWithSideEffectGetter);
+    });
+    result.push(function(jsonObject){
         return jsonObject.stringify(objectWithSideEffectGetterAndProto);
     });
+    result[result.length - 1].expected = JSON.stringify({});
     result.push(function(jsonObject){
+        return jsonObject.stringify(objectWithSideEffectGetterAndProto);
+    });
+    result.push(function(jsonObject){
         return jsonObject.stringify(arrayWithSideEffectGetter);
     });
     result.push(function(jsonObject){

Modified: trunk/Source/WebCore/ChangeLog (179405 => 179406)


--- trunk/Source/WebCore/ChangeLog	2015-01-30 18:26:36 UTC (rev 179405)
+++ trunk/Source/WebCore/ChangeLog	2015-01-30 19:09:14 UTC (rev 179406)
@@ -1,3 +1,17 @@
+2015-01-30  Matthew Mirman  <mmir...@apple.com>
+
+        Added ClientRect as an interface that requires attributes 
+        on instance for compatibility.
+        https://bugs.webkit.org/show_bug.cgi?id=141063
+        <rdar://problem/18437653>
+
+        Reviewed by Oliver Hunt.
+
+        Added a new test to LayoutTests/js/resources/JSON-stringify.js
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (InterfaceRequiresAttributesOnInstanceForCompatibility):
+
 2015-01-30  Chris Dumez  <cdu...@apple.com>
 
         Optimize MemoryCache::getSessionMap() a bit

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (179405 => 179406)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2015-01-30 18:26:36 UTC (rev 179405)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2015-01-30 19:09:14 UTC (rev 179406)
@@ -555,6 +555,7 @@
     # Needed for compatibility with existing content
     return 1 if $interfaceName =~ "Touch";
     return 1 if $interfaceName =~ "Navigator";
+    return 1 if $interfaceName =~ "ClientRect";
     # FIXME: Once https://bugs.webkit.org/show_bug.cgi?id=134364 is fixed, we can remove this.
     return 1 if $interfaceName =~ "XMLHttpRequest";
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to