1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
---
title: nsIDOMClientRect
slug: XPCOM_Interface_Reference/nsIDOMClientRect
tags:
- Interfaces
- 'Interfaces:Scriptable'
- XPCOM
- XPCOM Interface Reference
translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMClientRect
---
<p></p><div style="border: solid #ddd 2px; margin-bottom: 12px;">
<div style="background: #eee; padding: 2px;"><code><a href="https://dxr.mozilla.org/mozilla-central/source/dom/interfaces/base/nsIDOMClientRect.idl" rel="custom">dom/interfaces/base/nsIDOMClientRect.idl</a></code><span style="text-align: right; float: right;"><a href="/fr/docs/Interfaces/À_propos_des_interfaces_scriptables" style="color: #00cc00; font-weight: 700;">Scriptable</a></span></div>
<span style="padding: 4px 2px;">Représente une boîte rectangulaire. Le type de boîte est spécifié par la méthode qui renvoie un tel objet. Il est retourné par des fonctions comme <a href="/fr/docs/Web/API/Element/getBoundingClientRect" title="La méthode Element.getBoundingClientRect() renvoie la taille d'un élément et sa position relative par rapport à la zone d'affichage (viewport)."><code>element.getBoundingClientRect</code></a>.</span>
<div style="height: 42px; position: relative; padding: 2px; width: auto;">
<div style="top: 22px; font-size: 11px; position: absolute;">1.0</div>
<div style="top: 22px; font-size: 11px; position: absolute; left: 0px; text-align: right; float: right; width: 100%;">66</div>
<div style="height: 8px; top: 16px; background: #dd0000; left: 0px; position: absolute; width: 8.571428571428571%;"></div>
<div style="height: 8px; top: 16px; left: 8.571428571428571%; background: #00dd00; position: absolute; width: 91.42857142857143%;" title="Introduced in Gecko 1.9 (Firefox 3)"></div>
<div style="top: 0px; font-size: 11px; position: absolute; left: 8.571428571428571%;">Introduced</div>
<div style="top: 22px; font-size: 11px; position: absolute; left: 8.571428571428571%;">Gecko 1.9</div>
<div style="height: 8px; top: 16px; left: 9.023809428571429%; background: #eeee00; position: absolute; width: 1%; border-radius: 4px; -webkit-border-radius: 4px;" title="Last changed in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0)"></div>
</div>
<div style="background: #eee; padding: 2px;">
Inherits from: <code><a href="/fr/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupports" title="">nsISupports</a></code>
<span style="text-align: right; float: right;">Last changed in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0)</span></div>
</div><p></p>
<h2 id="Attributes" name="Attributes">Attributs</h2>
<table class="standard-table">
<tbody>
<tr>
<td class="header">Attribut</td>
<td class="header">Type</td>
<td class="header">Description</td>
</tr>
<tr>
<td><code>bottom</code></td>
<td><code>float</code></td>
<td>Coordonnée Y, par rapport à l'origine du point de vue, du bas de la boîte rectangulaire. <strong>En lecture seule</strong>.</td>
</tr>
<tr>
<td><code>height</code></td>
<td><code>float</code></td>
<td>Hauteur de la boîte rectangle (identique à <code>bottom</code> moins <code>top</code>). <strong>En lecture seule.</strong></td>
</tr>
<tr>
<td><code>left</code></td>
<td><code>float</code></td>
<td>Coordonnée X, par rapport à l'origine du point de vue, de la gauche de la boîte rectangulaire. <strong>En lecture seule.</strong></td>
</tr>
<tr>
<td><code>right</code></td>
<td><code>float</code></td>
<td>Coordonnée X, par rapport à l'origine du point de vue, de la droite de la boîte rectangulaire. <strong>En lecture seule.</strong></td>
</tr>
<tr>
<td><code>top</code></td>
<td><code>float</code></td>
<td>Coordonnée Y, par rapport à l'origine du point de vue, du haut de la boîte rectangulaire. <strong>En lecture seule.</strong></td>
</tr>
<tr>
<td><code>width</code></td>
<td><code>float</code></td>
<td>Largeur de la boîte rectangle (identique à <code>right</code> moins <code>left</code>). <strong>En lecture seule.</strong> </td>
</tr>
<tr>
<td><code>x</code></td>
<td><code>float</code></td>
<td>Coordonnée X, par rapport à l'origine du point de vue, de la gauche de la boîte rectangulaire. <strong>En lecture seule.</strong></td>
</tr>
<tr>
<td><code>y</code></td>
<td><code>float</code></td>
<td>Coordonnée Y, par rapport à l'origine du point de vue,, du haut de la boîte rectangulaire. <strong>En lecture seule.</strong></td>
</tr>
</tbody>
</table>
<h2 id="See_also" name="See_also">Voir aussi</h2>
<ul>
<li><a href="http://www.w3.org/TR/cssom-view/#the-clientrect-interface">CSSOM View Module : The ClientRect Interface</a><span style="color: #fff; background: #e66e33; display: inline-block; font-size: x-small; margin-left: 6px; white-space: nowrap; padding: 2px 5px;" title="Working Draft">WD</span></li>
</ul>
<p>Cet objet a été renommé plusieurs fois : le nom initial était TextRectangle, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=916520">ensuite</a> ClientRect, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=916520">ensuite</a> DOMRect.</p>
<p>Initialement, il avait juste les attributs top/left/right/bottom, puis width/height/x/y ont été ajoutés.</p>
|