зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #18450 - Use the LonghandIdSet to check whether a property is set (from upsuper:property-is-set); r=Manishearth
Servo side change of [bug 1398479](https://bugzilla.mozilla.org/show_bug.cgi?id=1398479). Source-Repo: https://github.com/servo/servo Source-Revision: 24b2d8d9cf265a149535ebc22941e427dd5e21b3 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 5a2be5b5ff4886cce99883d4338bad2d6621527e
This commit is contained in:
Родитель
87c459e671
Коммит
2dd26b6b32
|
@ -239,6 +239,11 @@ impl PropertyDeclarationBlock {
|
|||
!self.declarations_importance.all_true()
|
||||
}
|
||||
|
||||
/// Returns whether this block contains a declaration of a given longhand.
|
||||
pub fn contains(&self, id: LonghandId) -> bool {
|
||||
self.longhands.contains(id)
|
||||
}
|
||||
|
||||
/// Get a declaration for a given property.
|
||||
///
|
||||
/// NOTE: This is linear time.
|
||||
|
|
|
@ -2566,10 +2566,8 @@ pub extern "C" fn Servo_DeclarationBlock_PropertyIsSet(declarations:
|
|||
RawServoDeclarationBlockBorrowed,
|
||||
property: nsCSSPropertyID)
|
||||
-> bool {
|
||||
use style::properties::PropertyDeclarationId;
|
||||
let long = get_longhand_from_id!(property);
|
||||
read_locked_arc(declarations, |decls: &PropertyDeclarationBlock| {
|
||||
decls.get(PropertyDeclarationId::Longhand(long)).is_some()
|
||||
decls.contains(get_longhand_from_id!(property))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче