Title: [165132] branches/safari-537.75-branch/Source/WebCore
Diff
Modified: branches/safari-537.75-branch/Source/WebCore/ChangeLog (165131 => 165132)
--- branches/safari-537.75-branch/Source/WebCore/ChangeLog 2014-03-05 22:31:34 UTC (rev 165131)
+++ branches/safari-537.75-branch/Source/WebCore/ChangeLog 2014-03-05 22:41:51 UTC (rev 165132)
@@ -1,5 +1,28 @@
2014-03-05 Matthew Hanson <[email protected]>
+ Merge r162063.
+
+ 2014-01-15 Antti Koivisto <[email protected]>
+
+ Suspend resource requests during computedStyle
+ https://bugs.webkit.org/show_bug.cgi?id=127034
+
+ Reviewed by Andreas Kling.
+
+ We have some cases where getting computed style leads to crashes in loadPendingImages.
+ This is probably caused by load callbacks resulting in re-entering WebKit and killing the StyleResolver.
+
+ As a speculative fix suspend resource loads (and so callbacks) when getting the computed style.
+ We do similar suspension during style recalc for the same reason.
+
+ * dom/Document.cpp:
+ (WebCore::Document::styleForElementIgnoringPendingStylesheets):
+ * loader/ResourceLoadScheduler.h:
+ (WebCore::ResourceLoadScheduler::Suspender::Suspender):
+ (WebCore::ResourceLoadScheduler::Suspender::~Suspender):
+
+2014-03-05 Matthew Hanson <[email protected]>
+
Merge r158697.
2013-11-05 Enrica Casucci <[email protected]>
Modified: branches/safari-537.75-branch/Source/WebCore/dom/Document.cpp (165131 => 165132)
--- branches/safari-537.75-branch/Source/WebCore/dom/Document.cpp 2014-03-05 22:31:34 UTC (rev 165131)
+++ branches/safari-537.75-branch/Source/WebCore/dom/Document.cpp 2014-03-05 22:41:51 UTC (rev 165132)
@@ -101,6 +101,7 @@
#include "InspectorCounters.h"
#include "InspectorInstrumentation.h"
#include "Language.h"
+#include "LoaderStrategy.h"
#include "Logging.h"
#include "MediaCanStartListener.h"
#include "MediaQueryList.h"
@@ -119,6 +120,7 @@
#include "PageGroup.h"
#include "PageTransitionEvent.h"
#include "PlatformLocale.h"
+#include "PlatformStrategies.h"
#include "PlugInsResources.h"
#include "PluginDocument.h"
#include "PointerLockController.h"
@@ -128,6 +130,7 @@
#include "RenderArena.h"
#include "RenderView.h"
#include "RenderWidget.h"
+#include "ResourceLoadScheduler.h"
#include "ResourceLoader.h"
#include "RuntimeEnabledFeatures.h"
#include "SchemeRegistry.h"
@@ -1923,6 +1926,9 @@
{
ASSERT_ARG(element, element->document() == this);
+ // On iOS request delegates called during styleForElement may result in re-entering WebKit and killing the style resolver.
+ ResourceLoadScheduler::Suspender suspender(*platformStrategies()->loaderStrategy()->resourceLoadScheduler());
+
bool oldIgnore = m_ignorePendingStylesheets;
m_ignorePendingStylesheets = true;
RefPtr<RenderStyle> style = ensureStyleResolver()->styleForElement(element, element->parentNode() ? element->parentNode()->computedStyle() : 0);
Modified: branches/safari-537.75-branch/Source/WebCore/loader/ResourceLoadScheduler.h (165131 => 165132)
--- branches/safari-537.75-branch/Source/WebCore/loader/ResourceLoadScheduler.h 2014-03-05 22:31:34 UTC (rev 165131)
+++ branches/safari-537.75-branch/Source/WebCore/loader/ResourceLoadScheduler.h 2014-03-05 22:41:51 UTC (rev 165132)
@@ -62,6 +62,14 @@
bool isSerialLoadingEnabled() const { return m_isSerialLoadingEnabled; }
virtual void setSerialLoadingEnabled(bool b) { m_isSerialLoadingEnabled = b; }
+ class Suspender {
+ public:
+ explicit Suspender(ResourceLoadScheduler& scheduler) : m_scheduler(scheduler) { m_scheduler.suspendPendingRequests(); }
+ ~Suspender() { m_scheduler.resumePendingRequests(); }
+ private:
+ ResourceLoadScheduler& m_scheduler;
+ };
+
protected:
ResourceLoadScheduler();
virtual ~ResourceLoadScheduler();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes