Bug 87999 - [Qt][W2] Qml Error in ViewportInfoItem.qml in MiniBrowser
Summary: [Qt][W2] Qml Error in ViewportInfoItem.qml in MiniBrowser
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-31 11:45 PDT by Dinu Jacob
Modified: 2012-06-01 05:27 PDT (History)
5 users (show)

See Also:


Attachments
patch (2.80 KB, patch)
2012-05-31 11:49 PDT, Dinu Jacob
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dinu Jacob 2012-05-31 11:45:33 PDT
qrc:///qml/ViewportInfoItem.qml:28: TypeError: Cannot call method 'toFixed' of undefined
qrc:///qml/ViewportInfoItem.qml:35: TypeError: Cannot call method 'toFixed' of undefined
qrc:///qml/ViewportInfoItem.qml:42: TypeError: Cannot call method 'toFixed' of undefined
qrc:///qml/ViewportInfoItem.qml:49: TypeError: Cannot call method 'toFixed' of undefined
qrc:///qml/ViewportInfoItem.qml:57: TypeError: Cannot call method 'toFixed' of undefined
qrc:///qml/ViewportInfoItem.qml:71: TypeError: Cannot read property 'width' of undefine
Comment 1 Dinu Jacob 2012-05-31 11:48:04 PDT
QWebKitTest methods return invalid QVariant initially and attempt to call toFixed on those results in the error seen. It would be better to return some default values than invalid.
Comment 2 Dinu Jacob 2012-05-31 11:49:00 PDT
Created attachment 145125 [details]
patch
Comment 3 Andras Becsi 2012-06-01 04:26:47 PDT
Comment on attachment 145125 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=145125&action=review

> Source/WebKit2/UIProcess/API/qt/qwebkittest.cpp:160
>  QVariant QWebKitTest::isScalable() const
>  {
>      if (QtViewportInteractionEngine* viewport = m_webViewPrivate->viewportInteractionEngine())
>          return !!viewport->m_rawAttributes.userScalable;
> -    return QVariant();
> +    return true;

Shouldn't the default be false here?
Comment 4 Kenneth Rohde Christiansen 2012-06-01 04:28:50 PDT
Comment on attachment 145125 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=145125&action=review

>> Source/WebKit2/UIProcess/API/qt/qwebkittest.cpp:160
>> +    return true;
> 
> Shouldn't the default be false here?

Good point
Comment 5 Dinu Jacob 2012-06-01 04:35:19 PDT
(In reply to comment #4)
> (From update of attachment 145125 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=145125&action=review
> 
> >> Source/WebKit2/UIProcess/API/qt/qwebkittest.cpp:160
> >> +    return true;
> > 
> > Shouldn't the default be false here?
> 
> Good point

I will change it. Shouldn't user-scalable set to false explicitly though (isn't it treated as user-scalable true if it is not added explicitly? )
Comment 6 Dinu Jacob 2012-06-01 04:39:44 PDT
(In reply to comment #5)
> (In reply to comment #4)
> > (From update of attachment 145125 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=145125&action=review
> > 
> > >> Source/WebKit2/UIProcess/API/qt/qwebkittest.cpp:160
> > >> +    return true;
> > > 
> > > Shouldn't the default be false here?
> > 
> > Good point
> 
> I will change it. Shouldn't user-scalable set to false explicitly though (isn't it treated as user-scalable true if it is not added explicitly? )

Sorry, ignore my comment - I thought I had set it to false :( :(
Comment 7 WebKit Review Bot 2012-06-01 05:27:08 PDT
Comment on attachment 145125 [details]
patch

Clearing flags on attachment: 145125

Committed r119218: <http://trac.webkit.org/changeset/119218>
Comment 8 WebKit Review Bot 2012-06-01 05:27:13 PDT
All reviewed patches have been landed.  Closing bug.