aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasahiro FUJIMOTO <mfujimot@gmail.com>2022-03-04 22:43:54 +0900
committerpotappo <potappo@gmail.com>2022-03-12 13:20:39 +0900
commit8b67957d078ae8b8e56f540ddcbd6e2f50585990 (patch)
treeef957aa5401982cd834fa3dbc9f20ababfe24fbf
parentba8d3f6f9d418e3b7fdfe79ccfb6e7a6ffb7f566 (diff)
downloadtranslated-content-8b67957d078ae8b8e56f540ddcbd6e2f50585990.tar.gz
translated-content-8b67957d078ae8b8e56f540ddcbd6e2f50585990.tar.bz2
translated-content-8b67957d078ae8b8e56f540ddcbd6e2f50585990.zip
2021/09/15 時点の英語版に基づき新規翻訳
-rw-r--r--files/ja/web/api/stylepropertymapreadonly/getall/index.md57
1 files changed, 57 insertions, 0 deletions
diff --git a/files/ja/web/api/stylepropertymapreadonly/getall/index.md b/files/ja/web/api/stylepropertymapreadonly/getall/index.md
new file mode 100644
index 0000000000..216e826ea2
--- /dev/null
+++ b/files/ja/web/api/stylepropertymapreadonly/getall/index.md
@@ -0,0 +1,57 @@
+---
+title: StylePropertyMapReadOnly.getAll()
+slug: Web/API/StylePropertyMapReadOnly/getAll
+tags:
+ - API
+ - CSS Typed Object Model API
+ - 実験的
+ - Houdini
+ - メソッド
+ - リファレンス
+ - StylePropertyMapReadOnly
+ - getAll()
+browser-compat: api.StylePropertyMapReadOnly.getAll
+translation_of: Web/API/StylePropertyMapReadOnly/getAll
+---
+{{APIRef("CSS Typed Object Model API")}}{{SeeCompatTable}}
+
+**`getAll()`** は {{domxref("StylePropertyMapReadOnly")}} インターフェイスのメソッドで、指定されたプロパティの値を含む {{domxref("CSSStyleValue")}} オブジェクトの配列を返します。
+
+## 構文
+
+```js
+var cssStyleValues[] = StylePropertyMapReadOnly.getAll(property)
+```
+
+### 引数
+
+- property
+ - : すべての値を取得するプロパティの名前です。
+
+### 返値
+
+{{domxref("CSSStyleValue")}} オブジェクトの配列です。
+
+## 例
+
+以下の例では、 `getAll()` を使用して {{cssxref('background-image')}} プロパティに対して使用しています。宣言されているそれぞれの背景画像の項目が入った {{jsxref('Array')}} を返します。
+
+```js
+// button 要素を取得
+const buttonEl = document.querySelector('button');
+
+// `computedStyleMap` ですべての計算済みスタイルが取得できます
+const allComputedStyles = buttonEl.computedStyleMap();
+
+// getAll() を background-image プロパティに対して使用
+const allBkImages = allComputedStyles.getAll('background-image');
+console.log(allBkImages); // それぞれの背景画像を項目とした配列を出力
+```
+
+## 仕様書
+
+{{Specifications}}
+
+## ブラウザーの互換性
+
+{{Compat}}