Bug 48413 - [Qt] QML WebView doesn't render content
Summary: [Qt] QML WebView doesn't render content
Status: RESOLVED DUPLICATE of bug 50222
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Major
Assignee: Nobody
URL:
Keywords: Qt, QtTriaged
Depends on:
Blocks:
 
Reported: 2010-10-27 04:45 PDT by Henrik Hartz
Modified: 2011-02-24 08:53 PST (History)
6 users (show)

See Also:


Attachments
webview-bad.png (38.56 KB, image/png)
2010-10-27 04:46 PDT, Henrik Hartz
no flags Details
webview-ok.png (66.27 KB, image/png)
2010-10-27 04:48 PDT, Henrik Hartz
no flags Details
QML testcase showing a web page using CSS and one which does not (2.04 KB, application/zip)
2010-11-26 03:49 PST, Henrik Hartz
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Henrik Hartz 2010-10-27 04:45:54 PDT
A QML document has a Flickable which contains a WebView.

<pre>
import Qt 4.7
import QtWebKit 1.0


Rectangle {
      width: 800
      height: 480

        Flickable {
            x: 25
            y: 25
            width: 750
            height: 360
            contentWidth: 750
            contentHeight: help_browser.height
            clip: true

            WebView {
                id: help_browser
                url: "qrc:/doc/help.html"
                width: 750
            }
        }
   ....
}
</pre>

This results in the image shown in webview-bad.png. The chequered  area should be filled with docs. However, as soon as I pan even a little bit the docs appear and I get webview-ok.png.

The HTML file has this <head>:

<pre>
<html>
<head>
  <title>....</title>
  <link href="doc/stylesheet.css" rel="stylesheet" type="text/css">
</head>
</pre>

As soon as I leave out the stylesheet line it works as it should and the page is immediately loaded. Perhaps this is really a WebKit problem, but as I only use it together with QML I have no idea. The stylesheet is loaded and applied if both the HTML and CSS files are loaded from resources.
Comment 1 Henrik Hartz 2010-10-27 04:46:35 PDT
Created attachment 72008 [details]
webview-bad.png
Comment 2 Henrik Hartz 2010-10-27 04:48:14 PDT
Created attachment 72009 [details]
webview-ok.png
Comment 3 Simon Hausmann 2010-11-02 07:32:57 PDT
Please report QtWebKit bugs using http://webkit.org/new-qtwebkit-bug

See http://trac.webkit.org/wiki/QtWebKitBugs for guidance.
Comment 4 Frank Wolbring 2010-11-04 09:33:22 PDT
It will render It's content, if you set the preferredHeight and preferredWidth properties to a value grater than 0. The best is, to set these properties to the size of your flockable element.
Comment 5 Benjamin Poulain 2010-11-12 07:28:55 PST
Henrik, could you attach a .qml file so people can test this directly?
Comment 6 Henrik Hartz 2010-11-26 03:49:49 PST
Created attachment 74913 [details]
QML testcase showing a web page using CSS and one which does not

Here's a test project. Seems to be broken in both cases on MacOS X
Comment 7 Gopal Raghavan 2011-01-20 13:20:10 PST
patch in https://bugs.webkit.org/show_bug.cgi?id=50222 should solve this issue.
Comment 8 Alexis Menard (darktears) 2011-02-24 08:53:35 PST

*** This bug has been marked as a duplicate of bug 50222 ***