mirror of
https://github.com/servo/servo.git
synced 2025-06-19 14:48:59 +01:00
Generate bindings for HTMLDivElement, and pass abstract type to methods that need access to the opaque wrappers.
This commit is contained in:
parent
08ed6d318e
commit
65a33f60e5
10 changed files with 161 additions and 131 deletions
|
@ -7,7 +7,7 @@
|
|||
use dom::bindings::codegen::TextBinding;
|
||||
use dom::bindings::node;
|
||||
use dom::bindings::utils::{WrapperCache, DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{BindingObject, CacheableWrapper};
|
||||
use dom::bindings::utils::{BindingObject, CacheableWrapper, rust_box};
|
||||
use dom::bindings;
|
||||
use dom::characterdata::CharacterData;
|
||||
use dom::document::AbstractDocument;
|
||||
|
@ -235,6 +235,15 @@ impl<'self, View> AbstractNode<View> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Allow consumers to recreate an AbstractNode from the raw boxed type.
|
||||
/// Must only be used in situations where the boxed type is in the inheritance
|
||||
/// chain for nodes.
|
||||
pub fn from_box<T>(ptr: *mut rust_box<T>) -> AbstractNode<View> {
|
||||
AbstractNode {
|
||||
obj: ptr as *mut Node<View>
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the layout data, unsafely cast to whatever type layout wishes. Only layout is
|
||||
/// allowed to call this. This is wildly unsafe and is therefore marked as such.
|
||||
pub unsafe fn unsafe_layout_data<T>(self) -> @mut T {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue