Use "inline node" definition more
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Tue, 05 Jul 2011 11:39:05 -0600
changeset 361 121e958e7d65
parent 360 dab1ff3a48b9
child 362 e3392e61900d
Use "inline node" definition more
editcommands.html
implementation.js
source.html
--- a/editcommands.html	Tue Jul 05 11:33:21 2011 -0600
+++ b/editcommands.html	Tue Jul 05 11:39:05 2011 -0600
@@ -1311,8 +1311,7 @@
     <li>Let <var title="">affected by subscript</var> and <var title="">affected by
     superscript</var> be two boolean variables, both initially false.
 
-    <li>While <var title="">node</var> is 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> whose "display" property
-    computes to "inline":
+    <li>While <var title="">node</var> is an <a href=#inline-node>inline node</a>:
 
     <ol>
       <!-- Firefox 6.0a2 ignores vertical-align for this purpose, and only
@@ -1379,8 +1378,7 @@
   <li>If <var title="">command</var> is "subscript" or "superscript":
 
   <ol>
-    <li>If the <a href=http://www.w3.org/TR/CSS21/cascade.html#computed-value>computed value</a> of <var title="">element</var>'s "display" property is
-    neither "inline" nor "inline-block" nor "inline-table", return null.
+    <li>If <var title="">element</var> is not an <a href=#inline-node>inline node</a>, return null.
 
     <li>If <var title="">element</var> has a <code class=external data-anolis-spec=html title="the style attribute"><a href=http://www.whatwg.org/html/#the-style-attribute>style</a></code> attribute set, and that attribute
     has the effect of setting "vertical-align", return the value that it sets
--- a/implementation.js	Tue Jul 05 11:33:21 2011 -0600
+++ b/implementation.js	Tue Jul 05 11:39:05 2011 -0600
@@ -1734,11 +1734,8 @@
 		var affectedBySubscript = false;
 		var affectedBySuperscript = false;
 
-		// "While node is an Element whose "display" property computes to
-		// "inline":"
-		while (node
-		&& node.nodeType == Node.ELEMENT_NODE
-		&& getComputedStyle(node).display == "inline") {
+		// "While node is an inline node:"
+		while (isInlineNode(node)) {
 			var verticalAlign = getComputedStyle(node).verticalAlign;
 
 			// "If node's "vertical-align" property computes to "sub", set
@@ -1834,13 +1831,8 @@
 
 	// "If command is "subscript" or "superscript":"
 	if (command == "subscript" || command == "superscript") {
-		// "If the computed value of element's "display" property is
-		// neither "inline" nor "inline-block" nor "inline-table", return
-		// null."
-		var style = getComputedStyle(element);
-		if (style.display != "inline"
-		&& style.display != "inline-block"
-		&& style.display != "inline-table") {
+		// "If element is not an inline node, return null."
+		if (!isInlineNode(element)) {
 			return null;
 		}
 
--- a/source.html	Tue Jul 05 11:33:21 2011 -0600
+++ b/source.html	Tue Jul 05 11:39:05 2011 -0600
@@ -1267,8 +1267,7 @@
     <li>Let <var>affected by subscript</var> and <var>affected by
     superscript</var> be two boolean variables, both initially false.
 
-    <li>While <var>node</var> is an [[element]] whose "display" property
-    computes to "inline":
+    <li>While <var>node</var> is an <span>inline node</span>:
 
     <ol>
       <!-- Firefox 6.0a2 ignores vertical-align for this purpose, and only
@@ -1335,8 +1334,7 @@
   <li>If <var>command</var> is "subscript" or "superscript":
 
   <ol>
-    <li>If the [[compval]] of <var>element</var>'s "display" property is
-    neither "inline" nor "inline-block" nor "inline-table", return null.
+    <li>If <var>element</var> is not an <span>inline node</span>, return null.
 
     <li>If <var>element</var> has a [[style]] attribute set, and that attribute
     has the effect of setting "vertical-align", return the value that it sets