Skip to content

Commit

Permalink
Make unknown pres attrs panic
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed May 10, 2017
1 parent 195e379 commit d1c3021
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions ports/geckolib/glue.rs
Expand Up @@ -1441,18 +1441,14 @@ pub extern "C" fn Servo_MediaList_DeleteMedium(list: RawServoMediaListBorrowed,
}

macro_rules! get_longhand_from_id {
($id:expr, $retval:expr) => {
($id:expr) => {
match PropertyId::from_nscsspropertyid($id) {
Ok(PropertyId::Longhand(long)) => long,
_ => {
error!("stylo: unknown presentation property with id {:?}", $id);
return $retval
panic!("stylo: unknown presentation property with id {:?}", $id);
}
}
};
($id:expr) => {
get_longhand_from_id!($id, ())
}
}

macro_rules! match_wrap_declared {
Expand All @@ -1462,8 +1458,7 @@ macro_rules! match_wrap_declared {
LonghandId::$property => PropertyDeclaration::$property($inner),
)*
_ => {
error!("stylo: Don't know how to handle presentation property {:?}", $longhand);
return
panic!("stylo: Don't know how to handle presentation property {:?}", $longhand);
}
}
)
Expand All @@ -1475,7 +1470,7 @@ pub extern "C" fn Servo_DeclarationBlock_PropertyIsSet(declarations:
property: nsCSSPropertyID)
-> bool {
use style::properties::PropertyDeclarationId;
let long = get_longhand_from_id!(property, false);
let long = get_longhand_from_id!(property);
read_locked_arc(declarations, |decls: &PropertyDeclarationBlock| {
decls.get(PropertyDeclarationId::Longhand(long)).is_some()
})
Expand Down

0 comments on commit d1c3021

Please sign in to comment.