aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/htmldocument.rs
diff options
context:
space:
mode:
authorbors-servo <release+servo@mozilla.com>2013-10-24 09:15:55 -0700
committerbors-servo <release+servo@mozilla.com>2013-10-24 09:15:55 -0700
commit13644ccab1942c053c3fd5e4a19bb75d9ebe8739 (patch)
tree38d66cafb51053d5c5d7304521e8948a828f1ca7 /src/components/script/dom/htmldocument.rs
parenta9e23299395b59edbf8bd0a65f7a088cb03fda76 (diff)
parent4e47d59165d186d0938fe9ffd726b2c1b83d50f4 (diff)
downloadservo-13644ccab1942c053c3fd5e4a19bb75d9ebe8739.tar.gz
servo-13644ccab1942c053c3fd5e4a19bb75d9ebe8739.zip
auto merge of #1079 : jdm/servo/docnode, r=jdm,metajack
The bit I don't like about these changes is that I ended up hiding the document node from the CSS selecting/matching code, so it continues thinking of the document's first child as the root. When I tried to send the full tree including the document node to layout, the layout code refused to create any child flows. When I sent the document's first child without hiding the document, it saw inherited values for properties like font-family, and later tried to treat the document node as an Element when searching for named nodes.
Diffstat (limited to 'src/components/script/dom/htmldocument.rs')
-rw-r--r--src/components/script/dom/htmldocument.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/components/script/dom/htmldocument.rs b/src/components/script/dom/htmldocument.rs
index cadba01ce97..d4ac4fa0e52 100644
--- a/src/components/script/dom/htmldocument.rs
+++ b/src/components/script/dom/htmldocument.rs
@@ -35,6 +35,11 @@ impl ReflectableDocument for HTMLDocument {
fn init_reflector(@mut self, cx: *JSContext) {
self.wrap_object_shared(cx, ptr::null()); //XXXjdm a proper scope would be nice
}
+
+ fn init_node(@mut self, doc: AbstractDocument) {
+ self.parent.node.set_owner_doc(doc);
+ self.parent.node.add_to_doc(AbstractNode::from_document(doc), doc);
+ }
}
impl HTMLDocument {