[Webkit-unassigned] [Bug 29583] New: [Qt] calling a js function via QWebFrame::evaluateJavaScript doe s not repaint div background
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Sep 21 08:48:46 PDT 2009
https://bugs.webkit.org/show_bug.cgi?id=29583
Summary: [Qt] calling a js function via
QWebFrame::evaluateJavaScript doe s not repaint div
background
Product: WebKit
Version: 528+ (Nightly build)
Platform: Other
OS/Version: Mac OS X 10.5
Status: NEW
Keywords: Qt
Severity: Normal
Priority: P2
Component: New Bugs
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: vestbo at webkit.org
This bug report originated from Nokia internal issue QT-1850
--- Comments ---
Product
Qt
Function
webkit
Version
4.5.0
Platform
Windows XP
Platform details
32bit Windows XP SP2
Compilers
GCC
Compiler details
Native Mingw 3.4.5
Subject
calling a js function via QWebFrame::evaluateJavaScript does not repaint div
background
Steps to reproduce / test case
Calling a javascript function, that sets a DIV element's background color:
function testrepaint()
{
document.getElementById("repaintdiv").style.backgroundColor="blue";
}
The js function is called from the GUI thread (via a button press slot), via
QWebFrame::evaluateJavaScript(), like this:
webView->page()->mainFrame()->evaluateJavaScript("testrepaint()");
The result:
If the above is triggered when the mouse is not within the area of the QWebView
control, the color of the DIV does not change. Subsequently, when moving the
mouse cursor over the QWebView control, the DIV gets immediately repainted.
More information
I have tried performing two other operations from the called javascript
function which work as expected:
toggling the state of a checkbox, and setting the innerHTML of the DIV. These
operations are executed immediately even if hte mouse cursor is not within the
QWebView control.
I have also tried an alternative method of calling the javascript function, via
using the WebKit API directly. The result is the same, which probably suggest
the issue is related to the Qt port of WebKit or to WebKit itself. Here is the
code that uses the webkit API to call the js function:
void MyBrowser::CallJSFunctionNameWithParams(WebCore::Frame* frame, const char*
jsFuncName, const JSC::ArgList& argList)
{
WebCore::JSDOMWindow *globalObject = toJSDOMWindow(frame);
if (!globalObject)
{
printf ("Warning: couldn't get window object");
return;
}
JSC::ExecState* globalExec = globalObject->globalExec();
JSC::JSLock lock(true);
JSC::Identifier identifier(globalExec, jsFuncName);
JSC::JSValuePtr funcVal = globalObject->get(globalExec, identifier);
if ( !funcVal || !funcVal->isObject())
{
printf("Requested Object could not Be Found!");
return;
}
JSC::JSObject* funcObj = asObject(funcVal);
if (!(funcObj->inherits(&JSC::JSFunction::info)))
{
printf("not a function");
return;
}
JSC::JSFunction* funcImp = static_cast<JSC::JSFunction*>(funcObj);
JSC::JSObject* thisObj = globalObject;
JSC::JSValuePtr result = funcImp->call(globalExec, thisObj, argList);
if (!result)
{
printf( "Nothing returned from JavaScript function");
return;
}
}
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list