[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
rniwa at webkit.org
rniwa at webkit.org
Wed Dec 22 15:32:00 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit cf0fea988bc4e591f3b349185057d88fc574a56e
Author: rniwa at webkit.org <rniwa at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Nov 5 22:47:59 2010 +0000
2010-11-05 Ryosuke Niwa <rniwa at webkit.org>
Reviewed by David Levin.
JSCallbackData::invokeCallback triggers layout from a worker thread
https://bugs.webkit.org/show_bug.cgi?id=49096
Fixed the bug by only calling updateStyleForAllDocuments when the context is document in
JSCallbackData::invokeCallback.
No new tests are added since many of existing workers tests hit the added assertion in debug builds.
* bindings/js/JSCallbackData.cpp:
(WebCore::JSCallbackData::invokeCallback): No longer calls updateStyleForAllDocuments unconditionally.
* dom/Document.cpp:
(WebCore::Document::updateStyleIfNeeded): Added ASSERT(isMainThread()).
(WebCore::Document::updateStyleForAllDocuments): Ditto.
(WebCore::Document::updateLayout): Ditto.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 86da837..535fd45 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-11-05 Ryosuke Niwa <rniwa at webkit.org>
+
+ Reviewed by David Levin.
+
+ JSCallbackData::invokeCallback triggers layout from a worker thread
+ https://bugs.webkit.org/show_bug.cgi?id=49096
+
+ Fixed the bug by only calling updateStyleForAllDocuments when the context is document in
+ JSCallbackData::invokeCallback.
+
+ No new tests are added since many of existing workers tests hit the added assertion in debug builds.
+
+ * bindings/js/JSCallbackData.cpp:
+ (WebCore::JSCallbackData::invokeCallback): No longer calls updateStyleForAllDocuments unconditionally.
+ * dom/Document.cpp:
+ (WebCore::Document::updateStyleIfNeeded): Added ASSERT(isMainThread()).
+ (WebCore::Document::updateStyleForAllDocuments): Ditto.
+ (WebCore::Document::updateLayout): Ditto.
+
2010-11-05 Ilya Sherman <isherman at chromium.org>
Reviewed by Simon Fraser.
diff --git a/WebCore/bindings/js/JSCallbackData.cpp b/WebCore/bindings/js/JSCallbackData.cpp
index f39c53c..204c348 100644
--- a/WebCore/bindings/js/JSCallbackData.cpp
+++ b/WebCore/bindings/js/JSCallbackData.cpp
@@ -65,12 +65,14 @@ JSValue JSCallbackData::invokeCallback(MarkedArgumentBuffer& args, bool* raisedE
if (!context)
return JSValue();
- JSValue result = context->isDocument()
+ bool contextIsDocument = context->isDocument();
+ JSValue result = contextIsDocument
? JSMainThreadExecState::call(exec, function, callType, callData, callback(), args)
: JSC::call(exec, function, callType, callData, callback(), args);
globalObject()->globalData().timeoutChecker.stop();
- Document::updateStyleForAllDocuments();
+ if (contextIsDocument)
+ Document::updateStyleForAllDocuments();
if (exec->hadException()) {
reportCurrentException(exec);
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index a40a88b..8e6e033 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -1541,6 +1541,7 @@ bail_out:
void Document::updateStyleIfNeeded()
{
+ ASSERT(isMainThread());
ASSERT(!view() || (!view()->isInLayout() && !view()->isPainting()));
if ((!m_pendingStyleRecalcShouldForce && !childNeedsStyleRecalc()) || inPageCache())
@@ -1558,6 +1559,7 @@ void Document::updateStyleIfNeeded()
void Document::updateStyleForAllDocuments()
{
+ ASSERT(isMainThread());
if (!documentsThatNeedStyleRecalc)
return;
@@ -1571,6 +1573,7 @@ void Document::updateStyleForAllDocuments()
void Document::updateLayout()
{
+ ASSERT(isMainThread());
if (Element* oe = ownerElement())
oe->document()->updateLayout();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list