From c98a9b1cf02d9143cc6924f1991d600c0f807411 Mon Sep 17 00:00:00 2001 From: MDN Date: Wed, 30 Jun 2021 00:38:38 +0000 Subject: [CRON] sync translated content --- .../orphaned/web/api/childnode/before/index.html | 142 +++++++++++++++++++++ files/fr/orphaned/web/api/childnode/index.html | 76 +++++++++++ files/fr/orphaned/web/css/paint()/index.html | 110 ++++++++++++++++ .../css/transform-function/translatex/index.html | 110 ++++++++++++++++ 4 files changed, 438 insertions(+) create mode 100644 files/fr/orphaned/web/api/childnode/before/index.html create mode 100644 files/fr/orphaned/web/api/childnode/index.html create mode 100644 files/fr/orphaned/web/css/paint()/index.html create mode 100644 files/fr/orphaned/web/css/transform-function/translatex/index.html (limited to 'files/fr/orphaned/web') diff --git a/files/fr/orphaned/web/api/childnode/before/index.html b/files/fr/orphaned/web/api/childnode/before/index.html new file mode 100644 index 0000000000..f917723698 --- /dev/null +++ b/files/fr/orphaned/web/api/childnode/before/index.html @@ -0,0 +1,142 @@ +--- +title: ChildNode.before() +slug: orphaned/Web/API/ChildNode/before +tags: + - API + - DOM + - Méthodes + - Noeuds + - References +translation_of: Web/API/ChildNode/before +original_slug: Web/API/ChildNode/before +--- +
{{APIRef("DOM")}} {{SeeCompatTable}}
+ +

La méthode ChildNode.before insère un ensemble d'objets {{domxref("Node")}} (noeud) ou {{domxref("DOMString")}} (chaîne de caractères) dans la liste des enfants du parent du ChildNode, juste avant ce ChildNode. Des objets {{domxref("DOMString")}} sont insérés comme noeuds équivalents à {{domxref("Text")}}.

+ +

Syntaxe

+ +
[Throws, Unscopable]
+void ChildNode.before((Node or DOMString)... nodes);
+
+ +

Paramètres

+ +
+
nodes
+
Un ensemble d'objets {{domxref("Node")}} (noeud) ou {{domxref("DOMString")}} (chaîne de caractères) à insérer.
+
+ +

Exceptions

+ + + +

Exemples

+ +

Insertion d'un élément

+ +
var parent = document.createElement("div");
+var child = document.createElement("p");
+parent.appendChild(child);
+var span = document.createElement("span");
+
+child.before(span);
+
+console.log(parent.outerHTML);
+// "<div><span></span><p></p></div>"
+
+ +

Insertion de texte

+ +
var parent = document.createElement("div");
+var child = document.createElement("p");
+parent.appendChild(child);
+
+child.before("Text");
+
+console.log(parent.outerHTML);
+// "<div>Text<p></p></div>"
+ +

Insertion d'un élément et de texte

+ +
var parent = document.createElement("div");
+var child = document.createElement("p");
+parent.appendChild(child);
+var span = document.createElement("span");
+
+child.before(span, "Text");
+
+console.log(parent.outerHTML);
+// "<div><span></span>Text<p></p></div>"
+ +

ChildNode.before() est inaccessible

+ +

La méthode before() n'est pas comprise dans l'instruction with. Voir {{jsxref("Symbol.unscopables")}} pour plus d'informations.

+ +
with(node) {
+  before("foo");
+}
+// ReferenceError: before is not defined (before n'est pas défini)
+ +

Polyfill

+ +

Vous pouvez utiliser un polyfill pour la méthode before() dans Internet Explorer 9 et supérieur avec le code suivant :

+ +
// from: https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/before()/before().md
+(function (arr) {
+  arr.forEach(function (item) {
+    if (item.hasOwnProperty('before')) {
+      return;
+    }
+    Object.defineProperty(item, 'before', {
+      configurable: true,
+      enumerable: true,
+      writable: true,
+      value: function before() {
+        var argArr = Array.prototype.slice.call(arguments),
+          docFrag = document.createDocumentFragment();
+
+        argArr.forEach(function (argItem) {
+          var isNode = argItem instanceof Node;
+          docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem)));
+        });
+
+        this.parentNode.insertBefore(docFrag, this);
+      }
+    });
+  });
+})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
+ +

Spécification

+ + + + + + + + + + + + + + +
SpécificationStatutCommentaire
{{SpecName('DOM WHATWG', '#dom-childnode-before', 'ChildNode.before()')}}{{Spec2('DOM WHATWG')}}Définition initiale.
+ +

Compatibilité des navigateurs

+ +

{{Compat("api.ChildNode.before")}}

+ +

Voir aussi

+ + diff --git a/files/fr/orphaned/web/api/childnode/index.html b/files/fr/orphaned/web/api/childnode/index.html new file mode 100644 index 0000000000..35b7b8438e --- /dev/null +++ b/files/fr/orphaned/web/api/childnode/index.html @@ -0,0 +1,76 @@ +--- +title: ChildNode +slug: orphaned/Web/API/ChildNode +tags: + - API + - DOM + - Interface + - Noeuds +translation_of: Web/API/ChildNode +original_slug: Web/API/ChildNode +--- +

{{APIRef("DOM")}}

+ +

L'interface ChildNode contient des méthodes propres aux objets {{domxref("Node")}} pouvant avoir un parent.

+ +

ChildNode est une interface de flux et aucun objet de ce type ne peut être créé ; elle est implémentée par les objets {{domxref("Element")}}, {{domxref("DocumentType")}} et {{domxref("CharacterData")}}.

+ +

Propriétés

+ +

Il n'y a pas de propriétés héritées ni spécifiques.

+ +

Méthodes

+ +

Il n'y a pas de méthodes héritées.

+ +
+
{{domxref("ChildNode.remove()")}} {{experimental_inline}}
+
supprime ce ChildNode de la liste des enfants du parent.
+
{{domxref("ChildNode.before()")}} {{experimental_inline}}
+
ajoute un jeu d'objets {{domxref("Node")}} ou {{domxref("DOMString")}} dans la liste des enfants du parent de ce ChildNode, juste avant lui. Les objets {{domxref("DOMString")}} sont ajoutés comme équivalent des noeuds {{domxref("Text")}}.
+
{{domxref("ChildNode.after()")}} {{experimental_inline}}
+
ajoute un jeu d'objets {{domxref("Node")}} ou {{domxref("DOMString")}} dans la liste des enfants du parent de ce ChildNode, juste après lui. Les objets {{domxref("DOMString")}} sont ajoutés comme équivalent des noeuds {{domxref("Text")}}.
+
{{domxref("ChildNode.replace()")}} {{experimental_inline}}
+
Remplace ce ChildNode dans la liste des enfants de son parent avec un jeu d'objets {{domxref("Node")}} ou {{domxref("DOMString")}}. Les objets {{domxref("DOMString")}} sont insérés comme équivalent des noeuds {{domxref("Text")}}.
+
+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + +
SpécificationsStatutCommentaire
{{SpecName('DOM WHATWG', '#interface-childnode', 'ChildNode')}}{{Spec2('DOM WHATWG')}}Sépare l'interface ElementTraversal dans {{domxref("ParentNode")}} et ChildNode. Les previousElementSibling et nextElementSibling sont maintenant définis  sur ce dernier.
+ Les {{domxref("CharacterData")}} et {{domxref("DocumentType")}} implémentent les nouvelles interfaces.
+ Ajoute les méthodes remove(), before(), after() et replace().
{{SpecName('Element Traversal', '#interface-elementTraversal', 'ElementTraversal')}}{{Spec2('Element Traversal')}}Ajoute la définition initiale de ses propriétés à l'interface pure ElementTraversal et l'utilise sur un {{domxref("Element")}}.
+ +

Polyfill

+ +

Externe sur github : childNode.js

+ +

Compatibilité des navigateurs

+ +

{{Compat("api.ChildNode")}}

+ +

Voir aussi

+ + diff --git a/files/fr/orphaned/web/css/paint()/index.html b/files/fr/orphaned/web/css/paint()/index.html new file mode 100644 index 0000000000..3a0b12a478 --- /dev/null +++ b/files/fr/orphaned/web/css/paint()/index.html @@ -0,0 +1,110 @@ +--- +title: paint() +slug: orphaned/Web/CSS/paint() +tags: + - CSS + - Fonction + - Houdini + - Reference + - Web +translation_of: Web/CSS/paint() +original_slug: Web/CSS/paint() +--- +
{{CSSRef}}{{SeeCompatTable}}
+ +

La fonction CSS paint() définit une {{cssxref("<image>")}} dont la valeur est générée par un PaintWorklet.

+ +

Syntaxe

+ +
paint(workletName, parameters)
+ +

Paramètres

+ +
+
workletName
+
Le nom du worklet enregistré.
+
parameters
+
Des paramètres supplémentaires optionnels, passés aux paintWorklet.
+
+ +

Exemples

+ +

Il est possible de passer des arguments supplémentaires grâce à la fonction CSS paint(). Dans cet exemple, on passe deux arguments : le premier indiquant si l'arrière-plan est rempli ou si on utilise juste son contour et le second indiquant la largeur de ce contour :

+ + + + + +
li {
+   --boxColor: hsla(55, 90%, 60%, 1.0);
+   background-image: paint(hollowHighlights, stroke, 2px);
+}
+
+li:nth-of-type(3n) {
+   --boxColor: hsla(155, 90%, 60%, 1.0);
+   background-image: paint(hollowHighlights, filled,  3px);
+}
+
+li:nth-of-type(3n+1) {
+   --boxColor: hsla(255, 90%, 60%, 1.0);
+   background-image: paint(hollowHighlights, stroke, 1px);
+}
+ +

On a ici ajouté une propriété personnalisée dans le sélecteur du bloc. Ces propriétés personnalisées peuvent être manipulées par le PaintWorklet.

+ +

{{EmbedLiveSample("Examples", 300, 300)}}

+ +

Spécifications

+ + + + + + + + + + + + + + + + +
SpécificationÉtatCommentaires
{{SpecName('CSS Painting API', '#paint-notation', 'Paint Notation')}}{{Spec2('CSS Painting API')}}Définition initiale.
+ +

Compatibilité des navigateurs

+ +

{{Compat("css.types.image.paint")}}

+ +

Voir aussi

+ + diff --git a/files/fr/orphaned/web/css/transform-function/translatex/index.html b/files/fr/orphaned/web/css/transform-function/translatex/index.html new file mode 100644 index 0000000000..e39190808d --- /dev/null +++ b/files/fr/orphaned/web/css/transform-function/translatex/index.html @@ -0,0 +1,110 @@ +--- +title: translateX() +slug: orphaned/Web/CSS/transform-function/translateX +tags: + - CSS + - Fonction + - Reference + - Transformations CSS +translation_of: Web/CSS/transform-function/translateX +original_slug: Web/CSS/transform-function/translateX +--- +
{{CSSRef}}
+ +

La fonction translateX() permet de déplacer un élément horizontalement. Cette transformation est caractérisée par une longueur (type {{cssxref("<length>")}}) qui définit l'amplitude du mouvement horizontal. La valeur obtenue par cette fonction est de type {{cssxref("<transform-function>")}}.

+ +

+ +

translateX(tx) est une notation raccourcie équivalente à translate(tx, 0).

+ +

Syntaxe

+ +
translateX(t)
+
+ +

Valeurs

+ +
+
t
+
Une valeur de type {{cssxref("<length>")}} qui représente l'abscisse (la coordonnée en X) du vecteur de translation.
+
+ + + + + + + + + + + + + + + + + + + + + +
Coordonnées cartésiennes sur ℝ2Coordonnées homogènes sur ℝℙ2Coordonnées cartésiennes sur ℝ3Coordonnées homogènes sur ℝℙ3
+

Une translation n'est pas une transformation linéaire sur ℝ2 et on ne peut donc pas la représenter en utilisant une matrice exprimée dans le système cartésien.

+
10t010001 10t010001 100t010000100001
[1 0 0 1 t 0]
+ +

Exemples

+ +

HTML

+ +
<p>toto</p>
+<p class="transformation">truc</p>
+<p>toto</p>
+ +

CSS

+ +
p {
+  width: 50px;
+  height: 50px;
+  background-color: teal;
+}
+
+.transformation {
+  transform: translateX(10px);
+  background-color: blue;
+}
+
+ +

Résultat

+ +

{{EmbedLiveSample("Exemples","100%","250")}}

+ +

Spécifications

+ + + + + + + + + + + + + + + + +
SpécificationÉtatCommentaires
{{SpecName("CSS3 Transforms", "#funcdef-transform-translatex", "translateX()")}}{{Spec2("CSS3 Transforms")}}Définition initiale.
+ +

Compatibilité des navigateurs

+ +

Voir la page sur le type de donnée <transform-function> pour les informations de compatibilité associées.

+ +

Voir aussi

+ + -- cgit v1.2.3-54-g00ecf