[webkit-reviews] review granted: [Bug 65920] [Qt] [WK2] Provide API for intercept (and possible ignore) links clicked in QDesktopWebView : [Attachment 104404] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 19 09:25:59 PDT 2011


Benjamin Poulain <benjamin at webkit.org> has granted Caio Marcelo de Oliveira
Filho <cmarcelo at webkit.org>'s request for review:
Bug 65920: [Qt] [WK2] Provide API for intercept (and possible ignore) links
clicked in QDesktopWebView
https://bugs.webkit.org/show_bug.cgi?id=65920

Attachment 104404: Patch
https://bugs.webkit.org/attachment.cgi?id=104404&action=review

------- Additional Comments from Benjamin Poulain <benjamin at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=104404&action=review


I like this patch a lot, I think that will be really useful. Nice work.

> Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp:396
> +    if (QMetaObject::invokeMethod(q, "navigationPolicyForUrl",
Q_RETURN_ARG(QVariant, ret), Q_ARG(QVariant, url), Q_ARG(QVariant, button),
Q_ARG(QVariant, QVariant(modifiers))))

It would be nice to have the doc for that, otherwise it is not advertised
anywhere that you can implement this function in QML.

>
Source/WebKit2/UIProcess/API/qt/tests/qmltests/DesktopWebView/tst_navigationPol
icyForUrl.qml:49
> +	       mouseClick(webView, 100, 100, Qt.MiddleButton,
Qt.ControlModifier)
> +	       otherSpy.wait()
> +	       compare(spy.count, 0)
> +	       compare(otherSpy.count, 1)
> +	       compare(otherWebView.title, "Test page 1")

This is one case, I think checking the UsePolicy would be necessary as well.
And you could check that the the original webview did not load anything since
IgnorePolicy was returned.


More information about the webkit-reviews mailing list