Bug 28600

Summary: Inspector: XML Tags should not be converted to lowercase
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web Inspector (Deprecated)Assignee: Alexander Pavlov (apavlov) <apavlov>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, aroben, mjs, pfeldman, timothy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[SAMPLE] XML File with Different Case Tags
none
[PATCH] Proposed solution
pfeldman: review+
[PATCH] Test altered to cover the change pfeldman: review+, apavlov: commit-queue+

Description Joseph Pecoraro 2009-08-20 22:31:31 PDT
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).
Comment 1 Timothy Hatcher 2009-09-11 20:24:54 PDT
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.
Comment 2 Alexander Pavlov (apavlov) 2010-03-23 10:43:23 PDT
Created attachment 51435 [details]
[PATCH] Proposed solution
Comment 3 Alexey Proskuryakov 2010-03-23 16:10:59 PDT
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 4 Pavel Feldman 2010-03-24 08:52:48 PDT
Comment on attachment 51435 [details]
[PATCH] Proposed solution

Please check tests.
Comment 5 Alexander Pavlov (apavlov) 2010-03-24 09:19:30 PDT
Created attachment 51512 [details]
[PATCH] Test altered to cover the change
Comment 6 Alexander Pavlov (apavlov) 2010-03-24 10:22:40 PDT
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