Skip to content

Commit ac80204

Browse files
author
bors-servo
authored
Auto merge of #12136 - ConnorGBrewster:servo_version_reporter, r=asajeffrey
Send servo version in mozbrowser error. <!-- Please describe your changes on the following line: --> Adds support for sending a version string to b.html so we can put the servo version in the auto generated issue reports. r? @asajeffrey --- <!-- 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 #12083 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because sending servo version on mozbrwosererror for issue reporter. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12136) <!-- Reviewable:end -->
2 parents 40909ed + ed678cb commit ac80204

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

components/script/dom/htmliframeelement.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ use style::attr::{AttrValue, LengthOrPercentageOrAuto};
4949
use style::context::ReflowGoal;
5050
use url::Url;
5151
use util::prefs::mozbrowser_enabled;
52+
use util::servo_version;
5253

5354
bitflags! {
5455
#[derive(JSTraceable, HeapSizeOf)]
@@ -360,6 +361,7 @@ impl MozBrowserEventDetailBuilder for HTMLIFrameElement {
360361
type_: Some(DOMString::from(error_type.name())),
361362
description: description.map(DOMString::from),
362363
report: report.map(DOMString::from),
364+
version: Some(DOMString::from_string(servo_version().into())),
363365
}.to_jsval(cx, rval);
364366
},
365367
MozBrowserEvent::SecurityChange(https_state) => {

components/script/dom/webidls/BrowserElement.webidl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ dictionary BrowserElementErrorEventDetail {
6161
DOMString type;
6262
DOMString description;
6363
DOMString report;
64+
DOMString version;
6465
};
6566

6667
dictionary BrowserElementLocationChangeEventDetail {

components/servo/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ use servo::Browser;
4040
use servo::compositing::windowing::WindowEvent;
4141
use servo::util::opts::{self, ArgumentParsingResult};
4242
use servo::util::panicking::initiate_panic_hook;
43+
use servo::util::servo_version;
4344
use std::process;
4445
use std::rc::Rc;
4546

@@ -104,7 +105,7 @@ fn main() {
104105
}
105106

106107
if opts::get().is_printing_version {
107-
println!("Servo {}{}", env!("CARGO_PKG_VERSION"), env!("GIT_INFO"));
108+
println!("{}", servo_version());
108109
process::exit(0);
109110
}
110111

components/util/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,7 @@ pub fn arc_ptr_eq<T: 'static>(a: &Arc<T>, b: &Arc<T>) -> bool {
6464
let b: &T = &**b;
6565
(a as *const T) == (b as *const T)
6666
}
67+
68+
pub fn servo_version() -> &'static str {
69+
concat!("Servo ", env!("CARGO_PKG_VERSION"), env!("GIT_INFO"))
70+
}

0 commit comments

Comments
 (0)