From 31c9ffb4b51b79394f882e5efed629c2df0600d9 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 30 Nov 2012 12:29:54 +0000 Subject: make boxes keep reference to the DOM node that causes them --- render/box_construct.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'render/box_construct.c') diff --git a/render/box_construct.c b/render/box_construct.c index 63575876e..52c8cfee5 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -994,12 +994,15 @@ bool box_construct_element(struct box_construct_ctx *ctx, return true; } - /* Attach box to DOM node */ + /* Attach DOM node to box */ err = dom_node_set_user_data(ctx->n, kstr_box_key, box, NULL, (void *) &old_box); if (err != DOM_NO_ERR) return false; + /* Attach box to DOM node */ + box->node = dom_node_ref(ctx->n); + if (props.inline_container == NULL && (box->type == BOX_INLINE || box->type == BOX_BR || -- cgit v1.2.3