diff options
| author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
|---|---|---|
| committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
| commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
| tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/api/performancepainttiming | |
| parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
| download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip | |
initial commit
Diffstat (limited to 'files/ja/web/api/performancepainttiming')
| -rw-r--r-- | files/ja/web/api/performancepainttiming/index.html | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/files/ja/web/api/performancepainttiming/index.html b/files/ja/web/api/performancepainttiming/index.html new file mode 100644 index 0000000000..e9713a4468 --- /dev/null +++ b/files/ja/web/api/performancepainttiming/index.html @@ -0,0 +1,81 @@ +--- +title: PerformancePaintTiming +slug: Web/API/PerformancePaintTiming +tags: + - API + - PerformancePaintTiming + - Web パフォーマンス + - インターフェイス + - パフォーマンスタイムライン API + - ペイントタイミング + - リファレンス +translation_of: Web/API/PerformancePaintTiming +--- +<p>{{SeeCompatTable}}{{APIRef("Performance Timeline API")}}</p> + +<p><a href="/en-US/docs/Web/API/Paint Timing">Paint Timing</a> の <strong><code>PerformancePaintTiming</code></strong> インタフェースは、Web ページ構築中の "paint" ("render" とも呼ばれる) 操作に関するタイミング情報を提供します。「ペイント」とは、レンダリングツリーを画面上のピクセルに変換することです。</p> + +<p>アプリケーションは、"<code>paint</code>" {{domxref("PerformanceEntry","パフォーマンスエントリタイプ")}} に対して {{domxref("PerformanceObserver")}} を登録することができ、オブザーバーはペイントイベントが発生した時間を取得することができます。この情報を使用して、優れたユーザーエクスペリエンスを提供するのに時間がかかりすぎる領域を特定するのに役立ちます。</p> + +<p>{{InheritanceDiagram}}</p> + +<h2 id="プロパティ">プロパティ</h2> + +<p>このインタフェースにはプロパティはありませんが、次のようにプロパティを修飾および制約することで、次の {{domxref("PerformanceEntry")}} プロパティ ("<code>paint</code>"{{domxref ("PerformanceEntry.entryType","パフォーマンスエントリタイプ")}} 用) を拡張します。</p> + +<dl> + <dt>{{domxref("PerformanceEntry.entryType")}}</dt> + <dd>"<code>paint</code>" を返します。</dd> + <dt>{{domxref("PerformanceEntry.name")}}</dt> + <dd><code>"first-paint"</code> または <code>"first-contentful-paint"</code> を返します。</dd> + <dt>{{domxref("PerformanceEntry.startTime")}}</dt> + <dd>描画が行われたときに {{domxref("DOMHighResTimeStamp","タイムスタンプ")}} を返します。</dd> + <dt>{{domxref("PerformanceEntry.duration")}}</dt> + <dd>0 を返します。</dd> +</dl> + +<h2 id="メソッド">メソッド</h2> + +<p>このインターフェイスにはメソッドがありません。</p> + +<h2 id="例">例</h2> + +<pre class="brush: js">function showPaintTimings() { + if (window.performance) { + let performance = window.performance; + let performanceEntries = performance.getEntriesByType('paint'); + performanceEntries.forEach( (performanceEntry, i, entries) => { + console.log("The time to " + performanceEntry.name + " was " + performanceEntry.startTime + " milliseconds."); + }); + } else { + console.log('Performance timing isn\'t supported.'); + } +}</pre> + +<p>上記のコードは、次のようなコンソール出力を生成します。</p> + +<pre>The time to first-paint was 2785.915 milliseconds. +The time to first-contentful-paint was 2787.460 milliseconds.</pre> + +<h2 id="仕様">仕様</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">仕様書</th> + <th scope="col">ステータス</th> + <th scope="col">コメント</th> + </tr> + <tr> + <td>{{SpecName('Paint Timing','#sec-PerformancePaintTiming','PerformancePaintTiming')}}</td> + <td>{{Spec2('Paint Timing')}}</td> + <td>初期定義</td> + </tr> + </tbody> +</table> + +<h2 id="ブラウザの互換性">ブラウザの互換性</h2> + +<div class="hidden">このページの互換性テーブルは構造化データから生成されます。データに貢献したい場合は <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックして、プルリクエストを送ってください。</div> + +<p>{{Compat("api.PerformancePaintTiming")}}</p> |
