mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Auto merge of #18963 - heycam:rm-property-id, r=upsuper
geckolib: Make Servo_DeclarationBlock_RemovePropertyById return whether it did remove a property. From https://bugzilla.mozilla.org/show_bug.cgi?id=1408311, reviewed there by Xidorn. <!-- 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/18963) <!-- Reviewable:end -->
This commit is contained in:
commit
7b61e3b6ee
2 changed files with 13 additions and 8 deletions
|
@ -2733,7 +2733,7 @@ extern "C" {
|
||||||
pub fn Servo_DeclarationBlock_RemovePropertyById(declarations:
|
pub fn Servo_DeclarationBlock_RemovePropertyById(declarations:
|
||||||
RawServoDeclarationBlockBorrowed,
|
RawServoDeclarationBlockBorrowed,
|
||||||
property:
|
property:
|
||||||
nsCSSPropertyID);
|
nsCSSPropertyID) -> bool;
|
||||||
}
|
}
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn Servo_DeclarationBlock_HasCSSWideKeyword(declarations:
|
pub fn Servo_DeclarationBlock_HasCSSWideKeyword(declarations:
|
||||||
|
|
|
@ -2670,10 +2670,13 @@ pub unsafe extern "C" fn Servo_DeclarationBlock_SetPropertyById(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn remove_property(declarations: RawServoDeclarationBlockBorrowed, property_id: PropertyId) {
|
fn remove_property(
|
||||||
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
|
property_id: PropertyId
|
||||||
|
) -> bool {
|
||||||
write_locked_arc(declarations, |decls: &mut PropertyDeclarationBlock| {
|
write_locked_arc(declarations, |decls: &mut PropertyDeclarationBlock| {
|
||||||
decls.remove_property(&property_id);
|
decls.remove_property(&property_id)
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
@ -2681,13 +2684,15 @@ pub unsafe extern "C" fn Servo_DeclarationBlock_RemoveProperty(
|
||||||
declarations: RawServoDeclarationBlockBorrowed,
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
property: *const nsACString,
|
property: *const nsACString,
|
||||||
) {
|
) {
|
||||||
remove_property(declarations, get_property_id_from_property!(property, ()))
|
remove_property(declarations, get_property_id_from_property!(property, ()));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_RemovePropertyById(declarations: RawServoDeclarationBlockBorrowed,
|
pub extern "C" fn Servo_DeclarationBlock_RemovePropertyById(
|
||||||
property: nsCSSPropertyID) {
|
declarations: RawServoDeclarationBlockBorrowed,
|
||||||
remove_property(declarations, get_property_id_from_nscsspropertyid!(property, ()))
|
property: nsCSSPropertyID
|
||||||
|
) -> bool {
|
||||||
|
remove_property(declarations, get_property_id_from_nscsspropertyid!(property, false))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue