Bug 52469 - [Qt] Made QtScript dependency optional
Summary: [Qt] Made QtScript dependency optional
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P5 Enhancement
Assignee: Nobody
URL:
Keywords: Qt, QtTriaged
: 34519 49748 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-01-14 12:24 PST by Konstantin Tokarev
Modified: 2014-02-03 03:17 PST (History)
6 users (show)

See Also:


Attachments
Made QtScript dependency optional (12.20 KB, patch)
2011-01-14 12:30 PST, Konstantin Tokarev
no flags Details | Formatted Diff | Diff
Made QtScript dependency optional (12.22 KB, patch)
2011-01-15 05:38 PST, Konstantin Tokarev
hausmann: review-
hausmann: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Tokarev 2011-01-14 12:24:41 PST
This patch fixes compilation when QtScript module is disabled.
Comment 1 Konstantin Tokarev 2011-01-14 12:30:55 PST
Created attachment 78982 [details]
Made QtScript dependency optional
Comment 2 WebKit Review Bot 2011-01-14 12:33:40 PST
Attachment 78982 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebCore/bridge/qt/qt_runtime.h:244:  Should have a space between // and comment  [whitespace/comments] [4]
WebKit/qt/Api/qwebelement.cpp:806:  Should have a space between // and comment  [whitespace/comments] [4]
Source/WebCore/bridge/qt/qt_instance.cpp:401:  Should have a space between // and comment  [whitespace/comments] [4]
Source/WebCore/bridge/qt/qt_class.cpp:228:  Should have a space between // and comment  [whitespace/comments] [4]
Source/WebCore/bridge/qt/qt_class.h:61:  Should have a space between // and comment  [whitespace/comments] [4]
WebKit/qt/Api/qwebframe.cpp:633:  Should have a space between // and comment  [whitespace/comments] [4]
Source/WebCore/bridge/qt/qt_instance.h:29:  Alphabetical sorting problem.  [build/include_order] [4]
Source/WebCore/bridge/qt/qt_instance.h:99:  Should have a space between // and comment  [whitespace/comments] [4]
Total errors found: 8 in 16 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Konstantin Tokarev 2011-01-15 05:38:52 PST
Created attachment 79062 [details]
Made QtScript dependency optional
Comment 4 Simon Hausmann 2011-01-16 23:51:21 PST
I don't really see us moving in that direction.

Right now the only dependency on QtScript we have is that $$prefix/include/QtScript is present. The library does not even have to be compiled!

In the future we want to make QtScript a real link-time dependency.
Comment 5 Konstantin Tokarev 2011-01-17 00:48:45 PST
(In reply to comment #4)
> I don't really see us moving in that direction.
> 
> Right now the only dependency on QtScript we have is that $$prefix/include/QtScript is present. The library does not even have to be compiled!

I realize that, but $$prefix/include/QtScript is not normally installed when script module is not enabled. I've asked for advice on webkit-qt@lists.webkit.org, and Benjamin Poulain adviced me to disable bridge if QtScript is missing
Comment 6 Simon Hausmann 2011-01-17 09:33:16 PST
Comment on attachment 79062 [details]
Made QtScript dependency optional

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

Ok, apart from the other notes I made in the review, I think for this patch to go in we should only disable the parts of the code that actually rely on QScriptEngine::ValueOwnership.

One way of doing that would be to disable the QObject bindings, another way would be to introduce a QtWebKit
internal enum that mirrors QScriptEngine::ValueOwnership and when QT_NO_SCRIPT is define only the
addToJavaScriptWindowObject method overload that takes the QScriptEngine parameter is excluded from
the build. The other overload would remain intact.

Either way when QT_NO_SCRIPT is define, I think QWebFrame::evaluateJavaScript should remain functional.

So let me revert my earlier statement. What you're trying to do makes sense, but I think the patch needs a bit of refinement :)

> Source/WebCore/bindings/js/ScriptControllerQt.cpp:54
> +#ifndef QT_NO_SCRIPT
>      if (widget->isPluginView()) {
>          PluginView* pluginView = static_cast<PluginView*>(widget);
>          return pluginView->bindingInstance();

This code - the one to return the binding instance of the PluginView is needed for Netscape plugin scripting to work.
The QT_NO_SCRIPT #ifdef has to be placed below that.

> Source/WebCore/platform/qt/PlatformMouseEventQt.cpp:39
> +#ifndef QT_NO_GRAPHICSVIEW

This should be handled in a different patch.
Comment 7 Konstantin Tokarev 2011-01-18 05:43:15 PST
(In reply to comment #6)
> One way of doing that would be to disable the QObject bindings, another way would be to introduce a QtWebKit internal enum that mirrors ScriptEngine::ValueOwnership and when QT_NO_SCRIPT is define only the
addToJavaScriptWindowObject method overload that takes the QScriptEngine parameter is excluded from the build. The other overload would remain intact.

Which way is more preferable?
Comment 8 Simon Hausmann 2011-01-19 07:43:49 PST
(In reply to comment #7)
> (In reply to comment #6)
> > One way of doing that would be to disable the QObject bindings, another way would be to introduce a QtWebKit internal enum that mirrors ScriptEngine::ValueOwnership and when QT_NO_SCRIPT is define only the
> addToJavaScriptWindowObject method overload that takes the QScriptEngine parameter is excluded from the build. The other overload would remain intact.
> 
> Which way is more preferable?

Hmm, I prefer the latter, just disabling the overload.
Comment 9 Konstantin Tokarev 2011-01-19 07:57:45 PST
> Hmm, I prefer the latter, just disabling the overload.

It requires addition of new public header which should be included instead of <QtScript/qscriptengine.h>, e.g., "scriptvalueownership.h". Where should it be placed (Source/WebCore/bridge/qt, /home/kostya/projects/git/WebKit/Source/WebKit/qt, or somewhere else)?

Also, do you have something against separate option for disabling QObject bindings?
Comment 10 Benjamin Poulain 2011-01-28 19:32:31 PST
*** Bug 49748 has been marked as a duplicate of this bug. ***
Comment 11 Benjamin Poulain 2011-01-30 09:06:55 PST
*** Bug 34519 has been marked as a duplicate of this bug. ***
Comment 12 Jocelyn Turcotte 2014-02-03 03:17:10 PST
=== Bulk closing of Qt bugs ===

If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it and remove [Qt] from the summary.

If you believe that this is still an important QtWebKit bug, please fill a new report at https://bugreports.qt-project.org and add a link to this issue. See http://qt-project.org/wiki/ReportingBugsInQt for additional guidelines.