Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 'use strict'; | |
| 6 | |
| 7 installClass('DOMPoint', function(global) { | |
| 8 | |
| 9 var DOMPointPrototype = Object.create(DOMPointReadOnly.prototype); | |
| 10 | |
| 11 DOMPointPrototype.initialize = function() { | |
| 12 // 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
| |
| 13 // In general javascript, DOMPointReadOnly.call(this) or this.init()? | |
| 14 this.m_x = 0; | |
| 15 this.m_y = 0; | |
| 16 this.m_z = 0; | |
| 17 this.m_w = 1; | |
| 18 }; | |
| 19 | |
| 20 Object.defineProperty(DOMPointPrototype, "x", { | |
| 21 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
| |
| 22 set: function(x) { this.m_x = x; } | |
| 23 }); | |
| 24 | |
| 25 Object.defineProperty(DOMPointPrototype, "y", { | |
| 26 get: function() { return this.m_y; }, | |
| 27 set: function(y) { this.m_y = y; } | |
| 28 }); | |
| 29 | |
| 30 Object.defineProperty(DOMPointPrototype, "z", { | |
| 31 get: function() { return this.m_z; }, | |
| 32 set: function(z) { this.m_z = z; } | |
| 33 }); | |
| 34 | |
| 35 Object.defineProperty(DOMPointPrototype, "w", { | |
| 36 get: function() { return this.m_w; }, | |
| 37 set: function(w) { this.m_w = w; } | |
| 38 }); | |
| 39 | |
| 40 return DOMPointPrototype; | |
| 41 }); | |
| OLD | NEW |