From 8d8aabed0956c3f50cb3ee9743966b1060d34d3a Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO <mfujimot@gmail.com> Date: Sat, 5 Mar 2022 12:47:35 +0900 Subject: 2021/09/15 時点の英語版に基づき新規翻訳 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/stylepropertymapreadonly/entries/index.md | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 files/ja/web/api/stylepropertymapreadonly/entries/index.md (limited to 'files') diff --git a/files/ja/web/api/stylepropertymapreadonly/entries/index.md b/files/ja/web/api/stylepropertymapreadonly/entries/index.md new file mode 100644 index 0000000000..2a6aaeb799 --- /dev/null +++ b/files/ja/web/api/stylepropertymapreadonly/entries/index.md @@ -0,0 +1,58 @@ +--- +title: StylePropertyMapReadOnly.entries() +slug: Web/API/StylePropertyMapReadOnly/entries +tags: + - API + - CSS 型付きオブジェクトモデル API + - 実験的 + - Houdini + - メソッド + - リファレンス + - StylePropertyMapReadOnly + - entries() +browser-compat: api.StylePropertyMapReadOnly.entries +translation_of: Web/API/StylePropertyMapReadOnly/entries +--- +{{APIRef("CSS Typed Object Model API")}}{{SeeCompatTable}} + +**`StylePropertyMapReadOnly.entries()`** メソッドは、このオブジェクトが持つ列挙可能なプロパティの `[key, value]` の組の配列を、 {{jsxref("Statements/for...in", "for...in")}} ループで提供されるのと同じ順序で返します(違いは for-in ループではプロトタイプチェーン内のプロパティも列挙する点です)。 + +## 構文 + +```js +StylePropertyMapReadOnly.entries() +``` + +### 引数 + +なし。 + +### 返値 + +この `StylePropertyMapReadOnly` オブジェクトが持つ列挙可能な `[key, value]` の組の配列です。 + +## 例 + +こちらは、 `StylePropertyMapReadOnly.entries()` メソッドを使用して要素の計算済みスタイルを取得する例です。 + +```js +// DOM 要素を取得 +const buttonEl = document.querySelector('button'); + +// `computedStyleMap` ですべての計算済みスタイルが取得できます +const allComputedStyles = buttonEl.computedStyleMap(); + +// entries は項目の反復可能オブジェクトを返します +const iterableStyles = allComputedStyles.entries(); + +// align-content を最初の項目、 CSSStyleValue を 2 番目の項目とする 2 項目の配列を返します。 +console.log(iterableStyles.next().value); +``` + +## 仕様書 + +{{Specifications}} + +## ブラウザーの互換性 + +{{Compat}} -- cgit v1.2.3-54-g00ecf