Diff
Modified: branches/safari-601.1.46-branch/LayoutTests/ChangeLog (193447 => 193448)
--- branches/safari-601.1.46-branch/LayoutTests/ChangeLog 2015-12-04 20:53:02 UTC (rev 193447)
+++ branches/safari-601.1.46-branch/LayoutTests/ChangeLog 2015-12-04 20:53:11 UTC (rev 193448)
@@ -1,5 +1,27 @@
2015-12-04 Timothy Hatcher <[email protected]>
+ Merge r186891. rdar://problem/23581597
+
+ 2015-07-16 Joseph Pecoraro <[email protected]>
+
+ Web Inspector: update $$() to return an Array
+ https://bugs.webkit.org/show_bug.cgi?id=146964
+
+ Reviewed by Brian Burg.
+
+ * inspector/console/command-line-api-expected.txt: Added.
+ * inspector/console/command-line-api.html: Added.
+ Add back a command line api test.
+
+ * platform/efl/inspector/console/command-line-api-expected.txt: Removed.
+ * platform/mac/inspector/console/command-line-api-expected.txt: Removed.
+ Remove old platform expected results for the old version of this test.
+
+ * platform/win/TestExpectations:
+ Speculatively skipping on Windows since other inspector/console tests are skipped.
+
+2015-12-04 Timothy Hatcher <[email protected]>
+
Merge r189104. rdar://problem/23581597
2015-08-28 Joseph Pecoraro <[email protected]>
Added: branches/safari-601.1.46-branch/LayoutTests/inspector/console/command-line-api-expected.txt (0 => 193448)
--- branches/safari-601.1.46-branch/LayoutTests/inspector/console/command-line-api-expected.txt (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/inspector/console/command-line-api-expected.txt 2015-12-04 20:53:11 UTC (rev 193448)
@@ -0,0 +1,35 @@
+CONSOLE MESSAGE: line 27: The console function $() has changed from $=getElementById(id) to $=querySelector(selector). You might try $("#%s")
+Tests that command line api works.
+
+
+STEP: String(keys([3,4]))
+0,1
+
+STEP: String(values([3,4]))
+3,4
+
+STEP: String($0)
+[object HTMLParagraphElement]
+
+STEP: String($('foo'))
+CONSOLE: The console function $() has changed from $=getElementById(id) to $=querySelector(selector). You might try $("#%s")
+null
+
+STEP: String($('#foo'))
+[object HTMLParagraphElement]
+
+STEP: String($('#foo', document.body))
+[object HTMLParagraphElement]
+
+STEP: String($('#foo', 'non-node'))
+[object HTMLParagraphElement]
+
+STEP: String($('#foo', $('#bar')))
+null
+
+STEP: String($$('p'))
+[object HTMLParagraphElement],[object HTMLParagraphElement]
+
+STEP: String($$('p', document.body))
+[object HTMLParagraphElement],[object HTMLParagraphElement]
+
Added: branches/safari-601.1.46-branch/LayoutTests/inspector/console/command-line-api.html (0 => 193448)
--- branches/safari-601.1.46-branch/LayoutTests/inspector/console/command-line-api.html (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/inspector/console/command-line-api.html 2015-12-04 20:53:11 UTC (rev 193448)
@@ -0,0 +1,66 @@
+<!doctype html>
+<html>
+<head>
+<script src=""
+<script>
+function test()
+{
+ var currentStepIndex = 0;
+ var steps = [
+ "String(keys([3,4]))",
+ "String(values([3,4]))",
+ "String($0)",
+ "String($('foo'))",
+ "String($('#foo'))",
+ "String($('#foo', document.body))",
+ "String($('#foo', 'non-node'))",
+ "String($('#foo', $('#bar')))",
+ "String($$('p'))",
+ "String($$('p', document.body))",
+ ];
+
+ var consoleMessage = null;
+
+ function runSteps()
+ {
+ for (var step of steps) {
+ WebInspector.runtimeManager.evaluateInInspectedWindow(step, "test", true, true, false, false, false, function(result, wasThrown) {
+ InspectorTest.log("\nSTEP: " + steps[currentStepIndex]);
+ if (consoleMessage) {
+ InspectorTest.log("CONSOLE: " + consoleMessage.messageText);
+ consoleMessage = null;
+ }
+ InspectorTest.log(result.description);
+
+ if (++currentStepIndex >= steps.length)
+ InspectorTest.completeTest();
+ });
+ }
+ }
+
+ // Detect console warning for $('foo').
+ WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+ consoleMessage = event.data.message;
+ InspectorTest.assert(consoleMessage instanceof WebInspector.ConsoleMessage);
+ });
+
+ // Select div#foo for $0.
+ WebInspector.domTreeManager.requestDocument(function(documentNode) {
+ WebInspector.domTreeManager.querySelector(documentNode.id, "#foo", function(contentNodeId) {
+ if (contentNodeId) {
+ ConsoleAgent.addInspectedNode(contentNodeId);
+ runSteps();
+ } else {
+ InspectorTest.log("FAIL: DOM node not found.");
+ InspectorTest.completeTest();
+ }
+ });
+ });
+}
+</script>
+</head>
+<body _onload_="runTest();">
+ <p id="foo">Tests that command line api works.</p>
+ <p id="bar"></p>
+</body>
+</html>
Deleted: branches/safari-601.1.46-branch/LayoutTests/platform/efl/inspector/console/command-line-api-expected.txt (193447 => 193448)
--- branches/safari-601.1.46-branch/LayoutTests/platform/efl/inspector/console/command-line-api-expected.txt 2015-12-04 20:53:02 UTC (rev 193447)
+++ branches/safari-601.1.46-branch/LayoutTests/platform/efl/inspector/console/command-line-api-expected.txt 2015-12-04 20:53:11 UTC (rev 193448)
@@ -1,48 +0,0 @@
-CONSOLE MESSAGE: line 1225: The console function $() has changed from $=getElementById(id) to $=querySelector(selector). You might try $("#%s")
-Tests that command line api works.
-
-
-
-String($0)
-"[object HTMLParagraphElement]"
-
-
-$3
-undefined
-
-
-String(keys([3,4]))
-"0,1"
-
-
-String(values([3,4]))
-"3,4"
-
-
-String($('#foo'))
-"[object HTMLParagraphElement]"
-
-
-String($('#foo', document.body))
-"[object HTMLParagraphElement]"
-
-
-String($('#foo', 'non-node'))
-"[object HTMLParagraphElement]"
-
-
-String($('#foo', $('#bar')))
-"null"
-
-
-String($$('p#foo'))
-"[object NodeList]"
-
-
-String($$('p#foo', document.body))
-"[object NodeList]"
-
-
-String($('foo'))
-The console function $() has changed from $=getElementById(id) to $=querySelector(selector). You might try $("#foo")
-
Deleted: branches/safari-601.1.46-branch/LayoutTests/platform/mac/inspector/console/command-line-api-expected.txt (193447 => 193448)
--- branches/safari-601.1.46-branch/LayoutTests/platform/mac/inspector/console/command-line-api-expected.txt 2015-12-04 20:53:02 UTC (rev 193447)
+++ branches/safari-601.1.46-branch/LayoutTests/platform/mac/inspector/console/command-line-api-expected.txt 2015-12-04 20:53:11 UTC (rev 193448)
@@ -1,48 +0,0 @@
-CONSOLE MESSAGE: line 180: The console function $() has changed from $=getElementById(id) to $=querySelector(selector). You might try $("#%s")
-Tests that command line api works.
-
-
-
-String($0)
-"[object HTMLParagraphElement]"
-
-
-$3
-undefined
-
-
-String(keys([3,4]))
-"0,1"
-
-
-String(values([3,4]))
-"3,4"
-
-
-String($('#foo'))
-"[object HTMLParagraphElement]"
-
-
-String($('#foo', document.body))
-"[object HTMLParagraphElement]"
-
-
-String($('#foo', 'non-node'))
-"[object HTMLParagraphElement]"
-
-
-String($('#foo', $('#bar')))
-"null"
-
-
-String($$('p#foo'))
-"[object NodeList]"
-
-
-String($$('p#foo', document.body))
-"[object NodeList]"
-
-
-String($('foo'))
-The console function $() has changed from $=getElementById(id) to $=querySelector(selector). You might try $("#foo")
-
Modified: branches/safari-601.1.46-branch/LayoutTests/platform/win/TestExpectations (193447 => 193448)
--- branches/safari-601.1.46-branch/LayoutTests/platform/win/TestExpectations 2015-12-04 20:53:02 UTC (rev 193447)
+++ branches/safari-601.1.46-branch/LayoutTests/platform/win/TestExpectations 2015-12-04 20:53:11 UTC (rev 193448)
@@ -2374,6 +2374,7 @@
inspector-protocol/debugger/removeBreakpoint.html [ Skip ] # Crashing
inspector-protocol/debugger/searchInContent-linebreaks.html [ Pass Crash ] # Flaky
+webkit.org/b/143548 inspector/console/command-line-api.html [ Skip ] # Timeout
webkit.org/b/143548 inspector/console/console-api.html [ Skip ] # Timeout
webkit.org/b/143548 inspector/console/console-table.html [ Skip ] # Timeout
Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (193447 => 193448)
--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog 2015-12-04 20:53:02 UTC (rev 193447)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog 2015-12-04 20:53:11 UTC (rev 193448)
@@ -1,3 +1,21 @@
+2015-12-04 Timothy Hatcher <[email protected]>
+
+ Merge r186891. rdar://problem/23581597
+
+ 2015-07-16 Joseph Pecoraro <[email protected]>
+
+ Web Inspector: update $$() to return an Array
+ https://bugs.webkit.org/show_bug.cgi?id=146964
+
+ Reviewed by Brian Burg.
+
+ Test: inspector/console/command-line-api.html
+
+ * inspector/CommandLineAPIModuleSource.js:
+ Update $$(...) to return an array.
+ Also InjectedScriptHost.type was renamed to subtype
+ a while ago.
+
2015-12-02 Timothy Hatcher <[email protected]>
Merge r191967. rdar://problem/23221163
Modified: branches/safari-601.1.46-branch/Source/WebCore/inspector/CommandLineAPIModuleSource.js (193447 => 193448)
--- branches/safari-601.1.46-branch/Source/WebCore/inspector/CommandLineAPIModuleSource.js 2015-12-04 20:53:02 UTC (rev 193447)
+++ branches/safari-601.1.46-branch/Source/WebCore/inspector/CommandLineAPIModuleSource.js 2015-12-04 20:53:11 UTC (rev 193448)
@@ -163,7 +163,7 @@
if (selector && selector[0] !== "#") {
result = inspectedWindow.document.getElementById(selector);
if (result) {
- inspectedWindow.console.warn("The console function $() has changed from $=getElementById(id) to $=querySelector(selector). You might try $(\"#%s\")", selector );
+ inspectedWindow.console.warn("The console function $() has changed from $=getElementById(id) to $=querySelector(selector). You might try $(\"#%s\")", selector);
return null;
}
}
@@ -177,8 +177,8 @@
$$: function (selector, start)
{
if (this._canQuerySelectorOnNode(start))
- return start.querySelectorAll(selector);
- return inspectedWindow.document.querySelectorAll(selector);
+ return slice(start.querySelectorAll(selector));
+ return slice(inspectedWindow.document.querySelectorAll(selector));
},
/**
@@ -187,7 +187,7 @@
*/
_canQuerySelectorOnNode: function(node)
{
- return !!node && InjectedScriptHost.type(node) === "node" && (node.nodeType === Node.ELEMENT_NODE || node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE);
+ return !!node && InjectedScriptHost.subtype(node) === "node" && (node.nodeType === Node.ELEMENT_NODE || node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE);
},
/**