mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
@ -550,6 +550,17 @@ pub trait TElement : Eq + PartialEq + Debug + Hash + Sized + Copy + Clone +
|
|||
/// traversal. Returns the number of children left to process.
|
||||
fn did_process_child(&self) -> isize;
|
||||
|
||||
/// Gets a reference to the ElementData container, or creates one.
|
||||
///
|
||||
/// Unsafe because it can race to allocate and leak if not used with
|
||||
/// exclusive access to the element.
|
||||
unsafe fn ensure_data(&self) -> AtomicRefMut<ElementData>;
|
||||
|
||||
/// Clears the element data reference, if any.
|
||||
///
|
||||
/// Unsafe following the same reasoning as ensure_data.
|
||||
unsafe fn clear_data(&self);
|
||||
|
||||
/// Gets a reference to the ElementData container.
|
||||
fn get_data(&self) -> Option<&AtomicRefCell<ElementData>>;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue