mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
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:
parent
623363e3c8
commit
5770247af0
1 changed files with 8 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue