Test text-decoration more, tweak spec
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Sun, 10 Apr 2011 15:11:55 -0600
changeset 51 89108d051216
parent 50 8971dcba61df
child 52 10cf964f203e
Test text-decoration more, tweak spec
autoimplementation.html
editcommands.html
implementation.js
source.html
--- a/autoimplementation.html	Thu Apr 07 15:32:58 2011 -0600
+++ b/autoimplementation.html	Sun Apr 10 15:11:55 2011 -0600
@@ -7,6 +7,9 @@
 b, strong { font-weight: bold }
 .bold { font-weight: bold }
 .notbold { font-weight: normal }
+.underline { text-decoration: underline }
+.line-through { text-decoration: line-through }
+.underline-and-line-through { text-decoration: underline line-through }
 #purple { color: purple }
 td > div:first-child {
 	padding-bottom: 0.2em;
@@ -559,6 +562,15 @@
 		'<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>',
 		'{<table><tr><td>foo<td>bar<td>baz</table>}',
 
+		'foo<u>[bar]</u>baz',
+		'foo<span style="text-decoration: underline">[bar]</span>baz',
+		'<u>foo[bar]baz</u>',
+		'<u>foo[b<span style="color:red">ar]ba</span>z</u>',
+		'<u>foo[b<span style="color:red" id=foo>ar]ba</span>z</u>',
+		'<u>foo[b<span style="font-size:3em">ar]ba</span>z</u>',
+		'<u>foo[b<i>ar]ba</i>z</u>',
+		'<p style="text-decoration: underline">foo[bar]baz</p>',
+
 		'foo<s>[bar]</s>baz',
 		'foo<span style="text-decoration: line-through">[bar]</span>baz',
 		'<s>foo[bar]baz</s>',
@@ -567,6 +579,27 @@
 		'<s>foo[b<span style="font-size:3em">ar]ba</span>z</s>',
 		'<s>foo[b<i>ar]ba</i>z</s>',
 		'<p style="text-decoration: line-through">foo[bar]baz</p>',
+
+		'foo<span style="text-decoration: underline line-through">[bar]</span>baz',
+		'foo<span style="text-decoration: underline line-through">b[a]r</span>baz',
+		'foo<s style="text-decoration: underline">[bar]</s>baz',
+		'foo<s style="text-decoration: underline">b[a]r</s>baz',
+		'foo<u style="text-decoration: line-through">[bar]</u>baz',
+		'foo<u style="text-decoration: line-through">b[a]r</u>baz',
+		'foo<s style="text-decoration: overline">[bar]</s>baz',
+		'foo<s style="text-decoration: overline">b[a]r</s>baz',
+		'foo<u style="text-decoration: overline">[bar]</u>baz',
+		'foo<u style="text-decoration: overline">b[a]r</u>baz',
+
+		'<p style="text-decoration: line-through">foo[bar]baz</p>',
+		'<p style="text-decoration: overline">foo[bar]baz</p>',
+
+		'foo<span class="underline">[bar]</span>baz',
+		'foo<span class="underline">b[a]r</span>baz',
+		'foo<span class="line-through">[bar]</span>baz',
+		'foo<span class="line-through">b[a]r</span>baz',
+		'foo<span class="underline-and-line-through">[bar]</span>baz',
+		'foo<span class="underline-and-line-through">b[a]r</span>baz',
 	],
 	subscript: [
 		'foo[bar]baz',
@@ -651,6 +684,36 @@
 		'<u>foo[b<span style="font-size:3em">ar]ba</span>z</u>',
 		'<u>foo[b<i>ar]ba</i>z</u>',
 		'<p style="text-decoration: underline">foo[bar]baz</p>',
+
+		'foo<s>[bar]</s>baz',
+		'foo<span style="text-decoration: line-through">[bar]</span>baz',
+		'<s>foo[bar]baz</s>',
+		'<s>foo[b<span style="color:red">ar]ba</span>z</s>',
+		'<s>foo[b<span style="color:red" id=foo>ar]ba</span>z</s>',
+		'<s>foo[b<span style="font-size:3em">ar]ba</span>z</s>',
+		'<s>foo[b<i>ar]ba</i>z</s>',
+		'<p style="text-decoration: line-through">foo[bar]baz</p>',
+
+		'foo<span style="text-decoration: underline line-through">[bar]</span>baz',
+		'foo<span style="text-decoration: underline line-through">b[a]r</span>baz',
+		'foo<s style="text-decoration: underline">[bar]</s>baz',
+		'foo<s style="text-decoration: underline">b[a]r</s>baz',
+		'foo<u style="text-decoration: line-through">[bar]</u>baz',
+		'foo<u style="text-decoration: line-through">b[a]r</u>baz',
+		'foo<s style="text-decoration: overline">[bar]</s>baz',
+		'foo<s style="text-decoration: overline">b[a]r</s>baz',
+		'foo<u style="text-decoration: overline">[bar]</u>baz',
+		'foo<u style="text-decoration: overline">b[a]r</u>baz',
+
+		'<p style="text-decoration: line-through">foo[bar]baz</p>',
+		'<p style="text-decoration: overline">foo[bar]baz</p>',
+
+		'foo<span class="underline">[bar]</span>baz',
+		'foo<span class="underline">b[a]r</span>baz',
+		'foo<span class="line-through">[bar]</span>baz',
+		'foo<span class="line-through">b[a]r</span>baz',
+		'foo<span class="underline-and-line-through">[bar]</span>baz',
+		'foo<span class="underline-and-line-through">b[a]r</span>baz',
 	],
 	unlink: [
 		'<a href=http://www.google.com/>foo[bar]baz</a>',
--- a/editcommands.html	Thu Apr 07 15:32:58 2011 -0600
+++ b/editcommands.html	Sun Apr 10 15:11:55 2011 -0600
@@ -27,7 +27,7 @@
 <body class=draft>
 <div class=head id=head>
 <h1>HTML Editing Commands</h1>
-<h2 class="no-num no-toc" id=work-in-progress-&mdash;-last-update-7-april-2011>Work in Progress &mdash; Last Update 7 April 2011</h2>
+<h2 class="no-num no-toc" id=work-in-progress-&mdash;-last-update-10-april-2011>Work in Progress &mdash; Last Update 10 April 2011</h2>
 <dl>
  <dt>Editor
  <dd>Aryeh Gregor &lt;ayg+spec@aryeh.name&gt;
@@ -419,23 +419,20 @@
   <code class=external data-anolis-spec=html title="the style attribute"><a href=http://www.whatwg.org/html/#the-style-attribute>style</a></code>, and the <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 sets exactly one CSS property
   (including invalid or unrecognized properties), which is "font-style".
 
-  <li>It is an <code class=external data-anolis-spec=html title="the s element"><a href=http://www.whatwg.org/html/#the-s-element>s</a></code> element with exactly one attribute, which is <code class=external data-anolis-spec=html title="the style attribute"><a href=http://www.whatwg.org/html/#the-style-attribute>style</a></code>, and
-  the <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 sets exactly one CSS property (including invalid or
-  unrecognized properties), which is "text-decoration", which is set to
-  "line-through" or "underline" or "none".
-
-  <li>It is a <code class=external data-anolis-spec=html title="the u element"><a href=http://www.whatwg.org/html/#the-u-element>u</a></code> element with exactly one attribute, which is <code class=external data-anolis-spec=html title="the style attribute"><a href=http://www.whatwg.org/html/#the-style-attribute>style</a></code>, and
-  the <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 sets exactly one CSS property (including invalid or
-  unrecognized properties), which is "text-decoration", which is set to
-  "line-through" or "underline" or "none".
-
   <li>It is a <code class=external data-anolis-spec=html title="the sub and sup elements"><a href=http://www.whatwg.org/html/#the-sub-and-sup-elements>sub</a></code> or <code class=external data-anolis-spec=html title="the sub and sup elements"><a href=http://www.whatwg.org/html/#the-sub-and-sup-elements>sup</a></code> element with exactly one attribute, which is
   <code class=external data-anolis-spec=html title="the style attribute"><a href=http://www.whatwg.org/html/#the-style-attribute>style</a></code>, and the <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 sets exactly one CSS property
   (including invalid or unrecognized properties), which is "vertical-align".
 
   <li>It is an <code class=external data-anolis-spec=html title="the a element"><a href=http://www.whatwg.org/html/#the-a-element>a</a></code>, <code class=external data-anolis-spec=html title=font><a href=http://www.whatwg.org/html/#font>font</a></code>, or <code class=external data-anolis-spec=html title="the span element"><a href=http://www.whatwg.org/html/#the-span-element>span</a></code> element with exactly one attribute,
   which is <code class=external data-anolis-spec=html title="the style attribute"><a href=http://www.whatwg.org/html/#the-style-attribute>style</a></code>, and the <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 sets exactly one CSS property
-  (including invalid or unrecognized properties).
+  (including invalid or unrecognized properties), and that property is not
+  "text-decoration".
+
+  <li>It is an <code class=external data-anolis-spec=html title="the a element"><a href=http://www.whatwg.org/html/#the-a-element>a</a></code>, <code class=external data-anolis-spec=html title=font><a href=http://www.whatwg.org/html/#font>font</a></code>, <code class=external data-anolis-spec=html title="the s element"><a href=http://www.whatwg.org/html/#the-s-element>s</a></code>, <code class=external data-anolis-spec=html title="the span element"><a href=http://www.whatwg.org/html/#the-span-element>span</a></code>, or <code class=external data-anolis-spec=html title="the u element"><a href=http://www.whatwg.org/html/#the-u-element>u</a></code> element with exactly
+  one attribute, which is <code class=external data-anolis-spec=html title="the style attribute"><a href=http://www.whatwg.org/html/#the-style-attribute>style</a></code>, and the <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 sets exactly
+  one CSS property (including invalid or unrecognized properties), which is
+  "text-decoration", which is set to "line-through" or "underline" or
+  "overline" or "none".
 </ul>
 
 <p class=note>Conceptually, a simple modifiable element is a modifiable element
--- a/implementation.js	Thu Apr 07 15:32:58 2011 -0600
+++ b/implementation.js	Sun Apr 10 15:11:55 2011 -0600
@@ -699,32 +699,6 @@
 		return true;
 	}
 
-	// "It is an s element with exactly one attribute, which is style, and the
-	// style attribute sets exactly one CSS property (including invalid or
-	// unrecognized properties), which is "text-decoration", which is set to
-	// "line-through" or "underline" or "none"."
-	if (node.tagName == "S"
-	&& node.hasAttribute("style")
-	&& node.style.length == 1
-	&& (node.style.textDecoration == "line-through"
-	|| node.style.textDecoration == "underline"
-	|| node.style.textDecoration == "none")) {
-		return true;
-	}
-
-	// "It is a u element with exactly one attribute, which is style, and the
-	// style attribute sets exactly one CSS property (including invalid or
-	// unrecognized properties), which is "text-decoration", which is set to
-	// "line-through" or "underline" or "none"."
-	if (node.tagName == "U"
-	&& node.hasAttribute("style")
-	&& node.style.length == 1
-	&& (node.style.textDecoration == "line-through"
-	|| node.style.textDecoration == "underline"
-	|| node.style.textDecoration == "none")) {
-		return true;
-	}
-
 	// "It is a sub or sub element with exactly one attribute, which is style,
 	// and the style attribute sets exactly one CSS property (including invalid
 	// or unrecognized properties), which is "vertical-align"."
@@ -737,10 +711,27 @@
 
 	// "It is an a, font, or span element with exactly one attribute, which is
 	// style, and the style attribute sets exactly one CSS property (including
-	// invalid or unrecognized properties)."
+	// invalid or unrecognized properties), and that property is not
+	// "text-decoration"."
 	if ((node.tagName == "A" || node.tagName == "FONT" || node.tagName == "SPAN")
 	&& node.hasAttribute("style")
-	&& node.style.length == 1) {
+	&& node.style.length == 1
+	&& node.style.textDecoration == "") {
+		return true;
+	}
+
+	// "It is an a, font, s, span, or u element with exactly one attribute,
+	// which is style, and the style attribute sets exactly one CSS property
+	// (including invalid or unrecognized properties), which is
+	// "text-decoration", which is set to "line-through" or "underline" or
+	// "overline" or "none"."
+	if (["A", "FONT", "S", "SPAN", "U"].indexOf(node.tagName) != -1
+	&& node.hasAttribute("style")
+	&& node.style.length == 1
+	&& (node.style.textDecoration == "line-through"
+	|| node.style.textDecoration == "underline"
+	|| node.style.textDecoration == "overline"
+	|| node.style.textDecoration == "none")) {
 		return true;
 	}
 
--- a/source.html	Thu Apr 07 15:32:58 2011 -0600
+++ b/source.html	Sun Apr 10 15:11:55 2011 -0600
@@ -408,23 +408,20 @@
   [[style]], and the [[style]] attribute sets exactly one CSS property
   (including invalid or unrecognized properties), which is "font-style".
 
-  <li>It is an [[s]] element with exactly one attribute, which is [[style]], and
-  the [[style]] attribute sets exactly one CSS property (including invalid or
-  unrecognized properties), which is "text-decoration", which is set to
-  "line-through" or "underline" or "none".
-
-  <li>It is a [[u]] element with exactly one attribute, which is [[style]], and
-  the [[style]] attribute sets exactly one CSS property (including invalid or
-  unrecognized properties), which is "text-decoration", which is set to
-  "line-through" or "underline" or "none".
-
   <li>It is a [[sub]] or [[sup]] element with exactly one attribute, which is
   [[style]], and the [[style]] attribute sets exactly one CSS property
   (including invalid or unrecognized properties), which is "vertical-align".
 
   <li>It is an [[a]], [[font]], or [[span]] element with exactly one attribute,
   which is [[style]], and the [[style]] attribute sets exactly one CSS property
-  (including invalid or unrecognized properties).
+  (including invalid or unrecognized properties), and that property is not
+  "text-decoration".
+
+  <li>It is an [[a]], [[font]], [[s]], [[span]], or [[u]] element with exactly
+  one attribute, which is [[style]], and the [[style]] attribute sets exactly
+  one CSS property (including invalid or unrecognized properties), which is
+  "text-decoration", which is set to "line-through" or "underline" or
+  "overline" or "none".
 </ul>
 
 <p class=note>Conceptually, a simple modifiable element is a modifiable element