mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Pass element or pseudo element to Servo_StyleSet_GetBaseComputedValuesForElement()
This commit is contained in:
parent
37fa711657
commit
dcedf11013
1 changed files with 0 additions and 16 deletions
|
@ -789,7 +789,6 @@ pub extern "C" fn Servo_StyleSet_GetBaseComputedValuesForElement(
|
||||||
element: RawGeckoElementBorrowed,
|
element: RawGeckoElementBorrowed,
|
||||||
computed_values: ServoStyleContextBorrowed,
|
computed_values: ServoStyleContextBorrowed,
|
||||||
snapshots: *const ServoElementSnapshotTable,
|
snapshots: *const ServoElementSnapshotTable,
|
||||||
pseudo_type: CSSPseudoElementType
|
|
||||||
) -> ServoStyleContextStrong {
|
) -> ServoStyleContextStrong {
|
||||||
debug_assert!(!snapshots.is_null());
|
debug_assert!(!snapshots.is_null());
|
||||||
let computed_values = unsafe { ArcBorrow::from_ref(computed_values) };
|
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 = 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 global_style_data = &*GLOBAL_STYLE_DATA;
|
||||||
let guard = global_style_data.shared_lock.read();
|
let guard = global_style_data.shared_lock.read();
|
||||||
let shared = create_shared_context(&global_style_data,
|
let shared = create_shared_context(&global_style_data,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue