LayoutTests:
authorlweintraub <lweintraub@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 May 2006 18:34:24 +0000 (18:34 +0000)
committerlweintraub <lweintraub@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 May 2006 18:34:24 +0000 (18:34 +0000)
        Reviewed by eric.

        - http://bugzilla.opendarwin.org/show_bug.cgi?id=8393
          <br>s created by createMarkup aren't valid xhtml
          Changes in case from innerHTML

        * editing/execCommand/createLink-expected.txt:
        * editing/execCommand/unlink-expected.txt:
        * editing/input/attributed-substring-from-range-lines-expected.txt:
        * fast/dom/Range/range-exceptions-expected.txt:
        * fast/dom/Range/resources/range-exceptions.js:
        * fast/innerHTML/005-expected.txt:
        * fast/innerHTML/innerHTML-custom-tag-expected.txt:
        * fast/innerHTML/innerHTML-cast.html: Added.
        * fast/innerHTML/innerHTML-cast-expected.txt: Added.
        * fast/xsl/xslt-processer-expected.txt:

WebCore:

        Reviewed by Eric.

        - Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8393
          <br>s created by createMarkup aren't valid xhtml
          Fixed uppered output from innerHTML

        * editing/markup.cpp:
        (WebCore::startMarkup):
        (WebCore::endMarkup):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14516 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/execCommand/createLink-expected.txt
LayoutTests/editing/execCommand/unlink-expected.txt
LayoutTests/editing/input/attributed-substring-from-range-lines-expected.txt
LayoutTests/fast/dom/Range/range-exceptions-expected.txt
LayoutTests/fast/dom/Range/resources/range-exceptions.js
LayoutTests/fast/innerHTML/005-expected.txt
LayoutTests/fast/innerHTML/innerHTML-case-expected.txt [new file with mode: 0644]
LayoutTests/fast/innerHTML/innerHTML-case.html [new file with mode: 0644]
LayoutTests/fast/innerHTML/innerHTML-custom-tag-expected.txt
LayoutTests/fast/xsl/xslt-processer-expected.txt
WebCore/ChangeLog
WebCore/editing/markup.cpp

index 246a81ce87fb5fb3326f0304add62764413c86f3..8fb582b0cd0b0e34be29f203d171dfc808963935 100644 (file)
@@ -1,3 +1,22 @@
+2006-05-22  Levi Weintraub  <lweintraub@apple.com>
+
+        Reviewed by eric.
+        
+        - http://bugzilla.opendarwin.org/show_bug.cgi?id=8393
+          <br>s created by createMarkup aren't valid xhtml
+          Changes in case from innerHTML
+
+        * editing/execCommand/createLink-expected.txt:
+        * editing/execCommand/unlink-expected.txt:
+        * editing/input/attributed-substring-from-range-lines-expected.txt:
+        * fast/dom/Range/range-exceptions-expected.txt:
+        * fast/dom/Range/resources/range-exceptions.js:
+        * fast/innerHTML/005-expected.txt:
+        * fast/innerHTML/innerHTML-custom-tag-expected.txt:
+        * fast/innerHTML/innerHTML-cast.html: Added.
+        * fast/innerHTML/innerHTML-cast-expected.txt: Added.
+        * fast/xsl/xslt-processer-expected.txt:
+
 2006-05-20  Anders Carlsson  <acarlsson@apple.com>
 
         Reviewed by Geoff.
index 577072e458ee4f3ea0817715ee325df9d5c36cce..a8e451921b4dc83b196ef5e1dccee4531c160a19 100644 (file)
@@ -52,8 +52,8 @@ Item 2
 This line contains  an image.
 innerHTML of editable regions after the test:
 
-<A href="http://www.google.com/">This paragraph starts unlinked. The entire paragraph should end up being a link to google.com.</A>
-<A href="http://www.apple.com/">This</A><A href="http://www.google.com/"> paragraph</A><A href="http://www.apple.com/"> starts out as a link to apple.com. The second word in the paragraph should end up being a link to google.com.</A>
-<A href="http://www.apple.com/">This</A><A href="http://www.google.com/"> paragraph</A><A href="http://www.apple.com/"> starts out as a link to apple.com. The second word in the paragraph should end up being a link to google.com.</A>
-<P><A href="http://www.google.com/">This </A><I><A href="http://www.google.com/">editable region</A></I><A href="http://www.google.com/"> contains lists, tables, styled text, and images. The entire region should end up being a link to google.com.</A></P> <UL> <LI><A href="http://www.google.com/">Item 1</A></LI> <LI><A href="http://www.google.com/">Item 2</A></LI> </UL> <TABLE border="1"><TBODY><TR><TD><A href="http://www.google.com/">1</A></TD><TD><A href="http://www.google.com/">2</A></TD><TD><A href="http://www.google.com/">3</A></TD></TR></TBODY></TABLE> <A href="http://www.google.com/"><BR> This </A><B><A href="http://www.google.com/">line</A></B><A href="http://www.google.com/"> contains </A><A href="http://www.google.com/"><IMG src="../resources/abe.jpg"> an image. </A>
+<a href="http://www.google.com/">This paragraph starts unlinked. The entire paragraph should end up being a link to google.com.</a>
+<a href="http://www.apple.com/">This</a><a href="http://www.google.com/"> paragraph</a><a href="http://www.apple.com/"> starts out as a link to apple.com. The second word in the paragraph should end up being a link to google.com.</a>
+<a href="http://www.apple.com/">This</a><a href="http://www.google.com/"> paragraph</a><a href="http://www.apple.com/"> starts out as a link to apple.com. The second word in the paragraph should end up being a link to google.com.</a>
+<p><a href="http://www.google.com/">This </a><i><a href="http://www.google.com/">editable region</a></i><a href="http://www.google.com/"> contains lists, tables, styled text, and images. The entire region should end up being a link to google.com.</a></p> <ul> <li><a href="http://www.google.com/">Item 1</a></li> <li><a href="http://www.google.com/">Item 2</a></li> </ul> <table border="1"><tbody><tr><td><a href="http://www.google.com/">1</a></td><td><a href="http://www.google.com/">2</a></td><td><a href="http://www.google.com/">3</a></td></tr></tbody></table> <a href="http://www.google.com/"><br> This </a><b><a href="http://www.google.com/">line</a></b><a href="http://www.google.com/"> contains </a><a href="http://www.google.com/"><img src="../resources/abe.jpg"> an image. </a>
 
index ebd0b4bc02712f68d6466ebf29df79c08808318b..13c89776745ebe9898255087eb875e17e075197a 100644 (file)
@@ -59,7 +59,7 @@ This line contains  an image.
 The innerHTML of editable regions after the test:
 
 This paragraph should should end up unlinked.
-<A href="http://www.apple.com/">The</A> second<A href="http://www.apple.com/"> word in this paragraph should end up being unlinked, everything else should be a link.</A>
-This paragraph starts with <I><A href="http://www.google.com">a</A></I><SPAN id="test3start"> link</SPAN> in the middle. Only the 'a' in the previous sentence should be linked after the test.
-<P>This <I>editable region</I> contains lists, tables, styled text, and images. Everything in this region that is not selected should be a link, nothing that is selected should be a link.</P> <UL> <LI>Item 1</LI> <LI>Item 2</LI> </UL> <TABLE border="1"><TBODY><TR><TD>1</TD><TD>2</TD><TD><SPAN id="test4end"><A href="http://www.google.com/">3</A></SPAN></TD></TR></TBODY></TABLE> <A href="http://www.google.com/"><BR> This </A><B><A href="http://www.google.com/">line</A></B><A href="http://www.google.com/"> contains </A><A href="http://www.google.com/"><IMG src="../resources/abe.jpg"> an image. </A>
+<a href="http://www.apple.com/">The</a> second<a href="http://www.apple.com/"> word in this paragraph should end up being unlinked, everything else should be a link.</a>
+This paragraph starts with <i><a href="http://www.google.com">a</a></i><span id="test3start"> link</span> in the middle. Only the 'a' in the previous sentence should be linked after the test.
+<p>This <i>editable region</i> contains lists, tables, styled text, and images. Everything in this region that is not selected should be a link, nothing that is selected should be a link.</p> <ul> <li>Item 1</li> <li>Item 2</li> </ul> <table border="1"><tbody><tr><td>1</td><td>2</td><td><span id="test4end"><a href="http://www.google.com/">3</a></span></td></tr></tbody></table> <a href="http://www.google.com/"><br> This </a><b><a href="http://www.google.com/">line</a></b><a href="http://www.google.com/"> contains </a><a href="http://www.google.com/"><img src="../resources/abe.jpg"> an image. </a>
 
index a6b6165290048995a3aecc6f2ddd07f50de16730..bfeda65db518ef03d1c3bcf211723869a6380f5b 100644 (file)
@@ -97,7 +97,7 @@ line two
 and three   
 
 Actual HTML:
-<pre> <DIV class="editing" id="test"></DIV> </pre>
+<pre> <div class="editing" id="test"></div> </pre>
 (0, 0):
 (0, 0) length: 0
 (0, 2): 12{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }
index cb38e718a939b542dd082277c956ef2ebc5d5649..559d00db25bb8ad64fbb724ae3460a3448c4eef7 100644 (file)
@@ -3,8 +3,8 @@ This test checks a few DOM range exceptions.
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS node.innerHTML is '<BAR>AB<MOO>C</MOO>DE</BAR>'
-PASS foo.outerHTML is '<FOO></FOO>'
+PASS node.innerHTML is '<bar>AB<moo>C</moo>DE</bar>'
+PASS foo.outerHTML is '<foo></foo>'
 PASS range.surroundContents(foo) threw exception Error: BAD_BOUNDARYPOINTS_ERR: DOM Range Exception 1.
 PASS successfullyParsed is true
 
index 6dfe41fb6aa2e898983794e17e294b0baf3d68bb..c0ac41e6d79255f13d884adb4dd6a7fedc0048ef 100644 (file)
@@ -5,12 +5,12 @@ description(
 // Test to be sure the name BAD_BOUNDARYPOINTS_ERR dumps properly.
 var node = document.createElement("DIV");
 node.innerHTML = "<BAR>AB<MOO>C</MOO>DE</BAR>";
-shouldBe("node.innerHTML", "'<BAR>AB<MOO>C</MOO>DE</BAR>'");
+shouldBe("node.innerHTML", "'<bar>AB<moo>C</moo>DE</bar>'");
 var range = document.createRange();
 range.setStart(node.firstChild, 1);
 range.setEnd(node.firstChild, 2);
 var foo = document.createElement("FOO");
-shouldBe("foo.outerHTML", "'<FOO></FOO>'");
+shouldBe("foo.outerHTML", "'<foo></foo>'");
 shouldThrow("range.surroundContents(foo)");
 
 var successfullyParsed = true;
index 44525345c57c45d6c41f9dd50f8459b46f126457..b084bbe4c84fcc0c416d27804ff399abae194af5 100644 (file)
@@ -1,18 +1,18 @@
 Content:
-<HEAD>
-<META name="description" content="This tests html output">
-<TITLE>html innerHTML test</TITLE>
-</HEAD><BODY>
-<SPAN>Content:</SPAN>
-<PRE id="content">placeholder</PRE>
-<DIV></DIV>
-<SPAN></SPAN>
-<B>test</B>
-<BR>
-<SCRIPT>
+<head>
+<meta name="description" content="This tests html output">
+<title>html innerHTML test</title>
+</head><body>
+<span>Content:</span>
+<pre id="content">placeholder</pre>
+<div></div>
+<span></span>
+<b>test</b>
+<br>
+<script>
 if (window.layoutTestController)
        layoutTestController.dumpAsText();
 document.getElementById("content").firstChild.nodeValue = document.documentElement.innerHTML;
-</SCRIPT></BODY>
+</script></body>
 test 
 
diff --git a/LayoutTests/fast/innerHTML/innerHTML-case-expected.txt b/LayoutTests/fast/innerHTML/innerHTML-case-expected.txt
new file mode 100644 (file)
index 0000000..6958b52
--- /dev/null
@@ -0,0 +1,7 @@
+This test checks to see if innerHTML is outputting in the proper case, i.e. all tags and methods lower-case.
+
+
+
+Original: <BR /><br /><HR /><hr /><Br><dIv sTyLe="color:bluE;"></dIv>
+Result:   <br><br><hr><hr><br><div style="color:bluE;"></div>
+
diff --git a/LayoutTests/fast/innerHTML/innerHTML-case.html b/LayoutTests/fast/innerHTML/innerHTML-case.html
new file mode 100644 (file)
index 0000000..fb9261e
--- /dev/null
@@ -0,0 +1,28 @@
+<div id="description">This test checks to see if innerHTML is outputting in the proper case, i.e. all tags and methods lower-case.</div>
+
+<div id="test" style="display:none"></div>
+
+<div id="console"></div>
+
+<script language="javascript">
+if (window.layoutTestController)
+    window.layoutTestController.dumpAsText();
+
+function log(message) {
+    var console = document.getElementById("console");
+    var li = document.createElement("li");
+    var pre = document.createElement("pre");
+    pre.appendChild(document.createTextNode(message));
+    li.appendChild(pre);
+    console.appendChild(li);
+}
+
+var html = "<BR /><br /><HR /><hr /><Br><dIv sTyLe=\"color:bluE;\"></dIv>";
+
+var e = document.getElementById("test");
+e.innerHTML = html;
+
+log("Original: " + html);
+log("Result:   " + e.innerHTML);
+
+</script>
\ No newline at end of file
index 214e751c66ff2aa29aa82f6dfb47432b8d4e447a..9d9f111589f3076597693bb4d2a287906d3e7b50 100644 (file)
@@ -1,15 +1,15 @@
 Content:
 
-<SPAN>Content:</SPAN>
-<PRE id="content">placeholder</PRE>
-<DIV></DIV>
-<SPAN></SPAN>
-<B>test</B>
-<BR>
-<EMPTYCUSTOMTAG></EMPTYCUSTOMTAG>
+<span>Content:</span>
+<pre id="content">placeholder</pre>
+<div></div>
+<span></span>
+<b>test</b>
+<br>
+<emptycustomtag></emptycustomtag>
 <anotherEmptyCustomTag></anotherEmptyCustomTag>
-<CUSTOMTAG>more test</CUSTOMTAG>
-<DIV id="testArea"></DIV>
+<customtag>more test</customtag>
+<div id="testArea"></div>
 
 
 
index d55759bab3c569d4578ecdd6fc7f34070fb7edd1..0d381614de66ed72046127f18e3ad9a926cc52f4 100644 (file)
@@ -36,9 +36,9 @@
 1.0 void importStylesheet(in DOMNode style):
 
 1.1 Import two different stylesheets:
-<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><META http-equiv="Content-Type" content="text/html; charset=UTF-8"></HEAD><BODY>
-              CHARACTERS IN XSLT: ééééééééééé <BR><BR>SOURCE XML: &lt;&lt;&lt;&amp;тест&amp;&gt;&gt;&gt;
-</BODY></HTML>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body>
+              CHARACTERS IN XSLT: ééééééééééé <br><br>SOURCE XML: &lt;&lt;&lt;&amp;тест&amp;&gt;&gt;&gt;
+</body></html>
 1.2 Import same stylesheet twice:
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
 <head><title></title></head>
index d0bb4e61462f30f7e1f9309d5a1a74827a0b82f5..756c1ffa4ab3e2dc140f98535c5b68dc252e9f56 100644 (file)
@@ -1,3 +1,15 @@
+2006-05-22  Levi Weintraub  <lweintraub@apple.com>
+
+        Reviewed by Eric.
+        
+        - Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8393
+          <br>s created by createMarkup aren't valid xhtml
+          Fixed uppered output from innerHTML
+
+        * editing/markup.cpp:
+        (WebCore::startMarkup):
+        (WebCore::endMarkup):
+
 2006-05-21  Dave Hyatt <hyatt@apple.com>
 
         Fix Win32 bustage.   I forgot to add a bunch of files.
index 66ed1bd45e6ad405dfbbfa6999253a40fb365192..9a378c8717a00c79ab8b33cf1736d194c8aee971 100644 (file)
@@ -191,8 +191,9 @@ static DeprecatedString startMarkup(const Node *node, const Range *range, EAnnot
         case Node::PROCESSING_INSTRUCTION_NODE:
             return static_cast<const ProcessingInstruction*>(node)->toString().deprecatedString();
         case Node::ELEMENT_NODE: {
-            DeprecatedString markup = QChar('<') + node->nodeName().deprecatedString();
+            DeprecatedString markup = QChar('<');
             const Element* el = static_cast<const Element*>(node);
+            markup += el->Element::nodeName().deprecatedString();
             String additionalStyle;
             if (defaultStyle && el->isHTMLElement()) {
                 RefPtr<CSSComputedStyleDeclaration> computedStyle = Position(const_cast<Element*>(el), 0).computedStyle();
@@ -274,7 +275,7 @@ static inline bool shouldSelfClose(const Node *node)
 static DeprecatedString endMarkup(const Node *node)
 {
     if (node->isElementNode() && !shouldSelfClose(node) && !doesHTMLForbidEndTag(node))
-        return "</" + node->nodeName().deprecatedString() + ">";
+        return "</" + static_cast<const Element*>(node)->Element::nodeName().deprecatedString() + ">";
     return "";
 }