mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Auto merge of #18450 - upsuper:property-is-set, r=Manishearth
Use the LonghandIdSet to check whether a property is set Servo side change of [bug 1398479](https://bugzilla.mozilla.org/show_bug.cgi?id=1398479). <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18450) <!-- Reviewable:end -->
This commit is contained in:
commit
24b2d8d9cf
2 changed files with 6 additions and 3 deletions
|
@ -239,6 +239,11 @@ impl PropertyDeclarationBlock {
|
||||||
!self.declarations_importance.all_true()
|
!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.
|
/// Get a declaration for a given property.
|
||||||
///
|
///
|
||||||
/// NOTE: This is linear time.
|
/// NOTE: This is linear time.
|
||||||
|
|
|
@ -2566,10 +2566,8 @@ pub extern "C" fn Servo_DeclarationBlock_PropertyIsSet(declarations:
|
||||||
RawServoDeclarationBlockBorrowed,
|
RawServoDeclarationBlockBorrowed,
|
||||||
property: nsCSSPropertyID)
|
property: nsCSSPropertyID)
|
||||||
-> bool {
|
-> bool {
|
||||||
use style::properties::PropertyDeclarationId;
|
|
||||||
let long = get_longhand_from_id!(property);
|
|
||||||
read_locked_arc(declarations, |decls: &PropertyDeclarationBlock| {
|
read_locked_arc(declarations, |decls: &PropertyDeclarationBlock| {
|
||||||
decls.get(PropertyDeclarationId::Longhand(long)).is_some()
|
decls.contains(get_longhand_from_id!(property))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue