メインコンテンツへスキップ

frame要素


1.仕様

FRAME要素は、
単一フレームの
内容と外観を定義します。

FRAME - X EMPTY -- subwindow (Void elements.) [None] --

frame

サブウィンドウ (subwindow)

HTML4.01 Frameset で扱われた、HTML5 で廃止の要素です。
以下の説明では、HTML Living Standard での解釈を想定して記述しています。

種類
空要素

任意のコンテンツを持つことができない要素です。

カテゴリ

なし

使用できるコンテキスト
<frameset>要素に 0個以上

<frameset>要素に 0個以上を そのコンテンツとして、使用できます。

コンテンツモデル
何もない

要素のコンテンツモデルが「何もない」の場合、要素にはテキストノード (要素間の空白以外) と要素ノードが含まれていてはなりません。

タグの省略

終了タグはありません。

コンテンツ属性
グローバル属性 他
src属性
フレームコンテンツのソース
name属性
ターゲティングするフレームの名前
scrolling属性
フレーム ウィンドウのスクロール情報
frameborder属性
フレーム境界に関する情報
longdesc属性
長い説明へのリンク
noresize属性
ユーザーによるフレームのサイズの変更可否
marginheight属性
フレームのコンテンツの上部と下部の余白の間に残すスペースの量
marginwidth属性
フレームのコンテンツ間の左右の余白に残すスペースの量
DOM インターフェイス
HTMLFrameElement
  1. [Exposed=Window]
  2. interface HTMLFrameElement : HTMLElement {
  3. lastReviewed;
  4. [HTMLConstructor] constructor();
  5.  
  6. [CEReactions] attribute DOMString name;
  7. [CEReactions] attribute DOMString scrolling;
  8. [CEReactions] attribute USVString src;
  9. [CEReactions] attribute DOMString frameBorder;
  10. [CEReactions] attribute USVString longDesc;
  11. [CEReactions] attribute boolean noResize;
  12. readonly attribute Document? contentDocument;
  13. readonly attribute WindowProxy? contentWindow;
  14.  
  15. [CEReactions] attribute [LegacyNullToEmptyString] DOMString marginHeight;
  16. [CEReactions] attribute [LegacyNullToEmptyString] DOMString marginWidth;
  17. };
HTMLElement
  1. [Exposed=Window]
  2. interface HTMLElement : Element {
  3. [HTMLConstructor] constructor();
  4.  
  5. // metadata attributes
  6. [CEReactions] attribute DOMString title;
  7. [CEReactions] attribute DOMString lang;
  8. [CEReactions] attribute boolean translate;
  9. [CEReactions] attribute DOMString dir;
  10.  
  11. // user interaction
  12. [CEReactions] attribute (boolean or unrestricted double or DOMString)? hidden;
  13. [CEReactions] attribute DOMString inert;
  14. undefined click();
  15. [CEReactions] attribute DOMString accessKey;
  16. readonly attribute DOMString accessKeyLabel;
  17. [CEReactions] attribute boolean draggable;
  18. [CEReactions] attribute boolean spellcheck;
  19. [CEReactions] attribute DOMString writingSuggestions;
  20. [CEReactions] attribute DOMString autocapitalize;
  21.  
  22. [CEReactions] attribute [LegacyNullToEmptyString] DOMString innerText;
  23. [CEReactions] attribute [LegacyNullToEmptyString] DOMString outerText;
  24.  
  25. ElementInternals attachInternals();
  26.  
  27. // The popover API
  28. undefined showPopover();
  29. undefined hidePopover();
  30. boolean togglePopover(optional boolean force);
  31. [CEReactions] attribute DOMString? popover;
  32. };
  33.  
  34. HTMLElement includes GlobalEventHandlers;
  35. HTMLElement includes ElementContentEditable;
  36. HTMLElement includes HTMLOrSVGElement;
Element
  1. [Exposed=Window]
  2. interface Element : Node {
  3. readonly attribute DOMString? namespaceURI;
  4. readonly attribute DOMString? prefix;
  5. readonly attribute DOMString localName;
  6. readonly attribute DOMString tagName;
  7.  
  8. [CEReactions] attribute DOMString id;
  9. [CEReactions] attribute DOMString className;
  10. [SameObject, PutForwards=value] readonly attribute DOMTokenList classList;
  11. [CEReactions, Unscopable] attribute DOMString slot;
  12.  
  13. boolean hasAttributes();
  14. [SameObject] readonly attribute NamedNodeMap attributes;
  15. sequence<DOMString> getAttributeNames();
  16. DOMString? getAttribute(DOMString qualifiedName);
  17. DOMString? getAttributeNS(DOMString? namespace, DOMString localName);
  18. [CEReactions] undefined setAttribute(DOMString qualifiedName, DOMString value);
  19. [CEReactions] undefined setAttributeNS(DOMString? namespace, DOMString qualifiedName, DOMString value);
  20. [CEReactions] undefined removeAttribute(DOMString qualifiedName);
  21. [CEReactions] undefined removeAttributeNS(DOMString? namespace, DOMString localName);
  22. [CEReactions] boolean toggleAttribute(DOMString qualifiedName, optional boolean force);
  23. boolean hasAttribute(DOMString qualifiedName);
  24. boolean hasAttributeNS(DOMString? namespace, DOMString localName);
  25.  
  26. Attr? getAttributeNode(DOMString qualifiedName);
  27. Attr? getAttributeNodeNS(DOMString? namespace, DOMString localName);
  28. [CEReactions] Attr? setAttributeNode(Attr attr);
  29. [CEReactions] Attr? setAttributeNodeNS(Attr attr);
  30. [CEReactions] Attr removeAttributeNode(Attr attr);
  31.  
  32. ShadowRoot attachShadow(ShadowRootInit init);
  33. readonly attribute ShadowRoot? shadowRoot;
  34.  
  35. Element? closest(DOMString selectors);
  36. boolean matches(DOMString selectors);
  37. boolean webkitMatchesSelector(DOMString selectors); // legacy alias of .matches
  38.  
  39. HTMLCollection getElementsByTagName(DOMString qualifiedName);
  40. HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
  41. HTMLCollection getElementsByClassName(DOMString classNames);
  42.  
  43. [CEReactions] Element? insertAdjacentElement(DOMString where, Element element); // legacy
  44. undefined insertAdjacentText(DOMString where, DOMString data); // legacy
  45. };
GlobalEventHandlers
  1. interface mixin GlobalEventHandlers {
  2. attribute EventHandler onabort;
  3. attribute EventHandler onauxclick;
  4. attribute EventHandler onbeforeinput;
  5. attribute EventHandler onbeforematch;
  6. attribute EventHandler onbeforetoggle;
  7. attribute EventHandler onblur;
  8. attribute EventHandler oncancel;
  9. attribute EventHandler oncanplay;
  10. attribute EventHandler oncanplaythrough;
  11. attribute EventHandler onchange;
  12. attribute EventHandler onclick;
  13. attribute EventHandler onclose;
  14. attribute EventHandler oncontextlost;
  15. attribute EventHandler oncontextmenu;
  16. attribute EventHandler oncontextrestored;
  17. attribute EventHandler oncopy;
  18. attribute EventHandler oncuechange;
  19. attribute EventHandler oncut;
  20. attribute EventHandler ondblclick;
  21. attribute EventHandler ondrag;
  22. attribute EventHandler ondragend;
  23. attribute EventHandler ondragenter;
  24. attribute EventHandler ondragleave;
  25. attribute EventHandler ondragover;
  26. attribute EventHandler ondragstart;
  27. attribute EventHandler ondrop;
  28. attribute EventHandler ondurationchange;
  29. attribute EventHandler onemptied;
  30. attribute EventHandler onended;
  31. attribute OnErrorEventHandler onerror;
  32. attribute EventHandler onfocus;
  33. attribute EventHandler onformdata;
  34. attribute EventHandler oninput;
  35. attribute EventHandler oninvalid;
  36. attribute EventHandler onkeydown;
  37. attribute EventHandler onkeypress;
  38. attribute EventHandler onkeyup;
  39. attribute EventHandler onload;
  40. attribute EventHandler onloadeddata;
  41. attribute EventHandler onloadedmetadata;
  42. attribute EventHandler onloadstart;
  43. attribute EventHandler onmousedown;
  44. [LegacyLenientThis] attribute EventHandler onmouseenter;
  45. [LegacyLenientThis] attribute EventHandler onmouseleave;
  46. attribute EventHandler onmousemove;
  47. attribute EventHandler onmouseout;
  48. attribute EventHandler onmouseover;
  49. attribute EventHandler onmouseup;
  50. attribute EventHandler onpaste;
  51. attribute EventHandler onpause;
  52. attribute EventHandler onplay;
  53. attribute EventHandler onplaying;
  54. attribute EventHandler onprogress;
  55. attribute EventHandler onratechange;
  56. attribute EventHandler onreset;
  57. attribute EventHandler onresize;
  58. attribute EventHandler onscroll;
  59. attribute EventHandler onscrollend;
  60. attribute EventHandler onsecuritypolicyviolation;
  61. attribute EventHandler onseeked;
  62. attribute EventHandler onseeking;
  63. attribute EventHandler onselect;
  64. attribute EventHandler onslotchange;
  65. attribute EventHandler onstalled;
  66. attribute EventHandler onsubmit;
  67. attribute EventHandler onsuspend;
  68. attribute EventHandler ontimeupdate;
  69. attribute EventHandler ontoggle;
  70. attribute EventHandler onvolumechange;
  71. attribute EventHandler onwaiting;
  72. attribute EventHandler onwebkitanimationend;
  73. attribute EventHandler onwebkitanimationiteration;
  74. attribute EventHandler onwebkitanimationstart;
  75. attribute EventHandler onwebkittransitionend;
  76. attribute EventHandler onwheel;
  77. };
ElementContentEditable
  1. interface mixin ElementContentEditable {
  2. [CEReactions] attribute DOMString contentEditable;
  3. [CEReactions] attribute DOMString enterKeyHint;
  4. readonly attribute boolean isContentEditable;
  5. [CEReactions] attribute DOMString inputMode;
  6. };
HTMLOrSVGElement
  1. interface mixin HTMLOrSVGElement {
  2. [SameObject] readonly attribute DOMStringMap dataset;
  3. attribute DOMString nonce; // intentionally no [CEReactions]
  4.  
  5. [CEReactions] attribute boolean autofocus;
  6. [CEReactions] attribute long tabIndex;
  7. undefined focus(optional FocusOptions options = {});
  8. undefined blur();
  9. };
ARIA in HTML

この要素は、HTML5 では廃止された機能です。ARIA in HTML に、この要素の記述はありません。

レンダリング
置換要素
フレーム
  1. frame {
  2. display: block;
  3. }

CSS を大雑把に読むと、 この要素は、内容(コンテンツ)が CSSフォーマットモデルの範囲外の置換要素です。 ブロックレベルボックスを生成します。 などになります。

説明
frame要素は、一つのフレームの内容と外観を表します。

frame要素は、iframe要素と同様にナビゲート可能なコンテンツがありますが、frameset要素内でレンダリングされます。

HTML5 では廃止された要素です。<iframe>要素とスタイルシートを用いて代用できます。

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
  2. <html lang="ja">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <title>frame要素の例 - (Example of frame element) | 離珠のHTMLでしぃ!</title>
  6. <meta name="author" content="コータン (KOUTAN)">
  7. <link rel="icon" href="../favicon.ico" type="image/vnd.microsoft.icon">
  8. </head>
  9. <frameset cols="30%,*">
  10. <frame src="./exframe01.htm">
  11. <frameset rows="35%,*">
  12. <frame src="./exframe02.htm">
  13. <frame src="./exframe03.htm">
  14. </frameset>
  15. <noframes>
  16. <body>
  17. <h1>frame要素の例</h1>
  18. <p>この例の frame要素は、一つのフレームの内容と外観を表しています。</p>
  19. </body>
  20. </noframes>
  21. </frameset>
  22. </html>

このサンプルへのリンクです。
(./exframe.htm)

JSONデータ
JSON形式での、データのイメージです。
  1. {
  2. "frame": {
  3. "group": "Page",
  4. "element": "- X EMPTY -- subwindow (Void elements.) [None] --",
  5. "attlist": {
  6. "%Global;": "",
  7. "longdesc": "%URI; #IMPLIED -- link to long description (complements title) --",
  8. "name": "CDATA #IMPLIED -- name of frame for targetting --",
  9. "src": "%URI; #IMPLIED -- source of frame content --",
  10. "frameborder": "(1|0) 1 -- request frame borders? --",
  11. "marginwidth": "%Pixels; #IMPLIED -- margin widths in pixels --",
  12. "marginheight": "%Pixels; #IMPLIED -- margin height in pixels --",
  13. "noresize": "(noresize) #IMPLIED -- allow users to resize frames? --",
  14. "scrolling": "(yes|no|auto) auto -- scrollbar or none --",
  15. },
  16. "summary": "サブウィンドウ (subwindow)",
  17. "point": "一つのフレームの内容と外観を表します。",
  18. "description": "iframe要素と同様にナビゲート可能なコンテンツがありますが、frameset要素内でレンダリングされます。",
  19. "elementKind": "Void",
  20. "categories": "None",
  21. "canUsedContexts": "FRAMESET (FRAME)*",
  22. "contentModel": "%Nothing",
  23. "tagOmission": [
  24. "-",
  25. "X",
  26. ],
  27. "rendering": "Replacedframe",
  28. "domInterface": "HTMLFrameElement",
  29. "contentAttributes": {
  30. "src": "フレームコンテンツのソース",
  31. "name": "ターゲティングするフレームの名前",
  32. "scrolling": "フレーム ウィンドウのスクロール情報",
  33. "frameborder": "フレーム境界に関する情報",
  34. "longdesc": "長い説明へのリンク",
  35. "noresize": "ユーザーによるフレームのサイズの変更可否",
  36. "marginheight": "フレームのコンテンツの上部と下部の余白の間に残すスペースの量",
  37. "marginwidth": "フレームのコンテンツ間の左右の余白に残すスペースの量",
  38. },
  39. "reference": [
  40. {
  41. "title": "HTML Living Standard. 16.2 Non-conforming features. Last Updated 5 August 2025",
  42. "href": "https://html.spec.whatwg.org/multipage/obsolete.html#noframes",
  43. "heading": "HTML Living Standard. 16.2 Non-conforming features",
  44. "sub": "最終更新日 2025年8月5日",
  45. },
  46. {
  47. "title": "HTML Living Standard. 16.3.2 Frames. Last Updated 5 August 2025",
  48. "href": "https://html.spec.whatwg.org/multipage/obsolete.html#frames",
  49. "heading": "HTML Living Standard. 16.3.2 Frames",
  50. "sub": "最終更新日 2025年8月5日",
  51. },
  52. {
  53. "title": "HTML Living Standard. 15 Rendering 15.6 Frames and framesets. Last Updated 5 August 2025",
  54. "href": "https://html.spec.whatwg.org/multipage/rendering.html#frames-and-framesets",
  55. "heading": "HTML Living Standard. 15 Rendering 15.6 Frames and framesets",
  56. "sub": "最終更新日 2025年8月5日",
  57. },
  58. {
  59. "title": "HTML 5.3 W3C Working Draft. 11.3.3 Frames. W3C First Public Working Draft, 14 December 2017",
  60. "href": "https://www.w3.org/TR/2017/WD-html53-20171214/obsolete.html#frames",
  61. "heading": "HTML 5.3 W3C 初公開ワーキングドラフト. 11.3.3 Frames",
  62. "sub": "W3Cワーキングドラフト、2017年12月14日",
  63. },
  64. {
  65. "title": "HTML 5.3 W3C Working Draft. 10. Rendering 10.6. Frames and framesets. W3C First Public Working Draft, 14 December 2017",
  66. "href": "https://www.w3.org/TR/2017/WD-html53-20171214/rendering.html#frames-and-framesets",
  67. "heading": "HTML 5.3 W3C 初公開ワーキングドラフト. 10. Rendering 10.6. Frames and framesets",
  68. "sub": "W3Cワーキングドラフト、2017年12月14日",
  69. },
  70. {
  71. "title": "HTML 5.2 W3C Recommendation. 11.3.3 Frames. W3C Recommendation, 14 December 2017.",
  72. "href": "https://www.w3.org/TR/2017/REC-html52-20171214/obsolete.html#frames",
  73. "heading": "HTML 5.2 W3C 勧告. 11.3.3 Frames",
  74. "sub": "W3C勧告、2017年12月14日",
  75. },
  76. {
  77. "title": "HTML 5.2 W3C Recommendation. 10. Rendering 10.6. Frames and framesets. W3C Recommendation, 14 December 2017.",
  78. "href": "https://www.w3.org/TR/2017/REC-html52-20171214/rendering.html#frames-and-framesets",
  79. "heading": "HTML 5.2 W3C 勧告. 10. Rendering 10.6. Frames and framesets",
  80. "sub": "W3C勧告、2017年12月14日",
  81. },
  82. {
  83. "title": "HTML 5.1 W3C Recommendation. 11.3.3 Frames. W3C Recommendation, 1 November 2016.",
  84. "href": "https://www.w3.org/TR/2016/REC-html51-20161101/obsolete.html#frames",
  85. "heading": "HTML 5.1 W3C 勧告. 11.3.3 Frames",
  86. "sub": "W3C勧告、2016年11月1日",
  87. },
  88. {
  89. "title": "HTML 5.1 W3C Recommendation. 10. Rendering 10.6. Frames and framesets. W3C Recommendation, 1 November 2016.",
  90. "href": "https://www.w3.org/TR/2016/REC-html51-20161101/rendering.html#frames-and-framesets",
  91. "heading": "HTML 5.1 W3C 勧告. 10. Rendering 10.6. Frames and framesets",
  92. "sub": "W3C勧告、2016年11月1日",
  93. },
  94. {
  95. "title": "HTML 5 W3C Recommendation. 11.3.3 Frames. W3C Recommendation, 28 October 2014.",
  96. "href": "https://www.w3.org/TR/2014/REC-html5-20141028/obsolete.html#frames",
  97. "heading": "HTML 5 W3C 勧告. 11.3.3 Frames",
  98. "sub": "W3C勧告、2014年10月28日",
  99. },
  100. {
  101. "title": "HTML 5 W3C Recommendation. 10. Rendering 10.6. Frames and framesets. W3C Recommendation, 28 October 2014.",
  102. "href": "https://www.w3.org/TR/2014/REC-html5-20141028/rendering.html#frames-and-framesets",
  103. "heading": "HTML 5 W3C 勧告. 10.6. 10. Rendering Frames and framesets",
  104. "sub": "W3C勧告、2014年10月28日",
  105. },
  106. {
  107. "title": "HTML 4.01 Specification. 16 Frames in HTML documents. 16.2.2 The FRAME element.",
  108. "href": "https://www.w3.org/TR/html401/present/frames.html#h-16.2.2",
  109. "heading": "HTML 4.01 Specification. 16 Frames in HTML documents. 16.2.2 The FRAME element",
  110. "sub": "W3C勧告1999年12月24日",
  111. },
  112. {
  113. "title": "MDN Web Docs. HTML <frame>.",
  114. "href": "https://developer.mozilla.org/ja/docs/Web/HTML/Element/frame",
  115. "heading": "<frame> - HTML: ハイパーテキストマークアップ言語 | MDN",
  116. },
  117. ],
  118. "version": {
  119. "first": "HTML4.01 Frameset",
  120. "latest": "HTML4.01 Frameset",
  121. },
  122. "lastReviewed": "2025-08-10",
  123. }
  124. }

注意: 簡易に描画する為に、各項目の後ろに , を付与しています。JSON の形式では、末尾の項目の後には , は付けません。

最終確認日

2025-08-10


2.使用できるコンテキスト

frame要素は、
frameset要素の
コンテンツとして
使用できます。

<frame>要素が使用できるコンテキスト(Context文脈)は、<frameset>要素コンテンツとしてです。

HTML5 では廃止された要素です。<iframe>要素とスタイルシートを用いて代用できます。

document
html
head
frameset
frame
frameset
noframes
frame
frame
body
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
  2. <html lang="ja">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>サンプル</title>
  6. </head>
  7. <frameset cols="30%, *">
  8. <frame src="./menu.htm">
  9. <frameset rows="20%, *">
  10. <frame src="./header.htm">
  11. <frame src="./body.htm">
  12. </frameset>
  13. <noframes>
  14. <body>
  15. フレームに関しての、テキストデータの表示等の例示です。
  16. </body>
  17. </noframes>
  18. </frameset>
  19. </html>

HTML4.01 Frameset で<frameset>要素のコンテンツとして、<frame>要素を使用できます。


3.コンテンツモデル

frame要素は、
配置可能なコンテンツは
ありません。

<frame>要素子や子孫としてどのようなコンテンツ(Content内容) が含まれなければならないかというと、何もない」 (要素にはテキストノード(要素間の空白以外) と要素ノードが含まれていてはなりません。) です。

<frame>要素は、(内容コンテンツContent)を持つことができない空要素です。

<frame>要素は、置換要素です。src属性で指定されたソースに置換されます。


4.コンテンツ属性

frame要素は、
グローバル属性と、
src属性,
name属性,
scrolling属性,
frameborder属性,
longdesc属性,
noresize属性,
marginheight属性,
marginwidth属性 を
配置できます。

src属性

  1. <frame src="./exframe01.htm">

src属性 は、フレームに含まれる初期コンテンツの場所(フレームコンテンツソース) を指定します。src コンテンツ属性は、URL を含むものとして定義されます。

name属性

  1. <frame name="frame1" src="./exframe01.htm">

name属性 は、現在のフレームに名前を割り当てます。この名前は、リンクのターゲットとして使用できます。

scrolling属性

  1. <frame scrolling="auto" src="./exframe01.htm">

scrolling属性 は、フレームウィンドウのスクロール情報を指定します。指定可能な値は、以下の通りです。

auto
この値は、必要に応じてフレームウィンドウのスクロールデバイスを提供するようユーザーエージェントに指示します。これが既定値です。
yes
この値は、フレームウィンドウのスクロールデバイスを常に提供するようユーザーエージェントに指示します。
no
この値は、フレームウィンドウのスクロールデバイスを提供しないようユーザーエージェントに指示します。

frameborder属性

  1. <frame frameborder="1" src="./exframe01.htm">

frameborder属性 は、ユーザーエージェントにフレームの境界に関する情報を提供します。指定可能な値は、以下の通りです。

1
この値は、ユーザーエージェントに、このフレームと隣接するすべてのフレームの間に区切り線を描画するように指示します。これが既定値です。
0
この値は、ユーザーエージェントに、このフレームと隣接するすべてのフレームの間にセパレーターを描画しないように指示します。ただし、他のフレームによって指定されている場合は、このフレームの横にセパレーターが描画されることがあります。

longdesc属性

  1. <frame longdesc="frame-desc.txt" src="./exframe01.htm">

longdesc属性 は、フレームの長い説明へのリンクを指定します。この説明は、title属性を使用して提供される短い説明を補足するものであり、非視覚的なユーザーエージェントにとって特に便利です。 注意すべきは、フレームに関連付けられた長い説明はフレームに添付されるのであって、フレームのコンテンツに添付されるのではない事です。コンテンツは時間の経過とともに変化する可能性がある為、最初の長い説明はフレームの後のコンテンツに適さなくなる可能性があります。特に、作成者はフレームの唯一のコンテンツとして画像を含めるべきではありません。 画像をフレームの唯一のコンテンツとすると longdesc属性以外で代替テキストを指定する方法がありません。その様な場合は、その画像を唯一のコンテンツとするHTML文書を用意して、そこで代替テキストを用意しましょう。

noresize属性

  1. <frame noresize src="./exframe01.htm">

noresize属性 は、ブール属性であり、存在する場合、フレームウィンドウサイズ変更できないことをユーザーエージェントに通知します。

marginheight属性

  1. <frame marginheight="10" src="./exframe01.htm">

marginheight属性 は、フレームのコンテンツ間の上部と下部に残すスペースのを指定します。値は 0 (ピクセル) より大きい必要があります。既定値はユーザーエージェントによって異なります。

marginwidth属性

  1. <frame marginwidth="10" src="./exframe01.htm">

marginwidth属性 は、フレームのコンテンツ間の左余白と右余白に残すスペースのを指定します。値は 0 (ピクセル) より大きい必要があります。既定値はユーザーエージェントによって異なります。


5.DOM インターフェイス

windowの
プロパティである
framesは、
frame要素及び
iframe要素の
配列風オブジェクトを
返します。

<frame>要素を JavaScript などで操作するには、windowのプロパティであるframesを用います。これはあくまで、フレームのコンテンツを操作するものです。window.frames擬似配列の各要素は Window オブジェクトです。

<frame>要素自体を JavaScript などで操作するには、documentquerySelector()メソッド等を用いて、タイプセレクタ, 子結合子, 疑似クラスなどを組み合わせて要素を特定して、目的の要素を取得する事が考えられます。HTMLFrameElement インターフェイスの形式で取得できます。ここのcontentWindowIDL属性がウィンドウオブジェクトであり、それのdocument<frame>要素のドキュメントとなります。

他のフレーム内のドキュメントの操作に関しては、制限があります。

HTMLFrameElement インターフェイスは、HTMLElement インターフェイスを継承しつつ、name属性, scrolling属性, src属性, frameBorder属性, longDesc属性, noResize属性, contentDocument属性, contentWindow属性, marginHeight属性, marginWidth属性など各IDL属性が追加されています。


6.アクセシビリティ

frame要素は、
ARIA in HTML に、
記述はありません。

<frame>要素暗黙的なARIAセマンティクスは、ありません。
<frame>要素は、HTML Living Standard では廃止された機能です。ARIA in HTML に、この要素の記述はありません。<frame>要素を使用する時は、HTML5 より前の機能でアクセシビリティを意識する必要がある訳です。

一応、グローバル aria-* 属性は、すべての要素で使用できます。しかし<frame>要素は、HTML Living Standard では廃止された機能です。そのHTML文書は HTML Living Standard より前の決まりで記述されるべきなので、グローバル aria-* 属性も使用しない方が良いと思います。

案としては、フレームの名前を意味として分かり易くするくらいでしょうか。<frame>要素name属性を、意識して使うくらいしか思いつきません。 「過ぎたるは猶及ばざるが如し」なので、アクセシビリティの為と考えて、無理していろいろしても逆効果でしょう。一応、longdesc属性もありますが、過信しないように注意しましょう。フレームの説明であって、コンテンツの説明ではありません。

そもそも論として、<frame>要素を使用してフレームを表して、それが使う側からしてがどうかという事です。 HTML文書の構成, 設計で、アクセシビリティを意識しているかという事です。 その上で、<frame>要素を使用する必要があるならば、何かしらのデメリットも認識しましょう。


7.レンダリング

  1. frame {
  2. display: block;
  3. }

<frame>要素ユーザーエージェントレベルスタイルシートデフォルトでは、displayプロパティの値は block であり、置換要素なので、ブロックレベルボックスを生成します。内容(コンテンツ)が CSSフォーマットモデルの範囲外なので、 フォーマットコンテキストの種類を定義し、子孫ボックスの配置方法を示す〇〇コンテナボックスの部分は生成しません。

<frame>要素包含ブロック<frameset>要素です。<frameset>要素ブロックフォーマットコンテキストに参加し、それを分割しています。<frame>要素はそこに参加します。

<frame>要素のレンダリングは、「そのコンテンツをナビゲート可能にし、長方形に合わせて配置およびサイズ調整します。」とあります。


8.気を付ける点

frame要素は、
HTML5 で
廃止されています。

<frame>要素は、HTML5 では廃止された HTML4.01 Frameset でのみ使える要素です。
<iframe>要素を用いて同等の表現が行えます。