Ensure id attributes on elements only affect elements present in a document.

This commit is contained in:
Josh Matthews 2014-02-18 15:12:00 -05:00
parent edd7e32fdb
commit 70e8a5e90f
2 changed files with 11 additions and 2 deletions

View file

@ -223,7 +223,7 @@ impl Element {
"style" => {
self.style_attribute = Some(style::parse_style_attribute(value))
}
"id" => {
"id" if abstract_self.is_in_doc() => {
// XXX: this dual declaration are workaround to avoid the compile error:
// "borrowed value does not live long enough"
let doc = self.node.owner_doc();
@ -287,7 +287,7 @@ impl Element {
"style" => {
self.style_attribute = None
}
"id" => {
"id" if abstract_self.is_in_doc() => {
// XXX: this dual declaration are workaround to avoid the compile error:
// "borrowed value does not live long enough"
let doc = self.node.owner_doc();