mirror of
https://github.com/servo/servo.git
synced 2025-08-13 17:35:36 +01:00
style: Don't serialize default values of the font shorthand.
This makes us consistent with the old style system and Blink / WebKit. Not adding a test because shorthands serialization is a mess... :( Anyway, nothing like fixing bugs by removing code. Bug: 1436031
This commit is contained in:
parent
3a3a7cdc22
commit
173c9aee61
2 changed files with 32 additions and 67 deletions
|
@ -2670,12 +2670,11 @@ pub extern "C" fn Servo_DeclarationBlock_SerializeOneValue(
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_SerializeFontValueForCanvas(
|
||||
pub unsafe extern "C" fn Servo_SerializeFontValueForCanvas(
|
||||
declarations: RawServoDeclarationBlockBorrowed,
|
||||
buffer: *mut nsAString,
|
||||
) {
|
||||
use style::properties::shorthands::font;
|
||||
|
||||
read_locked_arc(declarations, |decls: &PropertyDeclarationBlock| {
|
||||
let longhands = match font::LonghandsToSerialize::from_iter(decls.declarations().iter()) {
|
||||
Ok(l) => l,
|
||||
|
@ -2685,12 +2684,8 @@ pub extern "C" fn Servo_SerializeFontValueForCanvas(
|
|||
}
|
||||
};
|
||||
|
||||
let mut string = String::new();
|
||||
let rv = longhands.to_css_for_canvas(&mut CssWriter::new(&mut string));
|
||||
let rv = longhands.to_css(&mut CssWriter::new(&mut *buffer));
|
||||
debug_assert!(rv.is_ok());
|
||||
|
||||
let buffer = unsafe { buffer.as_mut().unwrap() };
|
||||
buffer.assign_utf8(&string);
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue