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
This commit is contained in:
Cameron McCormack 2018-10-17 09:43:45 +00:00 committed by Emilio Cobos Álvarez
parent 623363e3c8
commit 5770247af0
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -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 {