mirror of
https://github.com/servo/servo.git
synced 2025-10-01 17:19:16 +01:00
script: Move the layout_wrapper outside of script.
This allows us to have ensure_data() and clear_data() functions on the TElement trait, instead of hacking around it adding methods in random traits. This also allows us to do some further cleanup, which I'd rather do in a followup.
This commit is contained in:
parent
f9642b36bd
commit
bf9369b29d
17 changed files with 128 additions and 166 deletions
|
@ -762,7 +762,7 @@ pub extern "C" fn Servo_StyleWorkerThreadCount() -> u32 {
|
|||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_Element_ClearData(element: RawGeckoElementBorrowed) {
|
||||
GeckoElement(element).clear_data();
|
||||
unsafe { GeckoElement(element).clear_data() };
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
@ -1531,7 +1531,7 @@ pub extern "C" fn Servo_ResolvePseudoStyle(element: RawGeckoElementBorrowed,
|
|||
-> ServoComputedValuesStrong
|
||||
{
|
||||
let element = GeckoElement(element);
|
||||
let data = unsafe { element.ensure_data() }.borrow_mut();
|
||||
let data = unsafe { element.ensure_data() };
|
||||
let doc_data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
||||
|
||||
debug!("Servo_ResolvePseudoStyle: {:?} {:?}, is_probe: {}",
|
||||
|
@ -1582,7 +1582,7 @@ pub extern "C" fn Servo_SetExplicitStyle(element: RawGeckoElementBorrowed,
|
|||
// We only support this API for initial styling. There's no reason it couldn't
|
||||
// work for other things, we just haven't had a reason to do so.
|
||||
debug_assert!(element.get_data().is_none());
|
||||
let mut data = unsafe { element.ensure_data() }.borrow_mut();
|
||||
let mut data = unsafe { element.ensure_data() };
|
||||
data.styles.primary = Some(style.clone());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue