Bug 28600 - Inspector: XML Tags should not be converted to lowercase
Summary: Inspector: XML Tags should not be converted to lowercase
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Alexander Pavlov (apavlov)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-20 22:31 PDT by Joseph Pecoraro
Modified: 2010-03-24 10:22 PDT (History)
5 users (show)

See Also:


Attachments
[SAMPLE] XML File with Different Case Tags (109 bytes, application/xml)
2009-08-20 22:31 PDT, Joseph Pecoraro
no flags Details
[PATCH] Proposed solution (6.11 KB, patch)
2010-03-23 10:43 PDT, Alexander Pavlov (apavlov)
pfeldman: review+
Details | Formatted Diff | Diff
[PATCH] Test altered to cover the change (8.23 KB, patch)
2010-03-24 09:19 PDT, Alexander Pavlov (apavlov)
pfeldman: review+
apavlov: commit-queue+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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