Bug 29540
Summary: | [Qt] Problem with QWebElement toInnerXml() and toOuterXml() if HTML source contains closed tags | ||
---|---|---|---|
Product: | WebKit | Reporter: | Tor Arne Vestbø <vestbo> |
Component: | DOM | Assignee: | 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ø
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Kenneth Rohde Christiansen
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ø
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
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ø
Can't reproduce this in trunk