2020-04-10 21:10:11 +00:00
|
|
|
CONSOLE MESSAGE: log message
|
|
|
|
CONSOLE MESSAGE: log message
|
|
|
|
CONSOLE MESSAGE: log message
|
|
|
|
CONSOLE MESSAGE: log message
|
|
|
|
CONSOLE MESSAGE: log message
|
|
|
|
CONSOLE MESSAGE: log message
|
|
|
|
CONSOLE MESSAGE: log message
|
|
|
|
CONSOLE MESSAGE: 1
|
|
|
|
CONSOLE MESSAGE: 2
|
|
|
|
CONSOLE MESSAGE: 3
|
Web Inspector: print the target of `console.screenshot` last so the target is the closest item to the image
https://bugs.webkit.org/show_bug.cgi?id=199308
Reviewed by Joseph Pecoraro.
Source/JavaScriptCore:
* inspector/ConsoleMessage.h:
(Inspector::ConsoleMessage::arguments const):
* inspector/ScriptArguments.h:
* inspector/ScriptArguments.cpp:
(Inspector::ScriptArguments::getFirstArgumentAsString const): Added.
(Inspector::ScriptArguments::getFirstArgumentAsString): Deleted.
Source/WebCore:
Right now, evaluating `console.screenshot(document, "test", 1);` will log a message to the
console with `#document`, `"test"`, and `1`, all on different lines (togglable by a
disclosure triangle) since `#document` isn't stringifiable.
The ideal situation would be to have `"test"` and `1` logged on the same line, and then have
`#document` be in a disclosure triangle. This way, you can "label" your images using
additional arguments (e.g. `console.screenshot(document.images[1], "second image");`), as
well as provide other data.
If the only argument was the target, it should print as if it was `console.log(target);`.
If there are no arguments, it should print the text "Viewport"` before the image.
Test: inspector/console/console-screenshot.html
* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::addMessage):
(WebCore::PageConsoleClient::screenshot):
Source/WebInspectorUI:
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype.render):
(WI.ConsoleMessageView.prototype._appendMessageTextAndArguments):
(WI.ConsoleMessageView.prototype._handleContextMenu):
* UserInterface/Views/ConsoleMessageView.css:
(.console-image > .console-message-body > :matches(hr, img)): Added.
(.console-image > .console-message-body > hr): Added.
(.console-image > .console-message-body > img): Added.
(.console-log-level.console-image::before): Added.
(.console-message-body > .console-image): Deleted.
(.console-log-level.console-image-container::before): Deleted.
Allow `ConsoleMessage.MessageType.Image` to be an `ConsoleMessage.MessageLevel.Error`, and
print the message (and extra parameters) in that case.
Drive-by: reorganize the switch-case so all paths have the same `default` case.
* Localizations/en.lproj/localizedStrings.js:
LayoutTests:
* inspector/console/console-expected.txt:
* inspector/console/console-screenshot.html:
* inspector/console/console-screenshot-expected.txt:
Canonical link: https://commits.webkit.org/213920@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247790 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-07-24 21:39:32 +00:00
|
|
|
CONSOLE MESSAGE: Viewport
|
|
|
|
CONSOLE MESSAGE: Viewport
|
|
|
|
CONSOLE MESSAGE: Viewport
|
|
|
|
CONSOLE MESSAGE: Viewport
|
|
|
|
CONSOLE MESSAGE: Viewport
|
|
|
|
CONSOLE MESSAGE: Viewport
|
|
|
|
CONSOLE MESSAGE: Viewport
|
|
|
|
CONSOLE MESSAGE: Viewport
|
|
|
|
CONSOLE MESSAGE: Viewport
|
Make console a namespace object (like Math/JSON), allowing functions to be called unbound
https://bugs.webkit.org/show_bug.cgi?id=157286
<rdar://problem/26052830>
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-05-02
Reviewed by Timothy Hatcher.
Source/JavaScriptCore:
This changes `console` to be a global namespace object, like `Math` and `JSON`.
It just holds a bunch of functions, that can be used on their own, unbound.
For example, `[1,2,3].forEach(console.log)` and `var log = console.log; log(1)`
used to throw exceptions and now do not.
Previously console was an Object/Prototype pair, so functions were on
ConsolePrototype (console.__proto__.log) and they needed to be called
Console objects as the `this` value. Now, `console` is just a standard
object with a bunch of functions. Since there is no console prototype the
functions can be passed around and called as expected and they will
just do the right thing.
For compatability with other browsers, `console` was made enumerable
on the global object.
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
Add new files and remove old files.
* runtime/CommonIdentifiers.h:
Add "console".
* runtime/ConsoleObject.cpp: Renamed from Source/JavaScriptCore/runtime/ConsolePrototype.cpp.
(JSC::ConsoleObject::ConsoleObject):
(JSC::ConsoleObject::finishCreation):
(JSC::valueToStringWithUndefinedOrNullCheck):
(JSC::consoleLogWithLevel):
(JSC::consoleProtoFuncDebug):
(JSC::consoleProtoFuncError):
(JSC::consoleProtoFuncLog):
(JSC::consoleProtoFuncInfo):
(JSC::consoleProtoFuncWarn):
(JSC::consoleProtoFuncClear):
(JSC::consoleProtoFuncDir):
(JSC::consoleProtoFuncDirXML):
(JSC::consoleProtoFuncTable):
(JSC::consoleProtoFuncTrace):
(JSC::consoleProtoFuncAssert):
(JSC::consoleProtoFuncCount):
(JSC::consoleProtoFuncProfile):
(JSC::consoleProtoFuncProfileEnd):
(JSC::consoleProtoFuncTakeHeapSnapshot):
(JSC::consoleProtoFuncTime):
(JSC::consoleProtoFuncTimeEnd):
(JSC::consoleProtoFuncTimeStamp):
(JSC::consoleProtoFuncGroup):
(JSC::consoleProtoFuncGroupCollapsed):
(JSC::consoleProtoFuncGroupEnd):
Console functions no longer need to check if the this object is
a Console object. They will always just work now.
* runtime/MathObject.cpp:
* runtime/MathObject.h:
* runtime/ConsoleObject.h: Renamed from Source/JavaScriptCore/runtime/ConsolePrototype.h.
(JSC::ConsoleObject::create):
(JSC::ConsoleObject::createStructure):
ConsoleObject is a basic object like MathObject.
* runtime/JSConsole.cpp: Removed.
* runtime/JSConsole.h: Removed.
* runtime/JSGlobalObject.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
Remove JSConsole / ConsolePrototype in favor of the single ConsoleObject.
LayoutTests:
* js/console-expected.txt: Added.
* js/console.html: Added.
Canonical link: https://commits.webkit.org/175386@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200350 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-03 00:51:24 +00:00
|
|
|
PASS typeof console is "object"
|
2020-08-22 18:08:49 +00:00
|
|
|
PASS console.toString() is "[object console]"
|
Make console a namespace object (like Math/JSON), allowing functions to be called unbound
https://bugs.webkit.org/show_bug.cgi?id=157286
<rdar://problem/26052830>
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-05-02
Reviewed by Timothy Hatcher.
Source/JavaScriptCore:
This changes `console` to be a global namespace object, like `Math` and `JSON`.
It just holds a bunch of functions, that can be used on their own, unbound.
For example, `[1,2,3].forEach(console.log)` and `var log = console.log; log(1)`
used to throw exceptions and now do not.
Previously console was an Object/Prototype pair, so functions were on
ConsolePrototype (console.__proto__.log) and they needed to be called
Console objects as the `this` value. Now, `console` is just a standard
object with a bunch of functions. Since there is no console prototype the
functions can be passed around and called as expected and they will
just do the right thing.
For compatability with other browsers, `console` was made enumerable
on the global object.
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
Add new files and remove old files.
* runtime/CommonIdentifiers.h:
Add "console".
* runtime/ConsoleObject.cpp: Renamed from Source/JavaScriptCore/runtime/ConsolePrototype.cpp.
(JSC::ConsoleObject::ConsoleObject):
(JSC::ConsoleObject::finishCreation):
(JSC::valueToStringWithUndefinedOrNullCheck):
(JSC::consoleLogWithLevel):
(JSC::consoleProtoFuncDebug):
(JSC::consoleProtoFuncError):
(JSC::consoleProtoFuncLog):
(JSC::consoleProtoFuncInfo):
(JSC::consoleProtoFuncWarn):
(JSC::consoleProtoFuncClear):
(JSC::consoleProtoFuncDir):
(JSC::consoleProtoFuncDirXML):
(JSC::consoleProtoFuncTable):
(JSC::consoleProtoFuncTrace):
(JSC::consoleProtoFuncAssert):
(JSC::consoleProtoFuncCount):
(JSC::consoleProtoFuncProfile):
(JSC::consoleProtoFuncProfileEnd):
(JSC::consoleProtoFuncTakeHeapSnapshot):
(JSC::consoleProtoFuncTime):
(JSC::consoleProtoFuncTimeEnd):
(JSC::consoleProtoFuncTimeStamp):
(JSC::consoleProtoFuncGroup):
(JSC::consoleProtoFuncGroupCollapsed):
(JSC::consoleProtoFuncGroupEnd):
Console functions no longer need to check if the this object is
a Console object. They will always just work now.
* runtime/MathObject.cpp:
* runtime/MathObject.h:
* runtime/ConsoleObject.h: Renamed from Source/JavaScriptCore/runtime/ConsolePrototype.h.
(JSC::ConsoleObject::create):
(JSC::ConsoleObject::createStructure):
ConsoleObject is a basic object like MathObject.
* runtime/JSConsole.cpp: Removed.
* runtime/JSConsole.h: Removed.
* runtime/JSGlobalObject.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
Remove JSConsole / ConsolePrototype in favor of the single ConsoleObject.
LayoutTests:
* js/console-expected.txt: Added.
* js/console.html: Added.
Canonical link: https://commits.webkit.org/175386@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200350 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-03 00:51:24 +00:00
|
|
|
PASS console is console
|
2016-05-17 18:20:26 +00:00
|
|
|
PASS Object.getPrototypeOf(console) is not Object.getPrototypeOf({})
|
Make console a namespace object (like Math/JSON), allowing functions to be called unbound
https://bugs.webkit.org/show_bug.cgi?id=157286
<rdar://problem/26052830>
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-05-02
Reviewed by Timothy Hatcher.
Source/JavaScriptCore:
This changes `console` to be a global namespace object, like `Math` and `JSON`.
It just holds a bunch of functions, that can be used on their own, unbound.
For example, `[1,2,3].forEach(console.log)` and `var log = console.log; log(1)`
used to throw exceptions and now do not.
Previously console was an Object/Prototype pair, so functions were on
ConsolePrototype (console.__proto__.log) and they needed to be called
Console objects as the `this` value. Now, `console` is just a standard
object with a bunch of functions. Since there is no console prototype the
functions can be passed around and called as expected and they will
just do the right thing.
For compatability with other browsers, `console` was made enumerable
on the global object.
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
Add new files and remove old files.
* runtime/CommonIdentifiers.h:
Add "console".
* runtime/ConsoleObject.cpp: Renamed from Source/JavaScriptCore/runtime/ConsolePrototype.cpp.
(JSC::ConsoleObject::ConsoleObject):
(JSC::ConsoleObject::finishCreation):
(JSC::valueToStringWithUndefinedOrNullCheck):
(JSC::consoleLogWithLevel):
(JSC::consoleProtoFuncDebug):
(JSC::consoleProtoFuncError):
(JSC::consoleProtoFuncLog):
(JSC::consoleProtoFuncInfo):
(JSC::consoleProtoFuncWarn):
(JSC::consoleProtoFuncClear):
(JSC::consoleProtoFuncDir):
(JSC::consoleProtoFuncDirXML):
(JSC::consoleProtoFuncTable):
(JSC::consoleProtoFuncTrace):
(JSC::consoleProtoFuncAssert):
(JSC::consoleProtoFuncCount):
(JSC::consoleProtoFuncProfile):
(JSC::consoleProtoFuncProfileEnd):
(JSC::consoleProtoFuncTakeHeapSnapshot):
(JSC::consoleProtoFuncTime):
(JSC::consoleProtoFuncTimeEnd):
(JSC::consoleProtoFuncTimeStamp):
(JSC::consoleProtoFuncGroup):
(JSC::consoleProtoFuncGroupCollapsed):
(JSC::consoleProtoFuncGroupEnd):
Console functions no longer need to check if the this object is
a Console object. They will always just work now.
* runtime/MathObject.cpp:
* runtime/MathObject.h:
* runtime/ConsoleObject.h: Renamed from Source/JavaScriptCore/runtime/ConsolePrototype.h.
(JSC::ConsoleObject::create):
(JSC::ConsoleObject::createStructure):
ConsoleObject is a basic object like MathObject.
* runtime/JSConsole.cpp: Removed.
* runtime/JSConsole.h: Removed.
* runtime/JSGlobalObject.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
Remove JSConsole / ConsolePrototype in favor of the single ConsoleObject.
LayoutTests:
* js/console-expected.txt: Added.
* js/console.html: Added.
Canonical link: https://commits.webkit.org/175386@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200350 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-03 00:51:24 +00:00
|
|
|
PASS consoleDescriptor.configurable is true
|
|
|
|
PASS consoleDescriptor.writable is true
|
2016-05-03 09:18:40 +00:00
|
|
|
PASS consoleDescriptor.enumerable is false
|
Make console a namespace object (like Math/JSON), allowing functions to be called unbound
https://bugs.webkit.org/show_bug.cgi?id=157286
<rdar://problem/26052830>
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-05-02
Reviewed by Timothy Hatcher.
Source/JavaScriptCore:
This changes `console` to be a global namespace object, like `Math` and `JSON`.
It just holds a bunch of functions, that can be used on their own, unbound.
For example, `[1,2,3].forEach(console.log)` and `var log = console.log; log(1)`
used to throw exceptions and now do not.
Previously console was an Object/Prototype pair, so functions were on
ConsolePrototype (console.__proto__.log) and they needed to be called
Console objects as the `this` value. Now, `console` is just a standard
object with a bunch of functions. Since there is no console prototype the
functions can be passed around and called as expected and they will
just do the right thing.
For compatability with other browsers, `console` was made enumerable
on the global object.
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
Add new files and remove old files.
* runtime/CommonIdentifiers.h:
Add "console".
* runtime/ConsoleObject.cpp: Renamed from Source/JavaScriptCore/runtime/ConsolePrototype.cpp.
(JSC::ConsoleObject::ConsoleObject):
(JSC::ConsoleObject::finishCreation):
(JSC::valueToStringWithUndefinedOrNullCheck):
(JSC::consoleLogWithLevel):
(JSC::consoleProtoFuncDebug):
(JSC::consoleProtoFuncError):
(JSC::consoleProtoFuncLog):
(JSC::consoleProtoFuncInfo):
(JSC::consoleProtoFuncWarn):
(JSC::consoleProtoFuncClear):
(JSC::consoleProtoFuncDir):
(JSC::consoleProtoFuncDirXML):
(JSC::consoleProtoFuncTable):
(JSC::consoleProtoFuncTrace):
(JSC::consoleProtoFuncAssert):
(JSC::consoleProtoFuncCount):
(JSC::consoleProtoFuncProfile):
(JSC::consoleProtoFuncProfileEnd):
(JSC::consoleProtoFuncTakeHeapSnapshot):
(JSC::consoleProtoFuncTime):
(JSC::consoleProtoFuncTimeEnd):
(JSC::consoleProtoFuncTimeStamp):
(JSC::consoleProtoFuncGroup):
(JSC::consoleProtoFuncGroupCollapsed):
(JSC::consoleProtoFuncGroupEnd):
Console functions no longer need to check if the this object is
a Console object. They will always just work now.
* runtime/MathObject.cpp:
* runtime/MathObject.h:
* runtime/ConsoleObject.h: Renamed from Source/JavaScriptCore/runtime/ConsolePrototype.h.
(JSC::ConsoleObject::create):
(JSC::ConsoleObject::createStructure):
ConsoleObject is a basic object like MathObject.
* runtime/JSConsole.cpp: Removed.
* runtime/JSConsole.h: Removed.
* runtime/JSGlobalObject.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
Remove JSConsole / ConsolePrototype in favor of the single ConsoleObject.
LayoutTests:
* js/console-expected.txt: Added.
* js/console.html: Added.
Canonical link: https://commits.webkit.org/175386@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200350 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-03 00:51:24 +00:00
|
|
|
|
|
|
|
console.debug
|
|
|
|
PASS typeof console.debug is "function"
|
|
|
|
PASS console.debug.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
|
|
|
console.error
|
|
|
|
PASS typeof console.error is "function"
|
|
|
|
PASS console.error.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
|
|
|
console.log
|
|
|
|
PASS typeof console.log is "function"
|
|
|
|
PASS console.log.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
|
|
|
console.info
|
|
|
|
PASS typeof console.info is "function"
|
|
|
|
PASS console.info.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
|
|
|
console.warn
|
|
|
|
PASS typeof console.warn is "function"
|
|
|
|
PASS console.warn.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
|
|
|
console.clear
|
|
|
|
PASS typeof console.clear is "function"
|
|
|
|
PASS console.clear.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
|
|
|
console.dir
|
|
|
|
PASS typeof console.dir is "function"
|
|
|
|
PASS console.dir.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
|
|
|
console.dirxml
|
|
|
|
PASS typeof console.dirxml is "function"
|
|
|
|
PASS console.dirxml.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
|
|
|
console.table
|
|
|
|
PASS typeof console.table is "function"
|
|
|
|
PASS console.table.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
|
|
|
console.trace
|
|
|
|
PASS typeof console.trace is "function"
|
|
|
|
PASS console.trace.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
|
|
|
console.assert
|
|
|
|
PASS typeof console.assert is "function"
|
|
|
|
PASS console.assert.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
|
|
|
console.count
|
|
|
|
PASS typeof console.count is "function"
|
|
|
|
PASS console.count.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
2019-06-26 22:25:48 +00:00
|
|
|
console.countReset
|
|
|
|
PASS typeof console.countReset is "function"
|
|
|
|
PASS console.countReset.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
Make console a namespace object (like Math/JSON), allowing functions to be called unbound
https://bugs.webkit.org/show_bug.cgi?id=157286
<rdar://problem/26052830>
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-05-02
Reviewed by Timothy Hatcher.
Source/JavaScriptCore:
This changes `console` to be a global namespace object, like `Math` and `JSON`.
It just holds a bunch of functions, that can be used on their own, unbound.
For example, `[1,2,3].forEach(console.log)` and `var log = console.log; log(1)`
used to throw exceptions and now do not.
Previously console was an Object/Prototype pair, so functions were on
ConsolePrototype (console.__proto__.log) and they needed to be called
Console objects as the `this` value. Now, `console` is just a standard
object with a bunch of functions. Since there is no console prototype the
functions can be passed around and called as expected and they will
just do the right thing.
For compatability with other browsers, `console` was made enumerable
on the global object.
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
Add new files and remove old files.
* runtime/CommonIdentifiers.h:
Add "console".
* runtime/ConsoleObject.cpp: Renamed from Source/JavaScriptCore/runtime/ConsolePrototype.cpp.
(JSC::ConsoleObject::ConsoleObject):
(JSC::ConsoleObject::finishCreation):
(JSC::valueToStringWithUndefinedOrNullCheck):
(JSC::consoleLogWithLevel):
(JSC::consoleProtoFuncDebug):
(JSC::consoleProtoFuncError):
(JSC::consoleProtoFuncLog):
(JSC::consoleProtoFuncInfo):
(JSC::consoleProtoFuncWarn):
(JSC::consoleProtoFuncClear):
(JSC::consoleProtoFuncDir):
(JSC::consoleProtoFuncDirXML):
(JSC::consoleProtoFuncTable):
(JSC::consoleProtoFuncTrace):
(JSC::consoleProtoFuncAssert):
(JSC::consoleProtoFuncCount):
(JSC::consoleProtoFuncProfile):
(JSC::consoleProtoFuncProfileEnd):
(JSC::consoleProtoFuncTakeHeapSnapshot):
(JSC::consoleProtoFuncTime):
(JSC::consoleProtoFuncTimeEnd):
(JSC::consoleProtoFuncTimeStamp):
(JSC::consoleProtoFuncGroup):
(JSC::consoleProtoFuncGroupCollapsed):
(JSC::consoleProtoFuncGroupEnd):
Console functions no longer need to check if the this object is
a Console object. They will always just work now.
* runtime/MathObject.cpp:
* runtime/MathObject.h:
* runtime/ConsoleObject.h: Renamed from Source/JavaScriptCore/runtime/ConsolePrototype.h.
(JSC::ConsoleObject::create):
(JSC::ConsoleObject::createStructure):
ConsoleObject is a basic object like MathObject.
* runtime/JSConsole.cpp: Removed.
* runtime/JSConsole.h: Removed.
* runtime/JSGlobalObject.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
Remove JSConsole / ConsolePrototype in favor of the single ConsoleObject.
LayoutTests:
* js/console-expected.txt: Added.
* js/console.html: Added.
Canonical link: https://commits.webkit.org/175386@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200350 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-03 00:51:24 +00:00
|
|
|
console.profile
|
|
|
|
PASS typeof console.profile is "function"
|
|
|
|
PASS console.profile.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
|
|
|
console.profileEnd
|
|
|
|
PASS typeof console.profileEnd is "function"
|
|
|
|
PASS console.profileEnd.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
|
|
|
console.time
|
|
|
|
PASS typeof console.time is "function"
|
|
|
|
PASS console.time.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
2019-06-25 18:36:29 +00:00
|
|
|
console.timeLog
|
|
|
|
PASS typeof console.timeLog is "function"
|
|
|
|
PASS console.timeLog.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
Make console a namespace object (like Math/JSON), allowing functions to be called unbound
https://bugs.webkit.org/show_bug.cgi?id=157286
<rdar://problem/26052830>
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-05-02
Reviewed by Timothy Hatcher.
Source/JavaScriptCore:
This changes `console` to be a global namespace object, like `Math` and `JSON`.
It just holds a bunch of functions, that can be used on their own, unbound.
For example, `[1,2,3].forEach(console.log)` and `var log = console.log; log(1)`
used to throw exceptions and now do not.
Previously console was an Object/Prototype pair, so functions were on
ConsolePrototype (console.__proto__.log) and they needed to be called
Console objects as the `this` value. Now, `console` is just a standard
object with a bunch of functions. Since there is no console prototype the
functions can be passed around and called as expected and they will
just do the right thing.
For compatability with other browsers, `console` was made enumerable
on the global object.
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
Add new files and remove old files.
* runtime/CommonIdentifiers.h:
Add "console".
* runtime/ConsoleObject.cpp: Renamed from Source/JavaScriptCore/runtime/ConsolePrototype.cpp.
(JSC::ConsoleObject::ConsoleObject):
(JSC::ConsoleObject::finishCreation):
(JSC::valueToStringWithUndefinedOrNullCheck):
(JSC::consoleLogWithLevel):
(JSC::consoleProtoFuncDebug):
(JSC::consoleProtoFuncError):
(JSC::consoleProtoFuncLog):
(JSC::consoleProtoFuncInfo):
(JSC::consoleProtoFuncWarn):
(JSC::consoleProtoFuncClear):
(JSC::consoleProtoFuncDir):
(JSC::consoleProtoFuncDirXML):
(JSC::consoleProtoFuncTable):
(JSC::consoleProtoFuncTrace):
(JSC::consoleProtoFuncAssert):
(JSC::consoleProtoFuncCount):
(JSC::consoleProtoFuncProfile):
(JSC::consoleProtoFuncProfileEnd):
(JSC::consoleProtoFuncTakeHeapSnapshot):
(JSC::consoleProtoFuncTime):
(JSC::consoleProtoFuncTimeEnd):
(JSC::consoleProtoFuncTimeStamp):
(JSC::consoleProtoFuncGroup):
(JSC::consoleProtoFuncGroupCollapsed):
(JSC::consoleProtoFuncGroupEnd):
Console functions no longer need to check if the this object is
a Console object. They will always just work now.
* runtime/MathObject.cpp:
* runtime/MathObject.h:
* runtime/ConsoleObject.h: Renamed from Source/JavaScriptCore/runtime/ConsolePrototype.h.
(JSC::ConsoleObject::create):
(JSC::ConsoleObject::createStructure):
ConsoleObject is a basic object like MathObject.
* runtime/JSConsole.cpp: Removed.
* runtime/JSConsole.h: Removed.
* runtime/JSGlobalObject.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
Remove JSConsole / ConsolePrototype in favor of the single ConsoleObject.
LayoutTests:
* js/console-expected.txt: Added.
* js/console.html: Added.
Canonical link: https://commits.webkit.org/175386@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200350 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-03 00:51:24 +00:00
|
|
|
console.timeEnd
|
|
|
|
PASS typeof console.timeEnd is "function"
|
|
|
|
PASS console.timeEnd.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
|
|
|
console.timeStamp
|
|
|
|
PASS typeof console.timeStamp is "function"
|
|
|
|
PASS console.timeStamp.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
|
|
|
console.takeHeapSnapshot
|
|
|
|
PASS typeof console.takeHeapSnapshot is "function"
|
|
|
|
PASS console.takeHeapSnapshot.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
|
|
|
console.group
|
|
|
|
PASS typeof console.group is "function"
|
|
|
|
PASS console.group.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
|
|
|
console.groupCollapsed
|
|
|
|
PASS typeof console.groupCollapsed is "function"
|
|
|
|
PASS console.groupCollapsed.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
|
|
|
console.groupEnd
|
|
|
|
PASS typeof console.groupEnd is "function"
|
|
|
|
PASS console.groupEnd.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
2017-12-04 21:40:55 +00:00
|
|
|
console.record
|
|
|
|
PASS typeof console.record is "function"
|
|
|
|
PASS console.record.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
|
|
|
console.recordEnd
|
|
|
|
PASS typeof console.recordEnd is "function"
|
|
|
|
PASS console.recordEnd.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
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 Joseph Pecoraro.
Source/JavaScriptCore:
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
- capture an image of a `Node` (if provided)
- capture an image of the viewport if nothing is provided
* 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.
Source/WebCore:
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
- capture an image of a `Node` (if provided)
- capture an image of the viewport if nothing is provided
* 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:
Source/WebInspectorUI:
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
- capture an image of a `Node` (if provided)
- capture an image of the viewport if nothing is provided
* UserInterface/Models/ConsoleMessage.js:
(WI.ConsoleMessage):
* UserInterface/Views/ConsoleCommandView.js:
(WI.ConsoleCommandView.prototype.render):
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype.render):
(WI.ConsoleMessageView.prototype.toClipboardString):
(WI.ConsoleMessageView.prototype._appendMessageTextAndArguments):
(WI.ConsoleMessageView.prototype._appendSavedResultIndex):
(WI.ConsoleMessageView.prototype._appendStackTrace):
(WI.ConsoleMessageView.prototype._makeExpandable):
(WI.ConsoleMessageView.prototype._handleContextMenu): Added.
* UserInterface/Views/ConsoleMessageView.css:
(.console-user-command.special-user-log > .console-message-body): Added.
(.console-message-body): Added.
(.console-message-body > span): Added.
(.console-message-body > span > :matches(.console-message-enclosed, .console-message-preview, .console-message-preview-divider)): Added.
(.console-message-body > .console-image): Added.
(.console-message-body > .show-grid): Added.
(.console-error-level .console-message-body): Added.
(.console-warning-level .console-message-body): Added.
(.console-log-level.console-image-container::before): Added.
(.console-user-command > .console-message-body): Added.
(.console-warning-level .console-message-body): Added.
(.console-error-level .console-message-body): Added.
(.console-user-command > .console-message-body): Added.
(.console-user-command.special-user-log > .console-message-text): Deleted.
(.console-message-text): Deleted.
(.console-message-text > span): Deleted.
(.console-message-text > span > :matches(.console-message-enclosed, .console-message-preview, .console-message-preview-divider)): Deleted.
(.console-error-level .console-message-text): Deleted.
(.console-warning-level .console-message-text): Deleted.
(.console-user-command > .console-message-text): Deleted.
(.console-warning-level .console-message-text): Deleted.
(.console-error-level .console-message-text): Deleted.
(.console-user-command > .console-message-text): Deleted.
* UserInterface/Views/LogContentView.css:
(.search-in-progress .console-item:not(.filtered-out-by-search).special-user-log .console-message-text .highlighted): Added.
(.search-in-progress .console-item:not(.filtered-out-by-search).special-user-log .console-message-body .highlighted): Deleted.
Renamed variables/classes to be more semantically correct when the content is an image.
- `_messageTextElement` to `_messageBodyElement` (JS)
- `.console-message-text` to `.console-message-body` (CSS)
* 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:
* UserInterface/Images/ConsoleImage.svg: Copied from UserInterface/Images/Canvas.svg.
* Localizations/en.lproj/localizedStrings.js:
LayoutTests:
* js/console.html:
* js/console-expected.txt:
* inspector/console/console-screenshot.html: Added.
* inspector/console/console-screenshot-expected.txt: Added.
* http/tests/inspector/dom/cross-domain-inspected-node-access-expected.txt:
Canonical link: https://commits.webkit.org/210079@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242992 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-03-15 08:12:21 +00:00
|
|
|
console.screenshot
|
|
|
|
PASS typeof console.screenshot is "function"
|
|
|
|
PASS console.screenshot.length is 0
|
|
|
|
PASS descriptor.configurable is true
|
|
|
|
PASS descriptor.writable is true
|
|
|
|
PASS descriptor.enumerable is true
|
|
|
|
|
Make console a namespace object (like Math/JSON), allowing functions to be called unbound
https://bugs.webkit.org/show_bug.cgi?id=157286
<rdar://problem/26052830>
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-05-02
Reviewed by Timothy Hatcher.
Source/JavaScriptCore:
This changes `console` to be a global namespace object, like `Math` and `JSON`.
It just holds a bunch of functions, that can be used on their own, unbound.
For example, `[1,2,3].forEach(console.log)` and `var log = console.log; log(1)`
used to throw exceptions and now do not.
Previously console was an Object/Prototype pair, so functions were on
ConsolePrototype (console.__proto__.log) and they needed to be called
Console objects as the `this` value. Now, `console` is just a standard
object with a bunch of functions. Since there is no console prototype the
functions can be passed around and called as expected and they will
just do the right thing.
For compatability with other browsers, `console` was made enumerable
on the global object.
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
Add new files and remove old files.
* runtime/CommonIdentifiers.h:
Add "console".
* runtime/ConsoleObject.cpp: Renamed from Source/JavaScriptCore/runtime/ConsolePrototype.cpp.
(JSC::ConsoleObject::ConsoleObject):
(JSC::ConsoleObject::finishCreation):
(JSC::valueToStringWithUndefinedOrNullCheck):
(JSC::consoleLogWithLevel):
(JSC::consoleProtoFuncDebug):
(JSC::consoleProtoFuncError):
(JSC::consoleProtoFuncLog):
(JSC::consoleProtoFuncInfo):
(JSC::consoleProtoFuncWarn):
(JSC::consoleProtoFuncClear):
(JSC::consoleProtoFuncDir):
(JSC::consoleProtoFuncDirXML):
(JSC::consoleProtoFuncTable):
(JSC::consoleProtoFuncTrace):
(JSC::consoleProtoFuncAssert):
(JSC::consoleProtoFuncCount):
(JSC::consoleProtoFuncProfile):
(JSC::consoleProtoFuncProfileEnd):
(JSC::consoleProtoFuncTakeHeapSnapshot):
(JSC::consoleProtoFuncTime):
(JSC::consoleProtoFuncTimeEnd):
(JSC::consoleProtoFuncTimeStamp):
(JSC::consoleProtoFuncGroup):
(JSC::consoleProtoFuncGroupCollapsed):
(JSC::consoleProtoFuncGroupEnd):
Console functions no longer need to check if the this object is
a Console object. They will always just work now.
* runtime/MathObject.cpp:
* runtime/MathObject.h:
* runtime/ConsoleObject.h: Renamed from Source/JavaScriptCore/runtime/ConsolePrototype.h.
(JSC::ConsoleObject::create):
(JSC::ConsoleObject::createStructure):
ConsoleObject is a basic object like MathObject.
* runtime/JSConsole.cpp: Removed.
* runtime/JSConsole.h: Removed.
* runtime/JSGlobalObject.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
Remove JSConsole / ConsolePrototype in favor of the single ConsoleObject.
LayoutTests:
* js/console-expected.txt: Added.
* js/console.html: Added.
Canonical link: https://commits.webkit.org/175386@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200350 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-03 00:51:24 +00:00
|
|
|
PASS Object.getOwnPropertyNames(console).length is enumerablePropertyCount
|
2017-12-04 21:40:55 +00:00
|
|
|
|
|
|
|
fuzzing of target for console.record
|
|
|
|
PASS console.record() did not throw exception.
|
|
|
|
PASS console.record(undefined) did not throw exception.
|
|
|
|
PASS console.record(null) did not throw exception.
|
|
|
|
PASS console.record(1) did not throw exception.
|
|
|
|
PASS console.record("test") did not throw exception.
|
|
|
|
PASS console.record([]) did not throw exception.
|
|
|
|
PASS console.record({}) did not throw exception.
|
|
|
|
PASS console.record(window) did not throw exception.
|
|
|
|
PASS console.record(console) did not throw exception.
|
|
|
|
|
|
|
|
fuzzing of options for console.record
|
|
|
|
PASS console.record({}, undefined) did not throw exception.
|
|
|
|
PASS console.record({}, null) did not throw exception.
|
|
|
|
PASS console.record({}, 1) did not throw exception.
|
|
|
|
PASS console.record({}, "test") did not throw exception.
|
|
|
|
PASS console.record({}, []) did not throw exception.
|
|
|
|
PASS console.record({}, {}) did not throw exception.
|
|
|
|
PASS console.record({}, window) did not throw exception.
|
|
|
|
PASS console.record({}, console) did not throw exception.
|
|
|
|
|
|
|
|
fuzzing of target for console.recordEnd
|
|
|
|
PASS console.recordEnd() did not throw exception.
|
|
|
|
PASS console.recordEnd(undefined) did not throw exception.
|
|
|
|
PASS console.recordEnd(null) did not throw exception.
|
|
|
|
PASS console.recordEnd(1) did not throw exception.
|
|
|
|
PASS console.recordEnd("test") did not throw exception.
|
|
|
|
PASS console.recordEnd([]) did not throw exception.
|
|
|
|
PASS console.recordEnd({}) did not throw exception.
|
|
|
|
PASS console.recordEnd(window) did not throw exception.
|
|
|
|
PASS console.recordEnd(console) did not throw exception.
|
|
|
|
|
|
|
|
ensure multiple calls don't throw
|
|
|
|
PASS console.recordEnd(window.canvas) did not throw exception.
|
|
|
|
PASS console.recordEnd(window.canvas) did not throw exception.
|
|
|
|
PASS console.recordEnd(window.canvas) did not throw exception.
|
|
|
|
PASS console.record(window.canvas) did not throw exception.
|
|
|
|
PASS console.record(window.canvas) did not throw exception.
|
|
|
|
PASS console.record(window.canvas) did not throw exception.
|
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 Joseph Pecoraro.
Source/JavaScriptCore:
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
- capture an image of a `Node` (if provided)
- capture an image of the viewport if nothing is provided
* 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.
Source/WebCore:
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
- capture an image of a `Node` (if provided)
- capture an image of the viewport if nothing is provided
* 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:
Source/WebInspectorUI:
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
- capture an image of a `Node` (if provided)
- capture an image of the viewport if nothing is provided
* UserInterface/Models/ConsoleMessage.js:
(WI.ConsoleMessage):
* UserInterface/Views/ConsoleCommandView.js:
(WI.ConsoleCommandView.prototype.render):
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype.render):
(WI.ConsoleMessageView.prototype.toClipboardString):
(WI.ConsoleMessageView.prototype._appendMessageTextAndArguments):
(WI.ConsoleMessageView.prototype._appendSavedResultIndex):
(WI.ConsoleMessageView.prototype._appendStackTrace):
(WI.ConsoleMessageView.prototype._makeExpandable):
(WI.ConsoleMessageView.prototype._handleContextMenu): Added.
* UserInterface/Views/ConsoleMessageView.css:
(.console-user-command.special-user-log > .console-message-body): Added.
(.console-message-body): Added.
(.console-message-body > span): Added.
(.console-message-body > span > :matches(.console-message-enclosed, .console-message-preview, .console-message-preview-divider)): Added.
(.console-message-body > .console-image): Added.
(.console-message-body > .show-grid): Added.
(.console-error-level .console-message-body): Added.
(.console-warning-level .console-message-body): Added.
(.console-log-level.console-image-container::before): Added.
(.console-user-command > .console-message-body): Added.
(.console-warning-level .console-message-body): Added.
(.console-error-level .console-message-body): Added.
(.console-user-command > .console-message-body): Added.
(.console-user-command.special-user-log > .console-message-text): Deleted.
(.console-message-text): Deleted.
(.console-message-text > span): Deleted.
(.console-message-text > span > :matches(.console-message-enclosed, .console-message-preview, .console-message-preview-divider)): Deleted.
(.console-error-level .console-message-text): Deleted.
(.console-warning-level .console-message-text): Deleted.
(.console-user-command > .console-message-text): Deleted.
(.console-warning-level .console-message-text): Deleted.
(.console-error-level .console-message-text): Deleted.
(.console-user-command > .console-message-text): Deleted.
* UserInterface/Views/LogContentView.css:
(.search-in-progress .console-item:not(.filtered-out-by-search).special-user-log .console-message-text .highlighted): Added.
(.search-in-progress .console-item:not(.filtered-out-by-search).special-user-log .console-message-body .highlighted): Deleted.
Renamed variables/classes to be more semantically correct when the content is an image.
- `_messageTextElement` to `_messageBodyElement` (JS)
- `.console-message-text` to `.console-message-body` (CSS)
* 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:
* UserInterface/Images/ConsoleImage.svg: Copied from UserInterface/Images/Canvas.svg.
* Localizations/en.lproj/localizedStrings.js:
LayoutTests:
* js/console.html:
* js/console-expected.txt:
* inspector/console/console-screenshot.html: Added.
* inspector/console/console-screenshot-expected.txt: Added.
* http/tests/inspector/dom/cross-domain-inspected-node-access-expected.txt:
Canonical link: https://commits.webkit.org/210079@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242992 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-03-15 08:12:21 +00:00
|
|
|
|
|
|
|
fuzzing of target for console.screenshot
|
|
|
|
PASS console.screenshot() did not throw exception.
|
|
|
|
PASS console.screenshot(undefined) did not throw exception.
|
|
|
|
PASS console.screenshot(null) did not throw exception.
|
|
|
|
PASS console.screenshot(1) did not throw exception.
|
|
|
|
PASS console.screenshot("test") did not throw exception.
|
|
|
|
PASS console.screenshot([]) did not throw exception.
|
|
|
|
PASS console.screenshot({}) did not throw exception.
|
|
|
|
PASS console.screenshot(window) did not throw exception.
|
|
|
|
PASS console.screenshot(console) did not throw exception.
|
|
|
|
|
Make console a namespace object (like Math/JSON), allowing functions to be called unbound
https://bugs.webkit.org/show_bug.cgi?id=157286
<rdar://problem/26052830>
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-05-02
Reviewed by Timothy Hatcher.
Source/JavaScriptCore:
This changes `console` to be a global namespace object, like `Math` and `JSON`.
It just holds a bunch of functions, that can be used on their own, unbound.
For example, `[1,2,3].forEach(console.log)` and `var log = console.log; log(1)`
used to throw exceptions and now do not.
Previously console was an Object/Prototype pair, so functions were on
ConsolePrototype (console.__proto__.log) and they needed to be called
Console objects as the `this` value. Now, `console` is just a standard
object with a bunch of functions. Since there is no console prototype the
functions can be passed around and called as expected and they will
just do the right thing.
For compatability with other browsers, `console` was made enumerable
on the global object.
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
Add new files and remove old files.
* runtime/CommonIdentifiers.h:
Add "console".
* runtime/ConsoleObject.cpp: Renamed from Source/JavaScriptCore/runtime/ConsolePrototype.cpp.
(JSC::ConsoleObject::ConsoleObject):
(JSC::ConsoleObject::finishCreation):
(JSC::valueToStringWithUndefinedOrNullCheck):
(JSC::consoleLogWithLevel):
(JSC::consoleProtoFuncDebug):
(JSC::consoleProtoFuncError):
(JSC::consoleProtoFuncLog):
(JSC::consoleProtoFuncInfo):
(JSC::consoleProtoFuncWarn):
(JSC::consoleProtoFuncClear):
(JSC::consoleProtoFuncDir):
(JSC::consoleProtoFuncDirXML):
(JSC::consoleProtoFuncTable):
(JSC::consoleProtoFuncTrace):
(JSC::consoleProtoFuncAssert):
(JSC::consoleProtoFuncCount):
(JSC::consoleProtoFuncProfile):
(JSC::consoleProtoFuncProfileEnd):
(JSC::consoleProtoFuncTakeHeapSnapshot):
(JSC::consoleProtoFuncTime):
(JSC::consoleProtoFuncTimeEnd):
(JSC::consoleProtoFuncTimeStamp):
(JSC::consoleProtoFuncGroup):
(JSC::consoleProtoFuncGroupCollapsed):
(JSC::consoleProtoFuncGroupEnd):
Console functions no longer need to check if the this object is
a Console object. They will always just work now.
* runtime/MathObject.cpp:
* runtime/MathObject.h:
* runtime/ConsoleObject.h: Renamed from Source/JavaScriptCore/runtime/ConsolePrototype.h.
(JSC::ConsoleObject::create):
(JSC::ConsoleObject::createStructure):
ConsoleObject is a basic object like MathObject.
* runtime/JSConsole.cpp: Removed.
* runtime/JSConsole.h: Removed.
* runtime/JSGlobalObject.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
Remove JSConsole / ConsolePrototype in favor of the single ConsoleObject.
LayoutTests:
* js/console-expected.txt: Added.
* js/console.html: Added.
Canonical link: https://commits.webkit.org/175386@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200350 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-03 00:51:24 +00:00
|
|
|
PASS successfullyParsed is true
|
|
|
|
|
|
|
|
TEST COMPLETE
|
|
|
|
|