mirror of
https://github.com/servo/servo.git
synced 2025-06-18 13:24:29 +00:00
Add 'src/components/script/style/' from commit 'dd8b178860
'
git-subtree-dir: src/components/script/style git-subtree-mainline:0c726b4581
git-subtree-split:dd8b178860
This commit is contained in:
commit
71ca10a50c
15 changed files with 2190 additions and 0 deletions
21
src/components/script/style/parsing_utils.rs
Normal file
21
src/components/script/style/parsing_utils.rs
Normal file
|
@ -0,0 +1,21 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
use std::ascii::StrAsciiExt;
|
||||
use cssparser::*;
|
||||
|
||||
|
||||
pub fn one_component_value<'a>(input: &'a [ComponentValue]) -> Option<&'a ComponentValue> {
|
||||
let mut iter = input.skip_whitespace();
|
||||
iter.next().filtered(|_| iter.next().is_none())
|
||||
}
|
||||
|
||||
|
||||
pub fn get_ident_lower(component_value: &ComponentValue) -> Option<~str> {
|
||||
match component_value {
|
||||
&Ident(ref value) => Some(value.to_ascii_lower()),
|
||||
_ => None,
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue