diff --git a/components/style/gecko/url.rs b/components/style/gecko/url.rs index 2e694b3a2d6..ac7c9359b00 100644 --- a/components/style/gecko/url.rs +++ b/components/style/gecko/url.rs @@ -109,7 +109,7 @@ impl CssUrlData { /// Returns true if this URL looks like a fragment. /// See https://drafts.csswg.org/css-values/#local-urls pub fn is_fragment(&self) -> bool { - self.as_str().chars().next().map_or(false, |c| c == '#') + self.as_str().as_bytes().iter().next().map_or(false, |b| *b == b'#') } /// Return the unresolved url as string, or the empty string if it's