Pass element or pseudo element to Servo_StyleSet_GetBaseComputedValuesForElement()

This commit is contained in:
Hiroyuki Ikezoe 2017-11-22 11:02:46 +09:00
parent 37fa711657
commit dcedf11013

View file

@ -789,7 +789,6 @@ pub extern "C" fn Servo_StyleSet_GetBaseComputedValuesForElement(
element: RawGeckoElementBorrowed,
computed_values: ServoStyleContextBorrowed,
snapshots: *const ServoElementSnapshotTable,
pseudo_type: CSSPseudoElementType
) -> ServoStyleContextStrong {
debug_assert!(!snapshots.is_null());
let computed_values = unsafe { ArcBorrow::from_ref(computed_values) };
@ -807,21 +806,6 @@ pub extern "C" fn Servo_StyleSet_GetBaseComputedValuesForElement(
let element = GeckoElement(element);
let element_data = match element.borrow_data() {
Some(data) => data,
None => return computed_values.clone_arc().into(),
};
if let Some(pseudo) = PseudoElement::from_pseudo_type(pseudo_type) {
let styles = &element_data.styles;
// This style already doesn't have animations.
return styles
.pseudos
.get(&pseudo)
.expect("GetBaseComputedValuesForElement for an unexisting pseudo?")
.clone().into();
}
let global_style_data = &*GLOBAL_STYLE_DATA;
let guard = global_style_data.shared_lock.read();
let shared = create_shared_context(&global_style_data,