Bug 48413

Summary: [Qt] QML WebView doesn't render content
Product: WebKit Reporter: Henrik Hartz <henrik.hartz>
Component: WebKit QtAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Major CC: benjamin, FrankWolbring, gopal.1.raghavan, hausmann, henrik.hartz, menard
Priority: P2 Keywords: Qt, QtTriaged
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
webview-bad.png
none
webview-ok.png
none
QML testcase showing a web page using CSS and one which does not none

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 ***