mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Remove Traceable from element.rs
This commit is contained in:
parent
4f362ab5e6
commit
96f6c2fd67
2 changed files with 5 additions and 6 deletions
|
@ -390,7 +390,7 @@ pub struct LayoutElement<'le> {
|
||||||
impl<'le> LayoutElement<'le> {
|
impl<'le> LayoutElement<'le> {
|
||||||
pub fn style_attribute(&self) -> &'le Option<PropertyDeclarationBlock> {
|
pub fn style_attribute(&self) -> &'le Option<PropertyDeclarationBlock> {
|
||||||
let style: &Option<PropertyDeclarationBlock> = unsafe {
|
let style: &Option<PropertyDeclarationBlock> = unsafe {
|
||||||
let style: &RefCell<Option<PropertyDeclarationBlock>> = self.element.style_attribute.deref();
|
let style: &RefCell<Option<PropertyDeclarationBlock>> = &self.element.style_attribute;
|
||||||
// cast to the direct reference to T placed on the head of RefCell<T>
|
// cast to the direct reference to T placed on the head of RefCell<T>
|
||||||
mem::transmute(style)
|
mem::transmute(style)
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,7 +14,6 @@ use dom::bindings::codegen::Bindings::NamedNodeMapBinding::NamedNodeMapMethods;
|
||||||
use dom::bindings::codegen::InheritTypes::{ElementDerived, NodeCast};
|
use dom::bindings::codegen::InheritTypes::{ElementDerived, NodeCast};
|
||||||
use dom::bindings::js::{MutNullableJS, JS, JSRef, Temporary, TemporaryPushable};
|
use dom::bindings::js::{MutNullableJS, JS, JSRef, Temporary, TemporaryPushable};
|
||||||
use dom::bindings::js::{OptionalSettable, OptionalRootable, Root};
|
use dom::bindings::js::{OptionalSettable, OptionalRootable, Root};
|
||||||
use dom::bindings::trace::Traceable;
|
|
||||||
use dom::bindings::utils::{Reflectable, Reflector};
|
use dom::bindings::utils::{Reflectable, Reflector};
|
||||||
use dom::bindings::error::{ErrorResult, Fallible, NamespaceError, InvalidCharacter, Syntax};
|
use dom::bindings::error::{ErrorResult, Fallible, NamespaceError, InvalidCharacter, Syntax};
|
||||||
use dom::bindings::utils::{QName, Name, InvalidXMLName, xml_name_type};
|
use dom::bindings::utils::{QName, Name, InvalidXMLName, xml_name_type};
|
||||||
|
@ -51,7 +50,7 @@ pub struct Element {
|
||||||
pub namespace: Namespace,
|
pub namespace: Namespace,
|
||||||
pub prefix: Option<DOMString>,
|
pub prefix: Option<DOMString>,
|
||||||
pub attrs: RefCell<Vec<JS<Attr>>>,
|
pub attrs: RefCell<Vec<JS<Attr>>>,
|
||||||
pub style_attribute: Traceable<RefCell<Option<style::PropertyDeclarationBlock>>>,
|
pub style_attribute: RefCell<Option<style::PropertyDeclarationBlock>>,
|
||||||
pub attr_list: MutNullableJS<NamedNodeMap>,
|
pub attr_list: MutNullableJS<NamedNodeMap>,
|
||||||
class_list: MutNullableJS<DOMTokenList>,
|
class_list: MutNullableJS<DOMTokenList>,
|
||||||
}
|
}
|
||||||
|
@ -159,7 +158,7 @@ impl Element {
|
||||||
attrs: RefCell::new(vec!()),
|
attrs: RefCell::new(vec!()),
|
||||||
attr_list: Default::default(),
|
attr_list: Default::default(),
|
||||||
class_list: Default::default(),
|
class_list: Default::default(),
|
||||||
style_attribute: Traceable::new(RefCell::new(None)),
|
style_attribute: RefCell::new(None),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -851,7 +850,7 @@ impl<'a> VirtualMethods for JSRef<'a, Element> {
|
||||||
let doc = document_from_node(*self).root();
|
let doc = document_from_node(*self).root();
|
||||||
let base_url = doc.deref().url().clone();
|
let base_url = doc.deref().url().clone();
|
||||||
let style = Some(style::parse_style_attribute(value.as_slice(), &base_url));
|
let style = Some(style::parse_style_attribute(value.as_slice(), &base_url));
|
||||||
*self.deref().style_attribute.deref().borrow_mut() = style;
|
*self.deref().style_attribute.borrow_mut() = style;
|
||||||
}
|
}
|
||||||
"id" => {
|
"id" => {
|
||||||
let node: JSRef<Node> = NodeCast::from_ref(*self);
|
let node: JSRef<Node> = NodeCast::from_ref(*self);
|
||||||
|
@ -875,7 +874,7 @@ impl<'a> VirtualMethods for JSRef<'a, Element> {
|
||||||
|
|
||||||
match name.as_slice() {
|
match name.as_slice() {
|
||||||
"style" => {
|
"style" => {
|
||||||
*self.deref().style_attribute.deref().borrow_mut() = None;
|
*self.deref().style_attribute.borrow_mut() = None;
|
||||||
}
|
}
|
||||||
"id" => {
|
"id" => {
|
||||||
let node: JSRef<Node> = NodeCast::from_ref(*self);
|
let node: JSRef<Node> = NodeCast::from_ref(*self);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue