Auto merge of #17841 - ferjm:bug1380890.column, r=jdm

stylo: make GetRuleColumn report a 1-based value

https://bugzilla.mozilla.org/show_bug.cgi?id=1380890

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- 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/17841)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-07-24 07:55:06 -07:00 committed by GitHub
commit 723b21b669
2 changed files with 7 additions and 6 deletions

View file

@ -515,6 +515,7 @@ fn get_location_with_offset(
) -> SourceLocation {
SourceLocation {
line: location.line + offset as u32,
column: location.column,
// Column offsets are not yet supported, but Gecko devtools expect 1-based columns.
column: location.column + 1,
}
}

View file

@ -85,7 +85,7 @@ fn test_parse_stylesheet() {
url: NsAtom::from("http://www.w3.org/1999/xhtml"),
source_location: SourceLocation {
line: 1,
column: 18,
column: 19,
},
}))),
CssRule::Style(Arc::new(stylesheet.shared_lock.wrap(StyleRule {
@ -115,7 +115,7 @@ fn test_parse_stylesheet() {
]))),
source_location: SourceLocation {
line: 3,
column: 8,
column: 9,
},
}))),
CssRule::Style(Arc::new(stylesheet.shared_lock.wrap(StyleRule {
@ -142,7 +142,7 @@ fn test_parse_stylesheet() {
]))),
source_location: SourceLocation {
line: 11,
column: 8,
column: 9,
},
}))),
CssRule::Style(Arc::new(stylesheet.shared_lock.wrap(StyleRule {
@ -204,7 +204,7 @@ fn test_parse_stylesheet() {
]))),
source_location: SourceLocation {
line: 15,
column: 8,
column: 9,
},
}))),
CssRule::Keyframes(Arc::new(stylesheet.shared_lock.wrap(KeyframesRule {
@ -236,7 +236,7 @@ fn test_parse_stylesheet() {
vendor_prefix: None,
source_location: SourceLocation {
line: 16,
column: 18,
column: 19,
},
})))