mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Console.Clear implemented
This commit is contained in:
parent
332c9cc12f
commit
d8b6755a8d
4 changed files with 9 additions and 0 deletions
|
@ -272,6 +272,7 @@ impl ConsoleActor {
|
|||
LogLevel::Info => "info",
|
||||
LogLevel::Warn => "warn",
|
||||
LogLevel::Error => "error",
|
||||
LogLevel::Clear => "clear",
|
||||
_ => "log",
|
||||
}
|
||||
.to_owned();
|
||||
|
|
|
@ -246,6 +246,7 @@ pub enum LogLevel {
|
|||
Info,
|
||||
Warn,
|
||||
Error,
|
||||
Clear,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
|
|
|
@ -72,6 +72,12 @@ impl Console {
|
|||
console_messages(global, &messages, LogLevel::Log)
|
||||
}
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Console/clear
|
||||
pub fn Clear(global: &GlobalScope) {
|
||||
let message: Vec<DOMString> = Vec::new();
|
||||
console_messages(global, &message, LogLevel::Clear)
|
||||
}
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Console
|
||||
pub fn Debug(global: &GlobalScope, messages: Vec<DOMString>) {
|
||||
console_messages(global, &messages, LogLevel::Debug)
|
||||
|
|
|
@ -15,6 +15,7 @@ namespace console {
|
|||
void warn(DOMString... messages);
|
||||
void error(DOMString... messages);
|
||||
void assert(boolean condition, optional DOMString message);
|
||||
void clear();
|
||||
|
||||
// Grouping
|
||||
void group(DOMString... data);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue