Auto merge of #17624 - jdm:stylo-error-reporter, r=emilio

Hook up Stylo error reporter to Firefox devtools

Reviewed by @emilio in https://bugzilla.mozilla.org/show_bug.cgi?id=1352669.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17624)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-07-06 11:44:47 -07:00 committed by GitHub
commit 585468da9a
30 changed files with 6011 additions and 4423 deletions

View file

@ -10,7 +10,7 @@ path = "lib.rs"
doctest = false
[dependencies]
cssparser = "0.16.1"
cssparser = "0.17.0"
gfx = {path = "../../../components/gfx"}
ipc-channel = "0.8"
style = {path = "../../../components/style"}

View file

@ -15,7 +15,7 @@ testing = ["style/testing"]
[dependencies]
byteorder = "1.0"
app_units = "0.5"
cssparser = "0.16.1"
cssparser = "0.17.0"
euclid = "0.15"
html5ever = "0.18"
parking_lot = "0.3"

View file

@ -84,7 +84,7 @@ fn test_parse_stylesheet() {
url: NsAtom::from("http://www.w3.org/1999/xhtml"),
source_location: SourceLocation {
line: 1,
column: 19,
column: 18,
},
}))),
CssRule::Style(Arc::new(stylesheet.shared_lock.wrap(StyleRule {
@ -114,7 +114,7 @@ fn test_parse_stylesheet() {
]))),
source_location: SourceLocation {
line: 3,
column: 9,
column: 8,
},
}))),
CssRule::Style(Arc::new(stylesheet.shared_lock.wrap(StyleRule {
@ -141,7 +141,7 @@ fn test_parse_stylesheet() {
]))),
source_location: SourceLocation {
line: 11,
column: 9,
column: 8,
},
}))),
CssRule::Style(Arc::new(stylesheet.shared_lock.wrap(StyleRule {
@ -203,7 +203,7 @@ fn test_parse_stylesheet() {
]))),
source_location: SourceLocation {
line: 15,
column: 9,
column: 8,
},
}))),
CssRule::Keyframes(Arc::new(stylesheet.shared_lock.wrap(KeyframesRule {
@ -235,7 +235,7 @@ fn test_parse_stylesheet() {
vendor_prefix: None,
source_location: SourceLocation {
line: 16,
column: 19,
column: 18,
},
})))
@ -314,15 +314,16 @@ fn test_report_error_stylesheet() {
let mut errors = errors.lock().unwrap();
let error = errors.pop().unwrap();
assert_eq!("Unsupported property declaration: 'invalid: true;', found unexpected identifier true", error.message);
assert_eq!(10, error.line);
assert_eq!(9, error.column);
assert_eq!("Unsupported property declaration: 'invalid: true;', \
Custom(UnknownProperty(\"invalid\"))", error.message);
assert_eq!(9, error.line);
assert_eq!(8, error.column);
let error = errors.pop().unwrap();
assert_eq!("Unsupported property declaration: 'display: invalid;', \
Custom(PropertyDeclaration(InvalidValue))", error.message);
assert_eq!(9, error.line);
assert_eq!(9, error.column);
Custom(PropertyDeclaration(InvalidValue(\"display\")))", error.message);
assert_eq!(8, error.line);
assert_eq!(8, error.column);
// testing for the url
assert_eq!(url, error.url);

View file

@ -16,7 +16,7 @@ testing = ["style/testing"]
[dependencies]
atomic_refcell = "0.1"
cssparser = "0.16.1"
cssparser = "0.17.0"
env_logger = "0.4"
euclid = "0.15"
geckoservo = {path = "../../../ports/geckolib"}