Bug 29540

Summary: [Qt] Problem with QWebElement toInnerXml() and toOuterXml() if HTML source contains closed tags
Product: WebKit Reporter: Tor Arne Vestbø <vestbo>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WORKSFORME    
Severity: Normal CC: benjamin, jedrzej.nowacki, kenneth, laszlo.gombos, tonikitoo
Priority: P2 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 29799    

Tor Arne Vestbø
Reported 2009-09-21 04:58:09 PDT
This bug report originated from Nokia internal issue QT-695 --- Description --- QWebElement generate bad output for toInnerXml and toOuterXml methods if source HTML contains solo tags. QWebElement tread closed tags (ex. <tag/>) as if they include data normaly following them . For example: -------------------- source html: <tag><childtag/>some text</tag> result toInnerHtml() for <tag> element should be: <childtag/>some text or '<childtag></childtag>some text but it was: <childtag>some text</childtag> result toOuterHtml() for <tag> element should be: <tag><childtag/>some text</tag> or '<tag><childtag></childtag>some text</tag> but it was: <tag><childtag>some text</childtag></tag>
Attachments
Kenneth Rohde Christiansen
Comment 1 2009-10-05 05:12:11 PDT
I don't really see the point. This is how they are treated internally, and the functions do start with "to", indicating some kind of conversion. Would be fun to see what jQuery returns?
Tor Arne Vestbø
Comment 2 2009-10-05 05:19:09 PDT
Both Safari and Firefox has this behavior: data:text/html,<p id="para"><br/>foo</p> document.getElementById("para") <p id=​"para">​ document.getElementById("para").innerHTML <br>foo document.getElementById("para").outerHTML <p id="para"><br>foo</p>
Jędrzej Nowacki
Comment 3 2009-10-05 07:58:37 PDT
The output is broken, it is true but: 1. HTML doesn't support closed tags, XHTML does. 2. nobody care, I'm pretty sure it is my request, closed in Hooligan and (badly?) migrated to Jira and than to bugzilla.
Tor Arne Vestbø
Comment 4 2009-10-06 03:51:47 PDT
Can't reproduce this in trunk
Note You need to log in before you can comment on or make changes to this bug.