mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Make PropertyDeclarationBlock fields private
This commit is contained in:
parent
da4e5146e9
commit
f70a49974a
8 changed files with 31 additions and 33 deletions
|
@ -765,14 +765,14 @@ pub extern "C" fn Servo_DeclarationBlock_SerializeOneValue(
|
|||
#[no_mangle]
|
||||
pub extern "C" fn Servo_DeclarationBlock_Count(declarations: RawServoDeclarationBlockBorrowed) -> u32 {
|
||||
let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
|
||||
declarations.read().declarations.len() as u32
|
||||
declarations.read().declarations().len() as u32
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_DeclarationBlock_GetNthProperty(declarations: RawServoDeclarationBlockBorrowed,
|
||||
index: u32, result: *mut nsAString) -> bool {
|
||||
let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
|
||||
if let Some(&(ref decl, _)) = declarations.read().declarations.get(index as usize) {
|
||||
if let Some(&(ref decl, _)) = declarations.read().declarations().get(index as usize) {
|
||||
let result = unsafe { result.as_mut().unwrap() };
|
||||
decl.id().to_css(result).unwrap();
|
||||
true
|
||||
|
@ -923,7 +923,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetIdentStringValue(declarations:
|
|||
let prop = match_wrap_declared! { long,
|
||||
XLang => Lang(Atom::from(value)),
|
||||
};
|
||||
declarations.write().declarations.push((prop, Default::default()));
|
||||
declarations.write().push(prop, Importance::Normal);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
@ -960,7 +960,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetKeywordValue(declarations:
|
|||
BorderBottomStyle => BorderStyle::from_gecko_keyword(value),
|
||||
BorderLeftStyle => BorderStyle::from_gecko_keyword(value),
|
||||
};
|
||||
declarations.write().declarations.push((prop, Default::default()));
|
||||
declarations.write().push(prop, Importance::Normal);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
@ -975,7 +975,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetIntValue(declarations: RawServoDecla
|
|||
let prop = match_wrap_declared! { long,
|
||||
XSpan => Span(value),
|
||||
};
|
||||
declarations.write().declarations.push((prop, Default::default()));
|
||||
declarations.write().push(prop, Importance::Normal);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
@ -1014,7 +1014,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetPixelValue(declarations:
|
|||
}
|
||||
),
|
||||
};
|
||||
declarations.write().declarations.push((prop, Default::default()));
|
||||
declarations.write().push(prop, Importance::Normal);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
@ -1037,7 +1037,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetPercentValue(declarations:
|
|||
MarginBottom => pc.into(),
|
||||
MarginLeft => pc.into(),
|
||||
};
|
||||
declarations.write().declarations.push((prop, Default::default()));
|
||||
declarations.write().push(prop, Importance::Normal);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
@ -1059,7 +1059,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetAutoValue(declarations:
|
|||
MarginBottom => auto,
|
||||
MarginLeft => auto,
|
||||
};
|
||||
declarations.write().declarations.push((prop, Default::default()));
|
||||
declarations.write().push(prop, Importance::Normal);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
@ -1080,7 +1080,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetCurrentColor(declarations:
|
|||
BorderBottomColor => cc,
|
||||
BorderLeftColor => cc,
|
||||
};
|
||||
declarations.write().declarations.push((prop, Default::default()));
|
||||
declarations.write().push(prop, Importance::Normal);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
@ -1107,7 +1107,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetColorValue(declarations:
|
|||
Color => longhands::color::SpecifiedValue(color),
|
||||
BackgroundColor => color,
|
||||
};
|
||||
declarations.write().declarations.push((prop, Default::default()));
|
||||
declarations.write().push(prop, Importance::Normal);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
@ -1124,7 +1124,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetFontFamily(declarations:
|
|||
if let Ok(family) = FontFamily::parse(&mut parser) {
|
||||
if parser.is_exhausted() {
|
||||
let decl = PropertyDeclaration::FontFamily(DeclaredValue::Value(family));
|
||||
declarations.write().declarations.push((decl, Default::default()));
|
||||
declarations.write().push(decl, Importance::Normal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1139,7 +1139,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetTextDecorationColorOverride(declarat
|
|||
let mut decoration = text_decoration_line::computed_value::none;
|
||||
decoration |= text_decoration_line::COLOR_OVERRIDE;
|
||||
let decl = PropertyDeclaration::TextDecorationLine(DeclaredValue::Value(decoration));
|
||||
declarations.write().declarations.push((decl, Default::default()));
|
||||
declarations.write().push(decl, Importance::Normal);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
@ -1356,7 +1356,7 @@ pub extern "C" fn Servo_GetComputedKeyframeValues(keyframes: RawGeckoKeyframeLis
|
|||
let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
|
||||
let guard = declarations.read();
|
||||
|
||||
let anim_iter = guard.declarations
|
||||
let anim_iter = guard.declarations()
|
||||
.iter()
|
||||
.filter_map(|&(ref decl, imp)| {
|
||||
if imp == Importance::Normal {
|
||||
|
@ -1463,7 +1463,7 @@ pub extern "C" fn Servo_StyleSet_FillKeyframesForName(raw_data: RawServoStyleSet
|
|||
let guard = block.read();
|
||||
// Filter out non-animatable properties.
|
||||
let animatable =
|
||||
guard.declarations
|
||||
guard.declarations()
|
||||
.iter()
|
||||
.filter(|&&(ref declaration, _)| {
|
||||
declaration.is_animatable()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue