Title: [147580] trunk/Source/WebCore
Revision
147580
Author
timo...@apple.com
Date
2013-04-03 13:39:22 -0700 (Wed, 03 Apr 2013)

Log Message

Stop unconditionally enabling _javascript_ execution when closing the Web Inspector.

https://webkit.org/b/113889
rdar://problem/12281794

Reviewed by Joseph Pecoraro.

* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::InspectorPageAgent): Initialize m_originalScriptExecutionDisabled.
(WebCore::InspectorPageAgent::enable): Populate m_originalScriptExecutionDisabled based on current setting.
(WebCore::InspectorPageAgent::disable): Restore previous setting.
* inspector/InspectorPageAgent.h:
(InspectorPageAgent): Added m_originalScriptExecutionDisabled.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (147579 => 147580)


--- trunk/Source/WebCore/ChangeLog	2013-04-03 20:13:20 UTC (rev 147579)
+++ trunk/Source/WebCore/ChangeLog	2013-04-03 20:39:22 UTC (rev 147580)
@@ -1,3 +1,19 @@
+2013-04-03  Timothy Hatcher  <timo...@apple.com>
+
+        Stop unconditionally enabling _javascript_ execution when closing the Web Inspector.
+
+        https://webkit.org/b/113889
+        rdar://problem/12281794
+
+        Reviewed by Joseph Pecoraro.
+
+        * inspector/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::InspectorPageAgent): Initialize m_originalScriptExecutionDisabled.
+        (WebCore::InspectorPageAgent::enable): Populate m_originalScriptExecutionDisabled based on current setting.
+        (WebCore::InspectorPageAgent::disable): Restore previous setting.
+        * inspector/InspectorPageAgent.h:
+        (InspectorPageAgent): Added m_originalScriptExecutionDisabled.
+
 2013-04-03  Dean Jackson  <d...@apple.com>
 
         Cross fade into restarted plugin

Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (147579 => 147580)


--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp	2013-04-03 20:13:20 UTC (rev 147579)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp	2013-04-03 20:39:22 UTC (rev 147580)
@@ -343,6 +343,7 @@
     , m_lastScriptIdentifier(0)
     , m_enabled(false)
     , m_isFirstLayoutAfterOnLoad(false)
+    , m_originalScriptExecutionDisabled(false)
     , m_geolocationOverridden(false)
     , m_ignoreScriptsEnabledNotification(false)
 {
@@ -403,6 +404,11 @@
     m_enabled = true;
     m_state->setBoolean(PageAgentState::pageAgentEnabled, true);
     m_instrumentingAgents->setInspectorPageAgent(this);
+
+    if (Frame* frame = mainFrame()) {
+        if (Settings* settings = frame->settings())
+            m_originalScriptExecutionDisabled = !settings->isScriptEnabled();
+    }
 }
 
 void InspectorPageAgent::disable(ErrorString*)
@@ -412,7 +418,7 @@
     m_state->remove(PageAgentState::pageAgentScriptsToEvaluateOnLoad);
     m_instrumentingAgents->setInspectorPageAgent(0);
 
-    setScriptExecutionDisabled(0, false);
+    setScriptExecutionDisabled(0, m_originalScriptExecutionDisabled);
     setShowPaintRects(0, false);
     setShowDebugBorders(0, false);
     setShowFPSCounter(0, false);

Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.h (147579 => 147580)


--- trunk/Source/WebCore/inspector/InspectorPageAgent.h	2013-04-03 20:13:20 UTC (rev 147579)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.h	2013-04-03 20:39:22 UTC (rev 147580)
@@ -207,6 +207,7 @@
     HashMap<DocumentLoader*, String> m_loaderToIdentifier;
     bool m_enabled;
     bool m_isFirstLayoutAfterOnLoad;
+    bool m_originalScriptExecutionDisabled;
     bool m_geolocationOverridden;
     bool m_ignoreScriptsEnabledNotification;
     RefPtr<GeolocationPosition> m_geolocationPosition;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to