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

Unified Diff: Source/core/dom/DOMPoint.js

Issue 399923002: [WIP] Implement DOMPoint of geometry interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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: Source/core/dom/DOMPoint.js
diff --git a/Source/core/dom/DOMPoint.js b/Source/core/dom/DOMPoint.js
new file mode 100644
index 0000000000000000000000000000000000000000..d7dc19fc0677dd94fe08428bbfabdabfd0b8afa0
--- /dev/null
+++ b/Source/core/dom/DOMPoint.js
@@ -0,0 +1,41 @@
+// Copyright 2014 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.
+
+'use strict';
+
+installClass('DOMPoint', function(global) {
+
+ var DOMPointPrototype = Object.create(DOMPointReadOnly.prototype);
+
+ DOMPointPrototype.initialize = function() {
+ // FIXME: How can we call parent initialize function?
zino 2014/07/17 13:54:30 QUESTION #2: How can we call parent initialize fun
haraken 2014/07/17 15:01:58 I think this should be handled by PrivateScriptRun
+ // In general javascript, DOMPointReadOnly.call(this) or this.init()?
+ this.m_x = 0;
+ this.m_y = 0;
+ this.m_z = 0;
+ this.m_w = 1;
+ };
+
+ Object.defineProperty(DOMPointPrototype, "x", {
+ get: function() { return this.m_x; },
zino 2014/07/17 13:54:30 QUESTION #3: This getter function is duplicated wi
haraken 2014/07/17 15:01:58 As mentioned in DOMPoint.idl, inherit attributes a
+ set: function(x) { this.m_x = x; }
+ });
+
+ Object.defineProperty(DOMPointPrototype, "y", {
+ get: function() { return this.m_y; },
+ set: function(y) { this.m_y = y; }
+ });
+
+ Object.defineProperty(DOMPointPrototype, "z", {
+ get: function() { return this.m_z; },
+ set: function(z) { this.m_z = z; }
+ });
+
+ Object.defineProperty(DOMPointPrototype, "w", {
+ get: function() { return this.m_w; },
+ set: function(w) { this.m_w = w; }
+ });
+
+ return DOMPointPrototype;
+});

Powered by Google App Engine
This is Rietveld 408576698