From 5770247af09993e604f949060bd75982f8abed6f Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Wed, 17 Oct 2018 09:43:45 +0000 Subject: [PATCH] style: Make css::URLValue::IsLocalRef call into CssUrlData::is_fragment. This fixes the issue that we should no longer be looking for control characters. Differential Revision: https://phabricator.services.mozilla.com/D8876 --- components/style/gecko/url.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/style/gecko/url.rs b/components/style/gecko/url.rs index 3ee7c830788..811a0250826 100644 --- a/components/style/gecko/url.rs +++ b/components/style/gecko/url.rs @@ -54,8 +54,9 @@ impl CssUrl { /// Returns true if this URL looks like a fragment. /// See https://drafts.csswg.org/css-values/#local-urls + #[inline] pub fn is_fragment(&self) -> bool { - self.as_str().chars().next().map_or(false, |c| c == '#') + self.0.is_fragment() } /// Return the unresolved url as string, or the empty string if it's @@ -67,6 +68,12 @@ impl CssUrl { } 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 == '#') + } + /// Return the unresolved url as string, or the empty string if it's /// invalid. pub fn as_str(&self) -> &str {