Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Unified Diff: Source/core/dom/Document.cpp

Issue 367863002: Add ScriptForbiddenScopes to style and layout. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Blanket allow inspector scripts. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/frame/FrameView.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 48013d58a1922b32848c0cae2a650a12565899e0..3881bb2c419be3b39ec965c75fa901117a437866 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -1755,6 +1755,8 @@ void Document::updateRenderTree(StyleRecalcChange change)
{
ASSERT(isMainThread());
+ ScriptForbiddenScope forbidScript;
+
if (change != Force && !needsRenderTreeUpdate())
return;
@@ -1768,6 +1770,8 @@ void Document::updateRenderTree(StyleRecalcChange change)
RELEASE_ASSERT(!view()->isPainting());
// Script can run below in WidgetUpdates, so protect the LocalFrame.
+ // FIXME: Can this still happen? How does script run inside
+ // UpdateSuspendScope::performDeferredWidgetTreeOperations() ?
RefPtr<LocalFrame> protect(m_frame);
TRACE_EVENT0("blink", "Document::updateRenderTree");
@@ -1780,11 +1784,7 @@ void Document::updateRenderTree(StyleRecalcChange change)
InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRecalculateStyle(this);
DocumentAnimations::updateOutdatedAnimationPlayersIfNeeded(*this);
-
- // FIXME: This executes media query listeners which runs script, instead the script
- // should run at raf timing in ScriptedAnimationController just like resize events.
evaluateMediaQueryListIfNeeded();
-
updateUseShadowTreesIfNeeded();
updateDistributionIfNeeded();
updateStyleInvalidationIfNeeded();
@@ -1826,7 +1826,6 @@ void Document::updateStyle(StyleRecalcChange change)
{
TRACE_EVENT0("blink", "Document::updateStyle");
- ScriptForbiddenScope forbidScript;
HTMLFrameOwnerElement::UpdateSuspendScope suspendWidgetHierarchyUpdates;
m_lifecycle.advanceTo(DocumentLifecycle::InStyleRecalc);
@@ -1900,6 +1899,8 @@ void Document::updateLayout()
{
ASSERT(isMainThread());
+ ScriptForbiddenScope forbidScript;
+
RefPtr<FrameView> frameView = view();
if (frameView && frameView->isInPerformLayout()) {
// View layout should not be re-entrant.
« no previous file with comments | « no previous file | Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698