aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/element.rs
diff options
context:
space:
mode:
authorbors-servo <release+servo@mozilla.com>2013-08-06 19:21:32 -0700
committerbors-servo <release+servo@mozilla.com>2013-08-06 19:21:32 -0700
commitb017785aad93171cf199c286dd30dceff46372eb (patch)
treeded6f21ced8dccfb30ac68bbed15a6fdd585aeeb /src/components/script/dom/element.rs
parentff9e72a01351cd6407db8ead03df0b997e303053 (diff)
parent4d71918366f2971ec1b042f79767767eff2e0a37 (diff)
downloadservo-b017785aad93171cf199c286dd30dceff46372eb.tar.gz
servo-b017785aad93171cf199c286dd30dceff46372eb.zip
auto merge of #678 : metajack/servo/style-attributes, r=jdm
If a style attribute is given for a node, it is parsed and attached to the Element. When selector matching runs on the Element, the style attribute's stylesheet is passed in. Fixes #86.
Diffstat (limited to 'src/components/script/dom/element.rs')
-rw-r--r--src/components/script/dom/element.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/components/script/dom/element.rs b/src/components/script/dom/element.rs
index 7c2a9d13f13..04977ae7931 100644
--- a/src/components/script/dom/element.rs
+++ b/src/components/script/dom/element.rs
@@ -18,6 +18,7 @@ use dom::htmlimageelement::HTMLImageElement;
use dom::node::{ElementNodeTypeId, Node, ScriptView, AbstractNode};
use layout_interface::{ContentBoxQuery, ContentBoxResponse, ContentBoxesQuery};
use layout_interface::{ContentBoxesResponse};
+use newcss::stylesheet::Stylesheet;
use js::jsapi::{JSContext, JSObject};
@@ -34,6 +35,7 @@ pub struct Element {
parent: Node<ScriptView>,
tag_name: ~str, // TODO: This should be an atom, not a ~str.
attrs: ~[Attr],
+ style_attribute: Option<Stylesheet>,
}
impl CacheableWrapper for Element {
@@ -206,7 +208,8 @@ impl<'self> Element {
Element {
parent: Node::new(ElementNodeTypeId(type_id)),
tag_name: tag_name,
- attrs: ~[]
+ attrs: ~[],
+ style_attribute: None,
}
}