From 0eb114a591268c5c61a230321ee9821b09fe28f1 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@digia.com>
Date: Tue, 27 Aug 2013 12:01:11 +0200
Subject: [PATCH 3/8] Assertion while scrolling news.google.com

https://bugs.webkit.org/show_bug.cgi?id=115303

Reviewed by Anders Carlsson.

Do not relayout when accessing script elements during painting.

* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::renderWidgetForJSBindings):

Task-number: QTBUG-30892
Change-Id: Ide884c78dd6a359c0e0de22bb98774d7da90b901
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154672 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
---
 Source/WebCore/html/HTMLEmbedElement.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Source/WebCore/html/HTMLEmbedElement.cpp b/Source/WebCore/html/HTMLEmbedElement.cpp
index 9176d95..ba830f0 100644
--- a/Source/WebCore/html/HTMLEmbedElement.cpp
+++ b/Source/WebCore/html/HTMLEmbedElement.cpp
@@ -28,6 +28,7 @@
 #include "CSSPropertyNames.h"
 #include "DocumentLoader.h"
 #include "Frame.h"
+#include "FrameView.h"
 #include "HTMLDocument.h"
 #include "HTMLImageLoader.h"
 #include "HTMLNames.h"
@@ -70,7 +71,9 @@ static inline RenderWidget* findWidgetRenderer(const Node* n)
 
 RenderWidget* HTMLEmbedElement::renderWidgetForJSBindings() const
 {
-    document()->updateLayoutIgnorePendingStylesheets();
+    FrameView* view = document()->view();
+    if (!view || (!view->isInLayout() && !view->isPainting()))
+        document()->updateLayoutIgnorePendingStylesheets();
     return findWidgetRenderer(this);
 }
 
-- 
1.9.0

