mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
style: Remove the stupid space serialization on font-settings.
This commit is contained in:
parent
190e9b9715
commit
1380f1a14f
4 changed files with 69 additions and 70 deletions
|
@ -1444,7 +1444,7 @@ impl Clone for ${style_struct.gecko_struct_name} {
|
|||
unsafe { current_settings.set_len_pod(other_settings.len() as u32) };
|
||||
|
||||
for (current, other) in current_settings.iter_mut().zip(other_settings) {
|
||||
current.mTag = other.tag;
|
||||
current.mTag = other.tag.0;
|
||||
current.mValue = other.value.0;
|
||||
}
|
||||
}
|
||||
|
@ -1470,7 +1470,7 @@ impl Clone for ${style_struct.gecko_struct_name} {
|
|||
}
|
||||
|
||||
pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T {
|
||||
use values::generics::{FontSettings, FontSettingTag, ${tag_type}} ;
|
||||
use values::generics::{FontSettings, FontTag, FontSettingTag, ${tag_type}} ;
|
||||
|
||||
if self.gecko.mFont.${gecko_ffi_name}.len() == 0 {
|
||||
FontSettings::Normal
|
||||
|
@ -1478,7 +1478,7 @@ impl Clone for ${style_struct.gecko_struct_name} {
|
|||
FontSettings::Tag(
|
||||
self.gecko.mFont.${gecko_ffi_name}.iter().map(|gecko_font_setting| {
|
||||
FontSettingTag {
|
||||
tag: gecko_font_setting.mTag,
|
||||
tag: FontTag(gecko_font_setting.mTag),
|
||||
value: ${tag_type}(gecko_font_setting.mValue),
|
||||
}
|
||||
}).collect()
|
||||
|
|
|
@ -54,6 +54,7 @@ use values::distance::{ComputeSquaredDistance, SquaredDistance};
|
|||
#[cfg(feature = "gecko")] use values::generics::FontSettings as GenericFontSettings;
|
||||
#[cfg(feature = "gecko")] use values::generics::FontSettingTag as GenericFontSettingTag;
|
||||
#[cfg(feature = "gecko")] use values::generics::FontSettingTagFloat;
|
||||
#[cfg(feature = "gecko")] use values::generics::FontTag;
|
||||
use values::generics::NonNegative;
|
||||
use values::generics::effects::Filter;
|
||||
use values::generics::position as generic_position;
|
||||
|
@ -878,7 +879,7 @@ type FontSettingTag = GenericFontSettingTag<FontSettingTagFloat>;
|
|||
struct FontSettingTagIterState<'a> {
|
||||
tags: Vec<(&'a FontSettingTag)>,
|
||||
index: usize,
|
||||
prev_tag: u32,
|
||||
prev_tag: FontTag,
|
||||
}
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
|
@ -887,7 +888,7 @@ impl<'a> FontSettingTagIterState<'a> {
|
|||
FontSettingTagIterState {
|
||||
index: tags.len(),
|
||||
tags,
|
||||
prev_tag: 0,
|
||||
prev_tag: FontTag(0),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -941,7 +942,7 @@ impl<'a> FontSettingTagIter<'a> {
|
|||
fn as_new_sorted_tags(tags: &Vec<FontSettingTag>) -> Vec<(&FontSettingTag)> {
|
||||
use std::iter::FromIterator;
|
||||
let mut sorted_tags: Vec<(&FontSettingTag)> = Vec::from_iter(tags.iter());
|
||||
sorted_tags.sort_by_key(|k| k.tag);
|
||||
sorted_tags.sort_by_key(|k| k.tag.0);
|
||||
sorted_tags
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue