- Revision
- 249173
- Author
- [email protected]
- Date
- 2019-08-27 14:40:11 -0700 (Tue, 27 Aug 2019)
Log Message
Web Inspector: don't attach properties to `injectedScript` for the CommandLineAPI
https://bugs.webkit.org/show_bug.cgi?id=201193
Reviewed by Joseph Pecoraro.
Source/_javascript_Core:
For some reason, adding `injectedScript._inspectObject` inside CommandLineAPIModuleSource.js
causes inspector/debugger/tail-deleted-frames-this-value.html to fail.
We should have a similar approach to adding command line api getters and functions, in that
the CommandLineAPIModuleSource.js calls a function with a callback.
* inspector/InjectedScriptSource.js:
(InjectedScript.prototype.inspectObject):
(InjectedScript.prototype.setInspectObject): Added.
(InjectedScript.prototype._evaluateOn):
Source/WebCore:
For some reason, adding `injectedScript._inspectObject` inside CommandLineAPIModuleSource.js
causes inspector/debugger/tail-deleted-frames-this-value.html to fail.
We should have a similar approach to adding command line api getters and functions, in that
the CommandLineAPIModuleSource.js calls a function with a callback.
* inspector/CommandLineAPIModuleSource.js:
(injectedScript._inspectObject): Deleted.
LayoutTests:
* http/tests/inspector/dom/cross-domain-inspected-node-access-expected.txt:
* inspector/console/command-line-api-expected.txt:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (249172 => 249173)
--- trunk/LayoutTests/ChangeLog 2019-08-27 21:24:40 UTC (rev 249172)
+++ trunk/LayoutTests/ChangeLog 2019-08-27 21:40:11 UTC (rev 249173)
@@ -1,3 +1,13 @@
+2019-08-27 Devin Rousso <[email protected]>
+
+ Web Inspector: don't attach properties to `injectedScript` for the CommandLineAPI
+ https://bugs.webkit.org/show_bug.cgi?id=201193
+
+ Reviewed by Joseph Pecoraro.
+
+ * http/tests/inspector/dom/cross-domain-inspected-node-access-expected.txt:
+ * inspector/console/command-line-api-expected.txt:
+
2019-08-27 Carlos Alberto Lopez Perez <[email protected]>
Drawing an animated image to a canvas via drawImage should draw the first frame
Modified: trunk/LayoutTests/http/tests/inspector/dom/cross-domain-inspected-node-access-expected.txt (249172 => 249173)
--- trunk/LayoutTests/http/tests/inspector/dom/cross-domain-inspected-node-access-expected.txt 2019-08-27 21:24:40 UTC (rev 249172)
+++ trunk/LayoutTests/http/tests/inspector/dom/cross-domain-inspected-node-access-expected.txt 2019-08-27 21:40:11 UTC (rev 249173)
@@ -1,5 +1,5 @@
-CONSOLE MESSAGE: line 8: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 8: Blocked a frame with origin "http://localhost:8000" from accessing a frame with origin "http://127.0.0.1:8000". Protocols, domains, and ports must match.
+CONSOLE MESSAGE: line 6: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
+CONSOLE MESSAGE: line 6: Blocked a frame with origin "http://localhost:8000" from accessing a frame with origin "http://127.0.0.1:8000". Protocols, domains, and ports must match.
Test that code evaluated in the main frame cannot access $0 that resolves to a node in a frame from a different domain. Bug 105423.
Modified: trunk/LayoutTests/inspector/console/command-line-api-expected.txt (249172 => 249173)
--- trunk/LayoutTests/inspector/console/command-line-api-expected.txt 2019-08-27 21:24:40 UTC (rev 249172)
+++ trunk/LayoutTests/inspector/console/command-line-api-expected.txt 2019-08-27 21:40:11 UTC (rev 249173)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 31: The console function $() has changed from $=getElementById(id) to $=querySelector(selector). You might try $("#%s")
+CONSOLE MESSAGE: line 29: The console function $() has changed from $=getElementById(id) to $=querySelector(selector). You might try $("#%s")
Tests that command line api works.
Modified: trunk/Source/_javascript_Core/ChangeLog (249172 => 249173)
--- trunk/Source/_javascript_Core/ChangeLog 2019-08-27 21:24:40 UTC (rev 249172)
+++ trunk/Source/_javascript_Core/ChangeLog 2019-08-27 21:40:11 UTC (rev 249173)
@@ -1,3 +1,21 @@
+2019-08-27 Devin Rousso <[email protected]>
+
+ Web Inspector: don't attach properties to `injectedScript` for the CommandLineAPI
+ https://bugs.webkit.org/show_bug.cgi?id=201193
+
+ Reviewed by Joseph Pecoraro.
+
+ For some reason, adding `injectedScript._inspectObject` inside CommandLineAPIModuleSource.js
+ causes inspector/debugger/tail-deleted-frames-this-value.html to fail.
+
+ We should have a similar approach to adding command line api getters and functions, in that
+ the CommandLineAPIModuleSource.js calls a function with a callback.
+
+ * inspector/InjectedScriptSource.js:
+ (InjectedScript.prototype.inspectObject):
+ (InjectedScript.prototype.setInspectObject): Added.
+ (InjectedScript.prototype._evaluateOn):
+
2019-08-27 Mark Lam <[email protected]>
constructFunctionSkippingEvalEnabledCheck() should use tryMakeString() and check for OOM.
Modified: trunk/Source/_javascript_Core/inspector/InjectedScriptSource.js (249172 => 249173)
--- trunk/Source/_javascript_Core/inspector/InjectedScriptSource.js 2019-08-27 21:24:40 UTC (rev 249172)
+++ trunk/Source/_javascript_Core/inspector/InjectedScriptSource.js 2019-08-27 21:40:11 UTC (rev 249173)
@@ -387,12 +387,6 @@
return this._objectForId(parsedObjectId);
}
- inspectObject(object)
- {
- if (this._inspectObject)
- this._inspectObject(object);
- }
-
releaseObject(objectId)
{
let parsedObjectId = this._parseObjectId(objectId);
@@ -419,6 +413,17 @@
// CommandLineAPI
+ inspectObject(object)
+ {
+ if (this._inspectObject)
+ this._inspectObject(object);
+ }
+
+ setInspectObject(callback)
+ {
+ this._inspectObject = callback;
+ }
+
addCommandLineAPIGetter(name, func)
{
InjectedScript.CommandLineAPI._getters.push({name, func});
@@ -578,7 +583,7 @@
{
let commandLineAPI = null;
if (includeCommandLineAPI)
- commandLineAPI = new InjectedScript.CommandLineAPI(isEvalOnCallFrame ? object : null)
+ commandLineAPI = new InjectedScript.CommandLineAPI(isEvalOnCallFrame ? object : null);
return evalFunction.call(object, _expression_, commandLineAPI);
}
Modified: trunk/Source/WebCore/ChangeLog (249172 => 249173)
--- trunk/Source/WebCore/ChangeLog 2019-08-27 21:24:40 UTC (rev 249172)
+++ trunk/Source/WebCore/ChangeLog 2019-08-27 21:40:11 UTC (rev 249173)
@@ -1,3 +1,19 @@
+2019-08-27 Devin Rousso <[email protected]>
+
+ Web Inspector: don't attach properties to `injectedScript` for the CommandLineAPI
+ https://bugs.webkit.org/show_bug.cgi?id=201193
+
+ Reviewed by Joseph Pecoraro.
+
+ For some reason, adding `injectedScript._inspectObject` inside CommandLineAPIModuleSource.js
+ causes inspector/debugger/tail-deleted-frames-this-value.html to fail.
+
+ We should have a similar approach to adding command line api getters and functions, in that
+ the CommandLineAPIModuleSource.js calls a function with a callback.
+
+ * inspector/CommandLineAPIModuleSource.js:
+ (injectedScript._inspectObject): Deleted.
+
2019-08-27 Zalan Bujtas <[email protected]>
[LFC][TFC] Align table formatting context code with the existing layout logic.
Modified: trunk/Source/WebCore/inspector/CommandLineAPIModuleSource.js (249172 => 249173)
--- trunk/Source/WebCore/inspector/CommandLineAPIModuleSource.js 2019-08-27 21:24:40 UTC (rev 249172)
+++ trunk/Source/WebCore/inspector/CommandLineAPIModuleSource.js 2019-08-27 21:40:11 UTC (rev 249173)
@@ -32,21 +32,21 @@
// FIXME: <https://webkit.org/b/152294> Web Inspector: Parse InjectedScriptSource as a built-in to get guaranteed non-user-overridden built-ins
-injectedScript._inspectObject = function(object) {
+injectedScript.setInspectObject(function(object) {
if (arguments.length === 0)
return;
- let objectId = RemoteObject.create(object, "");
+ let objectId = RemoteObject.create(object);
let hints = {};
switch (RemoteObject.describe(object)) {
case "Database":
- let databaseId = CommandLineAPIHost.databaseId(object)
+ var databaseId = CommandLineAPIHost.databaseId(object);
if (databaseId)
hints.databaseId = databaseId;
break;
case "Storage":
- let storageId = CommandLineAPIHost.storageId(object)
+ var storageId = CommandLineAPIHost.storageId(object);
if (storageId)
hints.domStorageId = InjectedScriptHost.evaluate("(" + storageId + ")");
break;
@@ -53,8 +53,7 @@
}
CommandLineAPIHost.inspect(objectId, hints);
- return object;
-};
+});
injectedScript.addCommandLineAPIGetter("0", function() {
return CommandLineAPIHost.inspectedObject();