diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-02-22 16:11:09 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2016-02-22 16:11:09 +0000 |
commit | 50f20864b536982ea9aafa1851a2e647144ed6ac (patch) | |
tree | 537f4bde6fcf72a50abec64b27d4c9f709adb6da /Source/WebKit/qt/WidgetApi/qwebframe.cpp | |
parent | 5dd4bb67cfce812fd7686e43616e2069f354a7df (diff) | |
parent | bfa56c39850f4db30ffe6a5026d8bcf34ebaf3e2 (diff) | |
download | qtwebkit-50f20864b536982ea9aafa1851a2e647144ed6ac.tar.gz |
Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7
Diffstat (limited to 'Source/WebKit/qt/WidgetApi/qwebframe.cpp')
-rw-r--r-- | Source/WebKit/qt/WidgetApi/qwebframe.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Source/WebKit/qt/WidgetApi/qwebframe.cpp b/Source/WebKit/qt/WidgetApi/qwebframe.cpp index e8faab881..dd08725eb 100644 --- a/Source/WebKit/qt/WidgetApi/qwebframe.cpp +++ b/Source/WebKit/qt/WidgetApi/qwebframe.cpp @@ -910,7 +910,21 @@ void QWebFrame::print(QPrinter *printer) const Evaluates the JavaScript defined by \a scriptSource using this frame as context and returns the result of the last executed statement. - \sa addToJavaScriptWindowObject(), javaScriptWindowObjectCleared() + \note This method may be very inefficient if \a scriptSource returns a DOM element + as a result. For example, evaluation of the next innocuously looking code may take + a lot of CPU and memory to execute: + + \code + var img = document.createElement('img'); + document.getElementById(\"foo\").appendChild(img); + \endcode + + This code returns appended DOM element, which is converted to QVariantMap + containing all its properties. To avoid this issue you can add "true" after + the last statement. + + \sa addToJavaScriptWindowObject(), javaScriptWindowObjectCleared(), + QWebElement::evaluateJavaScript() */ QVariant QWebFrame::evaluateJavaScript(const QString& scriptSource) { |