aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/api/element/currentstyle
diff options
context:
space:
mode:
authortristantheb <tristantheb@users.noreply.github.com>2021-04-02 13:50:14 +0200
committerGitHub <noreply@github.com>2021-04-02 13:50:14 +0200
commit99efa5cfa34c3f9d38b75352881acdfc99508ebf (patch)
tree15a37e05bf05f0daff2893f0a2f1c8a3673ac86b /files/fr/web/api/element/currentstyle
parentc37cf5ec1bb9d4f6c51d12eaeef1bd5af12695f8 (diff)
downloadtranslated-content-99efa5cfa34c3f9d38b75352881acdfc99508ebf.tar.gz
translated-content-99efa5cfa34c3f9d38b75352881acdfc99508ebf.tar.bz2
translated-content-99efa5cfa34c3f9d38b75352881acdfc99508ebf.zip
UPDATE: FR-ONLY - Remove all old CompatibilityTable to replace with {{Compat()}} (#311)
* UPDATE: Removing CompatibilityTable script - Part 1 * UPDATE: Removing CompatibilityTable script - Part 2 * UPDATE: Removing CompatibilityTable script - Part 3 * UPDATE: Removing CompatibilityTable script - Part 4 * UPDATE: Removing CompatibilityTable script - Part 5/5 * FIX: Repair the EOL of one page * FIX: Fix conflicting file
Diffstat (limited to 'files/fr/web/api/element/currentstyle')
-rw-r--r--files/fr/web/api/element/currentstyle/index.html86
1 files changed, 29 insertions, 57 deletions
diff --git a/files/fr/web/api/element/currentstyle/index.html b/files/fr/web/api/element/currentstyle/index.html
index 09a7425ce9..3ac845eaf3 100644
--- a/files/fr/web/api/element/currentstyle/index.html
+++ b/files/fr/web/api/element/currentstyle/index.html
@@ -1,76 +1,48 @@
---
title: Element.currentStyle
slug: Web/API/Element/currentStyle
+tags:
+ - API
+ - NeedsExample
+ - Non-standard
+ - Property
translation_of: Web/API/Element/currentStyle
---
-<div>{{APIRef("DOM")}}</div>
+<div>{{APIRef("DOM")}}{{Non-standard_header}}</div>
-<p>{{ Non-standard_header() }}</p>
+<p class="summary"><strong><code>Element.currentStyle</code></strong> est une propriété propriétaire qui est similaire à la méthode normalisée {{DOMxRef("window.getComputedStyle()")}}. Elle est disponible dans les anciennes versions de Microsoft Internet Explorer. Cependant, elle renvoie les unités définies dans CSS alors que <code>window.getComputedStyle()</code> renvoie les valeurs en pixels.</p>
-<h2 id="Summary">Summary</h2>
+<h2 id="Polyfill">Prothèse d'émulation</h2>
-<p><strong><code>Element.currentStyle</code></strong> is a property which is a proprietary similar to the standardized {{domxref("window.getComputedStyle")}} method. It is available in old versions of Microsoft Internet Explorer. However, it returns the units set in CSS while window.getComputedStyle returns the values in pixels.</p>
+<div class="notecard note">
+ <p>Cette prothèse d'émulation retourne les valeurs en pixels et risque d'être plutôt lent, car il doit appeler {{domxref("window.getComputedStyle()")}} chaque fois que sa valeur est lue.</p>
+</div>
-<h2 id="Specification">Specification</h2>
+<pre class="brush: js">/* Tout droit d'auteur est dédié au domaine public.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
-<p>Ne fait partie d'aucune spécification.</p>
+if (!("currentStyle" in Element.prototype)) {
+ Object.defineProperty(Element.prototype, "currentStyle", {
+ get: function() {
+ return window.getComputedStyle(this);
+ }
+ });
+}
+</pre>
-<p>Microsoft <a href="https://msdn.microsoft.com/en-us/library/ms535231(v=vs.85).aspx">a une description MSDN</a>.</p>
+<h2 id="Specifications">Spécifications</h2>
-<h2 id="Browser_Compatibility" name="Browser_Compatibility">Compatibilité des navigateurs</h2>
+<p>Ne fait partie d'aucune spécification.</p>
-<p>{{ CompatibilityTable() }}</p>
+<p>Microsoft <a href="https://web.archive.org/web/20150629144515/https://msdn.microsoft.com/en-us/library/ms535231(v=vs.85).aspx">a une description MSDN</a>.</p>
-<div id="compat-desktop">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Chrome</th>
- <th>Firefox (Gecko)</th>
- <th>Internet Explorer</th>
- <th>Microsoft Edge</th>
- <th>Opera</th>
- <th>Safari (WebKit)</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{ CompatNo() }}</td>
- <td>{{ CompatNo() }}</td>
- <td>6</td>
- <td>{{ CompatNo() }}</td>
- <td>{{ CompatNo() }}</td>
- <td>{{ CompatNo() }}</td>
- </tr>
- </tbody>
-</table>
-</div>
+<h2 id="Browser_compatibility">Compatibilité des navigateurs</h2>
-<div id="compat-mobile">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Android</th>
- <th>Firefox Mobile (Gecko)</th>
- <th>IE Phone</th>
- <th>Opera Mobile</th>
- <th>Safari Mobile</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{ CompatNo() }}</td>
- <td>{{ CompatNo() }}</td>
- <td>{{ CompatUnknown() }}</td>
- <td>{{ CompatUnknown() }}</td>
- <td>{{ CompatNo() }}</td>
- </tr>
- </tbody>
-</table>
-</div>
+<p>{{Compat("api.Element.currentStyle")}}</p>
-<h2 id="Voir_aussi">Voir aussi</h2>
+<h2 id="See_also">Voir aussi</h2>
<ul>
- <li>{{domxref("Element.runtimeStyle")}}</li>
+ <li>{{DOMxRef("Element.runtimeStyle")}}</li>
+ <li>{{DOMxRef("window.getComputedStyle()")}}</li>
</ul>