mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Bug 1302949 - Add a method to Gecko bindings for comparing declaration blocks; r=Manishearth
MozReview-Commit-ID: EtX2oLXdGNm
This commit is contained in:
parent
56e70aec51
commit
61bcc3a2ef
3 changed files with 22 additions and 0 deletions
|
@ -70,6 +70,16 @@ pub struct GeckoDeclarationBlock {
|
||||||
pub immutable: AtomicBool,
|
pub immutable: AtomicBool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl PartialEq for GeckoDeclarationBlock {
|
||||||
|
fn eq(&self, other: &GeckoDeclarationBlock) -> bool {
|
||||||
|
match (&self.declarations, &other.declarations) {
|
||||||
|
(&None, &None) => true,
|
||||||
|
(&Some(ref s), &Some(ref other)) => *s.read() == *other.read(),
|
||||||
|
_ => false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
unsafe impl HasFFI for GeckoDeclarationBlock {
|
unsafe impl HasFFI for GeckoDeclarationBlock {
|
||||||
type FFIType = bindings::ServoDeclarationBlock;
|
type FFIType = bindings::ServoDeclarationBlock;
|
||||||
}
|
}
|
||||||
|
|
|
@ -872,6 +872,11 @@ extern "C" {
|
||||||
pub fn Servo_DeclarationBlock_Release(declarations:
|
pub fn Servo_DeclarationBlock_Release(declarations:
|
||||||
ServoDeclarationBlockBorrowed);
|
ServoDeclarationBlockBorrowed);
|
||||||
}
|
}
|
||||||
|
extern "C" {
|
||||||
|
pub fn Servo_DeclarationBlock_Equals(a: ServoDeclarationBlockBorrowed,
|
||||||
|
b: ServoDeclarationBlockBorrowed)
|
||||||
|
-> bool;
|
||||||
|
}
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn Servo_DeclarationBlock_GetCache(declarations:
|
pub fn Servo_DeclarationBlock_GetCache(declarations:
|
||||||
ServoDeclarationBlockBorrowed)
|
ServoDeclarationBlockBorrowed)
|
||||||
|
|
|
@ -413,6 +413,13 @@ pub extern "C" fn Servo_DeclarationBlock_Release(declarations: ServoDeclarationB
|
||||||
unsafe { GeckoDeclarationBlock::release(declarations) };
|
unsafe { GeckoDeclarationBlock::release(declarations) };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "C" fn Servo_DeclarationBlock_Equals(a: ServoDeclarationBlockBorrowed,
|
||||||
|
b: ServoDeclarationBlockBorrowed)
|
||||||
|
-> bool {
|
||||||
|
GeckoDeclarationBlock::as_arc(&a) == GeckoDeclarationBlock::as_arc(&b)
|
||||||
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_DeclarationBlock_GetCache(declarations: ServoDeclarationBlockBorrowed)
|
pub extern "C" fn Servo_DeclarationBlock_GetCache(declarations: ServoDeclarationBlockBorrowed)
|
||||||
-> *mut nsHTMLCSSStyleSheet {
|
-> *mut nsHTMLCSSStyleSheet {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue