WebKit Bugzilla
Attachment 361326 Details for
Bug 194279
: Web Inspector: provide a way to capture a screenshot of a node from within the page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194279-20190206140552.patch (text/plain), 67.49 KB, created by
Devin Rousso
on 2019-02-06 14:05:53 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2019-02-06 14:05:53 PST
Size:
67.49 KB
patch
obsolete
>diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index fb8389d38d980e86d6792f3b8103ca902ad6f5e2..a9c4320a4450018783809241fac39f0957025341 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,32 @@ >+2019-02-06 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: provide a way to capture a screenshot of a node from within the page >+ https://bugs.webkit.org/show_bug.cgi?id=194279 >+ <rdar://problem/10731573> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add `console.screenshot` functionality, which displays a screenshot of a given object (if >+ able) within Web Inspector's Console tab. From there, it can be viewed and saved. >+ >+ Currently, `console.screenshot` will only have an effect if given a `Node`. >+ >+ * inspector/protocol/Console.json: >+ Add `Image` enum value to `ConsoleMessage` type. >+ * runtime/ConsoleTypes.h: >+ * inspector/ConsoleMessage.h: >+ * inspector/ConsoleMessage.cpp: >+ (Inspector::messageTypeValue): >+ >+ * runtime/ConsoleClient.h: >+ * runtime/ConsoleObject.cpp: >+ (JSC::ConsoleObject::finishCreation): >+ (JSC::consoleProtoFuncScreenshot): Added. >+ >+ * inspector/JSGlobalObjectConsoleClient.h: >+ * inspector/JSGlobalObjectConsoleClient.cpp: >+ (Inspector::JSGlobalObjectConsoleClient::screenshot): Added. >+ > 2019-02-05 Mark Lam <mark.lam@apple.com> > > Fix DFG's doesGC() for a few more nodes. >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3896620c7c3a8f2bc319f3726e2be1208929629e..fc7bd862f053351d008bc71650cbccd319a59202 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,35 @@ >+2019-02-06 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: provide a way to capture a screenshot of a node from within the page >+ https://bugs.webkit.org/show_bug.cgi?id=194279 >+ <rdar://problem/10731573> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: inspector/console/console-screenshot.html >+ >+ Add `console.screenshot` functionality, which displays a screenshot of a given object (if >+ able) within Web Inspector's Console tab. From there, it can be viewed and saved. >+ >+ Currently, `console.screenshot` will only have an effect if given a `Node`. >+ >+ * page/PageConsoleClient.h: >+ * page/PageConsoleClient.cpp: >+ (WebCore::PageConsoleClient::addMessage): >+ (WebCore::PageConsoleClient::screenshot): Added. >+ >+ * workers/WorkerConsoleClient.h: >+ * workers/WorkerConsoleClient.cpp: >+ (WebCore::WorkerConsoleClient::screenshot): Added. >+ * worklets/WorkletConsoleClient.h: >+ * worklets/WorkletConsoleClient.cpp: >+ (WebCore::WorkletConsoleClient::screenshot): Added. >+ >+ * inspector/CommandLineAPIModuleSource.js: >+ (CommandLineAPIImpl.prototype.screenshot): Added. >+ >+ * inspector/InspectorInstrumentation.h: >+ > 2019-02-05 Alex Christensen <achristensen@webkit.org> > > Stop using blobRegistry in NetworkProcess >diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 1c4338aceafe53966bebc23b0f04cc455b52fe32..6f279a2dda2461d08f42a5a8f1104be1279c9f39 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,48 @@ >+2019-02-06 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: provide a way to capture a screenshot of a node from within the page >+ https://bugs.webkit.org/show_bug.cgi?id=194279 >+ <rdar://problem/10731573> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add `console.screenshot` functionality, which displays a screenshot of a given object (if >+ able) within Web Inspector's Console tab. From there, it can be viewed and saved. >+ >+ Currently, `console.screenshot` will only have an effect if given a `Node`. >+ >+ * UserInterface/Models/ConsoleMessage.js: >+ (WI.ConsoleMessage): >+ * UserInterface/Models/IssueMessage.js: >+ * UserInterface/Views/ConsoleCommandView.js: >+ * UserInterface/Views/LogContentView.css: >+ * UserInterface/Views/ConsoleMessageView.js: >+ (WI.ConsoleMessageView.prototype.render): >+ (WI.ConsoleMessageView.prototype._appendMessageTextAndArguments): >+ (WI.ConsoleMessageView.prototype._handleContextMenu): Added. >+ * UserInterface/Views/ConsoleMessageView.css: >+ (.console-message-body > img): Added. >+ (.console-message-body > .show-grid): Added. >+ Renamed (removed ChangeLog entries for simplicity/clarity) >+ - `messageText` to `data` (JS) >+ - `_messageTextElement` to `_messageBodyElement` (JS) >+ - `.console-message-text` to `.console-message-body` (CSS) >+ to be more semantically correct when the content is an image. >+ >+ * UserInterface/Controllers/JavaScriptLogViewController.js: >+ (WI.JavaScriptLogViewController.prototype.renderPendingMessages): >+ >+ * UserInterface/Views/Main.css: >+ (:matches(img, canvas).show-grid): >+ (@media (prefers-color-scheme: dark) :matches(img, canvas).show-grid): >+ >+ * UserInterface/Base/FileUtilities.js: >+ (WI.FileUtilities.screenshotString): Added. >+ >+ * UserInterface/Models/NativeFunctionParameters.js: >+ * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js: >+ * Localizations/en.lproj/localizedStrings.js: >+ > 2019-02-05 Devin Rousso <drousso@apple.com> > > Web Inspector: Lots of time spent updating related resources in ResourceDetailsSidebar when loading a page with lots of resources >diff --git a/Source/JavaScriptCore/inspector/ConsoleMessage.cpp b/Source/JavaScriptCore/inspector/ConsoleMessage.cpp >index 716ac441b7c01df10188dbb8db7db9bcfce08deb..3734b31ac1a8c8954de43cfc750e91fd96c4bb2a 100644 >--- a/Source/JavaScriptCore/inspector/ConsoleMessage.cpp >+++ b/Source/JavaScriptCore/inspector/ConsoleMessage.cpp >@@ -190,6 +190,7 @@ static Protocol::Console::ConsoleMessage::Type messageTypeValue(MessageType type > case MessageType::Timing: return Protocol::Console::ConsoleMessage::Type::Timing; > case MessageType::Profile: return Protocol::Console::ConsoleMessage::Type::Profile; > case MessageType::ProfileEnd: return Protocol::Console::ConsoleMessage::Type::ProfileEnd; >+ case MessageType::Image: return Protocol::Console::ConsoleMessage::Type::Image; > } > return Protocol::Console::ConsoleMessage::Type::Log; > } >diff --git a/Source/JavaScriptCore/inspector/ConsoleMessage.h b/Source/JavaScriptCore/inspector/ConsoleMessage.h >index f3706dbb97925421487b215bbe8fd335c210aed1..0a92f5b49fdce8f0c1125db6df2c8afd8c54ff80 100644 >--- a/Source/JavaScriptCore/inspector/ConsoleMessage.h >+++ b/Source/JavaScriptCore/inspector/ConsoleMessage.h >@@ -55,7 +55,7 @@ public: > ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned long requestIdentifier = 0); > ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& message, const String& url, unsigned line, unsigned column, JSC::ExecState* = nullptr, unsigned long requestIdentifier = 0); > ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& message, Ref<ScriptCallStack>&&, unsigned long requestIdentifier = 0); >- ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& message, Ref<ScriptArguments>&&, JSC::ExecState*, unsigned long requestIdentifier = 0); >+ ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& message, Ref<ScriptArguments>&&, JSC::ExecState* = nullptr, unsigned long requestIdentifier = 0); > ConsoleMessage(MessageSource, MessageType, MessageLevel, Vector<JSONLogValue>&&, JSC::ExecState*, unsigned long requestIdentifier = 0); > ~ConsoleMessage(); > >diff --git a/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.cpp b/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.cpp >index 096b9b7b7f0edccbec279bf161b53cfdb3a1c2fa..79e0275788d9c05dd3df4a332f07596e779dafe9 100644 >--- a/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.cpp >+++ b/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.cpp >@@ -168,6 +168,11 @@ void JSGlobalObjectConsoleClient::timeStamp(ExecState*, Ref<ScriptArguments>&&) > void JSGlobalObjectConsoleClient::record(ExecState*, Ref<ScriptArguments>&&) { } > void JSGlobalObjectConsoleClient::recordEnd(ExecState*, Ref<ScriptArguments>&&) { } > >+void JSGlobalObjectConsoleClient::screenshot(ExecState*, Ref<ScriptArguments>&&) >+{ >+ warnUnimplemented("console.screenshot"_s); >+} >+ > void JSGlobalObjectConsoleClient::warnUnimplemented(const String& method) > { > String message = method + " is currently ignored in JavaScript context inspection."; >diff --git a/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.h b/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.h >index 448917ebfa32e8ac17be6439f7200655bda47996..2e169c25c60d589896160faaff1b1592e726e324 100644 >--- a/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.h >+++ b/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.h >@@ -55,6 +55,7 @@ protected: > void timeStamp(JSC::ExecState*, Ref<ScriptArguments>&&) override; > void record(JSC::ExecState*, Ref<ScriptArguments>&&) override; > void recordEnd(JSC::ExecState*, Ref<ScriptArguments>&&) override; >+ void screenshot(JSC::ExecState*, Ref<ScriptArguments>&&) override; > > private: > void warnUnimplemented(const String& method); >diff --git a/Source/JavaScriptCore/inspector/protocol/Console.json b/Source/JavaScriptCore/inspector/protocol/Console.json >index 6b94399fac248d1f3954afb9631df069d8f61ce0..b176dcb16c45be3e41ff213c64e342656965456e 100644 >--- a/Source/JavaScriptCore/inspector/protocol/Console.json >+++ b/Source/JavaScriptCore/inspector/protocol/Console.json >@@ -31,7 +31,7 @@ > { "name": "source", "$ref": "ChannelSource"}, > { "name": "level", "type": "string", "enum": ["log", "info", "warning", "error", "debug"], "description": "Message severity." }, > { "name": "text", "type": "string", "description": "Message text." }, >- { "name": "type", "type": "string", "optional": true, "enum": ["log", "dir", "dirxml", "table", "trace", "clear", "startGroup", "startGroupCollapsed", "endGroup", "assert", "timing", "profile", "profileEnd"], "description": "Console message type." }, >+ { "name": "type", "type": "string", "optional": true, "enum": ["log", "dir", "dirxml", "table", "trace", "clear", "startGroup", "startGroupCollapsed", "endGroup", "assert", "timing", "profile", "profileEnd", "image"], "description": "Console message type." }, > { "name": "url", "type": "string", "optional": true, "description": "URL of the message origin." }, > { "name": "line", "type": "integer", "optional": true, "description": "Line number in the resource that generated this message." }, > { "name": "column", "type": "integer", "optional": true, "description": "Column number on the line in the resource that generated this message." }, >diff --git a/Source/JavaScriptCore/runtime/ConsoleClient.h b/Source/JavaScriptCore/runtime/ConsoleClient.h >index 852c193fa3bc72bc3451f406389a59ebb52f9a37..53abb50e9fc48db1cec080e9202768cec5ff915d 100644 >--- a/Source/JavaScriptCore/runtime/ConsoleClient.h >+++ b/Source/JavaScriptCore/runtime/ConsoleClient.h >@@ -64,6 +64,7 @@ public: > virtual void timeStamp(ExecState*, Ref<Inspector::ScriptArguments>&&) = 0; > virtual void record(ExecState*, Ref<Inspector::ScriptArguments>&&) = 0; > virtual void recordEnd(ExecState*, Ref<Inspector::ScriptArguments>&&) = 0; >+ virtual void screenshot(ExecState*, Ref<Inspector::ScriptArguments>&&) = 0; > > private: > enum ArgumentRequirement { ArgumentRequired, ArgumentNotRequired }; >diff --git a/Source/JavaScriptCore/runtime/ConsoleObject.cpp b/Source/JavaScriptCore/runtime/ConsoleObject.cpp >index 417d6404fa81f814a7f779ce72048bb5f85ccf76..37c40d3ab7d3acfa2af6e125bd4052c4779c0ff7 100644 >--- a/Source/JavaScriptCore/runtime/ConsoleObject.cpp >+++ b/Source/JavaScriptCore/runtime/ConsoleObject.cpp >@@ -59,6 +59,7 @@ static EncodedJSValue JSC_HOST_CALL consoleProtoFuncGroupCollapsed(ExecState*); > static EncodedJSValue JSC_HOST_CALL consoleProtoFuncGroupEnd(ExecState*); > static EncodedJSValue JSC_HOST_CALL consoleProtoFuncRecord(ExecState*); > static EncodedJSValue JSC_HOST_CALL consoleProtoFuncRecordEnd(ExecState*); >+static EncodedJSValue JSC_HOST_CALL consoleProtoFuncScreenshot(ExecState*); > > const ClassInfo ConsoleObject::s_info = { "Console", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(ConsoleObject) }; > >@@ -99,6 +100,7 @@ void ConsoleObject::finishCreation(VM& vm, JSGlobalObject* globalObject) > JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("groupEnd", consoleProtoFuncGroupEnd, static_cast<unsigned>(PropertyAttribute::None), 0); > JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("record", consoleProtoFuncRecord, static_cast<unsigned>(PropertyAttribute::None), 0); > JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("recordEnd", consoleProtoFuncRecordEnd, static_cast<unsigned>(PropertyAttribute::None), 0); >+ JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("screenshot", consoleProtoFuncScreenshot, static_cast<unsigned>(PropertyAttribute::None), 0); > } > > static String valueToStringWithUndefinedOrNullCheck(ExecState* exec, JSValue value) >@@ -391,4 +393,14 @@ static EncodedJSValue JSC_HOST_CALL consoleProtoFuncRecordEnd(ExecState* exec) > return JSValue::encode(jsUndefined()); > } > >+static EncodedJSValue JSC_HOST_CALL consoleProtoFuncScreenshot(ExecState* exec) >+{ >+ ConsoleClient* client = exec->lexicalGlobalObject()->consoleClient(); >+ if (!client) >+ return JSValue::encode(jsUndefined()); >+ >+ client->screenshot(exec, Inspector::createScriptArguments(exec, 0)); >+ return JSValue::encode(jsUndefined()); >+} >+ > } // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/ConsoleTypes.h b/Source/JavaScriptCore/runtime/ConsoleTypes.h >index 021c75357c2fc217e64d8eeab0063fabba88bf8b..3648c59aa732cb8485cf7cfa019173dc9870086f 100644 >--- a/Source/JavaScriptCore/runtime/ConsoleTypes.h >+++ b/Source/JavaScriptCore/runtime/ConsoleTypes.h >@@ -59,6 +59,7 @@ enum class MessageType { > Timing, > Profile, > ProfileEnd, >+ Image, > }; > > enum class MessageLevel : uint8_t { >diff --git a/Source/WebCore/inspector/CommandLineAPIModuleSource.js b/Source/WebCore/inspector/CommandLineAPIModuleSource.js >index 92254f588a0b33b58a3ed7244226b0a30d473976..6f51bf34853274542110942ea5e10104745d23aa 100644 >--- a/Source/WebCore/inspector/CommandLineAPIModuleSource.js >+++ b/Source/WebCore/inspector/CommandLineAPIModuleSource.js >@@ -83,6 +83,7 @@ CommandLineAPI.methods = [ > "profile", > "profileEnd", > "queryObjects", >+ "screenshot", > "table", > "unmonitorEvents", > "values", >@@ -200,6 +201,11 @@ CommandLineAPIImpl.prototype = { > return inspectedWindow.console.table.apply(inspectedWindow.console, arguments) > }, > >+ screenshot: function() >+ { >+ return inspectedWindow.console.screenshot.apply(inspectedWindow.console, arguments) >+ }, >+ > /** > * @param {Object} object > * @param {Array.<string>|string=} types >diff --git a/Source/WebCore/inspector/InspectorInstrumentation.h b/Source/WebCore/inspector/InspectorInstrumentation.h >index efe265a4e070f12b5499ebd82dd2fb39b66b834d..5b6ca8001a62ccb34e3a090f6e9386cedbd9bb6b 100644 >--- a/Source/WebCore/inspector/InspectorInstrumentation.h >+++ b/Source/WebCore/inspector/InspectorInstrumentation.h >@@ -98,7 +98,7 @@ enum class StorageType; > > struct WebSocketFrame; > >-#define FAST_RETURN_IF_NO_FRONTENDS(value) if (LIKELY(!hasFrontends())) return value; >+#define FAST_RETURN_IF_NO_FRONTENDS(value) if (LIKELY(!InspectorInstrumentation::hasFrontends())) return value; > > class InspectorInstrumentation { > public: >diff --git a/Source/WebCore/page/PageConsoleClient.cpp b/Source/WebCore/page/PageConsoleClient.cpp >index 9f65531480c5cbcf4d33cf2caa33577b4d92a2d6..b3d4cd3f47e0a878c72739e14bfe9a9a2718a19c 100644 >--- a/Source/WebCore/page/PageConsoleClient.cpp >+++ b/Source/WebCore/page/PageConsoleClient.cpp >@@ -34,15 +34,19 @@ > #include "ChromeClient.h" > #include "Document.h" > #include "Frame.h" >+#include "FrameSnapshotting.h" > #include "HTMLCanvasElement.h" > #include "ImageBitmapRenderingContext.h" >+#include "ImageBuffer.h" > #include "InspectorController.h" > #include "InspectorInstrumentation.h" > #include "JSCanvasRenderingContext2D.h" > #include "JSExecState.h" > #include "JSHTMLCanvasElement.h" > #include "JSImageBitmapRenderingContext.h" >+#include "JSNode.h" > #include "JSOffscreenCanvas.h" >+#include "Node.h" > #include "OffscreenCanvas.h" > #include "Page.h" > #include "ScriptableDocumentParser.h" >@@ -119,7 +123,7 @@ static void getParserLocationForConsoleMessage(Document* document, String& url, > > void PageConsoleClient::addMessage(std::unique_ptr<Inspector::ConsoleMessage>&& consoleMessage) > { >- if (consoleMessage->source() != MessageSource::CSS && !m_page.usesEphemeralSession()) { >+ if (consoleMessage->source() != MessageSource::CSS && consoleMessage->type() != MessageType::Image && !m_page.usesEphemeralSession()) { > m_page.chrome().client().addMessageToConsole(consoleMessage->source(), consoleMessage->level(), consoleMessage->message(), consoleMessage->line(), consoleMessage->column(), consoleMessage->url()); > > if (m_page.settings().logsPageMessagesToSystemConsoleEnabled() || shouldPrintExceptions()) >@@ -258,4 +262,30 @@ void PageConsoleClient::recordEnd(JSC::ExecState* state, Ref<ScriptArguments>&& > InspectorInstrumentation::didFinishRecordingCanvasFrame(*context, true); > } > >+void PageConsoleClient::screenshot(JSC::ExecState* state, Ref<ScriptArguments>&& arguments) >+{ >+ FAST_RETURN_IF_NO_FRONTENDS(void()); >+ >+ auto* target = objectArgumentAt(arguments, 0); >+ if (!target) >+ return; >+ >+ String dataURL; >+ >+ if (auto* node = JSNode::toWrapped(state->vm(), target)) { >+ if (std::unique_ptr<ImageBuffer> snapshot = WebCore::snapshotNode(m_page.mainFrame(), *node)) >+ dataURL = snapshot->toDataURL("image/png"_s, WTF::nullopt, PreserveResolution::Yes); >+ } >+ >+ if (dataURL.isEmpty()) >+ return; >+ >+ // Log the argument before sending the image for it. >+ String messageText; >+ arguments->getFirstArgumentAsString(messageText); >+ addMessage(std::make_unique<Inspector::ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::Log, MessageLevel::Log, messageText, arguments.copyRef())); >+ >+ addMessage(std::make_unique<Inspector::ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::Image, MessageLevel::Log, dataURL)); >+} >+ > } // namespace WebCore >diff --git a/Source/WebCore/page/PageConsoleClient.h b/Source/WebCore/page/PageConsoleClient.h >index ba6140d1404de79260f741f6b0fe4ba1a04bfa6e..52c2fdc9ac83e0f46253ad9dc9b1303ca79dd9d6 100644 >--- a/Source/WebCore/page/PageConsoleClient.h >+++ b/Source/WebCore/page/PageConsoleClient.h >@@ -76,6 +76,7 @@ protected: > void timeStamp(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override; > void record(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override; > void recordEnd(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override; >+ void screenshot(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override; > > private: > Page& m_page; >diff --git a/Source/WebCore/workers/WorkerConsoleClient.cpp b/Source/WebCore/workers/WorkerConsoleClient.cpp >index c354a5631b0a2678f04d638b69723710b120d6d5..bab2da66329cfaeeca2ae25c54ad54a281d8617b 100644 >--- a/Source/WebCore/workers/WorkerConsoleClient.cpp >+++ b/Source/WebCore/workers/WorkerConsoleClient.cpp >@@ -76,4 +76,6 @@ void WorkerConsoleClient::timeStamp(JSC::ExecState*, Ref<ScriptArguments>&&) { } > void WorkerConsoleClient::record(JSC::ExecState*, Ref<ScriptArguments>&&) { } > void WorkerConsoleClient::recordEnd(JSC::ExecState*, Ref<ScriptArguments>&&) { } > >+void WorkerConsoleClient::screenshot(JSC::ExecState*, Ref<ScriptArguments>&&) { } >+ > } // namespace WebCore >diff --git a/Source/WebCore/workers/WorkerConsoleClient.h b/Source/WebCore/workers/WorkerConsoleClient.h >index 1f79bf94a977d0bb923c2794cc28511d9f333e2e..ef38587471bbab24cf94c4a25d53e61d2c7c7e92 100644 >--- a/Source/WebCore/workers/WorkerConsoleClient.h >+++ b/Source/WebCore/workers/WorkerConsoleClient.h >@@ -52,6 +52,7 @@ protected: > void timeStamp(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override; > void record(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override; > void recordEnd(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override; >+ void screenshot(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override; > > private: > WorkerGlobalScope& m_workerGlobalScope; >diff --git a/Source/WebCore/worklets/WorkletConsoleClient.cpp b/Source/WebCore/worklets/WorkletConsoleClient.cpp >index 89506b9e393134cec33636ca66f1c5dc24b88182..5dcb68e07b243cacaf7ddbcb4d9c493beb835534 100644 >--- a/Source/WebCore/worklets/WorkletConsoleClient.cpp >+++ b/Source/WebCore/worklets/WorkletConsoleClient.cpp >@@ -66,5 +66,7 @@ void WorkletConsoleClient::timeStamp(JSC::ExecState*, Ref<ScriptArguments>&&) { > void WorkletConsoleClient::record(JSC::ExecState*, Ref<ScriptArguments>&&) { } > void WorkletConsoleClient::recordEnd(JSC::ExecState*, Ref<ScriptArguments>&&) { } > >+void WorkletConsoleClient::screenshot(JSC::ExecState*, Ref<ScriptArguments>&&) { } >+ > } // namespace WebCore > #endif >diff --git a/Source/WebCore/worklets/WorkletConsoleClient.h b/Source/WebCore/worklets/WorkletConsoleClient.h >index 520f75960ff8b768e1c6c40f5d1929eb0864239b..7a581c804e039c2f3123aa01ff969b1f802fe578 100644 >--- a/Source/WebCore/worklets/WorkletConsoleClient.h >+++ b/Source/WebCore/worklets/WorkletConsoleClient.h >@@ -54,6 +54,7 @@ private: > void timeStamp(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) final; > void record(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) final; > void recordEnd(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) final; >+ void screenshot(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) final; > > WorkletGlobalScope& m_workletGlobalScope; > }; >diff --git a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >index d8c79558caadaefbeb25f954bdbfb8499d5091ad..9f3b376c246798ee1955c9fcda250b39f9a7b397 100644 >--- a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >+++ b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >@@ -807,6 +807,7 @@ localizedStrings["Running the \u201C%s\u201D audit"] = "Running the \u201C%s\u20 > localizedStrings["Samples"] = "Samples"; > localizedStrings["Save %d"] = "Save %d"; > localizedStrings["Save File"] = "Save File"; >+localizedStrings["Save Image"] = "Save Image"; > localizedStrings["Save Selected"] = "Save Selected"; > localizedStrings["Save configuration"] = "Save configuration"; > localizedStrings["Saved States"] = "Saved States"; >diff --git a/Source/WebInspectorUI/UserInterface/Base/FileUtilities.js b/Source/WebInspectorUI/UserInterface/Base/FileUtilities.js >index e8deaaf61d9993a7221512f7c2e412854ce47ee7..ccc06dd7e634d05fecd61482ad4a3a98b06ed92c 100644 >--- a/Source/WebInspectorUI/UserInterface/Base/FileUtilities.js >+++ b/Source/WebInspectorUI/UserInterface/Base/FileUtilities.js >@@ -24,6 +24,20 @@ > */ > > WI.FileUtilities = class FileUtilities { >+ static screenshotString() >+ { >+ let date = new Date; >+ let values = [ >+ date.getFullYear(), >+ Number.zeroPad(date.getMonth() + 1, 2), >+ Number.zeroPad(date.getDate(), 2), >+ Number.zeroPad(date.getHours(), 2), >+ Number.zeroPad(date.getMinutes(), 2), >+ Number.zeroPad(date.getSeconds(), 2), >+ ]; >+ return WI.UIString("Screen Shot %s-%s-%s at %s.%s.%s").format(...values); >+ } >+ > static save(saveData, forceSaveAs) > { > console.assert(saveData); >diff --git a/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js b/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js >index d293c14a2f830497125b8656be9635b81e40ff59..71245b568e7e7ea27def7dc1456d97f121ff2bd6 100644 >--- a/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js >+++ b/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js >@@ -322,7 +322,7 @@ WI.JavaScriptLogViewController = class JavaScriptLogViewController extends WI.Ob > > this._currentSessionOrGroup = savedCurrentConsoleGroup; > >- if (wasScrolledToBottom || lastMessageView instanceof WI.ConsoleCommandView || lastMessageView.message.type === WI.ConsoleMessage.MessageType.Result) >+ if (wasScrolledToBottom || lastMessageView instanceof WI.ConsoleCommandView || lastMessageView.message.type === WI.ConsoleMessage.MessageType.Result || lastMessageView.message.type === WI.ConsoleMessage.MessageType.Image) > this.scrollToBottom(); > > WI.quickConsole.needsLayout(); >diff --git a/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js b/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js >index f23df46b130b4707a157bb1ce182996f9c40510f..e71d6771e364aa208d99743531c011e02865cd48 100644 >--- a/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js >+++ b/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js >@@ -319,6 +319,7 @@ WI.JavaScriptRuntimeCompletionProvider._commandLineAPI = [ > "profile", > "profileEnd", > "queryObjects", >+ "screenshot", > "table", > "unmonitorEvents", > "values", >diff --git a/Source/WebInspectorUI/UserInterface/Models/ConsoleMessage.js b/Source/WebInspectorUI/UserInterface/Models/ConsoleMessage.js >index d061d52fd55171419e87b77ff844148dbb20c18c..69df1d208b6b35f62fcd0ac09b57b763471460ba 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/ConsoleMessage.js >+++ b/Source/WebInspectorUI/UserInterface/Models/ConsoleMessage.js >@@ -25,18 +25,19 @@ > > WI.ConsoleMessage = class ConsoleMessage > { >- constructor(target, source, level, message, type, url, line, column, repeatCount, parameters, callFrames, request) >+ constructor(target, source, level, data, type, url, line, column, repeatCount, parameters, callFrames, request) > { >+ console.assert(target instanceof WI.Target); > console.assert(typeof source === "string"); > console.assert(typeof level === "string"); >- console.assert(typeof message === "string"); >- console.assert(target instanceof WI.Target); >+ console.assert(typeof data === "string"); >+ console.assert(!type || Object.values(WI.ConsoleMessage.MessageType).includes(type)); > console.assert(!parameters || parameters.every((x) => x instanceof WI.RemoteObject)); > > this._target = target; > this._source = source; > this._level = level; >- this._messageText = message; >+ this._data = data; > this._type = type || WI.ConsoleMessage.MessageType.Log; > > this._url = url || null; >@@ -58,7 +59,7 @@ WI.ConsoleMessage = class ConsoleMessage > get target() { return this._target; } > get source() { return this._source; } > get level() { return this._level; } >- get messageText() { return this._messageText; } >+ get data() { return this._data; } > get type() { return this._type; } > get url() { return this._url; } > get line() { return this._line; } >@@ -126,6 +127,7 @@ WI.ConsoleMessage.MessageType = { > Timing: "timing", > Profile: "profile", > ProfileEnd: "profileEnd", >+ Image: "image", > Result: "result", // Frontend Only. > }; > >diff --git a/Source/WebInspectorUI/UserInterface/Models/IssueMessage.js b/Source/WebInspectorUI/UserInterface/Models/IssueMessage.js >index ad3d248bbfbfb4c370b1f4e754167afb4df07207..ad762d8822664b937b7b4c32b32e7079b69374af 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/IssueMessage.js >+++ b/Source/WebInspectorUI/UserInterface/Models/IssueMessage.js >@@ -132,10 +132,10 @@ WI.IssueMessage = class IssueMessage extends WI.Object > { > let parameters = this._consoleMessage.parameters; > if (!parameters) >- return this._consoleMessage.messageText; >+ return this._consoleMessage.data; > > if (parameters[0].type !== "string") >- return this._consoleMessage.messageText; >+ return this._consoleMessage.data; > > function valueFormatter(obj) > { >diff --git a/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js b/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js >index d885b0ca1d77f47acec358f20ba95f83c58f9e58..795e09527919f11d7e4c8387ec09552d7b70719a 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js >+++ b/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js >@@ -175,6 +175,7 @@ WI.NativeConstructorFunctionParameters = { > profileEnd: "name", > record: "object, [options]", > recordEnd: "object", >+ screenshot: "object", > table: "data, [columns]", > takeHeapSnapshot: "[label]", > time: "name = \"default\"", >diff --git a/Source/WebInspectorUI/UserInterface/Views/ConsoleCommandView.js b/Source/WebInspectorUI/UserInterface/Views/ConsoleCommandView.js >index 434c6aaee9cf306ef6ff9d1fa4498962a7b60364..8326a5534751d5edc3024a0cd901315434a95778 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/ConsoleCommandView.js >+++ b/Source/WebInspectorUI/UserInterface/Views/ConsoleCommandView.js >@@ -49,7 +49,7 @@ WI.ConsoleCommandView = class ConsoleCommandView extends WI.Object > this._element.classList.add(this._className); > > this._formattedCommandElement = this._element.appendChild(document.createElement("span")); >- this._formattedCommandElement.classList.add("console-message-text"); >+ this._formattedCommandElement.classList.add("console-message-body"); > this._formattedCommandElement.textContent = this._commandText; > > // FIXME: <https://webkit.org/b/143545> Web Inspector: LogContentView should use higher level objects >diff --git a/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.css b/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.css >index 3a2909f73a32fef700dfe8e2c3ff47c6ef72aeb4..f5af79bc6e026e483916b421458b2e7af3ccc99e 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.css >+++ b/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.css >@@ -29,7 +29,7 @@ > min-height: 21px; > } > >-.console-user-command.special-user-log > .console-message-text { >+.console-user-command.special-user-log > .console-message-body { > padding: 0 6px 1px; > border-radius: 3px; > border: 1px solid transparent; >@@ -59,18 +59,29 @@ > border-radius: 7px; > } > >-.console-message-text { >+.console-message-body { > white-space: pre-wrap; > } > >-.console-message-text > span { >+.console-message-body > span { > -webkit-user-select: text; > } > >-.console-message-text > span > :matches(.console-message-enclosed, .console-message-preview, .console-message-preview-divider) { >+.console-message-body > span > :matches(.console-message-enclosed, .console-message-preview, .console-message-preview-divider) { > -webkit-user-select: none; > } > >+.console-message-body > img { >+ max-width: 500px; >+ max-height: 500px; >+ box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.58); >+} >+ >+.console-message-body > .show-grid { >+ /* Prevents the light blue highlight from being visible in the checkerboard. */ >+ --checkerboard-light-square: white; >+} >+ > .console-message.expandable .console-top-level-message::before { > display: inline-block; > >@@ -160,7 +171,7 @@ body[dir=rtl] .console-message.expandable .console-top-level-message::before { > border-color: hsl(0, 100%, 92%); > } > >-.console-error-level .console-message-text { >+.console-error-level .console-message-body { > color: hsl(0, 75%, 45%); > } > >@@ -169,7 +180,7 @@ body[dir=rtl] .console-message.expandable .console-top-level-message::before { > border-color: hsl(40, 100%, 90%); > } > >-.console-warning-level .console-message-text { >+.console-warning-level .console-message-body { > color: hsl(30, 90%, 35%); > } > >@@ -212,7 +223,7 @@ body[dir=rtl] .console-message.expandable .console-top-level-message::before { > padding-top: 1px; > } > >-.console-user-command > .console-message-text { >+.console-user-command > .console-message-body { > color: hsl(209, 100%, 50%); > -webkit-user-select: text; > } >@@ -290,15 +301,15 @@ body[dir=rtl] .console-message.expandable .console-top-level-message::before { > background-color: unset; > } > >- .console-warning-level .console-message-text { >+ .console-warning-level .console-message-body { > color: hsl(53, 80%, 55%); > } > >- .console-error-level .console-message-text { >+ .console-error-level .console-message-body { > color: hsl(10, 100%, 70%); > } > >- .console-user-command > .console-message-text { >+ .console-user-command > .console-message-body { > color: hsl(209, 100%, 70%); > } > >diff --git a/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js b/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js >index de6ec24e9911444115e0877812b80ede5e009f3a..8d0a0741e6f535d729b8173c7ded95408a6df60c 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js >+++ b/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js >@@ -88,16 +88,18 @@ WI.ConsoleMessageView = class ConsoleMessageView extends WI.Object > // FIXME: The location link should include stack trace information. > this._appendLocationLink(); > >- this._messageTextElement = this._element.appendChild(document.createElement("span")); >- this._messageTextElement.classList.add("console-top-level-message"); >- this._messageTextElement.classList.add("console-message-text"); >- this._appendMessageTextAndArguments(this._messageTextElement); >+ this._messageBodyElement = this._element.appendChild(document.createElement("span")); >+ this._messageBodyElement.classList.add("console-top-level-message", "console-message-body"); >+ this._appendMessageTextAndArguments(this._messageBodyElement); > this._appendSavedResultIndex(); > > this._appendExtraParameters(); > this._appendStackTrace(); > > this._renderRepeatCount(); >+ >+ if (this._message.type === WI.ConsoleMessage.MessageType.Image) >+ this._element.addEventListener("contextmenu", this._handleContextMenu.bind(this)); > } > > get element() >@@ -197,7 +199,7 @@ WI.ConsoleMessageView = class ConsoleMessageView extends WI.Object > > toClipboardString(isPrefixOptional) > { >- let clipboardString = this._messageTextElement.innerText.removeWordBreakCharacters(); >+ let clipboardString = this._messageBodyElement.innerText.removeWordBreakCharacters(); > if (this._message.savedResultIndex) > clipboardString = clipboardString.replace(/\s*=\s*(\$\d+)$/, ""); > >@@ -279,13 +281,31 @@ WI.ConsoleMessageView = class ConsoleMessageView extends WI.Object > > case WI.ConsoleMessage.MessageType.StartGroup: > case WI.ConsoleMessage.MessageType.StartGroupCollapsed: >- var args = this._message.parameters || [this._message.messageText || WI.UIString("Group")]; >+ var args = this._message.parameters || [this._message.data || WI.UIString("Group")]; > this._formatWithSubstitutionString(args, element); > this._extraParameters = null; > break; > >+ case WI.ConsoleMessage.MessageType.Image: { >+ let image = element.appendChild(document.createElement("img")); >+ image.classList.add("show-grid"); >+ image.src = this._message.data; >+ >+ let filename = WI.FileUtilities.screenshotString(); >+ image.title = filename; >+ image.setAttribute("filename", filename + ".png"); >+ >+ image.addEventListener("load", (event) => { >+ if (image.width >= image.height) >+ image.width = image.width / window.devicePixelRatio; >+ else >+ image.height = image.height / window.devicePixelRatio; >+ }); >+ break; >+ } >+ > default: >- var args = this._message.parameters || [this._message.messageText]; >+ var args = this._message.parameters || [this._message.data]; > this._appendFormattedArguments(element, args); > break; > } >@@ -294,7 +314,7 @@ WI.ConsoleMessageView = class ConsoleMessageView extends WI.Object > > // FIXME: Better handle WI.ConsoleMessage.MessageSource.Network once it has request info. > >- var args = this._message.parameters || [this._message.messageText]; >+ var args = this._message.parameters || [this._message.data]; > this._appendFormattedArguments(element, args); > } > >@@ -313,7 +333,7 @@ WI.ConsoleMessageView = class ConsoleMessageView extends WI.Object > if (this._objectTree) > this._objectTree.appendTitleSuffix(savedVariableElement); > else >- this._messageTextElement.appendChild(savedVariableElement); >+ this._messageBodyElement.appendChild(savedVariableElement); > } > > _appendLocationLink() >@@ -403,7 +423,7 @@ WI.ConsoleMessageView = class ConsoleMessageView extends WI.Object > this.expand(); > > this._stackTraceElement = this._element.appendChild(document.createElement("div")); >- this._stackTraceElement.classList.add("console-message-text", "console-message-stack-trace-container"); >+ this._stackTraceElement.classList.add("console-message-body", "console-message-stack-trace-container"); > > var callFramesElement = new WI.StackTraceView(this._message.stackTrace).element; > this._stackTraceElement.appendChild(callFramesElement); >@@ -920,6 +940,24 @@ WI.ConsoleMessageView = class ConsoleMessageView extends WI.Object > this._element.classList.add("expandable"); > > this._boundClickHandler = this.toggle.bind(this); >- this._messageTextElement.addEventListener("click", this._boundClickHandler); >+ this._messageBodyElement.addEventListener("click", this._boundClickHandler); >+ } >+ >+ _handleContextMenu(event) >+ { >+ let image = this._messageBodyElement.querySelector("img"); >+ >+ let contextMenu = WI.ContextMenu.createFromEvent(event); >+ >+ contextMenu.appendItem(WI.UIString("Save Image"), () => { >+ const forceSaveAs = true; >+ WI.FileUtilities.save({ >+ url: encodeURI("web-inspector:///" + image.getAttribute("filename")), >+ content: parseDataURL(this._message.data).data, >+ base64Encoded: true, >+ }, forceSaveAs); >+ }); >+ >+ contextMenu.appendSeparator(); > } > }; >diff --git a/Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js b/Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js >index b543529f5c1c0198999fa4b58e9da5038958fd9b..5d2c577c67d9006b81fc18c0328fb1574f5e076f 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js >+++ b/Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js >@@ -228,18 +228,8 @@ WI.appendContextMenuItemsForDOMNode = function(contextMenu, domNode, options = { > return; > } > >- let date = new Date; >- let values = [ >- date.getFullYear(), >- Number.zeroPad(date.getMonth() + 1, 2), >- Number.zeroPad(date.getDate(), 2), >- Number.zeroPad(date.getHours(), 2), >- Number.zeroPad(date.getMinutes(), 2), >- Number.zeroPad(date.getSeconds(), 2), >- ]; >- let filename = WI.UIString("Screen Shot %s-%s-%s at %s.%s.%s").format(...values); > WI.FileUtilities.save({ >- url: encodeURI(`web-inspector:///${filename}.png`), >+ url: encodeURI(`web-inspector:///${WI.FileUtilities.screenshotString()}.png`), > content: parseDataURL(dataURL).data, > base64Encoded: true, > }); >diff --git a/Source/WebInspectorUI/UserInterface/Views/LogContentView.css b/Source/WebInspectorUI/UserInterface/Views/LogContentView.css >index ad96a3d5f744b3c79b65206df242d6716a675165..14637f8ef33d00d271bdbcfd93cc4480c19739e5 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/LogContentView.css >+++ b/Source/WebInspectorUI/UserInterface/Views/LogContentView.css >@@ -238,7 +238,7 @@ body[dir=rtl] .console-group-title::before { > background-color: hsla(53, 83%, 53%, 0.75); > } > >-.search-in-progress .console-item:not(.filtered-out-by-search).special-user-log .console-message-text .highlighted { >+.search-in-progress .console-item:not(.filtered-out-by-search).special-user-log .console-message-body .highlighted { > color: var(--selected-foreground-color); > background-color: var(--selected-background-color-highlight); > >diff --git a/Source/WebInspectorUI/UserInterface/Views/Main.css b/Source/WebInspectorUI/UserInterface/Views/Main.css >index 31a70cb19f5676ca3f12741cc3a1f38ad663c63c..9aee116ecaf9fe1c70cb78a24fca3f115ab81172 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/Main.css >+++ b/Source/WebInspectorUI/UserInterface/Views/Main.css >@@ -379,12 +379,16 @@ body[dir=rtl] .go-to-arrow { > } > > :matches(img, canvas).show-grid { >- background-image: linear-gradient(315deg, transparent 75%, hsl(0, 0%, 95%) 75%), >- linear-gradient(45deg, transparent 75%, hsl(0, 0%, 95%) 75%), >- linear-gradient(315deg, hsl(0, 0%, 95%) 25%, transparent 25%), >- linear-gradient(45deg, hsl(0, 0%, 95%) 25%, transparent 25%); >+ background-color: var(--checkerboard-light-square); >+ background-image: linear-gradient(315deg, transparent 75%, var(--checkerboard-dark-square) 75%), >+ linear-gradient(45deg, transparent 75%, var(--checkerboard-dark-square) 75%), >+ linear-gradient(315deg, var(--checkerboard-dark-square) 25%, transparent 25%), >+ linear-gradient(45deg, var(--checkerboard-dark-square) 25%, transparent 25%); > background-size: 20px 20px; > background-position: 10px 10px, 10px 0px, 0 0, 0 10px; >+ >+ --checkerboard-light-square: transparent; >+ --checkerboard-dark-square: hsl(0, 0%, 95%); > } > > .device-settings-content { >@@ -452,8 +456,7 @@ body[dir=rtl] .go-to-arrow { > } > > :matches(img, canvas).show-grid { >- background-color: white; >+ --checkerboard-light-square: white; > --checkerboard-dark-square: hsl(0, 0%, 80%); >- background-image: linear-gradient(315deg, transparent 75%, var(--checkerboard-dark-square) 75%), linear-gradient(45deg, transparent 75%, var(--checkerboard-dark-square) 75%), linear-gradient(315deg, var(--checkerboard-dark-square) 25%, transparent 25%), linear-gradient(45deg, var(--checkerboard-dark-square) 25%, transparent 25%); > } > } >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index b51adadd1224b2a8f32a24bf06afce283fa0555e..b352ab6d226afa4aac1936ebd2fc6e422d393751 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,25 @@ >+2019-02-06 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: provide a way to capture a screenshot of a node from within the page >+ https://bugs.webkit.org/show_bug.cgi?id=194279 >+ <rdar://problem/10731573> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * inspector/console/console-screenshot.html: Added. >+ * inspector/console/console-screenshot-expected.txt: Added. >+ >+ * inspector/console/command-line-api.html: >+ * inspector/console/console-api-expected.txt: >+ * inspector/console/console-count.html: >+ * inspector/console/console-table-expected.txt: >+ * inspector/console/console-time.html: >+ * inspector/console/webcore-logging.html: >+ * inspector/debugger/csp-exceptions.html: >+ * inspector/worker/console-basic.html: >+ * inspector/worker/console-basic-expected.txt: >+ Renamed `messageText` to `data`. >+ > 2019-02-05 Megan Gardner <megan_gardner@apple.com> > > [iOS] Layout tests editing/pasteboard/smart-paste-007.html and editing/pasteboard/smart-paste-008.html are failing >diff --git a/LayoutTests/inspector/console/command-line-api.html b/LayoutTests/inspector/console/command-line-api.html >index da105ebe022385be3d798738eb28fcc0a9336b9a..49235c63c4ff282ad86629f9c96ef22323bd07ec 100644 >--- a/LayoutTests/inspector/console/command-line-api.html >+++ b/LayoutTests/inspector/console/command-line-api.html >@@ -83,7 +83,7 @@ function test() > WI.consoleManager.singleFireEventListener(WI.ConsoleManager.Event.MessageAdded, (event) => { > let message = event.data.message; > InspectorTest.assert(message instanceof WI.ConsoleMessage); >- InspectorTest.log(`CONSOLE: ${message.messageText}`); >+ InspectorTest.log(`CONSOLE: ${message.data}`); > }); > > resolve(); >diff --git a/LayoutTests/inspector/console/console-api-expected.txt b/LayoutTests/inspector/console/console-api-expected.txt >index 836e8142463549abf0e8dc10ef593703016d6b00..443526334970d39e0579c5e9a66ac8812e7c4ef9 100644 >--- a/LayoutTests/inspector/console/console-api-expected.txt >+++ b/LayoutTests/inspector/console/console-api-expected.txt >@@ -21,7 +21,7 @@ STEP: console.log('console.log') > { > "_source": "console-api", > "_level": "log", >- "_messageText": "console.log", >+ "_data": "console.log", > "_type": "log", > "_url": null, > "_line": 3, >@@ -43,7 +43,7 @@ STEP: console.warn('console.warn') > { > "_source": "console-api", > "_level": "warning", >- "_messageText": "console.warn", >+ "_data": "console.warn", > "_type": "log", > "_url": null, > "_line": 3, >@@ -65,7 +65,7 @@ STEP: console.error('console.error') > { > "_source": "console-api", > "_level": "error", >- "_messageText": "console.error", >+ "_data": "console.error", > "_type": "log", > "_url": null, > "_line": 3, >@@ -87,7 +87,7 @@ STEP: console.debug('console.debug') > { > "_source": "console-api", > "_level": "debug", >- "_messageText": "console.debug", >+ "_data": "console.debug", > "_type": "log", > "_url": null, > "_line": 3, >@@ -109,7 +109,7 @@ STEP: console.info('console.info') > { > "_source": "console-api", > "_level": "info", >- "_messageText": "console.info", >+ "_data": "console.info", > "_type": "log", > "_url": null, > "_line": 3, >@@ -131,7 +131,7 @@ STEP: console.assert(false, 'assertion message') > { > "_source": "console-api", > "_level": "error", >- "_messageText": "assertion message", >+ "_data": "assertion message", > "_type": "assert", > "_url": null, > "_line": 3, >@@ -153,7 +153,7 @@ STEP: console.trace() > { > "_source": "console-api", > "_level": "log", >- "_messageText": "", >+ "_data": "", > "_type": "trace", > "_url": null, > "_line": 3, >@@ -167,7 +167,7 @@ STEP: console.log('string message', string) > { > "_source": "console-api", > "_level": "log", >- "_messageText": "string message", >+ "_data": "string message", > "_type": "log", > "_url": null, > "_line": 3, >@@ -195,7 +195,7 @@ STEP: console.log('message', object, object) > { > "_source": "console-api", > "_level": "log", >- "_messageText": "message", >+ "_data": "message", > "_type": "log", > "_url": null, > "_line": 3, >@@ -257,7 +257,7 @@ STEP: console.error('message', object) > { > "_source": "console-api", > "_level": "error", >- "_messageText": "message", >+ "_data": "message", > "_type": "log", > "_url": null, > "_line": 3, >@@ -299,7 +299,7 @@ STEP: console.warn('message', object) > { > "_source": "console-api", > "_level": "warning", >- "_messageText": "message", >+ "_data": "message", > "_type": "log", > "_url": null, > "_line": 3, >@@ -341,7 +341,7 @@ STEP: console.debug('message', object) > { > "_source": "console-api", > "_level": "debug", >- "_messageText": "message", >+ "_data": "message", > "_type": "log", > "_url": null, > "_line": 3, >@@ -383,7 +383,7 @@ STEP: console.info('message', object) > { > "_source": "console-api", > "_level": "info", >- "_messageText": "message", >+ "_data": "message", > "_type": "log", > "_url": null, > "_line": 3, >@@ -425,7 +425,7 @@ STEP: console.dir(object) > { > "_source": "console-api", > "_level": "log", >- "_messageText": "[object Object]", >+ "_data": "[object Object]", > "_type": "dir", > "_url": null, > "_line": 3, >@@ -461,7 +461,7 @@ STEP: console.dirxml(object) > { > "_source": "console-api", > "_level": "log", >- "_messageText": "[object Object]", >+ "_data": "[object Object]", > "_type": "dirxml", > "_url": null, > "_line": 3, >@@ -497,7 +497,7 @@ STEP: console.group('groupName') > { > "_source": "console-api", > "_level": "log", >- "_messageText": "groupName", >+ "_data": "groupName", > "_type": "startGroup", > "_url": null, > "_line": 3, >@@ -519,7 +519,7 @@ STEP: console.groupEnd('groupName') > { > "_source": "console-api", > "_level": "log", >- "_messageText": "groupName", >+ "_data": "groupName", > "_type": "endGroup", > "_url": null, > "_line": 0, >@@ -541,7 +541,7 @@ STEP: console.groupCollapsed('collapsedGroupName') > { > "_source": "console-api", > "_level": "log", >- "_messageText": "collapsedGroupName", >+ "_data": "collapsedGroupName", > "_type": "startGroupCollapsed", > "_url": null, > "_line": 3, >@@ -563,7 +563,7 @@ STEP: console.groupEnd('collapsedGroupName') > { > "_source": "console-api", > "_level": "log", >- "_messageText": "collapsedGroupName", >+ "_data": "collapsedGroupName", > "_type": "endGroup", > "_url": null, > "_line": 0, >@@ -585,7 +585,7 @@ STEP: console.count() > { > "_source": "console-api", > "_level": "debug", >- "_messageText": "Global: 1", >+ "_data": "Global: 1", > "_type": "log", > "_url": null, > "_line": 3, >@@ -599,7 +599,7 @@ STEP: console.count() > { > "_source": "console-api", > "_level": "debug", >- "_messageText": "Global: 2", >+ "_data": "Global: 2", > "_type": "log", > "_url": null, > "_line": 3, >@@ -613,7 +613,7 @@ STEP: console.count('') > { > "_source": "console-api", > "_level": "debug", >- "_messageText": ": 1", >+ "_data": ": 1", > "_type": "log", > "_url": null, > "_line": 3, >@@ -627,7 +627,7 @@ STEP: console.count(' ') > { > "_source": "console-api", > "_level": "debug", >- "_messageText": " : 1", >+ "_data": " : 1", > "_type": "log", > "_url": null, > "_line": 3, >@@ -641,7 +641,7 @@ STEP: console.count('') > { > "_source": "console-api", > "_level": "debug", >- "_messageText": ": 2", >+ "_data": ": 2", > "_type": "log", > "_url": null, > "_line": 3, >@@ -655,7 +655,7 @@ STEP: console.count(' ') > { > "_source": "console-api", > "_level": "debug", >- "_messageText": " : 2", >+ "_data": " : 2", > "_type": "log", > "_url": null, > "_line": 3, >@@ -669,7 +669,7 @@ STEP: console.count(string) > { > "_source": "console-api", > "_level": "debug", >- "_messageText": "string: 1", >+ "_data": "string: 1", > "_type": "log", > "_url": null, > "_line": 3, >@@ -683,7 +683,7 @@ STEP: console.count(string) > { > "_source": "console-api", > "_level": "debug", >- "_messageText": "string: 2", >+ "_data": "string: 2", > "_type": "log", > "_url": null, > "_line": 3, >@@ -697,7 +697,7 @@ STEP: console.count(object) > { > "_source": "console-api", > "_level": "debug", >- "_messageText": "[object Object]: 1", >+ "_data": "[object Object]: 1", > "_type": "log", > "_url": null, > "_line": 3, >@@ -711,7 +711,7 @@ STEP: console.count(object) > { > "_source": "console-api", > "_level": "debug", >- "_messageText": "[object Object]: 2", >+ "_data": "[object Object]: 2", > "_type": "log", > "_url": null, > "_line": 3, >@@ -725,7 +725,7 @@ STEP: console.count(otherObject) > { > "_source": "console-api", > "_level": "debug", >- "_messageText": "[object Object]: 3", >+ "_data": "[object Object]: 3", > "_type": "log", > "_url": null, > "_line": 3, >@@ -739,7 +739,7 @@ STEP: console.count(otherObject) > { > "_source": "console-api", > "_level": "debug", >- "_messageText": "[object Object]: 4", >+ "_data": "[object Object]: 4", > "_type": "log", > "_url": null, > "_line": 3, >@@ -753,7 +753,7 @@ STEP: console.count(number) > { > "_source": "console-api", > "_level": "debug", >- "_messageText": "42: 1", >+ "_data": "42: 1", > "_type": "log", > "_url": null, > "_line": 3, >@@ -767,7 +767,7 @@ STEP: console.count(number) > { > "_source": "console-api", > "_level": "debug", >- "_messageText": "42: 2", >+ "_data": "42: 2", > "_type": "log", > "_url": null, > "_line": 3, >diff --git a/LayoutTests/inspector/console/console-count.html b/LayoutTests/inspector/console/console-count.html >index d648adbbf20860c71ef27e09999ae9e5430a6719..1f25e7a14fa3eb643949cedb1f602ce8fa89f832 100644 >--- a/LayoutTests/inspector/console/console-count.html >+++ b/LayoutTests/inspector/console/console-count.html >@@ -34,7 +34,7 @@ function test() > WI.consoleManager.addEventListener(WI.ConsoleManager.Event.MessageAdded, handler); > function handler(event) { > let message = event.data.message; >- InspectorTest.log(message.messageText); >+ InspectorTest.log(message.data); > if (++seen === expected) { > WI.consoleManager.removeEventListener(WI.ConsoleManager.Event.MessageAdded, handler); > resolve(); >@@ -55,7 +55,7 @@ function test() > WI.consoleManager.addEventListener(WI.ConsoleManager.Event.MessageAdded, handler); > function handler(event) { > let message = event.data.message; >- InspectorTest.log(message.messageText); >+ InspectorTest.log(message.data); > if (++seen === expected) { > WI.consoleManager.removeEventListener(WI.ConsoleManager.Event.MessageAdded, handler); > resolve(); >diff --git a/LayoutTests/inspector/console/console-screenshot-expected.txt b/LayoutTests/inspector/console/console-screenshot-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..f862541d86fcc5abdaa588fb48ccad67c31627a5 >--- /dev/null >+++ b/LayoutTests/inspector/console/console-screenshot-expected.txt >@@ -0,0 +1,9 @@ >+CONSOLE MESSAGE: [object HTMLDivElement] >+Tests for the console.screenshot API. >+ >+ >+== Running test suite: console.screenshot >+-- Running test case: console.screenshot.Node >+PASS: The added message should be an image. >+PASS: The image should be a 2x2 red square. >+ >diff --git a/LayoutTests/inspector/console/console-screenshot.html b/LayoutTests/inspector/console/console-screenshot.html >new file mode 100644 >index 0000000000000000000000000000000000000000..88b6e0075b5a50d547202a5d56fdebd677db00dc >--- /dev/null >+++ b/LayoutTests/inspector/console/console-screenshot.html >@@ -0,0 +1,50 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../http/tests/inspector/resources/inspector-test.js"></script> >+<script> >+function test() >+{ >+ // 2x2 red square >+ const redSquareDataURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAAXNSR0IArs4c6QAAABNJREFUCB1j/M/AAEQMDEwgAgQAHxcCAmtAm/sAAAAASUVORK5CYII="; >+ >+ let suite = InspectorTest.createAsyncSuite("console.screenshot"); >+ >+ suite.addTestCase({ >+ name: "console.screenshot.Node", >+ description: "Test that console.screenshot works with nodes.", >+ test(resolve, reject) { >+ let listener = WI.consoleManager.addEventListener(WI.ConsoleManager.Event.MessageAdded, (event) => { >+ let {message} = event.data; >+ if (message.type !== WI.ConsoleMessage.MessageType.Image) >+ return; >+ >+ InspectorTest.expectEqual(message.type, WI.ConsoleMessage.MessageType.Image, "The added message should be an image."); >+ InspectorTest.expectEqual(message.data, redSquareDataURL, "The image should be a 2x2 red square."); >+ >+ WI.consoleManager.removeEventListener(WI.ConsoleManager.Event.MessageAdded, listener); >+ >+ resolve(); >+ }); >+ >+ InspectorTest.evaluateInPage(`console.screenshot(document.querySelector("#test1"))`) >+ .catch(reject); >+ }, >+ }); >+ >+ suite.runTestCasesAndFinish(); >+} >+</script> >+</head> >+<body onload="runTest()"> >+ <p>Tests for the console.screenshot API.</p> >+ <div id="test1"></div> >+ <style> >+ #test1 { >+ width: 2px; >+ height: 2px; >+ background-color: red; >+ } >+ </style> >+</body> >+</html> >diff --git a/LayoutTests/inspector/console/console-table-expected.txt b/LayoutTests/inspector/console/console-table-expected.txt >index 06e3a4309f7023974037b36445e00d71a935c87f..e4310dc45a6e6377684bd7038d3ffe2cd4342567 100644 >--- a/LayoutTests/inspector/console/console-table-expected.txt >+++ b/LayoutTests/inspector/console/console-table-expected.txt >@@ -11,7 +11,7 @@ STEP: console.table([]) > { > "_source": "console-api", > "_level": "log", >- "_messageText": "", >+ "_data": "", > "_type": "table", > "_url": null, > "_line": 3, >@@ -45,7 +45,7 @@ STEP: console.table(['apple', 'orange', 'banana']) > { > "_source": "console-api", > "_level": "log", >- "_messageText": "apple,orange,banana", >+ "_data": "apple,orange,banana", > "_type": "table", > "_url": null, > "_line": 3, >@@ -95,7 +95,7 @@ STEP: console.table({firstName: 'John', lastName: 'Smith'}) > { > "_source": "console-api", > "_level": "log", >- "_messageText": "[object Object]", >+ "_data": "[object Object]", > "_type": "table", > "_url": null, > "_line": 3, >@@ -136,7 +136,7 @@ STEP: console.table({f: function(){}, x: 10}) > { > "_source": "console-api", > "_level": "log", >- "_messageText": "[object Object]", >+ "_data": "[object Object]", > "_type": "table", > "_url": null, > "_line": 3, >@@ -184,7 +184,7 @@ STEP: console.table([['John', 'Smith'], ['Jane', 'Doe'], ['Emily', 'Jones']]) > { > "_source": "console-api", > "_level": "log", >- "_messageText": "John,Smith,Jane,Doe,Emily,Jones", >+ "_data": "John,Smith,Jane,Doe,Emily,Jones", > "_type": "table", > "_url": null, > "_line": 3, >@@ -297,7 +297,7 @@ STEP: console.table([john, jane, emily]) > { > "_source": "console-api", > "_level": "log", >- "_messageText": "[object Object],[object Object],[object Object]", >+ "_data": "[object Object],[object Object],[object Object]", > "_type": "table", > "_url": null, > "_line": 3, >@@ -401,7 +401,7 @@ STEP: console.table([john, jane, emily], ['firstName']) > { > "_source": "console-api", > "_level": "log", >- "_messageText": "[object Object],[object Object],[object Object]", >+ "_data": "[object Object],[object Object],[object Object]", > "_type": "table", > "_url": null, > "_line": 3, >@@ -529,7 +529,7 @@ STEP: console.table([manyProperties, manyProperties], ['five', 'six']) > { > "_source": "console-api", > "_level": "log", >- "_messageText": "[object Object],[object Object]", >+ "_data": "[object Object],[object Object]", > "_type": "table", > "_url": null, > "_line": 3, >diff --git a/LayoutTests/inspector/console/console-time.html b/LayoutTests/inspector/console/console-time.html >index 05f44ca9c03e3beae3b3cea4d8cde1d8ed90d592..7bc25d24426818d9563c152d61740712d08a1a23 100644 >--- a/LayoutTests/inspector/console/console-time.html >+++ b/LayoutTests/inspector/console/console-time.html >@@ -17,7 +17,7 @@ function test() > function handler(event) { > let message = event.data.message; > InspectorTest.expectThat(message.type === WI.ConsoleMessage.MessageType.Timing, "Should receive a Timing type message."); >- InspectorTest.expectThat(message.messageText.includes("default"), "Message should contain the 'default' label name somewhere."); >+ InspectorTest.expectThat(message.data.includes("default"), "Message should contain the 'default' label name somewhere."); > if (++seen === expected) { > WI.consoleManager.removeEventListener(WI.ConsoleManager.Event.MessageAdded, handler); > resolve(); >@@ -43,7 +43,7 @@ function test() > .then((event) => { > let message = event.data.message; > InspectorTest.expectThat(message.type === WI.ConsoleMessage.MessageType.Timing, "Should receive a Timing type message."); >- InspectorTest.expectThat(message.messageText.includes("my-label"), "Message should contain the 'my-label' label name somewhere."); >+ InspectorTest.expectThat(message.data.includes("my-label"), "Message should contain the 'my-label' label name somewhere."); > }) > .then(resolve, reject); > >@@ -63,7 +63,7 @@ function test() > let message = event.data.message; > let expectedLabel = seen === 0 ? "my-label-2" : "my-label-1"; > InspectorTest.expectThat(message.type === WI.ConsoleMessage.MessageType.Timing, "Should receive a Timing type message."); >- InspectorTest.expectThat(message.messageText.includes(expectedLabel), "Message should contain the '" + expectedLabel + "' label name somewhere."); >+ InspectorTest.expectThat(message.data.includes(expectedLabel), "Message should contain the '" + expectedLabel + "' label name somewhere."); > if (++seen === expected) { > WI.consoleManager.removeEventListener(WI.ConsoleManager.Event.MessageAdded, handler); > resolve(); >@@ -87,7 +87,7 @@ function test() > if (message.level === WI.ConsoleMessage.MessageLevel.Warning) { > InspectorTest.expectThat(message.type === WI.ConsoleMessage.MessageType.Timing, "Should receive a Timing type message."); > InspectorTest.pass("Should receive a Warning level message"); >- InspectorTest.expectThat(message.messageText.includes("default"), "Message should contain the 'default' label name somewhere."); >+ InspectorTest.expectThat(message.data.includes("default"), "Message should contain the 'default' label name somewhere."); > return; > } > if (message.type === WI.ConsoleMessage.MessageType.Timing) { >@@ -111,7 +111,7 @@ function test() > let message = event.data.message; > InspectorTest.expectThat(message.type === WI.ConsoleMessage.MessageType.Timing, "Should receive a Timing type message."); > InspectorTest.expectThat(message.level === WI.ConsoleMessage.MessageLevel.Warning, "Should receive a Warning level message."); >- InspectorTest.expectThat(message.messageText.includes("default"), "Message should contain the 'default' label name somewhere."); >+ InspectorTest.expectThat(message.data.includes("default"), "Message should contain the 'default' label name somewhere."); > }) > .then(resolve, reject); > >diff --git a/LayoutTests/inspector/console/webcore-logging.html b/LayoutTests/inspector/console/webcore-logging.html >index 55b90d7086c7e43f528691e338409430dcbfc337..aa2006462490c6646654defcfc0f581faeb783f3 100644 >--- a/LayoutTests/inspector/console/webcore-logging.html >+++ b/LayoutTests/inspector/console/webcore-logging.html >@@ -186,7 +186,7 @@ function test() > InspectorTest.assert(message instanceof WI.ConsoleMessage); > InspectorTest.assert(message.source === WI.ConsoleMessage.MessageSource.Media); > >- if (message.messageText.includes("LoadableTextTrack::newCuesAvailable")) { >+ if (message.data.includes("LoadableTextTrack::newCuesAvailable")) { > InspectorTest.expectThat(message.parameters.length > 1, "Message logged as JSON."); > InspectorTest.expectThat(message.repeatCount === 1, "ConsoleMessage repeatCount is 1."); > if (++messageCount === 3) { >diff --git a/LayoutTests/inspector/debugger/csp-exceptions.html b/LayoutTests/inspector/debugger/csp-exceptions.html >index 45c40f950aa7b7949b54a8a8dcac12ccb27a4c64..44793a5cb7d3df24be4f1ded05beafea53c25dd8 100644 >--- a/LayoutTests/inspector/debugger/csp-exceptions.html >+++ b/LayoutTests/inspector/debugger/csp-exceptions.html >@@ -33,7 +33,7 @@ function test() > > WI.consoleManager.singleFireEventListener(WI.ConsoleManager.Event.MessageAdded, (event) => { > InspectorTest.assert(event.data.message.level === WI.ConsoleMessage.MessageLevel.Error); >- InspectorTest.pass("CSP Exception Console Message: " + event.data.message.messageText); >+ InspectorTest.pass("CSP Exception Console Message: " + event.data.message.data); > resolve(); > }); > } >@@ -55,7 +55,7 @@ function test() > WI.debuggerManager.removeEventListener(WI.DebuggerManager.Event.Paused, tempPauseFailListener, null); > InspectorTest.assert(event.data.message.level === WI.ConsoleMessage.MessageLevel.Error); > InspectorTest.expectFalse(didPause, "CSP Exception caused outside of script evaluation should not pause."); >- InspectorTest.pass("CSP Exception Console Message: " + event.data.message.messageText); >+ InspectorTest.pass("CSP Exception Console Message: " + event.data.message.data); > resolve(); > }); > } >diff --git a/LayoutTests/inspector/worker/console-basic-expected.txt b/LayoutTests/inspector/worker/console-basic-expected.txt >index 5d57d3a988285899d275b55cafc0e4bbb6d306bf..9671fbe35620d38d58550994e25a46dbff09b414 100644 >--- a/LayoutTests/inspector/worker/console-basic-expected.txt >+++ b/LayoutTests/inspector/worker/console-basic-expected.txt >@@ -7,7 +7,7 @@ PASS: ConsoleMessage parameter RemoteObjects should be from the Worker target. > { > "_source": "console-api", > "_level": "log", >- "_messageText": "log!", >+ "_data": "log!", > "_type": "log", > "_url": "inspector/worker/resources/worker-console.js", > "_line": 4, >@@ -67,7 +67,7 @@ PASS: ConsoleMessage parameter RemoteObjects should be from the Worker target. > { > "_source": "console-api", > "_level": "warning", >- "_messageText": "warning!", >+ "_data": "warning!", > "_type": "log", > "_url": "inspector/worker/resources/worker-console.js", > "_line": 7, >@@ -89,7 +89,7 @@ PASS: ConsoleMessage parameter RemoteObjects should be from the Worker target. > { > "_source": "console-api", > "_level": "error", >- "_messageText": "error!", >+ "_data": "error!", > "_type": "log", > "_url": "inspector/worker/resources/worker-console.js", > "_line": 10, >@@ -111,7 +111,7 @@ PASS: ConsoleMessage parameter RemoteObjects should be from the Worker target. > { > "_source": "console-api", > "_level": "error", >- "_messageText": "Assertion Failure", >+ "_data": "Assertion Failure", > "_type": "assert", > "_url": "inspector/worker/resources/worker-console.js", > "_line": 14, >@@ -133,7 +133,7 @@ PASS: ConsoleMessage parameter RemoteObjects should be from the Worker target. > { > "_source": "console-api", > "_level": "debug", >- "_messageText": "name: <filtered>ms", >+ "_data": "name: <filtered>ms", > "_type": "timing", > "_url": "inspector/worker/resources/worker-console.js", > "_line": 18, >@@ -148,7 +148,7 @@ PASS: ConsoleMessage parameter RemoteObjects should be from the Worker target. > { > "_source": "console-api", > "_level": "debug", >- "_messageText": "Global: 1", >+ "_data": "Global: 1", > "_type": "log", > "_url": "inspector/worker/resources/worker-console.js", > "_line": 21, >diff --git a/LayoutTests/inspector/worker/console-basic.html b/LayoutTests/inspector/worker/console-basic.html >index a1e0c5cad083b98ea4e8b92041a84886e31fb49b..56fa3181ac8262c8af6323f374a02b7e88bb58cc 100644 >--- a/LayoutTests/inspector/worker/console-basic.html >+++ b/LayoutTests/inspector/worker/console-basic.html >@@ -97,7 +97,7 @@ function test() > description: "console.time/timeEnd should produce a timing message.", > message: "time", > preprocess(message) { >- message._messageText = message._messageText.replace(/[0-9.]+/, "<filtered>"); >+ message._data = message._data.replace(/[0-9.]+/, "<filtered>"); > } > }); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194279
:
361160
|
361161
|
361164
|
361165
|
361170
|
361172
|
361176
|
361326
|
361334
|
361337
|
361339
|
361340
|
361345
|
361358
|
364646
|
364647
|
364653
|
364776