From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../caretpositionfrompoint/index.html | 103 +++++++++++++++++++++ .../elementsfrompoint/index.html | 102 ++++++++++++++++++++ .../fullscreenelement/index.html | 81 ++++++++++++++++ .../documentorshadowroot/getselection/index.html | 87 +++++++++++++++++ files/ja/web/api/documentorshadowroot/index.html | 78 ++++++++++++++++ .../mselementsfromrect/index.html | 54 +++++++++++ .../documentorshadowroot/nodefrompoint/index.html | 78 ++++++++++++++++ .../documentorshadowroot/nodesfrompoint/index.html | 82 ++++++++++++++++ .../pointerlockelement/index.html | 60 ++++++++++++ .../documentorshadowroot/stylesheets/index.html | 61 ++++++++++++ 10 files changed, 786 insertions(+) create mode 100644 files/ja/web/api/documentorshadowroot/caretpositionfrompoint/index.html create mode 100644 files/ja/web/api/documentorshadowroot/elementsfrompoint/index.html create mode 100644 files/ja/web/api/documentorshadowroot/fullscreenelement/index.html create mode 100644 files/ja/web/api/documentorshadowroot/getselection/index.html create mode 100644 files/ja/web/api/documentorshadowroot/index.html create mode 100644 files/ja/web/api/documentorshadowroot/mselementsfromrect/index.html create mode 100644 files/ja/web/api/documentorshadowroot/nodefrompoint/index.html create mode 100644 files/ja/web/api/documentorshadowroot/nodesfrompoint/index.html create mode 100644 files/ja/web/api/documentorshadowroot/pointerlockelement/index.html create mode 100644 files/ja/web/api/documentorshadowroot/stylesheets/index.html (limited to 'files/ja/web/api/documentorshadowroot') diff --git a/files/ja/web/api/documentorshadowroot/caretpositionfrompoint/index.html b/files/ja/web/api/documentorshadowroot/caretpositionfrompoint/index.html new file mode 100644 index 0000000000..57168e3eea --- /dev/null +++ b/files/ja/web/api/documentorshadowroot/caretpositionfrompoint/index.html @@ -0,0 +1,103 @@ +--- +title: DocumentOrShadowRoot.caretPositionFromPoint() +slug: Web/API/DocumentOrShadowRoot/caretPositionFromPoint +tags: + - API + - Document + - DocumentOrShadowRoot + - Method + - Reference + - ShadowRoot + - caretPositionFromPoint() +translation_of: Web/API/DocumentOrShadowRoot/caretPositionFromPoint +--- +

{{APIRef("CSSOM View")}}{{SeeCompatTable}}

+ +

{{domxref("DocumentOrShadowRoot")}} インターフェイスの caretPositionFromPoint() プロパティは、 DOM ノードを含む {{domxref('CaretPosition')}} オブジェクトを、そのノード内のキャレットとキャレットの文字オフセットと共に返します。

+ +

構文

+ +
var caretPosition = document.caretPositionFromPoint(float x, float y);
+ +

パラメータ

+ +
+
x
+
ポイントの水平座標。
+
y
+
ポイントの垂直座標。
+
+ +

返り値

+ +

{{domxref('CaretPosition')}} オブジェクト。

+ +

+ +

この例では、クリックした場所に改行を挿入します。そのコードはデモの下にあります。

+ +

Demo

+ +

{{EmbedLiveSample('Example', '100%', '300px')}}

+ +

HTML Content

+ +
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
+sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
+sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
+Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
+ +

JavaScript Content

+ +
function insertBreakAtPoint(e) {
+  var range;
+  var textNode;
+  var offset;
+
+  if (document.caretPositionFromPoint) {
+    range = document.caretPositionFromPoint(e.clientX, e.clientY);
+    textNode = range.offsetNode;
+    offset = range.offset;
+  } else if (document.caretRangeFromPoint) {
+    range = document.caretRangeFromPoint(e.clientX, e.clientY);
+    textNode = range.startContainer;
+    offset = range.startOffset;
+  }
+
+  // only split TEXT_NODEs
+  if (textNode.nodeType == 3) {
+    var replacement = textNode.splitText(offset);
+    var br = document.createElement('br');
+    textNode.parentNode.insertBefore(br, replacement);
+  }
+}
+
+window.onload = function (){
+  var paragraphs = document.getElementsByTagName("p");
+  for (i=0 ; i < paragraphs.length; i++) {
+    paragraphs[i].addEventListener("click", insertBreakAtPoint, false);
+  }
+};
+ +

仕様

+ + + + + + + + + + + + + + +
仕様ステータス備考
{{SpecName('CSSOM View','#dom-document-caretpositionfrompoint','caretPositionFromPoint()')}}{{Spec2('CSSOM View')}}Initial definition.
+ +

ブラウザー実装状況

+ + + +

{{Compat("api.DocumentOrShadowRoot.caretPositionFromPoint")}}

diff --git a/files/ja/web/api/documentorshadowroot/elementsfrompoint/index.html b/files/ja/web/api/documentorshadowroot/elementsfrompoint/index.html new file mode 100644 index 0000000000..a5337f576f --- /dev/null +++ b/files/ja/web/api/documentorshadowroot/elementsfrompoint/index.html @@ -0,0 +1,102 @@ +--- +title: DocumentOrShadowRoot.elementsFromPoint() +slug: Web/API/DocumentOrShadowRoot/elementsFromPoint +tags: + - API + - Document + - DocumentOrShadowRoot + - Method + - Reference + - ShadowRoot + - elementsFromPoint + - elementsFromPoint() + - shadow dom + - メソッド +translation_of: Web/API/DocumentOrShadowRoot/elementsFromPoint +--- +
{{APIRef("DOM")}}{{SeeCompatTable}}
+ +

elementsFromPoint() は {{domxref("DocumentOrShadowRoot")}} インターフェイスのメソッドで、指定された座標 (ビューポートからの相対) にあるすべての要素の配列を返します。

+ +

これは {{domxref("DocumentOrShadowRoot.elementFromPoint", "elementFromPoint()")}} メソッドと同じような方法で動作します。

+ +

構文

+ +
const elements = document.elementsFromPoint(x, y);
+ +

引数

+ +
+
x
+
点の水平座標です。
+
y
+
点の垂直座標です。
+
+ +

返値

+ +

{{domxref("Element")}} オブジェクトの配列です。

+ +

+ +

HTML

+ +
<div>
+  <p>Some text</p>
+</div>
+<p>Elements at point 30, 20:</p>
+<div id="output"></div>
+
+ +

JavaScript

+ +
let output = document.getElementById("output");
+if (document.elementsFromPoint) {
+  let elements = document.elementsFromPoint(30, 20);
+  for (var i = 0; i < elements.length; i++) {
+    output.textContent += elements[i].localName;
+    if (i < elements.length - 1) {
+      output.textContent += " < ";
+    }
+  }
+} else {
+  output.innerHTML = "<span style=\"color: red;\">" +
+     "Browser does not support <code>document.elementsFromPoint()</code>" +
+     "</span>";
+}
+ +

{{EmbedLiveSample('Example', '420', '120')}}

+ +

仕様書

+ + + + + + + + + + + + + + + + + + +
仕様書状態
{{SpecName('Shadow DOM','#dom-documentorshadowroot-elementsfrompoint','elementsFromPoint()')}}{{Spec2('Shadow DOM')}}
{{SpecName('CSSOM View', '#dom-document-elementsfrompoint', 'elementsFromPoint()')}}{{Spec2('CSSOM View')}}
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.DocumentOrShadowRoot.elementsFromPoint")}}

+ +

関連情報

+ + diff --git a/files/ja/web/api/documentorshadowroot/fullscreenelement/index.html b/files/ja/web/api/documentorshadowroot/fullscreenelement/index.html new file mode 100644 index 0000000000..2c75a57840 --- /dev/null +++ b/files/ja/web/api/documentorshadowroot/fullscreenelement/index.html @@ -0,0 +1,81 @@ +--- +title: DocumentOrShadowRoot.fullscreenElement +slug: Web/API/DocumentOrShadowRoot/fullscreenElement +tags: + - API + - Document + - DocumentOrShadowRoot + - Full-screen + - Fullscreen API + - Graphics + - Property + - Read-only + - Reference + - ShadowRoot + - fullscreenElement + - screen + - グラフィック + - 全画面 + - 読み取り専用 +translation_of: Web/API/DocumentOrShadowRoot/fullscreenElement +--- +
{{ApiRef("Fullscreen API")}}
+ +

DocumentOrShadowRoot.fullscreenElement プロパティは読み取り専用で、この文書内で現在全画面モードで表示されている {{ domxref("Element") }} を返し、全画面モードを使用していない場合は null を返します。

+ +

このプロパティは読み取り専用ですが、変更されても (strict モードでも) 例外は発生しません。設定しても何もせず、無視されます。

+ +

構文

+ +
var element = document.fullscreenElement;
+ +

返値

+ +

現在全画面モードになっている {{domxref("Element")}} オブジェクト。全画面モードがこの document で使用されていない場合、返値は null です。

+ +

+ +

この例は isVideoInFullscreen() 関数を表し、 fullscreenElement からの返値を調べています。文書が全画面モードで (fullscreenElementnull ではなく)、全画面の要素の {{domxref("Node.nodeName", "nodeName")}} が VIDEO、すなわち {{HTMLElement("video")}} 要素を表す場合、この関数は true、すなわち動画が全画面モードであることを表します。

+ +
function isVideoInFullscreen() {
+  if (document.fullscreenElement && document.fullscreenElement.nodeName == 'VIDEO') {
+    return true;
+  }
+  return false;
+}
+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName("Fullscreen", "#dom-document-fullscreenelement", "Document.fullscreenElement")}}{{Spec2("Fullscreen")}}初回定義
+ +

ブラウザーの対応

+ + + +

{{Compat("api.DocumentOrShadowRoot.fullscreenElement")}}

+ +

関連情報

+ + diff --git a/files/ja/web/api/documentorshadowroot/getselection/index.html b/files/ja/web/api/documentorshadowroot/getselection/index.html new file mode 100644 index 0000000000..e201ed0675 --- /dev/null +++ b/files/ja/web/api/documentorshadowroot/getselection/index.html @@ -0,0 +1,87 @@ +--- +title: DocumentOrShadowRoot.getSelection() +slug: Web/API/DocumentOrShadowRoot/getSelection +tags: + - API + - DocumentOrShadowRoot + - Doument + - Method + - Reference + - ShadowRoot + - getSelection + - getSelection() + - shadow dom +translation_of: Web/API/DocumentOrShadowRoot/getSelection +--- +
{{APIRef("DOM")}}{{SeeCompatTable}}
+ +

getSelection() は {{DOMxRef("DocumentOrShadowRoot")}} インターフェイスのプロパティで、ユーザーが選択したテキストの範囲、またはキャレットの現在位置を表す {{DOMxRef("Selection")}} オブジェクトを返します。

+ +

構文

+ +
var selection = documentOrShadowRootInstance.getSelection()
+ +

引数

+ +

なし。

+ +

返値

+ +

{{DOMxRef("Selection")}} オブジェクト。

+ +

+ +
function foo() {
+    var selObj = document.getSelection();
+    alert(selObj);
+    var selRange = selObj.getRangeAt(0);
+    // do stuff with the range
+}
+ +

メモ

+ +

Selection オブジェクトの文字列表現

+ +

JavaScript では、オブジェクトが string を取る関数 ({{DOMxRef("Window.alert()")}} など) に渡された場合、オブジェクトの {{JSxRef("Object.toString", "toString()")}} メソッドが呼び出され、関数にその返値が渡されます。これにより、プロパティやメソッドを持つ実際のオブジェクトであった場合、他の関数に使われると文字列になって現れることがあります。

+ +

上記の例では、 selObj.toString() が呼び出されてから {{DOMxRef("Window.alert()")}} に渡されます。しかし、 JavaScript の String のプロパティやメソッド、例えば lengthsubstr が {{DOMxRef("Selection")}} オブジェクトに対して呼び出されると、そのプロパティやメソッドを持っていないため、エラーが発生するか予期しない結果が返ることがあります。 Selection オブジェクトを文字列として扱うには、 toString() メソッドを直接呼び出してください。

+ +
var selectedText = selObj.toString();
+ + + + + +

{{domxref("Window.getSelection()")}} を呼び出すと、 Document.getSelection() と同等の動作をします。

+ +

Firefox において現在は getSelection() は {{htmlelement("input")}} 要素の中では動作しないことに注意してください。 {{domxref("HTMLInputElement.setSelectionRange()")}}) を使用することで回避できます。

+ +

selectionfocus との違いにも注意してください。 {{domxref("Document.activeElement")}} はフォーカスを持つ要素を返します。

+ +

仕様書

+ + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName("Shadow DOM", "#extensions-to-the-documentorshadowroot-mixin", "DocumentOrShadowRoot")}}{{Spec2("Shadow DOM")}}初回定義
+ +

ブラウザーの互換性

+ +
+ + +

{{Compat("api.DocumentOrShadowRoot.getSelection")}}

+
diff --git a/files/ja/web/api/documentorshadowroot/index.html b/files/ja/web/api/documentorshadowroot/index.html new file mode 100644 index 0000000000..41a6afbfa8 --- /dev/null +++ b/files/ja/web/api/documentorshadowroot/index.html @@ -0,0 +1,78 @@ +--- +title: DocumentOrShadowRoot +slug: Web/API/DocumentOrShadowRoot +tags: + - API + - Document + - DocumentOrShadowRoot + - Reference + - ShadowRoot + - インターフェイス + - シャドウ DOM +translation_of: Web/API/DocumentOrShadowRoot +--- +
{{APIRef("Web Components")}}
+ +

DocumentOrShadowRootShadow DOM API のミックスインで、文書とシャドウルートで共有される API を提供します。以下の機能は {{DOMxRef("Document")}} と {{DOMxRef("ShadowRoot")}} の両方に含まれています。

+ +

プロパティ

+ +
+
{{DOMxRef("DocumentOrShadowRoot.activeElement")}}{{ReadOnlyInline}}
+
シャドウツリー内でフォーカスを持っている {{DOMxRef('Element')}} を返します。
+
{{DOMxRef("DocumentOrShadowRoot.fullscreenElement")}}{{ReadOnlyInline}}
+
この文書で現在全画面モードになっている {{DOMxRef('Element')}} を返します。
+
{{DOMxRef("DocumentOrShadowRoot.pointerLockElement")}} {{Experimental_Inline}}{{ReadOnlyInline}}
+
ポインターがロックされている間、マウスイベントのターゲットとして設定された要素を返します。ロック待ちの場合、ポインターがロックされていない場合、ターゲットが別な文書である場合は null を返します。
+
{{DOMxRef("DocumentOrShadowRoot.styleSheets")}}{{ReadOnlyInline}}
+
文書に明示的にリンクされているか、埋め込まれているスタイルシートの {{DOMxRef('CSSStyleSheet')}} オブジェクトの {{DOMxRef('StyleSheetList')}} を返します。
+
+ +

メソッド

+ +
+
{{DOMxRef("DocumentOrShadowRoot.caretPositionFromPoint()")}}
+
キャレットを含んでいる DOM ノードと、そのノード内におけるキャレットの文字のオフセットを含む {{DOMxRef('CaretPosition')}} オブジェクトを返します。
+
{{DOMxRef("DocumentOrShadowRoot.elementFromPoint()")}}
+
指定された座標にある最上位の要素を返します。
+
{{DOMxRef("DocumentOrShadowRoot.elementsFromPoint()")}}
+
指定された座標にあるすべての要素の配列を返します。
+
{{DOMxRef("DocumentOrShadowRoot.getSelection()")}}
+
ユーザーによって選択されているテキストの範囲、またはキャレットの現在の位置を表す {{DOMxRef('Selection')}} オブジェクトを返します。
+
{{DOMxRef("DocumentOrShadowRoot.nodeFromPoint()")}} {{non-standard_inline}}
+
指定された座標にある最上位のノードを返します。
+
{{DOMxRef("DocumentOrShadowRoot.nodesFromPoint()")}} {{non-standard_inline}}
+
指定された座標にあるすべてのノードの配列を返します。
+
+ +

仕様書

+ + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('Shadow DOM','#extensions-to-the-documentorshadowroot-mixin','DocumentOrShadowRoot')}}{{Spec2('Shadow DOM')}}Shadow DOM で実装。
{{SpecName('DOM WHATWG','#mixin-documentorshadowroot','DocumentOrShadowRoot')}}{{Spec2('DOM WHATWG')}}初回定義
+ +

ブラウザーの対応

+ + + +

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

+ +

[1] このインターフェイスの機能は {{DOMxRef("Document")}} オブジェクトにも実装されています。

diff --git a/files/ja/web/api/documentorshadowroot/mselementsfromrect/index.html b/files/ja/web/api/documentorshadowroot/mselementsfromrect/index.html new file mode 100644 index 0000000000..57d9c2b7b7 --- /dev/null +++ b/files/ja/web/api/documentorshadowroot/mselementsfromrect/index.html @@ -0,0 +1,54 @@ +--- +title: DocumentOrShadowRoot.msElementsFromRect() +slug: Web/API/DocumentOrShadowRoot/msElementsFromRect +tags: + - API + - 'API:Microsoft Extensions' + - Method + - Non-standard + - Reference + - msElementsFromRect +translation_of: Web/API/DocumentOrShadowRoot/msElementsFromRect +--- +
{{APIRef("Microsoft Extensions")}}{{Non-standard_Header}}
+ +

msElementsFromRect メソッドは、left、 top、 width、 heighで定義された四角形の下にある要素のノードリストを返します。

+ +

この独自プロパティは Internet Explorer と Microsoft Edge に固有のものです。

+ +

構文

+ +
object.msElementsFromRect(left, top, width, height, retVal)
+
+ +

パラメータ

+ +
+
left [in]
+
型: 浮動小数点
+
top[in]
+
型: 浮動小数点
+
width[in]
+
型: 浮動小数点
+
height [in]
+
型: 浮動小数点
+
retVal [out, reval]
+
型: ノードリスト
+
+ +

+ +

特定のポイントの下にある全ての要素を検索するには、 msElementsFromPoint(x, y) を使用します。長方形を交差する全ての要素を見つけるには、 msElementsFromRect(top, left, width, height) を使用します。

+ +
var nodeList = document.msElementsFromRect(x,y,width,height)
+var nodeList = document.msElementsFromPoint(x,y)
+
+ +

返された nodeList には z-index でソートされているため、要素の相対的なスタック順序を確認できます。

+ +

関連項目

+ + diff --git a/files/ja/web/api/documentorshadowroot/nodefrompoint/index.html b/files/ja/web/api/documentorshadowroot/nodefrompoint/index.html new file mode 100644 index 0000000000..6b375f30d3 --- /dev/null +++ b/files/ja/web/api/documentorshadowroot/nodefrompoint/index.html @@ -0,0 +1,78 @@ +--- +title: DocumentOrShadowRoot.nodeFromPoint() +slug: Web/API/DocumentOrShadowRoot/nodeFromPoint +tags: + - API + - DocumentOrShadowRoot + - Method + - Non-standard + - Reference + - nodeFromPoint + - メソッド + - 標準外 +translation_of: Web/API/DocumentOrShadowRoot +--- +
{{APIRef("DOM")}}{{Non-standard_header}}
+ +

{{domxref("DocumentOrShadowRoot")}} インターフェイスの nodeFromPoint() プロパティは、 (ビューポートからの相対で) 指定された座標にある最上位のノードを返します。

+ +

現在のところ、このメソッドは Firefox でしか実装されておらず、クロムコードでのみ利用できます。

+ +

構文

+ +
var node = document.nodeFromPoint(x, y);
+ +

引数

+ +
+
x
+
点の水平座標を表す倍精度浮動小数値。
+
y
+
点の垂直座標を表す倍精度浮動小数値。
+
+ +

返値

+ +

{{domxref('Node')}} オブジェクト。

+ +

+ +

HTML Content

+ +
<div>
+  <p>Some text</p>
+</div>
+<p>Top node at point 30, 20:</p>
+<div id="output"></div>
+
+ +

JavaScript Content

+ +
var output = document.getElementById("output");
+if (document.nodeFromPoint) {
+  var node = document.nodeFromPoint(30, 20);
+    output.textContent += node.localName;
+} else {
+  output.innerHTML = "<span style=\"color: red;\">" +
+     "Browser does not support <code>document.nodeFromPoint()</code>" +
+     "</span>";
+}
+ +

{{EmbedLiveSample('Example', '420', '120')}}

+ +

仕様書

+ +

現在はどの仕様書にも含まれていません。

+ +

ブラウザーの対応

+ + + +

{{Compat("api.DocumentOrShadowRoot.nodeFromPoint")}}

+ +

関連情報

+ + diff --git a/files/ja/web/api/documentorshadowroot/nodesfrompoint/index.html b/files/ja/web/api/documentorshadowroot/nodesfrompoint/index.html new file mode 100644 index 0000000000..7c5c0920cd --- /dev/null +++ b/files/ja/web/api/documentorshadowroot/nodesfrompoint/index.html @@ -0,0 +1,82 @@ +--- +title: DocumentOrShadowRoot.nodesFromPoint() +slug: Web/API/DocumentOrShadowRoot/nodesFromPoint +tags: + - API + - DocumentOrShadowRoot + - Method + - Non-standard + - Reference + - nodesFromPoint + - メソッド +translation_of: Web/API/DocumentOrShadowRoot +--- +
{{APIRef("DOM")}}{{Non-standard_header}}
+ +

{{domxref("DocumentOrShadowRoot")}} インターフェイスの nodesFromPoint() プロパティは、 (ビューポートからの相対で) 指定された座標のすべてのノードの配列を返します。

+ +

現在のところ、このメソッドは Firefox でしか実装されておらず、クロムコードでのみ利用できます。

+ +

構文

+ +
var nodes = document.nodesFromPoint(x, y);
+ +

引数

+ +
+
x
+
点の水平座標。
+
y
+
点の垂直座標。
+
+ +

返値

+ +

{{domxref('Node')}} オブジェクトの配列。

+ +

+ +

HTML コンテンツ

+ +
<div>
+  <p>Some text</p>
+</div>
+<p>Nodes at point 30, 20:</p>
+<div id="output"></div>
+
+ +

JavaScript コンテンツ

+ +
var output = document.getElementById("output");
+if (document.nodesFromPoint) {
+  var nodes = document.nodesFromPoint(30, 20);
+  for(var i = 0; i < nodes.length; i++) {
+    output.textContent += nodes[i].localName;
+    if (i < nodes.length - 1) {
+      output.textContent += " < ";
+    }
+  }
+} else {
+  output.innerHTML = "<span style=\"color: red;\">" +
+     "Browser does not support <code>document.nodesFromPoint()</code>" +
+     "</span>";
+}
+ +

{{EmbedLiveSample('Example', '420', '120')}}

+ +

仕様書

+ +

現在はどの仕様書にも含まれていません。

+ +

ブラウザーの対応

+ + + +

{{Compat("api.DocumentOrShadowRoot.nodesFromPoint")}}

+ +

関連情報

+ + diff --git a/files/ja/web/api/documentorshadowroot/pointerlockelement/index.html b/files/ja/web/api/documentorshadowroot/pointerlockelement/index.html new file mode 100644 index 0000000000..5806f9344e --- /dev/null +++ b/files/ja/web/api/documentorshadowroot/pointerlockelement/index.html @@ -0,0 +1,60 @@ +--- +title: DocumentOrShadowRoot.pointerLockElement +slug: Web/API/DocumentOrShadowRoot/pointerLockElement +tags: + - API + - DOM + - Document + - Property + - Reference + - ShadowRoot + - mouse lock + - プロパティ + - マウスロック +translation_of: Web/API/DocumentOrShadowRoot/pointerLockElement +--- +
{{APIRef("DOM")}}
+ +

pointerLockElement は {{domxref("Document")}} および {{domxref("ShadowRoot")}} インターフェイスのプロパティで、要素をポインターがロックされている間のマウスイベントの対象として設定します。ロック待ち状態の場合、ポインターがロックされていない場合、対象が他の文書にある場合は null になります。

+ +

構文

+ +
var element = document.pointerLockElement;
+
+ +

返値

+ +

{{domxref("Element")}} または null

+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('Pointer Lock','#extensions-to-the-documentorshadowroot-mixin','pointerLockElement')}}{{Spec2('Pointer Lock')}}Document インターフェイスを拡張
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.DocumentOrShadowRoot.pointerLockElement")}}

+ +

関連情報

+ + diff --git a/files/ja/web/api/documentorshadowroot/stylesheets/index.html b/files/ja/web/api/documentorshadowroot/stylesheets/index.html new file mode 100644 index 0000000000..48a1e7a169 --- /dev/null +++ b/files/ja/web/api/documentorshadowroot/stylesheets/index.html @@ -0,0 +1,61 @@ +--- +title: DocumentOrShadowRoot.styleSheets +slug: Web/API/DocumentOrShadowRoot/styleSheets +tags: + - API + - Document + - DocumentOrShadowRoot + - Property + - Reference + - ShadowRoot + - Stylesheets + - shadow dom +translation_of: Web/API/DocumentOrShadowRoot/styleSheets +--- +
{{SeeCompatTable}}{{APIRef("Shadow DOM")}}
+ +

{{domxref("DocumentOrShadowRoot")}} インターフェイスの styleSheets 読み取り専用プロパティは、 {{domxref('CSSStyleSheet')}} オブジェクトの {{domxref('StyleSheetList')}} を返します。ドキュメントに明示的にリンクまたは埋め込まれたスタイルシートの場合。

+ +

+ +
function getStyleSheet(unique_title) {
+  for (var i=0; i<document.styleSheets.length; i++) {
+    var sheet = document.styleSheets[i];
+    if (sheet.title == unique_title) {
+      return sheet;
+    }
+  }
+}
+
+ +

Notes

+ +

返されるリストは次の順序で並べられます:

+ + + +

仕様

+ + + + + + + + + + + + + + +
仕様ステータス備考
{{SpecName('Shadow DOM','#extensions-to-the-documentorshadowroot-mixin','DocumentOrShadowRoot')}}{{Spec2('Shadow DOM')}}初回定義
+ +

ブラウザー実装状況

+ + + +

{{Compat("api.DocumentOrShadowRoot.styleSheets")}}

-- cgit v1.2.3-54-g00ecf