Created attachment 38354 [details] [SAMPLE] XML File with Different Case Tags Restoring Bug after Bugzilla Data Loss - HTML can show lowercase node names (via localName) - XML should show unaffected due to its case-sensitivity --- Comment #1 from Maciej Stachowiak <mjs@apple.com> 2009-08-20 16:18:00 PDT --- My suggestion would be to use nodeName to get tag names in an XML document (this will preserve case and include the prefix) and localName in an HTML document (this will lowercase automatically).
The DOM is now serilized in native code and transfered to the Inspector in InspectorDOMAgent.cpp. We can serilize the correct nodeName case there and remove the forced lowercase code in the front end.
Created attachment 51435 [details] [PATCH] Proposed solution
Even a document that was originally served as XHTML can become an HTML document after a document.open() call. In this case, the MIME type check in this patch would be wrong. A more correct check would be to call Document.isHTMLDocument(), but that is not exposed to JS. There is also an issue with non-HTML elements added to HTML documents via DOM manipulation. I'd expect these to preserve their case, too. But maybe this is a good enough improvement as it is.
Comment on attachment 51435 [details] [PATCH] Proposed solution Please check tests.
Created attachment 51512 [details] [PATCH] Test altered to cover the change
Committing to http://svn.webkit.org/repository/webkit/trunk ... M LayoutTests/ChangeLog M LayoutTests/inspector/elements-panel-xhtml-structure-expected.txt M LayoutTests/inspector/elements-panel-xhtml-structure.xhtml M WebCore/ChangeLog M WebCore/inspector/front-end/ElementsPanel.js M WebCore/inspector/front-end/ElementsTreeOutline.js Committed r56446