RESOLVED FIXED 8393
<br>s created by createMarkup aren't valid xhtml
https://bugs.webkit.org/show_bug.cgi?id=8393
Summary <br>s created by createMarkup aren't valid xhtml
Justin Garcia
Reported 2006-04-14 13:51:03 PDT
They need to be self closing: <br />
Attachments
Patch + Layout Tests + Detailed Changelog Entry (6.03 KB, patch)
2006-05-11 18:10 PDT, Levi Weintraub
hyatt: review-
Patch + Changelog (3.29 KB, patch)
2006-05-15 15:03 PDT, Levi Weintraub
eric: review+
Patch (2.63 KB, patch)
2006-05-22 14:12 PDT, Levi Weintraub
hyatt: review+
James Cox
Comment 1 2006-04-14 17:54:42 PDT
also elements need to be lowercase as XML is case sensitive....
Levi Weintraub
Comment 2 2006-05-11 18:10:51 PDT
Created attachment 8256 [details] Patch + Layout Tests + Detailed Changelog Entry
Eric Seidel (no email)
Comment 3 2006-05-11 18:26:54 PDT
Comment on attachment 8256 [details] Patch + Layout Tests + Detailed Changelog Entry I don't think this is right. I don't like the lowering of the nodeNames(). I also think it could have a better name for the test. We can talk about this in person.
Dave Hyatt
Comment 4 2006-05-11 18:28:23 PDT
Comment on attachment 8256 [details] Patch + Layout Tests + Detailed Changelog Entry Elements and attributes in XML are case-sensitive. For generic non-HTML elements, the output should not be lower-cased. It should be left alone. For HTML elements, nodeName has been hacked to return an upper-case string. In both HTML and XHTML, this is not what should be used for HTML elements. We want to output in lower-case for HTML elements regardless of document type. Rather than having to .lower() over and over it would be better to put an accessor on HTML element that didn't .upper() the result. Right now you're calling nodeName() which uppers and then .lowering that.
Darin Adler
Comment 5 2006-05-11 18:31:57 PDT
Comment on attachment 8256 [details] Patch + Layout Tests + Detailed Changelog Entry The bug in the original code is that it is using nodeName(). That function uppercases the local names. Instead you should use localName() on that call site. You should *not* call lower() since there can be non-HTML tags and attribute names that are mixed case, and lowercasing them is incorrect. I believe the change to shouldSelfClose is also incorrect, although you should check that one with Maciej and Eric who have worked in this area in the past. I don't think we want to generate self-closing tags at all when generating HTML.
Levi Weintraub
Comment 6 2006-05-15 15:03:15 PDT
Created attachment 8331 [details] Patch + Changelog The confusion seems to come from the expectation for createMarkup to generate xhtml when operating on an html document. This is not desired behavior. There was an issue with the case being .uppered() for html documents, and this has been patched by substituting localName for nodeName as per Darin's comment. When operating on an xhtml document, createMarkup generates valid <br>s.
Eric Seidel (no email)
Comment 7 2006-05-19 13:52:02 PDT
Comment on attachment 8331 [details] Patch + Changelog r=me! we discussed in person some additional testing strategies. But the code is OK to land.
Dave Hyatt
Comment 8 2006-05-22 11:39:14 PDT
Are you calling .localName on XML elements too? That would not be right. localName excludes the prefix, so you're losing information when serializing.
Levi Weintraub
Comment 9 2006-05-22 14:12:04 PDT
Created attachment 8461 [details] Patch Attempted to land a fix in r14516. That change addressed mjs's point about prefixes. Change from r14516 to remove ugly non-virtual dispatch (my bad).
Dave Hyatt
Comment 10 2006-05-23 02:43:59 PDT
Comment on attachment 8461 [details] Patch Yeah this is good. r=me.
Levi Weintraub
Comment 11 2006-05-23 10:47:03 PDT
Patch landed in r14537!
Note You need to log in before you can comment on or make changes to this bug.