Bug 1380890 - stylo: make GetRuleColumn report a 1-based value. r?jdm draft
authorFernando Jimenez Moreno <ferjmoreno@gmail.com>
Sun, 23 Jul 2017 14:26:24 +0200
changeset 613978 d753603eec2ddaa0c245316eeb8f11bc95eee362
parent 611409 4b32e7ce740eaf6434180bc9e44731dab0aa67cc
child 638745 da1ad5f630453b514627bebddb1278d7c4ff8031
push id69880
push userferjmoreno@gmail.com
push dateSun, 23 Jul 2017 12:27:11 +0000
reviewersjdm
bugs1380890
milestone56.0a1
Bug 1380890 - stylo: make GetRuleColumn report a 1-based value. r?jdm MozReview-Commit-ID: mBrm9arKTX
servo/components/style/stylesheets/rule_parser.rs
--- a/servo/components/style/stylesheets/rule_parser.rs
+++ b/servo/components/style/stylesheets/rule_parser.rs
@@ -511,11 +511,12 @@ impl<'a, 'b, 'i> QualifiedRuleParser<'i>
 
 /// Calculates the location of a rule's source given an offset.
 fn get_location_with_offset(
     location: SourceLocation,
     offset: u64
 ) -> 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,
     }
 }