Title: [207420] trunk
Revision
207420
Author
simon.fra...@apple.com
Date
2016-10-17 12:06:25 -0700 (Mon, 17 Oct 2016)

Log Message

Implement DOMPoint/DOMPointReadOnly
https://bugs.webkit.org/show_bug.cgi?id=133916

Reviewed by Darin Adler.
Source/WebCore:

Patch mostly by Dirk Schultz <k...@webkit.org>.

Implement DOMPoint/DOMPointReadOnly following https://drafts.fxtf.org/geometry/
(although we may need to match https://www.w3.org/TR/geometry-1/ to be compatible
with Chrome).

Test: geometry/DOMPoint-001.html

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMPoint.h: Added.
* dom/DOMPoint.idl: Added.
* dom/DOMPointInit.h: Added.
* dom/DOMPointInit.idl: Added.
* dom/DOMPointReadOnly.h: Added.
(WebCore::DOMPointReadOnly::create):
(WebCore::DOMPointReadOnly::fromPoint):
(WebCore::DOMPointReadOnly::x):
(WebCore::DOMPointReadOnly::y):
(WebCore::DOMPointReadOnly::z):
(WebCore::DOMPointReadOnly::w):
(WebCore::DOMPointReadOnly::DOMPointReadOnly):
* dom/DOMPointReadOnly.idl: Added.

LayoutTests:

New Web Platform-style test, and rebaselines.

* geometry/DOMPoint-001-expected.txt: Added.
* geometry/DOMPoint-001.html: Added.
* js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
* js/dom/global-constructors-attributes-expected.txt:
* platform/efl/js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/js/dom/global-constructors-attributes-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (207419 => 207420)


--- trunk/LayoutTests/ChangeLog	2016-10-17 18:35:17 UTC (rev 207419)
+++ trunk/LayoutTests/ChangeLog	2016-10-17 19:06:25 UTC (rev 207420)
@@ -1,3 +1,23 @@
+2016-10-17  Simon Fraser  <simon.fra...@apple.com>
+
+        Implement DOMPoint/DOMPointReadOnly
+        https://bugs.webkit.org/show_bug.cgi?id=133916
+
+        Reviewed by Darin Adler.
+        
+        New Web Platform-style test, and rebaselines.
+
+        * geometry/DOMPoint-001-expected.txt: Added.
+        * geometry/DOMPoint-001.html: Added.
+        * js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
+        * js/dom/global-constructors-attributes-expected.txt:
+        * platform/efl/js/dom/global-constructors-attributes-expected.txt:
+        * platform/gtk/js/dom/global-constructors-attributes-expected.txt:
+        * platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
+        * platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
+        * platform/mac/js/dom/global-constructors-attributes-expected.txt:
+        * platform/win/js/dom/global-constructors-attributes-expected.txt:
+
 2016-10-17  Ryan Haddad  <ryanhad...@apple.com>
 
         Rebaseline mathml/mathml-in-dashboard.html for mac.

Added: trunk/LayoutTests/geometry/DOMPoint-001-expected.txt (0 => 207420)


--- trunk/LayoutTests/geometry/DOMPoint-001-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/geometry/DOMPoint-001-expected.txt	2016-10-17 19:06:25 UTC (rev 207420)
@@ -0,0 +1,29 @@
+Test DOMPoint and DOMPointReadOnly interfaces
+
+
+PASS testConstructor0 
+PASS testConstructor1 
+PASS testConstructor2 
+PASS testConstructor3 
+PASS testConstructor4 
+PASS testConstructor5 
+PASS testConstructorDOMPointInit0 
+PASS testConstructorDOMPointInit1 
+PASS testConstructorDOMPointInit2 
+PASS testConstructorDOMPointInit3 
+PASS testConstructorDOMPointInit4 
+PASS testConstructorDOMPointInit5 
+PASS testConstructorDOMPointInit2irregular 
+PASS testConstructorDOMPointInit2undefined 
+PASS testReadonlyConstructor1 
+PASS testConstructor2NaN 
+PASS testConstructor2Infinity 
+PASS testFromPointReturnType 
+PASS testFromPointReadOnlyReturnType 
+PASS testReadonlyAttributes 
+PASS testAttributes 
+PASS testAttributesUndefined 
+PASS testAttributesNaNInfinity 
+PASS testSerializer 
+PASS testReadonlySerializer 
+

Added: trunk/LayoutTests/geometry/DOMPoint-001.html (0 => 207420)


--- trunk/LayoutTests/geometry/DOMPoint-001.html	                        (rev 0)
+++ trunk/LayoutTests/geometry/DOMPoint-001.html	2016-10-17 19:06:25 UTC (rev 207420)
@@ -0,0 +1,128 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>Geometry Interfaces: DOMPoint and DOMPointReadOnly interface tests.</title>
+    <link rel="author" title="Dirk Schulze" href="" />
+    <link rel="help" href=""
+    <link rel="help" href=""
+    <link rel="help" href=""
+    <link rel="help" href=""
+    <link rel="help" href=""
+    <link rel="help" href=""
+    <link rel="help" href=""
+    <script src=""
+    <script src=""
+</head>
+<body>
+    <p>Test DOMPoint and DOMPointReadOnly interfaces</p>
+    <div id="log"></div>
+    <script>
+        test(function() {
+            checkDOMPoint(new DOMPoint(), {x:0, y:0, z:0, w:1});
+        },'testConstructor0');
+        test(function() {
+            checkDOMPoint(new DOMPoint(1), {x:1, y:0, z:0, w:1})
+        },'testConstructor1');
+        test(function() {
+            checkDOMPoint(new DOMPoint(1, 2), {x:1, y:2, z:0, w:1});
+        },'testConstructor2');
+        test(function() {
+            checkDOMPoint(new DOMPoint(1, 2, 3), {x:1, y:2, z:3, w:1});
+        },'testConstructor3');
+        test(function() {
+            checkDOMPoint(new DOMPoint(1, 2, 3, 4), {x:1, y:2, z:3, w:4});
+        },'testConstructor4');
+        test(function() {
+            checkDOMPoint(new DOMPoint(1, 2, 3, 4, 5), {x:1, y:2, z:3, w:4});
+        },'testConstructor5');
+        test(function() {
+            checkDOMPoint(DOMPoint.fromPoint({}), {x:0, y:0, z:0, w:1});
+        },'testConstructorDOMPointInit0');
+        test(function() {
+            checkDOMPoint(DOMPoint.fromPoint({x:1}), {x:1, y:0, z:0, w:1});
+        },'testConstructorDOMPointInit1');
+        test(function() {
+            checkDOMPoint(DOMPoint.fromPoint({x:1, y:2}), {x:1, y:2, z:0, w:1});
+        },'testConstructorDOMPointInit2');
+        test(function() {
+            checkDOMPoint(DOMPoint.fromPoint({x:1, y:2, z:3}), {x:1, y:2, z:3, w:1});
+        },'testConstructorDOMPointInit3');
+        test(function() {
+            checkDOMPoint(DOMPoint.fromPoint({x:1, y:2, z:3, w:4}), {x:1, y:2, z:3, w:4});
+        },'testConstructorDOMPointInit4');
+        test(function() {
+            checkDOMPoint(DOMPoint.fromPoint({x:1, y:2, z:3, w:4, v:5}), {x:1, y:2, z:3, w:4});
+        },'testConstructorDOMPointInit5');
+        test(function() {
+            checkDOMPoint(DOMPoint.fromPoint({x:1, z:3}), {x:1, y:0, z:3, w:1});
+        },'testConstructorDOMPointInit2irregular');
+        test(function() {
+            checkDOMPoint(DOMPoint.fromPoint({x:1, y: undefined, z:3}), {x:1, y:0, z:3, w:1});
+        },'testConstructorDOMPointInit2undefined');
+        test(function() {
+            checkDOMPoint(new DOMPointReadOnly(), {x:0, y:0, z:0, w:1});
+        },'testReadonlyConstructor1');
+        test(function() {
+            checkDOMPoint(new DOMPoint(1, NaN), {x:1, y:NaN, z:0, w:1});
+        },'testConstructor2NaN');
+        test(function() {
+            checkDOMPoint(new DOMPoint(1, Number.POSITIVE_INFINITY), {x:1, y:Infinity, z:0, w:1});
+        },'testConstructor2Infinity');
+        test(function() {
+            var p = DOMPoint.fromPoint({});
+            assert_true(p instanceof DOMPoint);
+        },'testFromPointReturnType');
+        test(function() {
+            var p = DOMPointReadOnly.fromPoint({});
+            assert_true(p instanceof DOMPointReadOnly);
+        },'testFromPointReadOnlyReturnType');
+        test(function() {
+            var p = new DOMPointReadOnly();
+            p.x = 1;
+            p.y = Math.PI;
+            p.z = 3.2;
+            p.w = 4;
+            checkDOMPoint(p, {x:0, y:0, z:0, w:1});
+        },'testReadonlyAttributes');
+        test(function() {
+            var p = new DOMPoint();
+            p.x = 1;
+            p.y = Math.PI;
+            p.z = 3.2;
+            p.w = 4;
+            checkDOMPoint(p, {x:1, y:Math.PI, z:3.2, w:4});
+        },'testAttributes');
+        test(function() {
+            var p = new DOMPoint(0, 0, 0, 1);
+            p.x = undefined;
+            p.y = undefined;
+            p.z = undefined;
+            p.w = undefined;
+            checkDOMPoint(p, {x:NaN, y:NaN, z:NaN, w:NaN});
+        },'testAttributesUndefined');
+        test(function() {
+            var p = new DOMPoint(0, 0, 0, 1);
+            p.x = NaN;
+            p.y = Number.POSITIVE_INFINITY;
+            p.z = Number.NEGATIVE_INFINITY;
+            p.w = Infinity;
+            checkDOMPoint(p, {x:NaN, y:Infinity, z:-Infinity, w:Infinity});
+        },'testAttributesNaNInfinity');
+        test(function() {
+            var p = DOMPoint.fromPoint({x:1, y:3.1415927, z:3.2, w:4});
+            assert_equals(JSON.stringify(p.toJSON()), "{\"x\":1,\"y\":3.1415927,\"z\":3.2,\"w\":4}");
+        },'testSerializer');
+        test(function() {
+            var p = DOMPointReadOnly.fromPoint({x:1, y:3.1415927, z:3.2, w:4});
+            assert_equals(JSON.stringify(p.toJSON()), "{\"x\":1,\"y\":3.1415927,\"z\":3.2,\"w\":4}");
+        },'testReadonlySerializer');
+
+        function checkDOMPoint(p, exp) {
+            assert_equals(p.x, exp.x, "Expected value for x is " + exp.x);
+            assert_equals(p.y, exp.y, "Expected value for y is " + exp.y);
+            assert_equals(p.z, exp.z, "Expected value for z is " + exp.z);
+            assert_equals(p.w, exp.w, "Expected value for w is " + exp.w);
+        }
+    </script>
+</body>
+</html>

Modified: trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt (207419 => 207420)


--- trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt	2016-10-17 18:35:17 UTC (rev 207419)
+++ trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt	2016-10-17 19:06:25 UTC (rev 207420)
@@ -49,6 +49,16 @@
 PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMException').hasOwnProperty('set') is false
 PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMException').enumerable is false
 PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMException').configurable is true
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMPoint').value is DOMPoint
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMPoint').hasOwnProperty('get') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMPoint').hasOwnProperty('set') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMPoint').enumerable is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMPoint').configurable is true
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').value is DOMPointReadOnly
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('get') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('set') is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').enumerable is false
+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').configurable is true
 PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DataView').value is DataView
 PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DataView').hasOwnProperty('get') is false
 PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DataView').hasOwnProperty('set') is false

Modified: trunk/LayoutTests/js/dom/global-constructors-attributes-expected.txt (207419 => 207420)


--- trunk/LayoutTests/js/dom/global-constructors-attributes-expected.txt	2016-10-17 18:35:17 UTC (rev 207419)
+++ trunk/LayoutTests/js/dom/global-constructors-attributes-expected.txt	2016-10-17 19:06:25 UTC (rev 207420)
@@ -288,6 +288,16 @@
 PASS Object.getOwnPropertyDescriptor(global, 'DOMParser').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'DOMParser').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'DOMParser').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').value is DOMPoint
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').value is DOMPointReadOnly
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'DOMStringList').value is DOMStringList
 PASS Object.getOwnPropertyDescriptor(global, 'DOMStringList').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'DOMStringList').hasOwnProperty('set') is false

Modified: trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt (207419 => 207420)


--- trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt	2016-10-17 18:35:17 UTC (rev 207419)
+++ trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt	2016-10-17 19:06:25 UTC (rev 207420)
@@ -288,6 +288,16 @@
 PASS Object.getOwnPropertyDescriptor(global, 'DOMParser').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'DOMParser').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'DOMParser').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').value is DOMPoint
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').value is DOMPointReadOnly
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'DOMStringList').value is DOMStringList
 PASS Object.getOwnPropertyDescriptor(global, 'DOMStringList').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'DOMStringList').hasOwnProperty('set') is false

Modified: trunk/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt (207419 => 207420)


--- trunk/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt	2016-10-17 18:35:17 UTC (rev 207419)
+++ trunk/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt	2016-10-17 19:06:25 UTC (rev 207420)
@@ -323,6 +323,16 @@
 PASS Object.getOwnPropertyDescriptor(global, 'DOMParser').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'DOMParser').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'DOMParser').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').value is DOMPoint
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').value is DOMPointReadOnly
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'DOMStringList').value is DOMStringList
 PASS Object.getOwnPropertyDescriptor(global, 'DOMStringList').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'DOMStringList').hasOwnProperty('set') is false

Modified: trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt (207419 => 207420)


--- trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt	2016-10-17 18:35:17 UTC (rev 207419)
+++ trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt	2016-10-17 19:06:25 UTC (rev 207420)
@@ -333,6 +333,16 @@
 PASS Object.getOwnPropertyDescriptor(global, 'DOMParser').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'DOMParser').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'DOMParser').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').value is DOMPoint
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').value is DOMPointReadOnly
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'DOMStringList').value is DOMStringList
 PASS Object.getOwnPropertyDescriptor(global, 'DOMStringList').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'DOMStringList').hasOwnProperty('set') is false

Modified: trunk/LayoutTests/platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt (207419 => 207420)


--- trunk/LayoutTests/platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt	2016-10-17 18:35:17 UTC (rev 207419)
+++ trunk/LayoutTests/platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt	2016-10-17 19:06:25 UTC (rev 207420)
@@ -333,6 +333,16 @@
 PASS Object.getOwnPropertyDescriptor(global, 'DOMParser').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'DOMParser').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'DOMParser').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').value is DOMPoint
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').value is DOMPointReadOnly
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'DOMStringList').value is DOMStringList
 PASS Object.getOwnPropertyDescriptor(global, 'DOMStringList').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'DOMStringList').hasOwnProperty('set') is false

Modified: trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt (207419 => 207420)


--- trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt	2016-10-17 18:35:17 UTC (rev 207419)
+++ trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt	2016-10-17 19:06:25 UTC (rev 207420)
@@ -333,6 +333,16 @@
 PASS Object.getOwnPropertyDescriptor(global, 'DOMParser').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'DOMParser').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'DOMParser').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').value is DOMPoint
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').value is DOMPointReadOnly
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'DOMStringList').value is DOMStringList
 PASS Object.getOwnPropertyDescriptor(global, 'DOMStringList').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'DOMStringList').hasOwnProperty('set') is false

Modified: trunk/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt (207419 => 207420)


--- trunk/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt	2016-10-17 18:35:17 UTC (rev 207419)
+++ trunk/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt	2016-10-17 19:06:25 UTC (rev 207420)
@@ -228,6 +228,16 @@
 PASS Object.getOwnPropertyDescriptor(global, 'DOMParser').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'DOMParser').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'DOMParser').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').value is DOMPoint
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPoint').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').value is DOMPointReadOnly
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'DOMStringList').value is DOMStringList
 PASS Object.getOwnPropertyDescriptor(global, 'DOMStringList').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'DOMStringList').hasOwnProperty('set') is false

Modified: trunk/Source/WebCore/CMakeLists.txt (207419 => 207420)


--- trunk/Source/WebCore/CMakeLists.txt	2016-10-17 18:35:17 UTC (rev 207419)
+++ trunk/Source/WebCore/CMakeLists.txt	2016-10-17 19:06:25 UTC (rev 207420)
@@ -386,6 +386,9 @@
     dom/DOMError.idl
     dom/DOMImplementation.idl
     dom/DOMNamedFlowCollection.idl
+    dom/DOMPoint.idl
+    dom/DOMPointInit.idl
+    dom/DOMPointReadOnly.idl
     dom/DOMStringList.idl
     dom/DOMStringMap.idl
     dom/DataTransfer.idl

Modified: trunk/Source/WebCore/ChangeLog (207419 => 207420)


--- trunk/Source/WebCore/ChangeLog	2016-10-17 18:35:17 UTC (rev 207419)
+++ trunk/Source/WebCore/ChangeLog	2016-10-17 19:06:25 UTC (rev 207420)
@@ -1,3 +1,35 @@
+2016-10-17  Simon Fraser  <simon.fra...@apple.com>
+
+        Implement DOMPoint/DOMPointReadOnly
+        https://bugs.webkit.org/show_bug.cgi?id=133916
+
+        Reviewed by Darin Adler.
+
+        Patch mostly by Dirk Schultz <k...@webkit.org>.
+
+        Implement DOMPoint/DOMPointReadOnly following https://drafts.fxtf.org/geometry/
+        (although we may need to match https://www.w3.org/TR/geometry-1/ to be compatible
+        with Chrome).
+        
+        Test: geometry/DOMPoint-001.html
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/DOMPoint.h: Added.
+        * dom/DOMPoint.idl: Added.
+        * dom/DOMPointInit.h: Added.
+        * dom/DOMPointInit.idl: Added.
+        * dom/DOMPointReadOnly.h: Added.
+        (WebCore::DOMPointReadOnly::create):
+        (WebCore::DOMPointReadOnly::fromPoint):
+        (WebCore::DOMPointReadOnly::x):
+        (WebCore::DOMPointReadOnly::y):
+        (WebCore::DOMPointReadOnly::z):
+        (WebCore::DOMPointReadOnly::w):
+        (WebCore::DOMPointReadOnly::DOMPointReadOnly):
+        * dom/DOMPointReadOnly.idl: Added.
+
 2016-10-17  Antoine Quint  <grao...@apple.com>
 
         [Modern Media Controls] Use modern-media-controls module sources for media controls stylesheet and script injection

Modified: trunk/Source/WebCore/DerivedSources.make (207419 => 207420)


--- trunk/Source/WebCore/DerivedSources.make	2016-10-17 18:35:17 UTC (rev 207419)
+++ trunk/Source/WebCore/DerivedSources.make	2016-10-17 19:06:25 UTC (rev 207420)
@@ -294,6 +294,9 @@
     $(WebCore)/dom/DOMError.idl \
     $(WebCore)/dom/DOMImplementation.idl \
     $(WebCore)/dom/DOMNamedFlowCollection.idl \
+    $(WebCore)/dom/DOMPoint.idl \
+    $(WebCore)/dom/DOMPointInit.idl \
+    $(WebCore)/dom/DOMPointReadOnly.idl \
     $(WebCore)/dom/DOMStringList.idl \
     $(WebCore)/dom/DOMStringMap.idl \
     $(WebCore)/dom/DataTransfer.idl \

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (207419 => 207420)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-10-17 18:35:17 UTC (rev 207419)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-10-17 19:06:25 UTC (rev 207420)
@@ -466,6 +466,15 @@
 		0F3F0E5A157030C3006DA57F /* RenderGeometryMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F3F0E58157030C3006DA57F /* RenderGeometryMap.h */; };
 		0F43C85D189E10CF00019AE2 /* PerformanceTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F43C85C189E10CF00019AE2 /* PerformanceTiming.cpp */; };
 		0F43C85F189E15A600019AE2 /* JSPerformanceTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F43C85E189E15A600019AE2 /* JSPerformanceTiming.cpp */; };
+		0F49669D1DB408C100A274BB /* DOMPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4966991DB408C100A274BB /* DOMPoint.h */; };
+		0F49669F1DB408C100A274BB /* DOMPointReadOnly.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F49669B1DB408C100A274BB /* DOMPointReadOnly.h */; };
+		0F4966A31DB4091000A274BB /* DOMPointInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4966A21DB4091000A274BB /* DOMPointInit.h */; };
+		0F4966AA1DB40C4300A274BB /* JSDOMPoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F4966A41DB40C4300A274BB /* JSDOMPoint.cpp */; };
+		0F4966AB1DB40C4300A274BB /* JSDOMPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4966A51DB40C4300A274BB /* JSDOMPoint.h */; };
+		0F4966AC1DB40C4300A274BB /* JSDOMPointInit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F4966A61DB40C4300A274BB /* JSDOMPointInit.cpp */; };
+		0F4966AD1DB40C4300A274BB /* JSDOMPointInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4966A71DB40C4300A274BB /* JSDOMPointInit.h */; };
+		0F4966AE1DB40C4300A274BB /* JSDOMPointReadOnly.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F4966A81DB40C4300A274BB /* JSDOMPointReadOnly.cpp */; };
+		0F4966AF1DB40C4300A274BB /* JSDOMPointReadOnly.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4966A91DB40C4300A274BB /* JSDOMPointReadOnly.h */; };
 		0F4E57171313276200CF85AF /* RenderSVGAllInOne.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F4E57161313276200CF85AF /* RenderSVGAllInOne.cpp */; };
 		0F54DCE51881051D003EEDBB /* TextAutoSizing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F54DCE31881051D003EEDBB /* TextAutoSizing.cpp */; };
 		0F54DCE61881051D003EEDBB /* TextAutoSizing.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F54DCE41881051D003EEDBB /* TextAutoSizing.h */; };
@@ -7300,6 +7309,18 @@
 		0F3F0E58157030C3006DA57F /* RenderGeometryMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderGeometryMap.h; sourceTree = "<group>"; };
 		0F43C85C189E10CF00019AE2 /* PerformanceTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceTiming.cpp; sourceTree = "<group>"; };
 		0F43C85E189E15A600019AE2 /* JSPerformanceTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPerformanceTiming.cpp; sourceTree = "<group>"; };
+		0F4966991DB408C100A274BB /* DOMPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMPoint.h; sourceTree = "<group>"; };
+		0F49669A1DB408C100A274BB /* DOMPoint.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMPoint.idl; sourceTree = "<group>"; };
+		0F49669B1DB408C100A274BB /* DOMPointReadOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMPointReadOnly.h; sourceTree = "<group>"; };
+		0F49669C1DB408C100A274BB /* DOMPointReadOnly.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMPointReadOnly.idl; sourceTree = "<group>"; };
+		0F4966A11DB4090100A274BB /* DOMPointInit.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = DOMPointInit.idl; sourceTree = "<group>"; };
+		0F4966A21DB4091000A274BB /* DOMPointInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMPointInit.h; sourceTree = "<group>"; };
+		0F4966A41DB40C4300A274BB /* JSDOMPoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSDOMPoint.cpp; path = JSDOMPoint.cpp; sourceTree = "<group>"; };
+		0F4966A51DB40C4300A274BB /* JSDOMPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSDOMPoint.h; path = JSDOMPoint.h; sourceTree = "<group>"; };
+		0F4966A61DB40C4300A274BB /* JSDOMPointInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSDOMPointInit.cpp; path = JSDOMPointInit.cpp; sourceTree = "<group>"; };
+		0F4966A71DB40C4300A274BB /* JSDOMPointInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSDOMPointInit.h; path = JSDOMPointInit.h; sourceTree = "<group>"; };
+		0F4966A81DB40C4300A274BB /* JSDOMPointReadOnly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSDOMPointReadOnly.cpp; path = JSDOMPointReadOnly.cpp; sourceTree = "<group>"; };
+		0F4966A91DB40C4300A274BB /* JSDOMPointReadOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSDOMPointReadOnly.h; path = JSDOMPointReadOnly.h; sourceTree = "<group>"; };
 		0F4E57161313276200CF85AF /* RenderSVGAllInOne.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGAllInOne.cpp; sourceTree = "<group>"; };
 		0F54DCCC1880C6AB003EEDBB /* ios-encodings.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = "ios-encodings.txt"; sourceTree = "<group>"; };
 		0F54DCE31881051D003EEDBB /* TextAutoSizing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextAutoSizing.cpp; sourceTree = "<group>"; };
@@ -19920,6 +19941,12 @@
 				65DF31E409D1CC60000BE325 /* JSDOMImplementation.h */,
 				52CCA9E015E3F62C0053C77F /* JSDOMNamedFlowCollection.cpp */,
 				52CCA9E115E3F62C0053C77F /* JSDOMNamedFlowCollection.h */,
+				0F4966A41DB40C4300A274BB /* JSDOMPoint.cpp */,
+				0F4966A51DB40C4300A274BB /* JSDOMPoint.h */,
+				0F4966A61DB40C4300A274BB /* JSDOMPointInit.cpp */,
+				0F4966A71DB40C4300A274BB /* JSDOMPointInit.h */,
+				0F4966A81DB40C4300A274BB /* JSDOMPointReadOnly.cpp */,
+				0F4966A91DB40C4300A274BB /* JSDOMPointReadOnly.h */,
 				C5137CF011A58378004ADB99 /* JSDOMStringList.cpp */,
 				C5137CF111A58378004ADB99 /* JSDOMStringList.h */,
 				BC64649511D82349006455B0 /* JSDOMStringMap.cpp */,
@@ -23380,6 +23407,12 @@
 				52B6C9BD15E3F4DF00690B05 /* DOMNamedFlowCollection.cpp */,
 				52B6C9BE15E3F4DF00690B05 /* DOMNamedFlowCollection.h */,
 				52B6C9BF15E3F4DF00690B05 /* DOMNamedFlowCollection.idl */,
+				0F4966991DB408C100A274BB /* DOMPoint.h */,
+				0F49669A1DB408C100A274BB /* DOMPoint.idl */,
+				0F4966A21DB4091000A274BB /* DOMPointInit.h */,
+				0F4966A11DB4090100A274BB /* DOMPointInit.idl */,
+				0F49669B1DB408C100A274BB /* DOMPointReadOnly.h */,
+				0F49669C1DB408C100A274BB /* DOMPointReadOnly.idl */,
 				C55610F011A704EB00B82D27 /* DOMStringList.cpp */,
 				C544274911A57E7A0063A749 /* DOMStringList.h */,
 				C544274A11A57E7A0063A749 /* DOMStringList.idl */,
@@ -24732,6 +24765,9 @@
 				FB91392416AE4C17001FE682 /* DOMPath.h in Headers */,
 				A9C6E4EC0D745E2B006442E9 /* DOMPlugin.h in Headers */,
 				A9C6E4F00D745E38006442E9 /* DOMPluginArray.h in Headers */,
+				0F49669D1DB408C100A274BB /* DOMPoint.h in Headers */,
+				0F4966A31DB4091000A274BB /* DOMPointInit.h in Headers */,
+				0F49669F1DB408C100A274BB /* DOMPointReadOnly.h in Headers */,
 				5185FCB71BB4C7670012898F /* DOMRequestState.h in Headers */,
 				BC5A86850C33676000EEA649 /* DOMSelection.h in Headers */,
 				C544274B11A57E7A0063A749 /* DOMStringList.h in Headers */,
@@ -25397,6 +25433,9 @@
 				FB91392A16AE4FC0001FE682 /* JSDOMPath.h in Headers */,
 				A9D247FF0D757E6900FDF959 /* JSDOMPlugin.h in Headers */,
 				A9D248010D757E6900FDF959 /* JSDOMPluginArray.h in Headers */,
+				0F4966AB1DB40C4300A274BB /* JSDOMPoint.h in Headers */,
+				0F4966AD1DB40C4300A274BB /* JSDOMPointInit.h in Headers */,
+				0F4966AF1DB40C4300A274BB /* JSDOMPointReadOnly.h in Headers */,
 				E172AF901811BC3700FBADB9 /* JSDOMPromise.h in Headers */,
 				BC5A86B60C3367E800EEA649 /* JSDOMSelection.h in Headers */,
 				C5137CF311A58378004ADB99 /* JSDOMStringList.h in Headers */,
@@ -29073,6 +29112,9 @@
 				A9D248000D757E6900FDF959 /* JSDOMPluginArray.cpp in Sources */,
 				A9C6E64C0D7465E7006442E9 /* JSDOMPluginArrayCustom.cpp in Sources */,
 				A9C6E64D0D7465E7006442E9 /* JSDOMPluginCustom.cpp in Sources */,
+				0F4966AA1DB40C4300A274BB /* JSDOMPoint.cpp in Sources */,
+				0F4966AC1DB40C4300A274BB /* JSDOMPointInit.cpp in Sources */,
+				0F4966AE1DB40C4300A274BB /* JSDOMPointReadOnly.cpp in Sources */,
 				E172AF8F1811BC3700FBADB9 /* JSDOMPromise.cpp in Sources */,
 				BC5A86B50C3367E800EEA649 /* JSDOMSelection.cpp in Sources */,
 				C5137CF211A58378004ADB99 /* JSDOMStringList.cpp in Sources */,

Added: trunk/Source/WebCore/dom/DOMPoint.h (0 => 207420)


--- trunk/Source/WebCore/dom/DOMPoint.h	                        (rev 0)
+++ trunk/Source/WebCore/dom/DOMPoint.h	2016-10-17 19:06:25 UTC (rev 207420)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
+ * Copyright (C) 2016 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "DOMPointReadOnly.h"
+
+namespace WebCore {
+
+class DOMPoint final : public DOMPointReadOnly {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    static Ref<DOMPoint> create(double x, double y, double z, double w) { return adoptRef(*new DOMPoint(x, y, z, w)); }
+    static Ref<DOMPoint> fromPoint(const DOMPointInit& init) { return create(init.x, init.y, init.z, init.w); }
+
+    void setX(double x) { m_x = x; }
+    void setY(double y) { m_y = y; }
+    void setZ(double z) { m_z = z; }
+    void setW(double w) { m_w = w; }
+
+private:
+    DOMPoint(double x, double y, double z, double w)
+        : DOMPointReadOnly(x, y, z, w)
+    {
+    }
+};
+
+} // namespace WebCore

Added: trunk/Source/WebCore/dom/DOMPoint.idl (0 => 207420)


--- trunk/Source/WebCore/dom/DOMPoint.idl	                        (rev 0)
+++ trunk/Source/WebCore/dom/DOMPoint.idl	2016-10-17 19:06:25 UTC (rev 207420)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
+ * Copyright (C) 2016 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0,
+        optional unrestricted double z = 0, optional unrestricted double w = 1),
+    Exposed=(Window,Worker),
+    ImplementationLacksVTable
+]
+interface DOMPoint : DOMPointReadOnly {
+    [NewObject] static DOMPoint fromPoint(optional DOMPointInit other);
+
+    inherit attribute unrestricted double x;
+    inherit attribute unrestricted double y;
+    inherit attribute unrestricted double z;
+    inherit attribute unrestricted double w;
+};

Added: trunk/Source/WebCore/dom/DOMPointInit.h (0 => 207420)


--- trunk/Source/WebCore/dom/DOMPointInit.h	                        (rev 0)
+++ trunk/Source/WebCore/dom/DOMPointInit.h	2016-10-17 19:06:25 UTC (rev 207420)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
+ * Copyright (C) 2016 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+namespace WebCore {
+
+struct DOMPointInit {
+    double x { 0 };
+    double y { 0 };
+    double z { 0 };
+    double w { 1 };
+};
+
+} // namespace WebCore

Added: trunk/Source/WebCore/dom/DOMPointInit.idl (0 => 207420)


--- trunk/Source/WebCore/dom/DOMPointInit.idl	                        (rev 0)
+++ trunk/Source/WebCore/dom/DOMPointInit.idl	2016-10-17 19:06:25 UTC (rev 207420)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
+ * Copyright (C) 2016 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+dictionary DOMPointInit {
+    unrestricted double x = 0;
+    unrestricted double y = 0;
+    unrestricted double z = 0;
+    unrestricted double w = 1;
+};

Added: trunk/Source/WebCore/dom/DOMPointReadOnly.h (0 => 207420)


--- trunk/Source/WebCore/dom/DOMPointReadOnly.h	                        (rev 0)
+++ trunk/Source/WebCore/dom/DOMPointReadOnly.h	2016-10-17 19:06:25 UTC (rev 207420)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
+ * Copyright (C) 2016 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "DOMPointInit.h"
+#include "ScriptWrappable.h"
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class DOMPointReadOnly : public ScriptWrappable, public RefCounted<DOMPointReadOnly> {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    static Ref<DOMPointReadOnly> create(double x, double y, double z, double w) { return adoptRef(*new DOMPointReadOnly(x, y, z, w)); }
+    static Ref<DOMPointReadOnly> fromPoint(const DOMPointInit& init) { return create(init.x, init.y, init.z, init.w); }
+
+    double x() const { return m_x; }
+    double y() const { return m_y; }
+    double z() const { return m_z; }
+    double w() const { return m_w; }
+
+protected:
+    DOMPointReadOnly(double x, double y, double z, double w)
+        : m_x(x)
+        , m_y(y)
+        , m_z(z)
+        , m_w(w)
+    {
+    }
+
+    // Any of these can be NaN or Inf.
+    double m_x;
+    double m_y;
+    double m_z;
+    double m_w;
+};
+
+} // namespace WebCore
+

Added: trunk/Source/WebCore/dom/DOMPointReadOnly.idl (0 => 207420)


--- trunk/Source/WebCore/dom/DOMPointReadOnly.idl	                        (rev 0)
+++ trunk/Source/WebCore/dom/DOMPointReadOnly.idl	2016-10-17 19:06:25 UTC (rev 207420)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
+ * Copyright (C) 2016 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0,
+        optional unrestricted double z = 0, optional unrestricted double w = 1),
+    Exposed=(Window,Worker),
+    ImplementationLacksVTable
+]
+interface DOMPointReadOnly {
+    [NewObject] static DOMPointReadOnly fromPoint(optional DOMPointInit other);
+
+    readonly attribute unrestricted double x;
+    readonly attribute unrestricted double y;
+    readonly attribute unrestricted double z;
+    readonly attribute unrestricted double w;
+
+    // FIXME: No support for DOMMatrix yet (webkit.org/b/110001)
+    // DOMPoint matrixTransform(optional DOMMatrixInit matrix);
+
+    serializer = { attribute };
+};
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to