[11] [CODE(DOMi)@en[Document]] [[インターフェイス]]の
[DFN[[CODE(DOMa)@en[designMode]]]] [[IDL属性]]は、
[[文書]]が編集モードかどうかを指定します。

* 仕様書

[REFS[
- [8] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2017-02-20 18:15:56 +09:00]]) <https://html.spec.whatwg.org/#making-entire-documents-editable:-the-designmode-idl-attribute>
]REFS]

* 意味

[13] [[文書]]全体を編集モードとするかどうかを指定します。
[[要素]]の [CODE[contentEditable]] に相当します。

[20] 編集モードとする場合は [DFN[[CODE[on][designMode]]]]、
しない場合は [DFN[[CODE[off][designMode]]]] で表します。

[10] [[文書]]は、 [DFN[[F[[CODE[designMode]]]]]] を持ちます。
値は[RUBYB[有効]@en[enabled]]または[RUBYB[無効]@en[disabled]]のいずれかです。
既定値は無効です。 [SRC[>>8]]

* 取得器

[21] [[取得器]]は、次のようにしなければ[MUST[なりません]] [SRC[>>8]]。

[FIG(steps)[
= [22] [[文脈オブジェクト]]の [F[[CODE[designMode]]]] が有効なら、
== [23] [CODE[on][designMode]] を返します。
= [24] それ以外なら、
== [25] [CODE[off][designMode]] を返します。
]FIG]

* 設定器

[14] [[設定器]]は、次のようにしなければ[MUST[なりません]] [SRC[>>8]]。

[FIG(steps)[
= [15] [VAR[新しい値]]を、指定された値を [CODE(IDL)@en[DOMString]] と解釈した結果に設定します。
= [16] [VAR[新しい値]]が [[ASCII大文字・小文字不区別]]で [CODE[on][designMode]] なら、
== [26] [[文脈オブジェクト]]の [F[[CODE[designMode]]]] が無効なら、
=== [17] [[文脈オブジェクト]]の [F[[CODE[designMode]]]] を、有効に設定します。
=== [27] [[文脈オブジェクト]]の[F[活性範囲]]の開始と終了の両境界点を、
[[文脈オブジェクト]]のはじめにおいて再設定します。
=== [28] [[文脈オブジェクト]]の[F[文書要素]]が [CODE[null]] でなければ、
==== [29] [[文脈オブジェクト]]の[F[文書要素]]について [[focusing steps]] を実行します。
= [18] それ以外で、[VAR[新しい値]]が [[ASCII大文字・小文字不区別]]で [CODE[off][designMode]] なら、
== [19] [[文脈オブジェクト]]の [F[[CODE[designMode]]]] を、無効に設定します。
]FIG]

;; [32] [[focusing steps]] で[[同期的]]に[[イベント]]が[[発火]]されることがあります。

[30] [CODE(IDL xattr)@en[CEReactions]] です [SRC[>>8]]。

;; [31] [[DOM変異]]は発生しなそうに見えますが...

* 処理

[12] [[editing host]] 参照。

* 歴史

[9] [[editing host]] も参照。

[1]
[CITE@ja-JP[Internet Explorer 5.5 を使った 編集可能な Web ページの作成方法]] ([CODE[2007-04-07 13:42:05 +09:00]] 版) <http://www.microsoft.com/japan/msdn/web/html/mshtml/createwp.aspx#createwp_topic3>
([[名無しさん]])


[2]
[CITE[Live designMode Viewer]] ([TIME[2007-10-16 04:21:00 +09:00]] 版) <http://simon.html5.org/tools/js/designmode-viewer/>

[3] [CITE['''['''whatwg''']''' Should scripts and plugins in contenteditable content be enabled or disabled?]]
([TIME[2010-07-30 09:46:18 +09:00]] 版)
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2010-July/027435.html>

[4] [CITE@en[Web Applications 1.0 r6528 Remove Editing APIs and related sections in favour of http://aryeh.name/spec/editing/editing.html]]
( ([TIME[2011-08-26 09:43:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=6527&to=6528>

[5] [CITE[HTML Editing APIs]]
( ([TIME[2014-01-02 12:21:36 +09:00]] 版))
<https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html>

[6] [CITE@en[Editorial: synchronize with the DOM Standard · whatwg/html@21c6ec7]]
([TIME[2016-03-20 18:16:13 +09:00]] 版)
<https://github.com/whatwg/html/commit/21c6ec77594eb89b836d4872222f5916910967fd>

[7] [CITE@en[Formalize custom element reactions · whatwg/html@27aa7bc]]
([TIME[2016-04-26 18:52:09 +09:00]] 版)
<https://github.com/whatwg/html/commit/27aa7bc4fa6f168654a8c858f0773e611f679b39>