Changeset 142654 in webkit
- Timestamp:
- Feb 12, 2013 12:45:44 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r142645 r142654 1 2013-02-12 Vivek Galatage <vivek.vg@samsung.com> 2 3 Web Inspector: JavaScript execution disabled by browser/UA should be notified to the front-end 4 https://bugs.webkit.org/show_bug.cgi?id=109402 5 6 Reviewed by Yury Semikhatsky. 7 8 Tests that whenever Script Execution state is changed outside inspector, its notified to the Inspector front-end. 9 10 * inspector/script-execution-state-change-notification-expected.txt: Added. 11 * inspector/script-execution-state-change-notification.html: Added. 12 1 13 2013-02-12 Uday Kiran <udaykiran@motorola.com> 2 14 -
trunk/LayoutTests/platform/mac/TestExpectations
r142439 r142654 305 305 # https://bugs.webkit.org/show_bug.cgi?id=96942 306 306 http/tests/inspector/network/network-xhr-replay.html 307 308 webkit.org/b/109546 inspector/script-execution-state-change-notification.html [ Skip ] 307 309 308 310 # Safari doesn't allow to customize outermost scrollbars. -
trunk/Source/WebCore/ChangeLog
r142652 r142654 1 2013-02-12 Vivek Galatage <vivek.vg@samsung.com> 2 3 Web Inspector: JavaScript execution disabled by browser/UA should be notified to the front-end 4 https://bugs.webkit.org/show_bug.cgi?id=109402 5 6 Reviewed by Yury Semikhatsky. 7 8 Whenever the UA/Browser changes the Script Execution state of a page, it should notify the 9 inspector front-end. Added the InspectorInstrumentation method didScriptExecutionStateChange 10 to achieve this. Also the state change triggered by the inspector should be ignored to avoid 11 infinite loop. 12 13 Test: inspector/script-execution-state-change-notification.html 14 15 * inspector/Inspector.json: 16 * inspector/InspectorInstrumentation.cpp: 17 (WebCore): 18 (WebCore::InspectorInstrumentation::scriptsEnabledImpl): 19 * inspector/InspectorInstrumentation.h: 20 (InspectorInstrumentation): 21 (WebCore::InspectorInstrumentation::scriptsEnabled): 22 (WebCore): 23 * inspector/InspectorPageAgent.cpp: 24 (WebCore::InspectorPageAgent::InspectorPageAgent): 25 (WebCore::InspectorPageAgent::setScriptExecutionDisabled): 26 (WebCore::InspectorPageAgent::scriptsEnabled): 27 (WebCore): 28 * inspector/InspectorPageAgent.h: 29 (InspectorPageAgent): 30 * inspector/front-end/ResourceTreeModel.js: 31 (WebInspector.PageDispatcher.prototype.javascriptDialogClosed): 32 (WebInspector.PageDispatcher.prototype.scriptsEnabled): 33 * page/Settings.cpp: 34 (WebCore::Settings::setScriptEnabled): 35 1 36 2013-02-12 Antti Koivisto <antti@apple.com> 2 37 -
trunk/Source/WebCore/inspector/Inspector.json
r142627 r142654 559 559 "name": "javascriptDialogClosed", 560 560 "description": "Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been closed.", 561 "hidden": true 562 }, 563 { 564 "name": "scriptsEnabled", 565 "description": "Fired when the JavaScript is enabled/disabled on the page", 566 "parameters": [ 567 { "name": "isEnabled", "type": "boolean", "description": "Whether script execution is enabled or disabled on the page." } 568 ], 561 569 "hidden": true 562 570 } -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r142575 r142654 448 448 } 449 449 450 void InspectorInstrumentation::scriptsEnabledImpl(InstrumentingAgents* instrumentingAgents, bool isEnabled) 451 { 452 if (InspectorPageAgent* pageAgent = instrumentingAgents->inspectorPageAgent()) 453 pageAgent->scriptsEnabled(isEnabled); 454 } 455 450 456 void InspectorInstrumentation::didCreateIsolatedContextImpl(InstrumentingAgents* instrumentingAgents, Frame* frame, ScriptState* scriptState, SecurityOrigin* origin) 451 457 { -
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
r142598 r142654 153 153 static InspectorInstrumentationCookie willEvaluateScript(Frame*, const String& url, int lineNumber); 154 154 static void didEvaluateScript(const InspectorInstrumentationCookie&); 155 static void scriptsEnabled(Page*, bool isEnabled); 155 156 static void didCreateIsolatedContext(Frame*, ScriptState*, SecurityOrigin*); 156 157 static InspectorInstrumentationCookie willFireTimer(ScriptExecutionContext*, int timerId); … … 357 358 static InspectorInstrumentationCookie willEvaluateScriptImpl(InstrumentingAgents*, const String& url, int lineNumber, Frame*); 358 359 static void didEvaluateScriptImpl(const InspectorInstrumentationCookie&); 360 static void scriptsEnabledImpl(InstrumentingAgents*, bool isEnabled); 359 361 static void didCreateIsolatedContextImpl(InstrumentingAgents*, Frame*, ScriptState*, SecurityOrigin*); 360 362 static InspectorInstrumentationCookie willFireTimerImpl(InstrumentingAgents*, int timerId, ScriptExecutionContext*); … … 967 969 } 968 970 971 inline void InspectorInstrumentation::scriptsEnabled(Page* page, bool isEnabled) 972 { 973 FAST_RETURN_IF_NO_FRONTENDS(void()); 974 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page)) 975 return scriptsEnabledImpl(instrumentingAgents, isEnabled); 976 } 977 969 978 inline void InspectorInstrumentation::didCreateIsolatedContext(Frame* frame, ScriptState* scriptState, SecurityOrigin* origin) 970 979 { -
trunk/Source/WebCore/inspector/InspectorPageAgent.cpp
r142247 r142654 338 338 , m_isFirstLayoutAfterOnLoad(false) 339 339 , m_geolocationOverridden(false) 340 , m_ignoreScriptsEnabledNotification(false) 340 341 { 341 342 } … … 813 814 814 815 Settings* settings = mainFrame()->settings(); 815 if (settings) 816 if (settings) { 817 m_ignoreScriptsEnabledNotification = true; 816 818 settings->setScriptEnabled(!value); 819 m_ignoreScriptsEnabledNotification = false; 820 } 817 821 } 818 822 … … 1028 1032 if (m_enabled) 1029 1033 m_overlay->update(); 1034 } 1035 1036 void InspectorPageAgent::scriptsEnabled(bool isEnabled) 1037 { 1038 if (m_ignoreScriptsEnabledNotification) 1039 return; 1040 1041 m_frontend->scriptsEnabled(isEnabled); 1030 1042 } 1031 1043 -
trunk/Source/WebCore/inspector/InspectorPageAgent.h
r142144 r142654 157 157 void didScroll(); 158 158 void didRecalculateStyle(); 159 void scriptsEnabled(bool isEnabled); 159 160 160 161 // Inspector Controller API … … 206 207 bool m_isFirstLayoutAfterOnLoad; 207 208 bool m_geolocationOverridden; 209 bool m_ignoreScriptsEnabledNotification; 208 210 RefPtr<GeolocationPosition> m_geolocationPosition; 209 211 RefPtr<GeolocationPosition> m_platformGeolocationPosition; -
trunk/Source/WebCore/inspector/front-end/ResourceTreeModel.js
r141555 r142654 626 626 javascriptDialogClosed: function() 627 627 { 628 }, 629 630 scriptsEnabled: function(isEnabled) 631 { 632 WebInspector.settings.javaScriptDisabled.set(!isEnabled); 628 633 } 629 634 } -
trunk/Source/WebCore/page/Settings.cpp
r141837 r142654 38 38 #include "HTMLMediaElement.h" 39 39 #include "HistoryItem.h" 40 #include "InspectorInstrumentation.h" 40 41 #include "Page.h" 41 42 #include "PageCache.h" … … 416 417 { 417 418 m_isScriptEnabled = isScriptEnabled; 419 InspectorInstrumentation::scriptsEnabled(m_page, m_isScriptEnabled); 418 420 } 419 421
Note: See TracChangeset
for help on using the changeset viewer.