DOMRect.webidl (2044B)
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 * 6 * The origin of this IDL file is 7 * https://drafts.fxtf.org/geometry/ 8 * 9 * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C 10 * liability, trademark and document use rules apply. 11 */ 12 13 [Exposed=(Window,Worker), 14 Serializable] 15 interface DOMRect : DOMRectReadOnly { 16 constructor(optional unrestricted double x = 0, 17 optional unrestricted double y = 0, 18 optional unrestricted double width = 0, 19 optional unrestricted double height = 0); 20 21 [NewObject] static DOMRect fromRect(optional DOMRectInit other = {}); 22 23 inherit attribute unrestricted double x; 24 inherit attribute unrestricted double y; 25 inherit attribute unrestricted double width; 26 inherit attribute unrestricted double height; 27 }; 28 29 [ProbablyShortLivingWrapper, 30 Exposed=(Window,Worker), 31 Serializable] 32 interface DOMRectReadOnly { 33 constructor(optional unrestricted double x = 0, 34 optional unrestricted double y = 0, 35 optional unrestricted double width = 0, 36 optional unrestricted double height = 0); 37 38 [NewObject] static DOMRectReadOnly fromRect(optional DOMRectInit other = {}); 39 40 readonly attribute unrestricted double x; 41 readonly attribute unrestricted double y; 42 readonly attribute unrestricted double width; 43 readonly attribute unrestricted double height; 44 readonly attribute unrestricted double top; 45 readonly attribute unrestricted double right; 46 readonly attribute unrestricted double bottom; 47 readonly attribute unrestricted double left; 48 49 [Default] object toJSON(); 50 }; 51 52 dictionary DOMRectInit { 53 unrestricted double x = 0; 54 unrestricted double y = 0; 55 unrestricted double width = 0; 56 unrestricted double height = 0; 57 };