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

Side by Side 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 unified diff | Download patch
OLDNEW
(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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698