[PyQt] Bug in QWebKit?...

Kovid Goyal kovid at kovidgoyal.net
Fri Jan 13 12:01:51 GMT 2012


On Fri, Jan 13, 2012 at 10:32:02AM +0100, Andreas Pakulat wrote:
> Maybe I didn't read your code close enough, but it merely looked like a
> case where different page-contents influence a given attribute in
> different ways. So the code tries to determine which attribute is best
> used for height. This is not uncommon in browsers, layouting HTML is a
> hard business due to varying rules and missing definitions. So it might
> just be that the contentsSize property does not map to the
> body.offsetHeight but uses some other property which is not set
> correctly in some webpages.

The difficulty of laying out HTML is irrelevant. Whatever that difficulty,
WebKit uses a single algorithm for laying out a given set of HTML. In other
words if you layout the same HTML n times, you will deterministically get the
same result n times. So for what you're saying to make sense, the C++ API would
need to query the layout engine in a different way than the javascript engine,
to get the same layout information. Which in turn means that they have 
different memory models of the rendered document. Which is what James' 
example also appears to be suffering from. 

Anyway, I claim that you will find disconnects between the javascript API 
and the C++ API a lot in Qt WebKit, make of that claim whatever you want. 

Kovid.

-- 
_____________________________________

Dr. Kovid Goyal 
http://www.kovidgoyal.net
http://calibre-ebook.com
_____________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20120113/cbcdc879/attachment.pgp>


More information about the PyQt mailing list