mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Some fixes in style
This commit is contained in:
parent
3ead9cc67b
commit
2091981db8
3 changed files with 10 additions and 13 deletions
|
@ -490,7 +490,7 @@ pub fn parse_length(mut value: &str) -> LengthOrPercentageOrAuto {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 5
|
// Step 5
|
||||||
if value.starts_with("+") {
|
if value.starts_with('+') {
|
||||||
value = &value[1..]
|
value = &value[1..]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -194,7 +194,7 @@ fn parse_declaration_value_block(input: &mut Parser,
|
||||||
let token_slice = input.slice_from(token_start);
|
let token_slice = input.slice_from(token_start);
|
||||||
if !token_slice.ends_with("*/") {
|
if !token_slice.ends_with("*/") {
|
||||||
missing_closing_characters.push_str(
|
missing_closing_characters.push_str(
|
||||||
if token_slice.ends_with("*") { "/" } else { "*/" })
|
if token_slice.ends_with('*') { "/" } else { "*/" })
|
||||||
}
|
}
|
||||||
token.serialization_type()
|
token.serialization_type()
|
||||||
}
|
}
|
||||||
|
|
|
@ -602,8 +602,7 @@ pub trait ElementMatchMethods : TElement
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i, &(ref candidate, ())) in style_sharing_candidate_cache.iter().enumerate() {
|
for (i, &(ref candidate, ())) in style_sharing_candidate_cache.iter().enumerate() {
|
||||||
match self.share_style_with_candidate_if_possible(parent.clone(), candidate) {
|
if let Some(shared_style) = self.share_style_with_candidate_if_possible(parent.clone(), candidate) {
|
||||||
Some(shared_style) => {
|
|
||||||
// Yay, cache hit. Share the style.
|
// Yay, cache hit. Share the style.
|
||||||
let node = self.as_node();
|
let node = self.as_node();
|
||||||
let style = &mut node.mutate_data().unwrap().style;
|
let style = &mut node.mutate_data().unwrap().style;
|
||||||
|
@ -612,8 +611,6 @@ pub trait ElementMatchMethods : TElement
|
||||||
*style = Some(shared_style);
|
*style = Some(shared_style);
|
||||||
return StyleSharingResult::StyleWasShared(i, damage)
|
return StyleSharingResult::StyleWasShared(i, damage)
|
||||||
}
|
}
|
||||||
None => {}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StyleSharingResult::CannotShare
|
StyleSharingResult::CannotShare
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue