mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Various fixes in stylesheets
This commit is contained in:
parent
b7c88dd547
commit
768cc79146
1 changed files with 4 additions and 4 deletions
|
@ -102,7 +102,7 @@ impl Stylesheet {
|
||||||
Stylesheet::from_str(&string, base_url, origin)
|
Stylesheet::from_str(&string, base_url, origin)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_str<'i>(css: &'i str, base_url: Url, origin: Origin) -> Stylesheet {
|
pub fn from_str(css: &str, base_url: Url, origin: Origin) -> Stylesheet {
|
||||||
let rule_parser = TopLevelRuleParser {
|
let rule_parser = TopLevelRuleParser {
|
||||||
context: ParserContext::new(origin, &base_url),
|
context: ParserContext::new(origin, &base_url),
|
||||||
state: Cell::new(State::Start),
|
state: Cell::new(State::Start),
|
||||||
|
@ -139,7 +139,7 @@ impl Stylesheet {
|
||||||
|
|
||||||
/// Return an iterator over all the rules within the style-sheet.
|
/// Return an iterator over all the rules within the style-sheet.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn rules<'a>(&'a self) -> Rules<'a> {
|
pub fn rules(&self) -> Rules {
|
||||||
Rules::new(self.rules.iter(), None)
|
Rules::new(self.rules.iter(), None)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,8 +243,8 @@ pub mod rule_filter {
|
||||||
|
|
||||||
fn next(&mut self) -> Option<&'a $value> {
|
fn next(&mut self) -> Option<&'a $value> {
|
||||||
while let Some(rule) = self.iter.next() {
|
while let Some(rule) = self.iter.next() {
|
||||||
match rule {
|
match *rule {
|
||||||
&CSSRule::$variant(ref value) => return Some(value),
|
CSSRule::$variant(ref value) => return Some(value),
|
||||||
_ => continue
|
_ => continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue