stylo: Remove Servo_Element_ShouldTraverse.

This commit is contained in:
Cameron McCormack 2017-02-10 10:23:36 +08:00
parent 57e1b25cbd
commit 2dc9166256
2 changed files with 0 additions and 22 deletions

View file

@ -1129,10 +1129,6 @@ extern "C" {
extern "C" { extern "C" {
pub fn Servo_Element_ClearData(node: RawGeckoElementBorrowed); pub fn Servo_Element_ClearData(node: RawGeckoElementBorrowed);
} }
extern "C" {
pub fn Servo_Element_ShouldTraverse(node: RawGeckoElementBorrowed)
-> bool;
}
extern "C" { extern "C" {
pub fn Servo_StyleSheet_Empty(parsing_mode: SheetParsingMode) pub fn Servo_StyleSheet_Empty(parsing_mode: SheetParsingMode)
-> RawServoStyleSheetStrong; -> RawServoStyleSheetStrong;

View file

@ -347,24 +347,6 @@ pub extern "C" fn Servo_Element_ClearData(element: RawGeckoElementBorrowed) -> (
GeckoElement(element).clear_data(); GeckoElement(element).clear_data();
} }
#[no_mangle]
pub extern "C" fn Servo_Element_ShouldTraverse(element: RawGeckoElementBorrowed) -> bool {
let element = GeckoElement(element);
debug_assert!(!element.has_dirty_descendants(),
"only call Servo_Element_ShouldTraverse if you know the element \
does not have dirty descendants");
let result = match element.borrow_data() {
// Note that we check for has_restyle here rather than has_current_styles,
// because we also want the traversal code to trigger if there's restyle
// damage. We really only need the Gecko post-traversal in that case, so
// the servo traversal will be a no-op, but it's cheap enough that we
// don't bother distinguishing the two cases.
Some(d) => !d.has_styles() || d.has_restyle(),
None => true,
};
result
}
#[no_mangle] #[no_mangle]
pub extern "C" fn Servo_StyleSheet_Empty(mode: SheetParsingMode) -> RawServoStyleSheetStrong { pub extern "C" fn Servo_StyleSheet_Empty(mode: SheetParsingMode) -> RawServoStyleSheetStrong {
let url = ServoUrl::parse("about:blank").unwrap(); let url = ServoUrl::parse("about:blank").unwrap();