Chromium Code Reviews| 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; |
| +}); |