From 6358ba3c266b0b1e7dd8efd4b70e1cea838b578c Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Fri, 4 Mar 2022 02:10:01 +0900 Subject: 2022/02/18 時点の英語版に基づき新規翻訳 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/stylepropertymapreadonly/values/index.md | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 files/ja/web/api/stylepropertymapreadonly/values/index.md diff --git a/files/ja/web/api/stylepropertymapreadonly/values/index.md b/files/ja/web/api/stylepropertymapreadonly/values/index.md new file mode 100644 index 0000000000..a794db9dd5 --- /dev/null +++ b/files/ja/web/api/stylepropertymapreadonly/values/index.md @@ -0,0 +1,56 @@ +--- +title: StylePropertyMapReadOnly.values() +slug: Web/API/StylePropertyMapReadOnly/values +tags: + - API + - CSS Typed Object Model API + - 実験的 + - Houdini + - メソッド + - リファレンス + - StylePropertyMapReadOnly + - values() +browser-compat: api.StylePropertyMapReadOnly.values +translation_of: Web/API/StylePropertyMapReadOnly/values +--- +{{APIRef("CSS Typed Object Model API")}}{{SeeCompatTable}} + +**`StylePropertyMapReadOnly.values()`** メソッドは、 `StylePropertyMapReadOnly` オブジェクトのそれぞれのインデックスに対応する値を含む新しい*配列反復子*を返します。 + +## 構文 + +```js +StylePropertyMapReadOnly.values() +``` + +### 引数 + +なし。 + +### 返値 + +新しい {{jsxref("Array")}} です。 + +## 例 + +この例では、 `values()` メソッドを使用して [`Element.computedStyleMap()`](/ja/docs/Web/API/Element/computedStyleMap) の中にある値にアクセスすることができます。 + +```js +// button 要素を取得 +const buttonEl = document.querySelector('button'); + +// すべての計算済みスタイルを `computedStyleMap` で受け取る +const allComputedStyles = buttonEl.computedStyleMap(); + +// values は CSS 値の反復可能なリストを返す +const vals = allComputedStyles.values(); +console.log(vals.next().value); // CSSStyleValue を返す +``` + +## 仕様書 + +{{Specifications}} + +## ブラウザーの互換性 + +{{Compat}} -- cgit v1.2.3-54-g00ecf