Skip to content

Commit 73ece48

Browse files
committed
Editorial: refactor designMode
1 parent cb4f5ff commit 73ece48

File tree

1 file changed

+32
-33
lines changed

1 file changed

+32
-33
lines changed

source

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -73576,21 +73576,11 @@ body { display:none }
7357673576

7357773577

7357873578

73579-
<h4>Making entire documents editable: the <code data-x="dom-document-designMode">designMode</code>
73580-
IDL attribute</h4>
73581-
73582-
<div w-nodev>
73583-
73584-
<p>Documents have a <dfn id="designMode"
73585-
data-x="dom-document-designMode"><code>designMode</code></dfn>, which can be either enabled or
73586-
disabled.</p>
73587-
73588-
</div>
73579+
<h4 id="making-entire-documents-editable:-the-designmode-idl-attribute">Making entire documents
73580+
editable: the <code data-x="dom-document-designMode">designMode</code> getter and setter</h4>
7358973581

7359073582
<dl class="domintro">
73591-
7359273583
<dt><var>document</var> . <code subdfn data-x="dom-document-designMode">designMode</code> [ = <var>value</var> ]</dt>
73593-
7359473584
<dd>
7359573585
<p>Returns "<code data-x="">on</code>" if the document is editable, and "<code
7359673586
data-x="">off</code>" if it isn't.</p>
@@ -73602,28 +73592,37 @@ body { display:none }
7360273592

7360373593
<div w-nodev>
7360473594

73605-
<p>The <code data-x="dom-document-designMode">designMode</code> IDL attribute on the
73606-
<code>Document</code> object takes two values, "<code data-x="">on</code>" and "<code
73607-
data-x="">off</code>". On setting, the new value must be compared in an <span>ASCII
73608-
case-insensitive</span> manner to these two values; if it matches the "<code data-x="">on</code>"
73609-
value, then <code data-x="dom-document-designMode">designMode</code> must be enabled, and if it
73610-
matches the "<code data-x="">off</code>" value, then <code
73611-
data-x="dom-document-designMode">designMode</code> must be disabled. Other values must be
73612-
ignored.</p>
73595+
<p><code>Document</code> objects have an associated <dfn>design mode enabled</dfn>, which is a
73596+
boolean. It is initially false.</p>
7361373597

73614-
<p>On getting, if <code data-x="dom-document-designMode">designMode</code> is enabled, the IDL
73615-
attribute must return the value "<code data-x="">on</code>"; otherwise it is disabled, and the
73616-
attribute must return the value "<code data-x="">off</code>".</p>
73598+
<p>The <dfn id="designMode"><code data-x="dom-document-designMode">designMode</code></dfn> getter
73599+
steps are to return "<code data-x="">on</code>" if <span>this</span>'s <span>design mode
73600+
enabled</span> is true; otherwise "<code data-x="">off</code>".</p>
7361773601

73618-
<p>The last state set must persist until the document is destroyed or the state is changed.
73619-
Initially, documents must have their <code data-x="dom-document-designMode">designMode</code>
73620-
disabled.</p>
73602+
<p>The <code data-x="dom-document-designMode">designMode</code> setter steps are:</p>
7362173603

73622-
<p>When the <code data-x="dom-document-designMode">designMode</code> changes from being disabled to
73623-
being enabled, the user agent must <span>immediately</span> reset the document's <span>active range</span>'s
73624-
start and end boundary points to be at the start of the <code>Document</code> and then run the
73625-
<span>focusing steps</span> for the <span>document element</span> of the <code>Document</code>, if
73626-
non-null.</p>
73604+
<ol>
73605+
<li><p>Let <var>value</var> be the given value, converted to <span>ASCII
73606+
lowercase</span>.</p></li>
73607+
73608+
<li>
73609+
<p>If <var>value</var> is "<code data-x="">on</code>" and <span>this</span>'s <span>design mode
73610+
enabled</span> is false, then:</p>
73611+
73612+
<ol>
73613+
<li><p>Set <span>this</span>'s <span>design mode enabled</span> to true.</p></li>
73614+
73615+
<li><p>Reset <span>this</span>'s <span>active range</span>'s start and end boundary points to
73616+
be at the start of <span>this</span>.</p></li>
73617+
73618+
<li><p>Run the <span>focusing steps</span> for <span>this</span>'s <span>document
73619+
element</span>, if non-null.</p></li>
73620+
</ol>
73621+
</li>
73622+
73623+
<li><p>If <var>value</var> is "<code data-x="">off</code>", then set <span>this</span>'s
73624+
<span>design mode enabled</span> to false.</p></li>
73625+
</ol>
7362773626

7362873627
</div>
7362973628

@@ -73665,8 +73664,8 @@ body { display:none }
7366573664
<p>An <dfn data-export="">editing host</dfn> is either an <span data-x="HTML elements">HTML
7366673665
element</span> with its <code data-x="attr-contenteditable">contenteditable</code> attribute in
7366773666
the <i>true</i> state, or a <span data-x="concept-tree-child">child</span> <span data-x="HTML
73668-
elements">HTML element</span> of a <code>Document</code> with <code
73669-
data-x="dom-document-designMode">designMode</code> enabled.</p>
73667+
elements">HTML element</span> of a <code>Document</code> whose <span>design mode enabled</span> is
73668+
true.</p>
7367073669

7367173670
<p>The definition of the terms <dfn
7367273671
data-x-href="https://w3c.github.io/editing/execCommand.html#active-range">active range</dfn>, <dfn

0 commit comments

Comments
 (0)