Fix some misuse of "prohibited paragraph child"
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Tue, 12 Jul 2011 15:58:57 -0600
changeset 409 4f1626e3a442
parent 408 22a24e38b232
child 410 4cb683673c4e
Fix some misuse of "prohibited paragraph child"
editcommands.html
implementation.js
source.html
--- a/editcommands.html	Tue Jul 12 15:45:28 2011 -0600
+++ b/editcommands.html	Tue Jul 12 15:58:57 2011 -0600
@@ -674,12 +674,9 @@
 is conceptually similar to "block node", but based on the element name.
 Generally we want to use block/inline node when we're interested in the visual
 effect, and prohibited paragraph children when we're concerned about parsing or
-semantics.  The current spec is not always so consistent.
+semantics.
 -->
 
-<p class=XXX>Audit the spec to find places where we should use block node
-instead of prohibited paragraph child or vice versa (see comment).
-
 <p>An <dfn id=editing-host>editing host</dfn> is a <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-node title=concept-node>node</a> that is either an <code class=external data-anolis-spec=domcore><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#element>Element</a></code> with
 a <code class=external data-anolis-spec=html title=attr-contenteditable><a href=http://www.whatwg.org/html/#attr-contenteditable>contenteditable</a></code>
 attribute set to the true state, or the <code class=external data-anolis-spec=domcore><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#element>Element</a></code> child of a <code class=external data-anolis-spec=domcore><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#document>Document</a></code>
@@ -737,9 +734,9 @@
 elsewhere.  E.g., if it gets turned into a p. -->
 
 <p>Something is <dfn id=visible>visible</dfn> if it is a <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-node title=concept-node>node</a> that either is a
-<a href=#prohibited-paragraph-child>prohibited paragraph child</a>, or a <code class=external data-anolis-spec=domcore><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#text>Text</a></code> node whose <code class=external data-anolis-spec=domcore title=dom-CharacterData-data><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-characterdata-data>data</a></code> is
-not empty, or an <code class=external data-anolis-spec=html title="the img element"><a href=http://www.whatwg.org/html/#the-img-element>img</a></code>, or a <code class=external data-anolis-spec=html title="the br element"><a href=http://www.whatwg.org/html/#the-br-element>br</a></code> that is not an <a href=#extraneous-line-break>extraneous line
-break</a>, or any <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-node title=concept-node>node</a> with a <a href=#visible>visible</a> <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-tree-descendant title=concept-tree-descendant>descendant</a>.
+<a href=#block-node>block node</a>, or a <code class=external data-anolis-spec=domcore><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#text>Text</a></code> node whose <code class=external data-anolis-spec=domcore title=dom-CharacterData-data><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-characterdata-data>data</a></code> is not empty, or
+an <code class=external data-anolis-spec=html title="the img element"><a href=http://www.whatwg.org/html/#the-img-element>img</a></code>, or a <code class=external data-anolis-spec=html title="the br element"><a href=http://www.whatwg.org/html/#the-br-element>br</a></code> that is not an <a href=#extraneous-line-break>extraneous line break</a>, or
+any <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-node title=concept-node>node</a> with a <a href=#visible>visible</a> <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-tree-descendant title=concept-tree-descendant>descendant</a>.
 
 <p>Something is <dfn id=invisible>invisible</dfn> if it is a <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-node title=concept-node>node</a> that is not
 <a href=#visible>visible</a>.
@@ -6167,9 +6164,9 @@
 
   <li>Let <var title="">descendants</var> be all <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-tree-descendant title=concept-tree-descendant>descendants</a> of <var title="">frag</var>.
 
-  <li>If the <a href=#active-range>active range</a>'s <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-range-start title=concept-range-start>start</a> <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-boundary-point-node title=concept-boundary-point-node>node</a> is a <a href=#prohibited-paragraph-child>prohibited
-  paragraph child</a> whose sole <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-tree-child title=concept-tree-child>child</a> is a <code class=external data-anolis-spec=html title="the br element"><a href=http://www.whatwg.org/html/#the-br-element>br</a></code>, and its
-  <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-range-start title=concept-range-start>start</a> <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-boundary-point-offset title=concept-boundary-point-offset>offset</a> is 0, remove its <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-range-start title=concept-range-start>start</a> <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-boundary-point-node title=concept-boundary-point-node>node</a>'s <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-tree-child title=concept-tree-child>child</a> from it.
+  <li>If the <a href=#active-range>active range</a>'s <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-range-start title=concept-range-start>start</a> <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-boundary-point-node title=concept-boundary-point-node>node</a> is a <a href=#block-node>block
+  node</a> whose sole <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-tree-child title=concept-tree-child>child</a> is a <code class=external data-anolis-spec=html title="the br element"><a href=http://www.whatwg.org/html/#the-br-element>br</a></code>, and its <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-range-start title=concept-range-start>start</a> <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-boundary-point-offset title=concept-boundary-point-offset>offset</a> is 0,
+  remove its <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-range-start title=concept-range-start>start</a> <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-boundary-point-node title=concept-boundary-point-node>node</a>'s <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-tree-child title=concept-tree-child>child</a> from it.
   <!--
   This is so we don't get something like
     <div>[foo]</div>
@@ -6213,9 +6210,9 @@
   <li>If the <a href=#active-range>active range</a>'s <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-range-start title=concept-range-start>start</a> <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-boundary-point-node title=concept-boundary-point-node>node</a> is neither
   <a href=#editable>editable</a> nor an <a href=#editing-host>editing host</a>, abort these steps.
 
-  <li>If <var title="">range</var>'s <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-range-start title=concept-range-start>start</a> <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-boundary-point-node title=concept-boundary-point-node>node</a> is a <a href=#prohibited-paragraph-child>prohibited paragraph
-  child</a> whose sole <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-tree-child title=concept-tree-child>child</a> is a <code class=external data-anolis-spec=html title="the br element"><a href=http://www.whatwg.org/html/#the-br-element>br</a></code>, and its <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-range-start title=concept-range-start>start</a> <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-boundary-point-offset title=concept-boundary-point-offset>offset</a> is 0,
-  remove its <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-range-start title=concept-range-start>start</a> <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-boundary-point-node title=concept-boundary-point-node>node</a>'s <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-tree-child title=concept-tree-child>child</a> from it.
+  <li>If <var title="">range</var>'s <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-range-start title=concept-range-start>start</a> <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-boundary-point-node title=concept-boundary-point-node>node</a> is a <a href=#block-node>block node</a> whose
+  sole <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-tree-child title=concept-tree-child>child</a> is a <code class=external data-anolis-spec=html title="the br element"><a href=http://www.whatwg.org/html/#the-br-element>br</a></code>, and its <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-range-start title=concept-range-start>start</a> <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-boundary-point-offset title=concept-boundary-point-offset>offset</a> is 0, remove its
+  <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-range-start title=concept-range-start>start</a> <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-boundary-point-node title=concept-boundary-point-node>node</a>'s <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-tree-child title=concept-tree-child>child</a> from it.
   <!-- Same logic as with insertHTML. -->
 
   <li>Let <var title="">img</var> be the result of calling <code class=external data-anolis-spec=domcore title=dom-Document-createElement><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-document-createelement>createElement("img")</a></code> on
--- a/implementation.js	Tue Jul 12 15:45:28 2011 -0600
+++ b/implementation.js	Tue Jul 12 15:58:57 2011 -0600
@@ -856,14 +856,14 @@
 	return origHeight == finalHeight;
 }
 
-// "Something is visible if it is a node that either is a prohibited paragraph
-// child, or a Text node whose data is not empty, or an img, or a br that is
-// not an extraneous line break, or any node with a visible descendant."
+// "Something is visible if it is a node that either is a block node, or a Text
+// node whose data is not empty, or an img, or a br that is not an extraneous
+// line break, or any node with a visible descendant."
 function isVisible(node) {
 	if (!node) {
 		return false;
 	}
-	if (isProhibitedParagraphChild(node)
+	if (isBlockNode(node)
 	|| (node.nodeType == Node.TEXT_NODE && node.length)
 	|| isHtmlElement(node, "img")
 	|| (isHtmlElement(node, "br") && !isExtraneousLineBreak(node))) {
@@ -6323,10 +6323,10 @@
 		// "Let descendants be all descendants of frag."
 		var descendants = getDescendants(frag);
 
-		// "If the active range's start node is a prohibited paragraph child
-		// whose sole child is a br, and its start offset is 0, remove its
-		// start node's child from it."
-		if (isProhibitedParagraphChild(getActiveRange().startContainer)
+		// "If the active range's start node is a block node whose sole child
+		// is a br, and its start offset is 0, remove its start node's child
+		// from it."
+		if (isBlockNode(getActiveRange().startContainer)
 		&& getActiveRange().startContainer.childNodes.length == 1
 		&& isHtmlElement(getActiveRange().startContainer.firstChild, "br")
 		&& getActiveRange().startOffset == 0) {
@@ -6371,10 +6371,9 @@
 			return;
 		}
 
-		// "If range's start node is a prohibited paragraph child whose sole
-		// child is a br, and its start offset is 0, remove its start node's
-		// child from it."
-		if (isProhibitedParagraphChild(range.startContainer)
+		// "If range's start node is a block node whose sole child is a br, and
+		// its start offset is 0, remove its start node's child from it."
+		if (isBlockNode(range.startContainer)
 		&& range.startContainer.childNodes.length == 1
 		&& isHtmlElement(range.startContainer.firstChild, "br")
 		&& range.startOffset == 0) {
--- a/source.html	Tue Jul 12 15:45:28 2011 -0600
+++ b/source.html	Tue Jul 12 15:58:57 2011 -0600
@@ -622,12 +622,9 @@
 is conceptually similar to "block node", but based on the element name.
 Generally we want to use block/inline node when we're interested in the visual
 effect, and prohibited paragraph children when we're concerned about parsing or
-semantics.  The current spec is not always so consistent.
+semantics.
 -->
 
-<p class=XXX>Audit the spec to find places where we should use block node
-instead of prohibited paragraph child or vice versa (see comment).
-
 <p>An <dfn>editing host</dfn> is a [[node]] that is either an [[element]] with
 a <code data-anolis-spec=html title=attr-contenteditable>contenteditable</code>
 attribute set to the true state, or the [[element]] child of a [[document]]
@@ -686,9 +683,9 @@
 elsewhere.  E.g., if it gets turned into a p. -->
 
 <p>Something is <dfn>visible</dfn> if it is a [[node]] that either is a
-<span>prohibited paragraph child</span>, or a [[text]] node whose [[cddata]] is
-not empty, or an [[img]], or a [[br]] that is not an <span>extraneous line
-break</span>, or any [[node]] with a <span>visible</span> [[descendant]].
+<span>block node</span>, or a [[text]] node whose [[cddata]] is not empty, or
+an [[img]], or a [[br]] that is not an <span>extraneous line break</span>, or
+any [[node]] with a <span>visible</span> [[descendant]].
 
 <p>Something is <dfn>invisible</dfn> if it is a [[node]] that is not
 <span>visible</span>.
@@ -6162,9 +6159,9 @@
 
   <li>Let <var>descendants</var> be all [[descendants]] of <var>frag</var>.
 
-  <li>If the <span>active range</span>'s [[startnode]] is a <span>prohibited
-  paragraph child</span> whose sole [[child]] is a [[br]], and its
-  [[startoffset]] is 0, remove its [[startnode]]'s [[child]] from it.
+  <li>If the <span>active range</span>'s [[startnode]] is a <span>block
+  node</span> whose sole [[child]] is a [[br]], and its [[startoffset]] is 0,
+  remove its [[startnode]]'s [[child]] from it.
   <!--
   This is so we don't get something like
     <div>[foo]</div>
@@ -6208,9 +6205,9 @@
   <li>If the <span>active range</span>'s [[startnode]] is neither
   <span>editable</span> nor an <span>editing host</span>, abort these steps.
 
-  <li>If <var>range</var>'s [[startnode]] is a <span>prohibited paragraph
-  child</span> whose sole [[child]] is a [[br]], and its [[startoffset]] is 0,
-  remove its [[startnode]]'s [[child]] from it.
+  <li>If <var>range</var>'s [[startnode]] is a <span>block node</span> whose
+  sole [[child]] is a [[br]], and its [[startoffset]] is 0, remove its
+  [[startnode]]'s [[child]] from it.
   <!-- Same logic as with insertHTML. -->
 
   <li>Let <var>img</var> be the result of calling [[createelement|"img"]] on