Bug 29461 - [Qt] QWebView->setHtml doesn't speak XHTML
Summary: [Qt] QWebView->setHtml doesn't speak XHTML
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Minor
Assignee: QtWebKit Unassigned
Keywords: Qt
: 29457 (view as bug list)
Depends on: 31115
  Show dependency treegraph
Reported: 2009-09-18 08:12 PDT by Tor Arne Vestbø
Modified: 2010-07-29 08:19 PDT (History)
5 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Tor Arne Vestbø 2009-09-18 08:12:44 PDT
This bug report originated from issue QTBUG-2787

--- Description ---

If one does:

    QString html="XHTML content";
    QWebView->setHtml( html );

it is parsed with WebKit's HTML parser as opposed to its XHTML parser (causing some oddities in the DOM tree because e.g. for HTML, <a id="something" /> is just an opened tag, while for XHTML it's opening and closing a tag).

QWebView->setContent( html.toLocal8Bit(), "application/xhtml+xml" ) does the correct thing, but is slower (and possibly less accurate), because of the charset conversions.

setHtml() should probably set the MIME type to application/xhtml+xml instead of text/html if it detects a proper XHTML header ("<?xml" and the doctype are good hints).
Comment 1 Jędrzej Nowacki 2009-11-25 09:17:29 PST
*** Bug 29457 has been marked as a duplicate of this bug. ***
Comment 2 Jocelyn Turcotte 2010-01-14 08:12:08 PST
Lowering to minor since workarounds are available.
Comment 3 Alexis Menard (darktears) 2010-07-29 08:17:29 PDT

*** This bug has been marked as a duplicate of bug 31115 ***
Comment 4 Alexis Menard (darktears) 2010-07-29 08:19:57 PDT
The documentation says better what to use now.