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

Side by Side Diff: third_party/WebKit/Source/modules/geometry/DOMPoint.js

Issue 1701283002: Implement DOMPoint using v8 extras. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 2016 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 (function(global, binding, v8) {
6 'use strict';
7
8 const defineProperty = global.Object.defineProperty;
9
10 class DOMPoint extends DOMPointReadOnly {
11 constructor(x = 0, y = 0, z = 0, w = 1) {
12 super(x, y, z, w);
13
14 defineProperty(this, 'x', {
15 value: x,
16 configurable: true,
17 enumerable: true,
18 writable: true
19 });
20
21 defineProperty(this, 'y', {
22 value: y,
23 configurable: true,
24 enumerable: true,
25 writable: true
26 });
27
28 defineProperty(this, 'z', {
29 value: z,
30 configurable: true,
31 enumerable: true,
32 writable: true
33 });
34
35 defineProperty(this, 'w', {
36 value: w,
37 configurable: true,
38 enumerable: true,
39 writable: true
40 });
41 }
42
43 static fromPoint(init) {
44 return new DOMPoint(init.x, init.y, init.z, init.w);
45 }
46 }
47
48 binding.createDOMPoint = DOMPoint.fromPoint;
49
50 defineProperty(global, 'DOMPoint', {
51 value: DOMPoint,
52 configurable: true,
53 enumerable: false,
54 writable: true
55 });
56 });
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.idl ('k') | third_party/WebKit/Source/modules/geometry/DOMPointReadOnly.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698