Summary: | [Qt][WK2] REGRESSION(r126067): It made qmltests::DoubleTapToZoom::test_basic() fail | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Csaba Osztrogonác <ossy> | ||||
Component: | New Bugs | Assignee: | Simon Hausmann <hausmann> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | cdumez, cmarcelo, gaborb, hausmann, kenneth, loki, menard, noam, oliver, ossy, pvarga, webkit.review.bot, zherczeg, zoltan | ||||
Priority: | P2 | Keywords: | Qt, QtTriaged | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 70236, 94493 | ||||||
Attachments: |
|
Description
Csaba Osztrogonác
2012-08-24 10:15:32 PDT
cc JSC/QML experts, maybe you know what is it and how to fix it It appears this QML attempts to serialize a ClientRect object (unhandled host object), which is not supported according to spec (http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#safe-passing-of-structured-data). As a consequence, a DataCloneError is being thrown. tst_doubleTapToZoom.qml code: function elementRect(id) { resultSpy.clear(); var result; webView.experimental.evaluateJavaScript( "document.getElementById('" + id + "').getBoundingClientRect();", function(rect) { webView.resultReceived(); result = rect }); resultSpy.wait(); return result; } I haven't looked at this in details, but Chris made the serialization more compliant with the specs and thus more strict. getBoundingClientRect(); returns ClientRect object (http://www.w3.org/TR/cssom-view/#clientrect) so it is not serializable and it has to be turned into an object literal (Object object) before serialization. This following line in Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_doubleTapToZoom.qml function(rect) { webView.resultReceived(); result = rect }); needs to be changed to function(rect) { webView.resultReceived(); result = { width: rect.width, height: rect.height } }); or similar Btw you need to do this before serialization! webView.experimental.evaluateJavaScript( "var clientRect = document.getElementById('" + id + "').getBoundingClientRect();" + "return { width: clientRect.width, height: clientRect.height }", function(rect) { webView.resultReceived(); result = rect }); Created attachment 160674 [details]
Patch
Comment on attachment 160674 [details]
Patch
Funny I thought about this yesterday... I should have mentioned to just use the JSON methods, and here we go :-)
I still wonder if for the QML API we should automatically imply a JSON conversion or instead keep the current implementation and document that the return value will be cloned according to the html cloning algo. Committed r126740: <http://trac.webkit.org/changeset/126740> |