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

Unified Diff: Source/core/dom/DOMPointReadOnly.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/DOMPointReadOnly.js
diff --git a/Source/core/dom/DOMPointReadOnly.js b/Source/core/dom/DOMPointReadOnly.js
new file mode 100644
index 0000000000000000000000000000000000000000..10cdedb4870f2f7cc98a1ecbe82f5e3173b8982c
--- /dev/null
+++ b/Source/core/dom/DOMPointReadOnly.js
@@ -0,0 +1,35 @@
+// 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('DOMPointReadOnly', function(global) {
+
+ var DOMPointReadOnlyPrototype = {};
+
+ DOMPointReadOnlyPrototype.initialize = function() {
+ this.m_x = 0;
+ this.m_y = 0;
+ this.m_z = 0;
+ this.m_w = 1;
+ };
+
+ Object.defineProperty(DOMPointReadOnlyPrototype, "x", {
+ get: function() { return this.m_x; },
+ });
+
+ Object.defineProperty(DOMPointReadOnlyPrototype, "y", {
+ get: function() { return this.m_y; },
+ });
+
+ Object.defineProperty(DOMPointReadOnlyPrototype, "z", {
+ get: function() { return this.m_z; },
+ });
+
+ Object.defineProperty(DOMPointReadOnlyPrototype, "w", {
+ get: function() { return this.m_w; },
+ });
+
+ return DOMPointReadOnlyPrototype;
+});

Powered by Google App Engine
This is Rietveld 408576698