Bug 118860

Summary: [Qt] Add a an isMainFrame property to the QWebNavigationRequest QtWebkit2 API
Product: WebKit Reporter: Alexandre Abreu <alexandre.abreu>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abecsi, cmarcelo, commit-queue, hausmann, kenneth, menard
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Add a 'isMainFrame' parameter to QWebNavigationRequest.
none
Add revision for the new property and bump the plugin minor versions
none
Archive of layout-test-results from APPLE-EWS-4 for win-future
none
Make sure that we can still access version 3.0 of NavigationRequest QtObject none

Description Alexandre Abreu 2013-07-18 12:43:59 PDT
The Qt/QML API exposed by QtWebkit2 for the navigation requested policy could use an additional 'isMainFrame' property to the QWebNavigationRequest object sent to onNavigationRequested. The fact that it not there makes it hard for an application to take an action with a limited context.
Comment 1 Alexandre Abreu 2013-07-18 13:40:52 PDT
Created attachment 207017 [details]
Add a 'isMainFrame' parameter to QWebNavigationRequest.
Comment 2 Simon Hausmann 2013-07-19 02:12:59 PDT
Comment on attachment 207017 [details]
Add a 'isMainFrame' parameter to QWebNavigationRequest.

Looks good to me in general, but adding new properties requires a new minor revision of the import. See also http://qt-project.org/doc/qt-5.1/qtqml/qtqml-cppintegration-definetypes.html#type-revisions-and-versions

Also, you may want to mark your patch for review :)
Comment 3 Alexandre Abreu 2013-07-19 12:52:32 PDT
Created attachment 207138 [details]
Add revision for the new property and bump the plugin minor versions
Comment 4 Build Bot 2013-07-27 12:07:41 PDT
Comment on attachment 207138 [details]
Add revision for the new property and bump the plugin minor versions

Attachment 207138 [details] did not pass win-ews (win):
Output: http://webkit-queues.appspot.com/results/1247513

New failing tests:
dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1.xhtml
dom/xhtml/level1/core/hc_attrappendchild4.xhtml
dom/svg/level3/xpath/XPathEvaluator_evaluate_INVALID_EXPRESSION_ERR.svg
dom/html/level2/events/dispatchEvent04.html
dom/svg/level3/xpath/XPathEvaluator_createExpression_INVALID_EXPRESSION_ERR.svg
dom/svg/level3/xpath/XPathEvaluator_createExpression_NAMESPACE_ERR_02.svg
dom/html/level1/core/documentinvalidcharacterexceptioncreateentref.html
dom/svg/level3/xpath/XPathEvaluator_evaluate_NOT_SUPPORTED_ERR.svg
dom/svg/level3/xpath/XPathEvaluator_evaluate_NAMESPACE_ERR.svg
dom/html/level2/events/dispatchEvent01.html
dom/html/level1/core/hc_attrgetvalue2.html
dom/html/level2/events/dispatchEvent03.html
dom/html/level2/events/dispatchEvent02.html
dom/html/level2/core/createDocumentType04.html
dom/html/level1/core/documentinvalidcharacterexceptioncreateentref1.html
dom/xhtml/level1/core/hc_attrappendchild2.xhtml
dom/html/level2/events/dispatchEvent06.html
dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1.xhtml
dom/html/level2/events/dispatchEvent07.html
dom/html/level2/core/setAttributeNS10.html
dom/html/level2/events/dispatchEvent05.html
dom/html/level1/core/hc_attrappendchild2.html
dom/html/level2/core/createAttributeNS06.html
dom/html/level1/core/hc_attrappendchild4.html
dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi.xhtml
dom/svg/level3/xpath/XPathEvaluator_createExpression_NAMESPACE_ERR_01.svg
dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref.xhtml
dom/html/level1/core/documentinvalidcharacterexceptioncreatepi1.html
dom/html/level1/core/documentinvalidcharacterexceptioncreatepi.html
dom/html/level2/core/hc_namednodemapinvalidtype1.html
Comment 5 Build Bot 2013-07-27 12:07:44 PDT
Created attachment 207587 [details]
Archive of layout-test-results from APPLE-EWS-4 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: APPLE-EWS-4  Port: win-future  Platform: CYGWIN_NT-6.1-WOW64-1.7.20-0.266-5-3-i686-32bit
Comment 6 Simon Hausmann 2013-08-26 23:38:44 PDT
Comment on attachment 207138 [details]
Add revision for the new property and bump the plugin minor versions

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

> Source/WebKit/qt/declarative/plugin.cpp:60
> -        qmlRegisterUncreatableType<QWebNavigationRequest>(uri, 3, 0, "NavigationRequest", QObject::tr("Cannot create separate instance of NavigationRequest"));
> +        qmlRegisterUncreatableType<QWebNavigationRequest, 1>(uri, 3, 1, "NavigationRequest", QObject::tr("Cannot create separate instance of NavigationRequest"));

I think you may want to keep both lines, in order to continue to be able to instantiate the 3.0 version.

Looks good to me otherwise!
Comment 7 Alexandre Abreu 2013-08-27 06:39:26 PDT
Created attachment 209763 [details]
Make sure that we can still access version 3.0 of NavigationRequest QtObject
Comment 8 Alexandre Abreu 2013-08-27 06:42:27 PDT
(In reply to comment #6)
> (From update of attachment 207138 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=207138&action=review
> 
> > Source/WebKit/qt/declarative/plugin.cpp:60
> > -        qmlRegisterUncreatableType<QWebNavigationRequest>(uri, 3, 0, "NavigationRequest", QObject::tr("Cannot create separate instance of NavigationRequest"));
> > +        qmlRegisterUncreatableType<QWebNavigationRequest, 1>(uri, 3, 1, "NavigationRequest", QObject::tr("Cannot create separate instance of NavigationRequest"));
> 
> I think you may want to keep both lines, in order to continue to be able to instantiate the 3.0 version.
> 
> Looks good to me otherwise!

right, done.
Comment 9 WebKit Commit Bot 2013-08-28 00:23:50 PDT
Comment on attachment 207138 [details]
Add revision for the new property and bump the plugin minor versions

Clearing flags on attachment: 207138

Committed r154724: <http://trac.webkit.org/changeset/154724>
Comment 10 WebKit Commit Bot 2013-08-28 00:23:53 PDT
All reviewed patches have been landed.  Closing bug.