Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(908)

Unified Diff: third_party/WebKit/Source/modules/geometry/DOMPointReadOnly.js

Issue 1701283002: Implement DOMPoint using v8 extras. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/geometry/DOMPointReadOnly.js
diff --git a/third_party/WebKit/Source/modules/geometry/DOMPointReadOnly.js b/third_party/WebKit/Source/modules/geometry/DOMPointReadOnly.js
new file mode 100644
index 0000000000000000000000000000000000000000..1621c61b9bc6dc2070ebbdbee02ed774863c1375
--- /dev/null
+++ b/third_party/WebKit/Source/modules/geometry/DOMPointReadOnly.js
@@ -0,0 +1,54 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+(function(global, binding, v8) {
+ 'use strict';
+
+ const defineProperty = global.Object.defineProperty;
+
+ class DOMPointReadOnly {
+ constructor(x = 0, y = 0, z = 0, w = 1) {
+ defineProperty(this, 'x', {
+ value: x,
+ configurable: true,
+ enumerable: true,
+ writable: false
+ });
+
+ defineProperty(this, 'y', {
+ value: y,
+ configurable: true,
+ enumerable: true,
+ writable: false
+ });
+
+ defineProperty(this, 'z', {
+ value: z,
+ configurable: true,
+ enumerable: true,
+ writable: false
+ });
+
+ defineProperty(this, 'w', {
+ value: w,
+ configurable: true,
+ enumerable: true,
+ writable: false
+ });
+ }
+
+ static fromPoint(init) {
+ return new DOMPointReadOnly(init.x, init.y, init.z, init.w);
+ }
+ }
+
+ binding.createDOMPointReadOnly = DOMPointReadOnly.fromPoint;
+
+ defineProperty(global, 'DOMPointReadOnly', {
+ value: DOMPointReadOnly,
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+});
« no previous file with comments | « third_party/WebKit/Source/modules/geometry/DOMPoint.js ('k') | third_party/WebKit/Source/modules/vr/VREyeParameters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698