[Webkit-unassigned] [Bug 44876] New: QWebElement::toOuterXml() and QWebElement::toInnerXml() return invalid XML

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 30 09:55:04 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=44876

           Summary: QWebElement::toOuterXml() and
                    QWebElement::toInnerXml() return invalid XML
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: WebKit Qt
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: bero at arklinux.org


QWebElement::toOuterXml() and QWebElement::toInnerXml() return HTML code that isn't valid XML when they hit certain tags, such as <meta>.

This snippet:

#include <QApplication>
#include <QWebView>
#include <QWebFrame>
#include <QWebElement>
#include <iostream>

int main(int argc, char **argv) {
        QApplication app(argc, argv);
        QWebView *v=new QWebView(0);
        v->setHtml("<html><head><meta name=\"author\" content=\"test1\"/></head><body><p>Test</p></body></html>");
        std::cerr << qPrintable(v->page()->mainFrame()->documentElement().toOuterXml()) << std::endl;
}


Prints:
<html><head><meta name="author" content="test1"></head><body><p>Test</p></body></html>


Note the absence of the closing / (or alternatively, </meta>) in the <meta tag.
This is valid HTML, but not valid X(HT)ML -- not what you'd expect from a function named to*Xml.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list