ClientRect properties should be on the prototype
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Jul 2016 00:21:31 +0000 (00:21 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Jul 2016 00:21:31 +0000 (00:21 +0000)
commitc0781a40ee2c7721a03250f85f73e90374d54d35
tree7295fe242b38dd6021d84bd8679beccf7178751a
parent451d98fec242e506c69632ec207ed855459851f8
ClientRect properties should be on the prototype
https://bugs.webkit.org/show_bug.cgi?id=160165

Reviewed by Geoffrey Garen.

Source/WebCore:

Move ClientRect properties from the instance to the prototype. This
matches the specification, Firefox and Chrome.

Also add a serializer to ClientRect in order to match the specification:
- https://drafts.fxtf.org/geometry/Overview.html#domrectreadonly
- https://heycam.github.io/webidl/#es-serializer

This avoids breaking content that relies on JSON.stringify() to
serialize ClientRect objects.

Tests: fast/css/ClientRect-attributes-prototype.html
       fast/css/ClientRect-serialization.html

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSClientRectCustom.cpp: Added.
(WebCore::JSClientRect::toJSON):
* bindings/scripts/CodeGeneratorJS.pm:
* dom/ClientRect.idl:

LayoutTests:

* fast/css/ClientRect-attributes-prototype-expected.txt: Added.
* fast/css/ClientRect-attributes-prototype.html: Added.
Add layout test to check that ClientRect's properties are on the
prototype.

* fast/css/ClientRect-serialization-expected.txt: Added.
* fast/css/ClientRect-serialization.html: Added.
Add layout test to check that ClientRect has a serializer.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/flexbox/align-absolute-child-expected.txt
LayoutTests/fast/css/ClientRect-attributes-prototype-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/ClientRect-attributes-prototype.html [new file with mode: 0644]
LayoutTests/fast/css/ClientRect-serialization-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/ClientRect-serialization.html [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
Source/WebCore/bindings/js/JSClientRectCustom.cpp [new file with mode: 0644]
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/dom/ClientRect.idl