From 961bdfc66151b9aef46149e4730110ef409e5587 Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Fri, 26 Aug 2011 16:53:03 +0200 Subject: Move most of the context to a "general context" substructure. This is so as to make sure that cloning (which does a shallow copy) gives us references to the same mutable content. --- org/madore/damlengine/TodoStyleOrScript.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'org/madore/damlengine/TodoStyleOrScript.java') diff --git a/org/madore/damlengine/TodoStyleOrScript.java b/org/madore/damlengine/TodoStyleOrScript.java index dcec137..cc00e11 100644 --- a/org/madore/damlengine/TodoStyleOrScript.java +++ b/org/madore/damlengine/TodoStyleOrScript.java @@ -31,18 +31,18 @@ public final class TodoStyleOrScript extends TodoItem { @Override public void handle() { - if ( ctx.headNode == null ) + if ( ctx.gc.headNode == null ) throw new IllegalStateException("head node is null when doing style or script"); Element node = ctx.doc.createElementNS(DamlEngine.XHTML_NS, t.eltName); node.setAttributeNS(null, "type", t.mimeType); if ( t==Type.SCRIPT ) node.setAttributeNS(null, "defer", "defer"); - ctx.headNode.appendChild(node); - ctx.headNode.appendChild(ctx.doc.createTextNode("\n")); + ctx.gc.headNode.appendChild(node); + ctx.gc.headNode.appendChild(ctx.doc.createTextNode("\n")); node.appendChild(ctx.doc.createTextNode("\n"+t.preCdata)); StringBuffer content - = (t==Type.SCRIPT)?ctx.scriptContent:ctx.styleContent; + = (t==Type.SCRIPT)?ctx.gc.scriptContent:ctx.gc.styleContent; node.appendChild(ctx.doc. createCDATASection(t.postCdata+content +t.preCdata)); -- cgit v1.2.3