mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Auto merge of #27443 - mustafapc19:master, r=jdm
console.clear implemented <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #27294 (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because it deals with Firefox's devtools. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
commit
a9a406e9e7
4 changed files with 9 additions and 0 deletions
|
@ -272,6 +272,7 @@ impl ConsoleActor {
|
||||||
LogLevel::Info => "info",
|
LogLevel::Info => "info",
|
||||||
LogLevel::Warn => "warn",
|
LogLevel::Warn => "warn",
|
||||||
LogLevel::Error => "error",
|
LogLevel::Error => "error",
|
||||||
|
LogLevel::Clear => "clear",
|
||||||
_ => "log",
|
_ => "log",
|
||||||
}
|
}
|
||||||
.to_owned();
|
.to_owned();
|
||||||
|
|
|
@ -246,6 +246,7 @@ pub enum LogLevel {
|
||||||
Info,
|
Info,
|
||||||
Warn,
|
Warn,
|
||||||
Error,
|
Error,
|
||||||
|
Clear,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
|
|
|
@ -72,6 +72,12 @@ impl Console {
|
||||||
console_messages(global, &messages, LogLevel::Log)
|
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
|
// https://developer.mozilla.org/en-US/docs/Web/API/Console
|
||||||
pub fn Debug(global: &GlobalScope, messages: Vec<DOMString>) {
|
pub fn Debug(global: &GlobalScope, messages: Vec<DOMString>) {
|
||||||
console_messages(global, &messages, LogLevel::Debug)
|
console_messages(global, &messages, LogLevel::Debug)
|
||||||
|
|
|
@ -15,6 +15,7 @@ namespace console {
|
||||||
void warn(DOMString... messages);
|
void warn(DOMString... messages);
|
||||||
void error(DOMString... messages);
|
void error(DOMString... messages);
|
||||||
void assert(boolean condition, optional DOMString message);
|
void assert(boolean condition, optional DOMString message);
|
||||||
|
void clear();
|
||||||
|
|
||||||
// Grouping
|
// Grouping
|
||||||
void group(DOMString... data);
|
void group(DOMString... data);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue