[PyQt] Bug in QWebKit?...

Andreas Pakulat apaku at gmx.de
Fri Jan 13 09:32:02 GMT 2012


On 13.01.12 14:23:02, Kovid Goyal wrote:
> On Fri, Jan 13, 2012 at 09:34:42AM +0100, Andreas Pakulat wrote:
> > Well, determining coordinates and height/width for elements is a
> > completely different story than fetching a static attribute from a
> > static element in a static page.
> 
> The point is that I have found that properties that can be modified in
> javascript often return different values when accessed via javascript and the
> Qt APIs. 
> 
> Static with respect to what? Do the following; in the test case James attached,
> click the Submit button without clicking the defaults button first, I'm betting
> you will see that the values returned by the two APIs are the same.

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.

Thats a bit different than accessing the same attribute in JS code and
via a C++ or Python API (in the same way, i.e.
document.firstChild.....value) and getting different results. This
suggests there's a disconnection between the Qt object and the JS
engine.

Andreas



More information about the PyQt mailing list