Make CJX_Object and its subclasses be garbage collected.

Unfortunately, this causes a nearly-identical change to each of the
numerous CFXA_Object subclasses, which was partially automated but
required some IWYU and argument naming adjustments.

Bug: pdfium:1563
Change-Id: Ie107b0b3b9ca628b65bfd14085a08061fbd1014b
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/73690
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/fxjs/xfa/cjx_boolean.h b/fxjs/xfa/cjx_boolean.h
index d2a85ba..6aaff83 100644
--- a/fxjs/xfa/cjx_boolean.h
+++ b/fxjs/xfa/cjx_boolean.h
@@ -14,7 +14,7 @@
 
 class CJX_Boolean final : public CJX_Object {
  public:
-  explicit CJX_Boolean(CXFA_Boolean* node);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Boolean() override;
 
   // CJX_Object:
@@ -24,6 +24,8 @@
   JSE_PROP(value);
 
  private:
+  explicit CJX_Boolean(CXFA_Boolean* node);
+
   using Type__ = CJX_Boolean;
   using ParentType__ = CJX_Object;
 
diff --git a/fxjs/xfa/cjx_container.h b/fxjs/xfa/cjx_container.h
index 51675e5..6fea0a2 100644
--- a/fxjs/xfa/cjx_container.h
+++ b/fxjs/xfa/cjx_container.h
@@ -14,7 +14,7 @@
 
 class CJX_Container : public CJX_Node {
  public:
-  explicit CJX_Container(CXFA_Node* node);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Container() override;
 
   // CJX_Object:
@@ -23,6 +23,9 @@
   JSE_METHOD(getDelta);
   JSE_METHOD(getDeltas);
 
+ protected:
+  explicit CJX_Container(CXFA_Node* node);
+
  private:
   using Type__ = CJX_Container;
   using ParentType__ = CJX_Node;
diff --git a/fxjs/xfa/cjx_datawindow.h b/fxjs/xfa/cjx_datawindow.h
index 6f3ad54..9a87312 100644
--- a/fxjs/xfa/cjx_datawindow.h
+++ b/fxjs/xfa/cjx_datawindow.h
@@ -11,12 +11,11 @@
 #include "fxjs/xfa/jse_define.h"
 #include "xfa/fxfa/fxfa_basic.h"
 
-class CFXJSE_Value;
 class CScript_DataWindow;
 
 class CJX_DataWindow final : public CJX_Object {
  public:
-  explicit CJX_DataWindow(CScript_DataWindow* window);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_DataWindow() override;
 
   // CJX_Object:
@@ -33,6 +32,8 @@
   JSE_PROP(recordsBefore);
 
  private:
+  explicit CJX_DataWindow(CScript_DataWindow* window);
+
   using Type__ = CJX_DataWindow;
   using ParentType__ = CJX_Object;
 
diff --git a/fxjs/xfa/cjx_delta.h b/fxjs/xfa/cjx_delta.h
index 716dd1e..f1e4127 100644
--- a/fxjs/xfa/cjx_delta.h
+++ b/fxjs/xfa/cjx_delta.h
@@ -14,7 +14,7 @@
 
 class CJX_Delta final : public CJX_Object {
  public:
-  explicit CJX_Delta(CXFA_Delta* delta);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Delta() override;
 
   // CJX_Object:
@@ -27,6 +27,8 @@
   JSE_PROP(target);
 
  private:
+  explicit CJX_Delta(CXFA_Delta* delta);
+
   using Type__ = CJX_Delta;
   using ParentType__ = CJX_Object;
 
diff --git a/fxjs/xfa/cjx_desc.h b/fxjs/xfa/cjx_desc.h
index 62cdec8..75f9157 100644
--- a/fxjs/xfa/cjx_desc.h
+++ b/fxjs/xfa/cjx_desc.h
@@ -14,7 +14,7 @@
 
 class CJX_Desc final : public CJX_Node {
  public:
-  explicit CJX_Desc(CXFA_Desc* desc);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Desc() override;
 
   // CJX_Object:
@@ -23,6 +23,8 @@
   JSE_METHOD(metadata);
 
  private:
+  explicit CJX_Desc(CXFA_Desc* desc);
+
   using Type__ = CJX_Desc;
   using ParentType__ = CJX_Node;
 
diff --git a/fxjs/xfa/cjx_draw.h b/fxjs/xfa/cjx_draw.h
index bf3c3a7..9a6a332 100644
--- a/fxjs/xfa/cjx_draw.h
+++ b/fxjs/xfa/cjx_draw.h
@@ -14,7 +14,7 @@
 
 class CJX_Draw final : public CJX_Container {
  public:
-  explicit CJX_Draw(CXFA_Draw* node);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Draw() override;
 
   // CJX_Object:
@@ -24,6 +24,8 @@
   JSE_PROP(rawValue);
 
  private:
+  explicit CJX_Draw(CXFA_Draw* node);
+
   using Type__ = CJX_Draw;
   using ParentType__ = CJX_Container;
 
diff --git a/fxjs/xfa/cjx_encrypt.h b/fxjs/xfa/cjx_encrypt.h
index 826bc1f..58989d1 100644
--- a/fxjs/xfa/cjx_encrypt.h
+++ b/fxjs/xfa/cjx_encrypt.h
@@ -14,7 +14,7 @@
 
 class CJX_Encrypt final : public CJX_Node {
  public:
-  explicit CJX_Encrypt(CXFA_Encrypt* node);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Encrypt() override;
 
   // CJX_Object:
@@ -23,6 +23,8 @@
   JSE_PROP(format);
 
  private:
+  explicit CJX_Encrypt(CXFA_Encrypt* node);
+
   using Type__ = CJX_Encrypt;
   using ParentType__ = CJX_Node;
 
diff --git a/fxjs/xfa/cjx_eventpseudomodel.h b/fxjs/xfa/cjx_eventpseudomodel.h
index 6f3cc84..a4e741f 100644
--- a/fxjs/xfa/cjx_eventpseudomodel.h
+++ b/fxjs/xfa/cjx_eventpseudomodel.h
@@ -35,7 +35,7 @@
 
 class CJX_EventPseudoModel final : public CJX_Object {
  public:
-  explicit CJX_EventPseudoModel(CScript_EventPseudoModel* model);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_EventPseudoModel() override;
 
   // CJX_Object:
@@ -63,6 +63,8 @@
   JSE_PROP(target);
 
  private:
+  explicit CJX_EventPseudoModel(CScript_EventPseudoModel* model);
+
   using Type__ = CJX_EventPseudoModel;
   using ParentType__ = CJX_Object;
 
diff --git a/fxjs/xfa/cjx_exclgroup.h b/fxjs/xfa/cjx_exclgroup.h
index b459808..a2d911a 100644
--- a/fxjs/xfa/cjx_exclgroup.h
+++ b/fxjs/xfa/cjx_exclgroup.h
@@ -14,7 +14,7 @@
 
 class CJX_ExclGroup final : public CJX_Node {
  public:
-  explicit CJX_ExclGroup(CXFA_ExclGroup* group);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_ExclGroup() override;
 
   // CJX_Object:
@@ -32,6 +32,8 @@
   JSE_PROP(transient);
 
  private:
+  explicit CJX_ExclGroup(CXFA_ExclGroup* group);
+
   using Type__ = CJX_ExclGroup;
   using ParentType__ = CJX_Node;
 
diff --git a/fxjs/xfa/cjx_extras.h b/fxjs/xfa/cjx_extras.h
index 0723575..c98d2fb 100644
--- a/fxjs/xfa/cjx_extras.h
+++ b/fxjs/xfa/cjx_extras.h
@@ -14,7 +14,7 @@
 
 class CJX_Extras final : public CJX_Node {
  public:
-  explicit CJX_Extras(CXFA_Extras* node);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Extras() override;
 
   // CJX_Object:
@@ -23,6 +23,8 @@
   JSE_PROP(type);
 
  private:
+  explicit CJX_Extras(CXFA_Extras* node);
+
   using Type__ = CJX_Extras;
   using ParentType__ = CJX_Node;
 
diff --git a/fxjs/xfa/cjx_field.h b/fxjs/xfa/cjx_field.h
index 6e16e7a..750738b 100644
--- a/fxjs/xfa/cjx_field.h
+++ b/fxjs/xfa/cjx_field.h
@@ -14,7 +14,7 @@
 
 class CJX_Field final : public CJX_Container {
  public:
-  explicit CJX_Field(CXFA_Field* field);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Field() override;
 
   // CJX_Object:
@@ -43,6 +43,8 @@
   JSE_PROP(selectedIndex);
 
  private:
+  explicit CJX_Field(CXFA_Field* field);
+
   using Type__ = CJX_Field;
   using ParentType__ = CJX_Container;
 
diff --git a/fxjs/xfa/cjx_form.h b/fxjs/xfa/cjx_form.h
index c7b1ce3..9156413 100644
--- a/fxjs/xfa/cjx_form.h
+++ b/fxjs/xfa/cjx_form.h
@@ -14,7 +14,7 @@
 
 class CJX_Form final : public CJX_Model {
  public:
-  explicit CJX_Form(CXFA_Form* form);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Form() override;
 
   // CJX_Object:
@@ -30,6 +30,8 @@
   JSE_PROP(checksumS);
 
  private:
+  explicit CJX_Form(CXFA_Form* form);
+
   using Type__ = CJX_Form;
   using ParentType__ = CJX_Model;
 
diff --git a/fxjs/xfa/cjx_handler.h b/fxjs/xfa/cjx_handler.h
index 348eaf1..25f7d9a 100644
--- a/fxjs/xfa/cjx_handler.h
+++ b/fxjs/xfa/cjx_handler.h
@@ -14,7 +14,7 @@
 
 class CJX_Handler final : public CJX_TextNode {
  public:
-  explicit CJX_Handler(CXFA_Handler* node);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Handler() override;
 
   // CJX_Object:
@@ -23,6 +23,8 @@
   JSE_PROP(version);
 
  private:
+  explicit CJX_Handler(CXFA_Handler* node);
+
   using Type__ = CJX_Handler;
   using ParentType__ = CJX_TextNode;
 
diff --git a/fxjs/xfa/cjx_hostpseudomodel.h b/fxjs/xfa/cjx_hostpseudomodel.h
index cdc293d..21262cc 100644
--- a/fxjs/xfa/cjx_hostpseudomodel.h
+++ b/fxjs/xfa/cjx_hostpseudomodel.h
@@ -11,12 +11,11 @@
 #include "fxjs/xfa/jse_define.h"
 #include "xfa/fxfa/fxfa_basic.h"
 
-class CFXJSE_Value;
 class CScript_HostPseudoModel;
 
 class CJX_HostPseudoModel final : public CJX_Object {
  public:
-  explicit CJX_HostPseudoModel(CScript_HostPseudoModel* model);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_HostPseudoModel() override;
 
   // CJX_Object:
@@ -54,6 +53,8 @@
   JSE_PROP(name);
 
  private:
+  explicit CJX_HostPseudoModel(CScript_HostPseudoModel* model);
+
   using Type__ = CJX_HostPseudoModel;
   using ParentType__ = CJX_Object;
 
diff --git a/fxjs/xfa/cjx_instancemanager.h b/fxjs/xfa/cjx_instancemanager.h
index 3fae9ab..0d574f6 100644
--- a/fxjs/xfa/cjx_instancemanager.h
+++ b/fxjs/xfa/cjx_instancemanager.h
@@ -14,7 +14,7 @@
 
 class CJX_InstanceManager final : public CJX_Node {
  public:
-  explicit CJX_InstanceManager(CXFA_InstanceManager* mgr);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_InstanceManager() override;
 
   // CJX_Object:
@@ -33,6 +33,8 @@
   int32_t MoveInstance(int32_t iTo, int32_t iFrom);
 
  private:
+  explicit CJX_InstanceManager(CXFA_InstanceManager* mgr);
+
   using Type__ = CJX_InstanceManager;
   using ParentType__ = CJX_Node;
 
diff --git a/fxjs/xfa/cjx_layoutpseudomodel.h b/fxjs/xfa/cjx_layoutpseudomodel.h
index d5f0cba..34e91d0 100644
--- a/fxjs/xfa/cjx_layoutpseudomodel.h
+++ b/fxjs/xfa/cjx_layoutpseudomodel.h
@@ -19,14 +19,13 @@
   XFA_LAYOUTMODEL_Y
 };
 
-class CFXJSE_Value;
 class CScript_LayoutPseudoModel;
 class CXFA_LayoutProcessor;
 class CXFA_Node;
 
 class CJX_LayoutPseudoModel final : public CJX_Object {
  public:
-  explicit CJX_LayoutPseudoModel(CScript_LayoutPseudoModel* model);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_LayoutPseudoModel() override;
 
   // CJX_Object:
@@ -55,6 +54,8 @@
   JSE_PROP(ready);
 
  private:
+  explicit CJX_LayoutPseudoModel(CScript_LayoutPseudoModel* model);
+
   using Type__ = CJX_LayoutPseudoModel;
   using ParentType__ = CJX_Object;
 
diff --git a/fxjs/xfa/cjx_list.h b/fxjs/xfa/cjx_list.h
index 842b859..2cbe820 100644
--- a/fxjs/xfa/cjx_list.h
+++ b/fxjs/xfa/cjx_list.h
@@ -14,7 +14,7 @@
 
 class CJX_List : public CJX_Object {
  public:
-  explicit CJX_List(CXFA_List* list);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_List() override;
 
   // CJX_Object:
@@ -27,6 +27,9 @@
 
   JSE_PROP(length);
 
+ protected:
+  explicit CJX_List(CXFA_List* list);
+
  private:
   using Type__ = CJX_List;
   using ParentType__ = CJX_Object;
diff --git a/fxjs/xfa/cjx_logpseudomodel.h b/fxjs/xfa/cjx_logpseudomodel.h
index fda3bb9..16e16db 100644
--- a/fxjs/xfa/cjx_logpseudomodel.h
+++ b/fxjs/xfa/cjx_logpseudomodel.h
@@ -16,7 +16,7 @@
 // xfa_basic_data_element_script is removed.
 class CJX_LogPseudoModel final : public CJX_Object {
  public:
-  explicit CJX_LogPseudoModel(CScript_LogPseudoModel* model);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_LogPseudoModel() override;
 
   // CJX_Object:
@@ -29,6 +29,8 @@
   JSE_METHOD(trace);
 
  private:
+  explicit CJX_LogPseudoModel(CScript_LogPseudoModel* model);
+
   using Type__ = CJX_LogPseudoModel;
   using ParentType__ = CJX_Object;
 
diff --git a/fxjs/xfa/cjx_manifest.h b/fxjs/xfa/cjx_manifest.h
index 8380ac6..ada7cdd 100644
--- a/fxjs/xfa/cjx_manifest.h
+++ b/fxjs/xfa/cjx_manifest.h
@@ -14,7 +14,7 @@
 
 class CJX_Manifest final : public CJX_Node {
  public:
-  explicit CJX_Manifest(CXFA_Manifest* manifest);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Manifest() override;
 
   // CJX_Object:
@@ -23,6 +23,8 @@
   JSE_METHOD(evaluate);
 
  private:
+  explicit CJX_Manifest(CXFA_Manifest* manifest);
+
   using Type__ = CJX_Manifest;
   using ParentType__ = CJX_Node;
 
diff --git a/fxjs/xfa/cjx_model.h b/fxjs/xfa/cjx_model.h
index 9fd54f5..455fc4c 100644
--- a/fxjs/xfa/cjx_model.h
+++ b/fxjs/xfa/cjx_model.h
@@ -14,7 +14,7 @@
 
 class CJX_Model : public CJX_Node {
  public:
-  explicit CJX_Model(CXFA_Node* obj);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Model() override;
 
   // CJX_Object:
@@ -27,6 +27,9 @@
   JSE_PROP(aliasNode);
   JSE_PROP(context);
 
+ protected:
+  explicit CJX_Model(CXFA_Node* obj);
+
  private:
   using Type__ = CJX_Model;
   using ParentType__ = CJX_Node;
diff --git a/fxjs/xfa/cjx_node.h b/fxjs/xfa/cjx_node.h
index 6d30351..bd1e13c 100644
--- a/fxjs/xfa/cjx_node.h
+++ b/fxjs/xfa/cjx_node.h
@@ -16,7 +16,7 @@
 
 class CJX_Node : public CJX_Tree {
  public:
-  explicit CJX_Node(CXFA_Node* node);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Node() override;
 
   // CJX_Object:
@@ -41,6 +41,8 @@
   JSE_PROP(oneOfChild);
 
  protected:
+  explicit CJX_Node(CXFA_Node* node);
+
   XFA_EventError execSingleEventByName(WideStringView wsEventName,
                                        XFA_Element eType);
 
diff --git a/fxjs/xfa/cjx_object.cpp b/fxjs/xfa/cjx_object.cpp
index 7b156bc..ba3ebb1 100644
--- a/fxjs/xfa/cjx_object.cpp
+++ b/fxjs/xfa/cjx_object.cpp
@@ -131,6 +131,11 @@
   return this;
 }
 
+void CJX_Object::Trace(cppgc::Visitor* visitor) const {
+  visitor->Trace(object_);
+  visitor->Trace(layout_item_);
+}
+
 bool CJX_Object::DynamicTypeIs(TypeTag eType) const {
   return eType == static_type__;
 }
diff --git a/fxjs/xfa/cjx_object.h b/fxjs/xfa/cjx_object.h
index a34654c..c3cdbf5 100644
--- a/fxjs/xfa/cjx_object.h
+++ b/fxjs/xfa/cjx_object.h
@@ -12,13 +12,14 @@
 #include <utility>
 #include <vector>
 
-#include "core/fxcrt/unowned_ptr.h"
 #include "core/fxcrt/widestring.h"
+#include "fxjs/gc/heap.h"
 #include "fxjs/xfa/fxjse.h"
 #include "fxjs/xfa/jse_define.h"
 #include "third_party/base/optional.h"
 #include "third_party/base/span.h"
-#include "v8/include/cppgc/persistent.h"
+#include "v8/include/cppgc/garbage-collected.h"
+#include "v8/include/cppgc/member.h"
 #include "xfa/fxfa/fxfa_basic.h"
 #include "xfa/fxfa/parser/cxfa_measurement.h"
 
@@ -57,7 +58,8 @@
   XFA_SOM_MandatoryMessage
 };
 
-class CJX_Object : public CFXJSE_HostObject {
+class CJX_Object : public cppgc::GarbageCollected<CJX_Object>,
+                   public CFXJSE_HostObject {
  public:
   // Corresponds 1:1 with CJX_ subclasses.
   enum class TypeTag {
@@ -98,12 +100,13 @@
     Xfa,
   };
 
-  explicit CJX_Object(CXFA_Object* obj);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Object() override;
 
   // CFXJSE_HostObject:
   CJX_Object* AsCJXObject() override;
 
+  virtual void Trace(cppgc::Visitor* visitor) const;
   virtual bool DynamicTypeIs(TypeTag eType) const;
 
   JSE_PROP(className);
@@ -222,6 +225,8 @@
   void ThrowTooManyOccurancesException(const WideString& obj) const;
 
  protected:
+  explicit CJX_Object(CXFA_Object* obj);
+
   void DefineMethods(pdfium::span<const CJX_MethodSpec> methods);
   void MoveBufferMapData(CXFA_Object* pSrcModule, CXFA_Object* pDstModule);
   void SetMapModuleString(void* pKey, WideStringView wsValue);
@@ -261,8 +266,8 @@
   void RemoveMapModuleKey(void* pKey);
   void MoveBufferMapData(CXFA_Object* pDstModule);
 
-  UnownedPtr<CXFA_Object> object_;
-  CXFA_LayoutItem* layout_item_ = nullptr;
+  cppgc::Member<CXFA_Object> object_;
+  cppgc::Member<CXFA_LayoutItem> layout_item_;
   std::unique_ptr<XFA_MAPMODULEDATA> map_module_data_;
   std::unique_ptr<CXFA_CalcData> calc_data_;
   std::map<ByteString, CJX_MethodCall> method_specs_;
diff --git a/fxjs/xfa/cjx_occur.h b/fxjs/xfa/cjx_occur.h
index 8b912b6..253ae92 100644
--- a/fxjs/xfa/cjx_occur.h
+++ b/fxjs/xfa/cjx_occur.h
@@ -14,7 +14,7 @@
 
 class CJX_Occur final : public CJX_Node {
  public:
-  explicit CJX_Occur(CXFA_Occur* node);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Occur() override;
 
   // CJX_Object:
@@ -24,6 +24,8 @@
   JSE_PROP(min);
 
  private:
+  explicit CJX_Occur(CXFA_Occur* node);
+
   using Type__ = CJX_Occur;
   using ParentType__ = CJX_Node;
 
diff --git a/fxjs/xfa/cjx_packet.h b/fxjs/xfa/cjx_packet.h
index df4a987..78af421 100644
--- a/fxjs/xfa/cjx_packet.h
+++ b/fxjs/xfa/cjx_packet.h
@@ -14,7 +14,7 @@
 
 class CJX_Packet final : public CJX_Node {
  public:
-  explicit CJX_Packet(CXFA_Packet* packet);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Packet() override;
 
   // CJX_Object:
@@ -27,6 +27,8 @@
   JSE_PROP(content);
 
  private:
+  explicit CJX_Packet(CXFA_Packet* packet);
+
   using Type__ = CJX_Packet;
   using ParentType__ = CJX_Node;
 
diff --git a/fxjs/xfa/cjx_script.h b/fxjs/xfa/cjx_script.h
index af7c985..f167afc 100644
--- a/fxjs/xfa/cjx_script.h
+++ b/fxjs/xfa/cjx_script.h
@@ -14,7 +14,7 @@
 
 class CJX_Script final : public CJX_Node {
  public:
-  explicit CJX_Script(CXFA_Script* node);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Script() override;
 
   // CJX_Object:
@@ -23,6 +23,8 @@
   JSE_PROP(stateless);
 
  private:
+  explicit CJX_Script(CXFA_Script* node);
+
   using Type__ = CJX_Script;
   using ParentType__ = CJX_Node;
 
diff --git a/fxjs/xfa/cjx_signaturepseudomodel.h b/fxjs/xfa/cjx_signaturepseudomodel.h
index ed77238..b423821 100644
--- a/fxjs/xfa/cjx_signaturepseudomodel.h
+++ b/fxjs/xfa/cjx_signaturepseudomodel.h
@@ -14,7 +14,7 @@
 
 class CJX_SignaturePseudoModel final : public CJX_Object {
  public:
-  explicit CJX_SignaturePseudoModel(CScript_SignaturePseudoModel* model);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_SignaturePseudoModel() override;
 
   // CJX_Object:
@@ -26,6 +26,8 @@
   JSE_METHOD(clear);
 
  private:
+  explicit CJX_SignaturePseudoModel(CScript_SignaturePseudoModel* model);
+
   using Type__ = CJX_SignaturePseudoModel;
   using ParentType__ = CJX_Object;
 
diff --git a/fxjs/xfa/cjx_source.h b/fxjs/xfa/cjx_source.h
index cd70601..0d13818 100644
--- a/fxjs/xfa/cjx_source.h
+++ b/fxjs/xfa/cjx_source.h
@@ -14,7 +14,7 @@
 
 class CJX_Source final : public CJX_Node {
  public:
-  explicit CJX_Source(CXFA_Source* src);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Source() override;
 
   // CJX_Object:
@@ -41,6 +41,8 @@
   JSE_PROP(db);
 
  private:
+  explicit CJX_Source(CXFA_Source* src);
+
   using Type__ = CJX_Source;
   using ParentType__ = CJX_Node;
 
diff --git a/fxjs/xfa/cjx_subform.h b/fxjs/xfa/cjx_subform.h
index 83ac66e..f236a76 100644
--- a/fxjs/xfa/cjx_subform.h
+++ b/fxjs/xfa/cjx_subform.h
@@ -10,11 +10,11 @@
 #include "fxjs/xfa/cjx_container.h"
 #include "fxjs/xfa/jse_define.h"
 
-class CXFA_Delta;
+class CXFA_Node;
 
 class CJX_Subform final : public CJX_Container {
  public:
-  explicit CJX_Subform(CXFA_Node* container);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Subform() override;
 
   // CJX_Object:
@@ -29,6 +29,8 @@
   JSE_PROP(locale);
 
  private:
+  explicit CJX_Subform(CXFA_Node* container);
+
   using Type__ = CJX_Subform;
   using ParentType__ = CJX_Container;
 
diff --git a/fxjs/xfa/cjx_template.h b/fxjs/xfa/cjx_template.h
index d396459..3705155 100644
--- a/fxjs/xfa/cjx_template.h
+++ b/fxjs/xfa/cjx_template.h
@@ -14,7 +14,7 @@
 
 class CJX_Template final : public CJX_Model {
  public:
-  explicit CJX_Template(CXFA_Template* tmpl);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Template() override;
 
   // CJX_Object:
@@ -31,6 +31,8 @@
   JSE_METHOD(remerge);
 
  private:
+  explicit CJX_Template(CXFA_Template* tmpl);
+
   using Type__ = CJX_Template;
   using ParentType__ = CJX_Model;
 
diff --git a/fxjs/xfa/cjx_textnode.h b/fxjs/xfa/cjx_textnode.h
index 6d74658..7db8a23 100644
--- a/fxjs/xfa/cjx_textnode.h
+++ b/fxjs/xfa/cjx_textnode.h
@@ -14,7 +14,7 @@
 
 class CJX_TextNode : public CJX_Node {
  public:
-  explicit CJX_TextNode(CXFA_Node* node);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_TextNode() override;
 
   // CJX_Object:
@@ -23,6 +23,9 @@
   JSE_PROP(defaultValue); /* {default} */
   JSE_PROP(value);
 
+ protected:
+  explicit CJX_TextNode(CXFA_Node* node);
+
  private:
   using Type__ = CJX_TextNode;
   using ParentType__ = CJX_Node;
diff --git a/fxjs/xfa/cjx_tree.h b/fxjs/xfa/cjx_tree.h
index cbef888..54dd88d 100644
--- a/fxjs/xfa/cjx_tree.h
+++ b/fxjs/xfa/cjx_tree.h
@@ -10,12 +10,13 @@
 #include "fxjs/xfa/cjx_object.h"
 #include "fxjs/xfa/jse_define.h"
 
+class CFXJSE_Value;
 class CXFA_Object;
 class CXFA_Node;
 
 class CJX_Tree : public CJX_Object {
  public:
-  explicit CJX_Tree(CXFA_Object* obj);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Tree() override;
 
   // CJX_Object:
@@ -32,6 +33,9 @@
   JSE_PROP(parent);
   JSE_PROP(somExpression);
 
+ protected:
+  explicit CJX_Tree(CXFA_Object* obj);
+
  private:
   using Type__ = CJX_Tree;
   using ParentType__ = CJX_Object;
diff --git a/fxjs/xfa/cjx_treelist.h b/fxjs/xfa/cjx_treelist.h
index 294ab26..9e5f6cf 100644
--- a/fxjs/xfa/cjx_treelist.h
+++ b/fxjs/xfa/cjx_treelist.h
@@ -14,7 +14,7 @@
 
 class CJX_TreeList final : public CJX_List {
  public:
-  explicit CJX_TreeList(CXFA_TreeList* list);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_TreeList() override;
 
   // CJX_Object:
@@ -23,6 +23,8 @@
   JSE_METHOD(namedItem);
 
  private:
+  explicit CJX_TreeList(CXFA_TreeList* list);
+
   using Type__ = CJX_TreeList;
   using ParentType__ = CJX_List;
 
diff --git a/fxjs/xfa/cjx_wsdlconnection.h b/fxjs/xfa/cjx_wsdlconnection.h
index bd5db40..4ed862c 100644
--- a/fxjs/xfa/cjx_wsdlconnection.h
+++ b/fxjs/xfa/cjx_wsdlconnection.h
@@ -14,7 +14,7 @@
 
 class CJX_WsdlConnection final : public CJX_Node {
  public:
-  explicit CJX_WsdlConnection(CXFA_WsdlConnection* connection);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_WsdlConnection() override;
 
   // CJX_Object:
@@ -23,6 +23,8 @@
   JSE_METHOD(execute);
 
  private:
+  explicit CJX_WsdlConnection(CXFA_WsdlConnection* connection);
+
   using Type__ = CJX_WsdlConnection;
   using ParentType__ = CJX_Node;
 
diff --git a/fxjs/xfa/cjx_xfa.h b/fxjs/xfa/cjx_xfa.h
index 63b0f5f..1582095 100644
--- a/fxjs/xfa/cjx_xfa.h
+++ b/fxjs/xfa/cjx_xfa.h
@@ -14,7 +14,7 @@
 
 class CJX_Xfa final : public CJX_Model {
  public:
-  explicit CJX_Xfa(CXFA_Xfa* node);
+  CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
   ~CJX_Xfa() override;
 
   // CJX_Object:
@@ -23,6 +23,8 @@
   JSE_PROP(thisValue); /* this */
 
  private:
+  explicit CJX_Xfa(CXFA_Xfa* node);
+
   using Type__ = CJX_Xfa;
   using ParentType__ = CJX_Model;
 
diff --git a/xfa/fxfa/parser/cscript_datawindow.cpp b/xfa/fxfa/parser/cscript_datawindow.cpp
index 1e95bea..9ed760c 100644
--- a/xfa/fxfa/parser/cscript_datawindow.cpp
+++ b/xfa/fxfa/parser/cscript_datawindow.cpp
@@ -6,17 +6,15 @@
 
 #include "xfa/fxfa/parser/cscript_datawindow.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_datawindow.h"
 #include "xfa/fxfa/parser/cxfa_document.h"
-#include "xfa/fxfa/parser/cxfa_localemgr.h"
-#include "xfa/fxfa/parser/xfa_utils.h"
 
-CScript_DataWindow::CScript_DataWindow(CXFA_Document* pDocument)
-    : CXFA_Object(pDocument,
+CScript_DataWindow::CScript_DataWindow(CXFA_Document* doc)
+    : CXFA_Object(doc,
                   XFA_ObjectType::Object,
                   XFA_Element::DataWindow,
-                  std::make_unique<CJX_DataWindow>(this)) {}
+                  cppgc::MakeGarbageCollected<CJX_DataWindow>(
+                      doc->GetHeap()->GetAllocationHandle(),
+                      this)) {}
 
 CScript_DataWindow::~CScript_DataWindow() = default;
diff --git a/xfa/fxfa/parser/cscript_eventpseudomodel.cpp b/xfa/fxfa/parser/cscript_eventpseudomodel.cpp
index b461ba8..1034eb9 100644
--- a/xfa/fxfa/parser/cscript_eventpseudomodel.cpp
+++ b/xfa/fxfa/parser/cscript_eventpseudomodel.cpp
@@ -6,14 +6,15 @@
 
 #include "xfa/fxfa/parser/cscript_eventpseudomodel.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_eventpseudomodel.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
-CScript_EventPseudoModel::CScript_EventPseudoModel(CXFA_Document* pDocument)
-    : CXFA_Object(pDocument,
+CScript_EventPseudoModel::CScript_EventPseudoModel(CXFA_Document* doc)
+    : CXFA_Object(doc,
                   XFA_ObjectType::Object,
                   XFA_Element::EventPseudoModel,
-                  std::make_unique<CJX_EventPseudoModel>(this)) {}
+                  cppgc::MakeGarbageCollected<CJX_EventPseudoModel>(
+                      doc->GetHeap()->GetAllocationHandle(),
+                      this)) {}
 
 CScript_EventPseudoModel::~CScript_EventPseudoModel() = default;
diff --git a/xfa/fxfa/parser/cscript_hostpseudomodel.cpp b/xfa/fxfa/parser/cscript_hostpseudomodel.cpp
index 5d495a8..bfdbe94 100644
--- a/xfa/fxfa/parser/cscript_hostpseudomodel.cpp
+++ b/xfa/fxfa/parser/cscript_hostpseudomodel.cpp
@@ -6,14 +6,15 @@
 
 #include "xfa/fxfa/parser/cscript_hostpseudomodel.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_hostpseudomodel.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
-CScript_HostPseudoModel::CScript_HostPseudoModel(CXFA_Document* pDocument)
-    : CXFA_Object(pDocument,
+CScript_HostPseudoModel::CScript_HostPseudoModel(CXFA_Document* doc)
+    : CXFA_Object(doc,
                   XFA_ObjectType::Object,
                   XFA_Element::HostPseudoModel,
-                  std::make_unique<CJX_HostPseudoModel>(this)) {}
+                  cppgc::MakeGarbageCollected<CJX_HostPseudoModel>(
+                      doc->GetHeap()->GetAllocationHandle(),
+                      this)) {}
 
 CScript_HostPseudoModel::~CScript_HostPseudoModel() = default;
diff --git a/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp b/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp
index 1a676d0..b2d6889 100644
--- a/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp
+++ b/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp
@@ -6,14 +6,15 @@
 
 #include "xfa/fxfa/parser/cscript_layoutpseudomodel.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_layoutpseudomodel.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
-CScript_LayoutPseudoModel::CScript_LayoutPseudoModel(CXFA_Document* pDocument)
-    : CXFA_Object(pDocument,
+CScript_LayoutPseudoModel::CScript_LayoutPseudoModel(CXFA_Document* doc)
+    : CXFA_Object(doc,
                   XFA_ObjectType::Object,
                   XFA_Element::LayoutPseudoModel,
-                  std::make_unique<CJX_LayoutPseudoModel>(this)) {}
+                  cppgc::MakeGarbageCollected<CJX_LayoutPseudoModel>(
+                      doc->GetHeap()->GetAllocationHandle(),
+                      this)) {}
 
 CScript_LayoutPseudoModel::~CScript_LayoutPseudoModel() = default;
diff --git a/xfa/fxfa/parser/cscript_logpseudomodel.cpp b/xfa/fxfa/parser/cscript_logpseudomodel.cpp
index 5808104..e0f6c6f 100644
--- a/xfa/fxfa/parser/cscript_logpseudomodel.cpp
+++ b/xfa/fxfa/parser/cscript_logpseudomodel.cpp
@@ -6,14 +6,15 @@
 
 #include "xfa/fxfa/parser/cscript_logpseudomodel.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_logpseudomodel.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
-CScript_LogPseudoModel::CScript_LogPseudoModel(CXFA_Document* pDocument)
-    : CXFA_Object(pDocument,
+CScript_LogPseudoModel::CScript_LogPseudoModel(CXFA_Document* doc)
+    : CXFA_Object(doc,
                   XFA_ObjectType::Object,
                   XFA_Element::LogPseudoModel,
-                  std::make_unique<CJX_LogPseudoModel>(this)) {}
+                  cppgc::MakeGarbageCollected<CJX_LogPseudoModel>(
+                      doc->GetHeap()->GetAllocationHandle(),
+                      this)) {}
 
 CScript_LogPseudoModel::~CScript_LogPseudoModel() = default;
diff --git a/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp b/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp
index ba262ce..f037ae8 100644
--- a/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp
+++ b/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp
@@ -6,15 +6,15 @@
 
 #include "xfa/fxfa/parser/cscript_signaturepseudomodel.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_signaturepseudomodel.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
-CScript_SignaturePseudoModel::CScript_SignaturePseudoModel(
-    CXFA_Document* pDocument)
-    : CXFA_Object(pDocument,
+CScript_SignaturePseudoModel::CScript_SignaturePseudoModel(CXFA_Document* doc)
+    : CXFA_Object(doc,
                   XFA_ObjectType::Object,
                   XFA_Element::SignaturePseudoModel,
-                  std::make_unique<CJX_SignaturePseudoModel>(this)) {}
+                  cppgc::MakeGarbageCollected<CJX_SignaturePseudoModel>(
+                      doc->GetHeap()->GetAllocationHandle(),
+                      this)) {}
 
 CScript_SignaturePseudoModel::~CScript_SignaturePseudoModel() = default;
diff --git a/xfa/fxfa/parser/cxfa_accessiblecontent.cpp b/xfa/fxfa/parser/cxfa_accessiblecontent.cpp
index e3bab9f..29aa760 100644
--- a/xfa/fxfa/parser/cxfa_accessiblecontent.cpp
+++ b/xfa/fxfa/parser/cxfa_accessiblecontent.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_accessiblecontent.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::AccessibleContent,
                 {},
                 kAccessibleContentAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_AccessibleContent::~CXFA_AccessibleContent() = default;
diff --git a/xfa/fxfa/parser/cxfa_acrobat.cpp b/xfa/fxfa/parser/cxfa_acrobat.cpp
index 6054685..d2501b0 100644
--- a/xfa/fxfa/parser/cxfa_acrobat.cpp
+++ b/xfa/fxfa/parser/cxfa_acrobat.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_acrobat.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -35,6 +34,8 @@
                 XFA_Element::Acrobat,
                 kAcrobatPropertyData,
                 kAcrobatAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Acrobat::~CXFA_Acrobat() = default;
diff --git a/xfa/fxfa/parser/cxfa_acrobat7.cpp b/xfa/fxfa/parser/cxfa_acrobat7.cpp
index 2343ad0..b36a5cd 100644
--- a/xfa/fxfa/parser/cxfa_acrobat7.cpp
+++ b/xfa/fxfa/parser/cxfa_acrobat7.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_acrobat7.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -31,6 +30,8 @@
                 XFA_Element::Acrobat7,
                 kAcrobat7PropertyData,
                 kAcrobat7AttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Acrobat7::~CXFA_Acrobat7() = default;
diff --git a/xfa/fxfa/parser/cxfa_adbe_jsconsole.cpp b/xfa/fxfa/parser/cxfa_adbe_jsconsole.cpp
index 0f0d356..6d6969d 100644
--- a/xfa/fxfa/parser/cxfa_adbe_jsconsole.cpp
+++ b/xfa/fxfa/parser/cxfa_adbe_jsconsole.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_adbe_jsconsole.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::ADBE_JSConsole,
                 {},
                 kADBE_JSConsoleAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_ADBE_JSConsole::~CXFA_ADBE_JSConsole() = default;
diff --git a/xfa/fxfa/parser/cxfa_adbe_jsdebugger.cpp b/xfa/fxfa/parser/cxfa_adbe_jsdebugger.cpp
index 710894b..6eb0cdb 100644
--- a/xfa/fxfa/parser/cxfa_adbe_jsdebugger.cpp
+++ b/xfa/fxfa/parser/cxfa_adbe_jsdebugger.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_adbe_jsdebugger.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::ADBE_JSDebugger,
                 {},
                 kADBE_JSDebuggerAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_ADBE_JSDebugger::~CXFA_ADBE_JSDebugger() = default;
diff --git a/xfa/fxfa/parser/cxfa_addsilentprint.cpp b/xfa/fxfa/parser/cxfa_addsilentprint.cpp
index 45fe9b9..64a1810 100644
--- a/xfa/fxfa/parser/cxfa_addsilentprint.cpp
+++ b/xfa/fxfa/parser/cxfa_addsilentprint.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_addsilentprint.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::AddSilentPrint,
                 {},
                 kAddSilentPrintAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_AddSilentPrint::~CXFA_AddSilentPrint() = default;
diff --git a/xfa/fxfa/parser/cxfa_addviewerpreferences.cpp b/xfa/fxfa/parser/cxfa_addviewerpreferences.cpp
index dbcca5b..0625d69 100644
--- a/xfa/fxfa/parser/cxfa_addviewerpreferences.cpp
+++ b/xfa/fxfa/parser/cxfa_addviewerpreferences.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_addviewerpreferences.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::AddViewerPreferences,
                 {},
                 kAddViewerPreferencesAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_AddViewerPreferences::~CXFA_AddViewerPreferences() = default;
diff --git a/xfa/fxfa/parser/cxfa_adjustdata.cpp b/xfa/fxfa/parser/cxfa_adjustdata.cpp
index 4bc8326..413ebbc 100644
--- a/xfa/fxfa/parser/cxfa_adjustdata.cpp
+++ b/xfa/fxfa/parser/cxfa_adjustdata.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_adjustdata.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::AdjustData,
                 {},
                 kAdjustDataAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_AdjustData::~CXFA_AdjustData() = default;
diff --git a/xfa/fxfa/parser/cxfa_adobeextensionlevel.cpp b/xfa/fxfa/parser/cxfa_adobeextensionlevel.cpp
index 41468f3..b7dde9e 100644
--- a/xfa/fxfa/parser/cxfa_adobeextensionlevel.cpp
+++ b/xfa/fxfa/parser/cxfa_adobeextensionlevel.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_adobeextensionlevel.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::AdobeExtensionLevel,
                 {},
                 kAdobeExtensionLevelAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_AdobeExtensionLevel::~CXFA_AdobeExtensionLevel() = default;
diff --git a/xfa/fxfa/parser/cxfa_agent.cpp b/xfa/fxfa/parser/cxfa_agent.cpp
index 8109ac5..d291e65 100644
--- a/xfa/fxfa/parser/cxfa_agent.cpp
+++ b/xfa/fxfa/parser/cxfa_agent.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_agent.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::Agent,
                 {},
                 kAgentAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Agent::~CXFA_Agent() = default;
diff --git a/xfa/fxfa/parser/cxfa_alwaysembed.cpp b/xfa/fxfa/parser/cxfa_alwaysembed.cpp
index 5b0519d..58a1e36 100644
--- a/xfa/fxfa/parser/cxfa_alwaysembed.cpp
+++ b/xfa/fxfa/parser/cxfa_alwaysembed.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_alwaysembed.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::AlwaysEmbed,
                 {},
                 kAlwaysEmbedAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_AlwaysEmbed::~CXFA_AlwaysEmbed() = default;
diff --git a/xfa/fxfa/parser/cxfa_amd.cpp b/xfa/fxfa/parser/cxfa_amd.cpp
index 42dbe4d..9dac974 100644
--- a/xfa/fxfa/parser/cxfa_amd.cpp
+++ b/xfa/fxfa/parser/cxfa_amd.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_amd.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Amd,
                 {},
                 kAmdAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Amd::~CXFA_Amd() = default;
diff --git a/xfa/fxfa/parser/cxfa_appearancefilter.cpp b/xfa/fxfa/parser/cxfa_appearancefilter.cpp
index 968052b..ff91ba6 100644
--- a/xfa/fxfa/parser/cxfa_appearancefilter.cpp
+++ b/xfa/fxfa/parser/cxfa_appearancefilter.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_appearancefilter.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -31,6 +30,8 @@
                 XFA_Element::AppearanceFilter,
                 {},
                 kAppearanceFilterAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_AppearanceFilter::~CXFA_AppearanceFilter() = default;
diff --git a/xfa/fxfa/parser/cxfa_arc.cpp b/xfa/fxfa/parser/cxfa_arc.cpp
index 115265c..89b68f0 100644
--- a/xfa/fxfa/parser/cxfa_arc.cpp
+++ b/xfa/fxfa/parser/cxfa_arc.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_arc.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -38,6 +37,8 @@
                XFA_Element::Arc,
                kArcPropertyData,
                kArcAttributeData,
-               std::make_unique<CJX_Node>(this)) {}
+               cppgc::MakeGarbageCollected<CJX_Node>(
+                   doc->GetHeap()->GetAllocationHandle(),
+                   this)) {}
 
 CXFA_Arc::~CXFA_Arc() = default;
diff --git a/xfa/fxfa/parser/cxfa_area.cpp b/xfa/fxfa/parser/cxfa_area.cpp
index 743ab28..6729228 100644
--- a/xfa/fxfa/parser/cxfa_area.cpp
+++ b/xfa/fxfa/parser/cxfa_area.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_area.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_container.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -41,6 +40,8 @@
           XFA_Element::Area,
           kAreaPropertyData,
           kAreaAttributeData,
-          std::make_unique<CJX_Container>(this)) {}
+          cppgc::MakeGarbageCollected<CJX_Container>(
+              doc->GetHeap()->GetAllocationHandle(),
+              this)) {}
 
 CXFA_Area::~CXFA_Area() = default;
diff --git a/xfa/fxfa/parser/cxfa_assist.cpp b/xfa/fxfa/parser/cxfa_assist.cpp
index 84c34fd..4ad409e 100644
--- a/xfa/fxfa/parser/cxfa_assist.cpp
+++ b/xfa/fxfa/parser/cxfa_assist.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_assist.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -34,6 +33,8 @@
                 XFA_Element::Assist,
                 kAssistPropertyData,
                 kAssistAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Assist::~CXFA_Assist() = default;
diff --git a/xfa/fxfa/parser/cxfa_attributes.cpp b/xfa/fxfa/parser/cxfa_attributes.cpp
index 8cf386a..7cfe6cc 100644
--- a/xfa/fxfa/parser/cxfa_attributes.cpp
+++ b/xfa/fxfa/parser/cxfa_attributes.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_attributes.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Attributes,
                 {},
                 kAttributesAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Attributes::~CXFA_Attributes() = default;
diff --git a/xfa/fxfa/parser/cxfa_autosave.cpp b/xfa/fxfa/parser/cxfa_autosave.cpp
index 7b4880b..ee48c1e 100644
--- a/xfa/fxfa/parser/cxfa_autosave.cpp
+++ b/xfa/fxfa/parser/cxfa_autosave.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_autosave.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::AutoSave,
                 {},
                 kAutoSaveAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_AutoSave::~CXFA_AutoSave() = default;
diff --git a/xfa/fxfa/parser/cxfa_barcode.cpp b/xfa/fxfa/parser/cxfa_barcode.cpp
index 166ab76..3e028ca 100644
--- a/xfa/fxfa/parser/cxfa_barcode.cpp
+++ b/xfa/fxfa/parser/cxfa_barcode.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_barcode.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_measurement.h"
 
 namespace {
@@ -51,7 +50,9 @@
                 XFA_Element::Barcode,
                 {},
                 kBarcodeAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Barcode::~CXFA_Barcode() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_base.cpp b/xfa/fxfa/parser/cxfa_base.cpp
index 5143d30..d9e466e 100644
--- a/xfa/fxfa/parser/cxfa_base.cpp
+++ b/xfa/fxfa/parser/cxfa_base.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_base.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Base,
                 {},
                 kBaseAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Base::~CXFA_Base() = default;
diff --git a/xfa/fxfa/parser/cxfa_batchoutput.cpp b/xfa/fxfa/parser/cxfa_batchoutput.cpp
index 1f51952..873fd93 100644
--- a/xfa/fxfa/parser/cxfa_batchoutput.cpp
+++ b/xfa/fxfa/parser/cxfa_batchoutput.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_batchoutput.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::BatchOutput,
                 {},
                 kBatchOutputAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_BatchOutput::~CXFA_BatchOutput() = default;
diff --git a/xfa/fxfa/parser/cxfa_behavioroverride.cpp b/xfa/fxfa/parser/cxfa_behavioroverride.cpp
index 9724624..963cdca 100644
--- a/xfa/fxfa/parser/cxfa_behavioroverride.cpp
+++ b/xfa/fxfa/parser/cxfa_behavioroverride.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_behavioroverride.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::BehaviorOverride,
                 {},
                 kBehaviorOverrideAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_BehaviorOverride::~CXFA_BehaviorOverride() = default;
diff --git a/xfa/fxfa/parser/cxfa_bind.cpp b/xfa/fxfa/parser/cxfa_bind.cpp
index 147c7a8..c21e1b6 100644
--- a/xfa/fxfa/parser/cxfa_bind.cpp
+++ b/xfa/fxfa/parser/cxfa_bind.cpp
@@ -6,10 +6,9 @@
 
 #include "xfa/fxfa/parser/cxfa_bind.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
 #include "fxjs/xfa/cjx_object.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_picture.h"
 
 namespace {
@@ -42,7 +41,9 @@
                 XFA_Element::Bind,
                 kBindPropertyData,
                 kBindAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Bind::~CXFA_Bind() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_binditems.cpp b/xfa/fxfa/parser/cxfa_binditems.cpp
index 1441e46..3d45183 100644
--- a/xfa/fxfa/parser/cxfa_binditems.cpp
+++ b/xfa/fxfa/parser/cxfa_binditems.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_binditems.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,7 +28,9 @@
                 XFA_Element::BindItems,
                 {},
                 kBindItemsAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_BindItems::~CXFA_BindItems() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_bookend.cpp b/xfa/fxfa/parser/cxfa_bookend.cpp
index 2b34aa1..3da4ee4 100644
--- a/xfa/fxfa/parser/cxfa_bookend.cpp
+++ b/xfa/fxfa/parser/cxfa_bookend.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_bookend.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -30,6 +29,8 @@
                 XFA_Element::Bookend,
                 {},
                 kBookendAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Bookend::~CXFA_Bookend() = default;
diff --git a/xfa/fxfa/parser/cxfa_boolean.cpp b/xfa/fxfa/parser/cxfa_boolean.cpp
index b4ae118..76427e3 100644
--- a/xfa/fxfa/parser/cxfa_boolean.cpp
+++ b/xfa/fxfa/parser/cxfa_boolean.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_boolean.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_boolean.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -30,6 +29,8 @@
                 XFA_Element::Boolean,
                 {},
                 kBooleanAttributeData,
-                std::make_unique<CJX_Boolean>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Boolean>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Boolean::~CXFA_Boolean() = default;
diff --git a/xfa/fxfa/parser/cxfa_border.cpp b/xfa/fxfa/parser/cxfa_border.cpp
index cf9b81d..1227bbd 100644
--- a/xfa/fxfa/parser/cxfa_border.cpp
+++ b/xfa/fxfa/parser/cxfa_border.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_border.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -41,6 +40,8 @@
                      XFA_Element::Border,
                      kBorderPropertyData,
                      kBorderAttributeData,
-                     std::make_unique<CJX_Node>(this)) {}
+                     cppgc::MakeGarbageCollected<CJX_Node>(
+                         doc->GetHeap()->GetAllocationHandle(),
+                         this)) {}
 
 CXFA_Border::~CXFA_Border() = default;
diff --git a/xfa/fxfa/parser/cxfa_box.cpp b/xfa/fxfa/parser/cxfa_box.cpp
index d0b52e9..eb49e14 100644
--- a/xfa/fxfa/parser/cxfa_box.cpp
+++ b/xfa/fxfa/parser/cxfa_box.cpp
@@ -65,7 +65,7 @@
                    XFA_Element eType,
                    pdfium::span<const PropertyData> properties,
                    pdfium::span<const AttributeData> attributes,
-                   std::unique_ptr<CJX_Object> js_node)
+                   CJX_Object* js_node)
     : CXFA_Node(pDoc,
                 ePacket,
                 validPackets,
@@ -73,7 +73,7 @@
                 eType,
                 properties,
                 attributes,
-                std::move(js_node)) {}
+                js_node) {}
 
 CXFA_Box::~CXFA_Box() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_box.h b/xfa/fxfa/parser/cxfa_box.h
index d72aad7..54ca865 100644
--- a/xfa/fxfa/parser/cxfa_box.h
+++ b/xfa/fxfa/parser/cxfa_box.h
@@ -7,7 +7,6 @@
 #ifndef XFA_FXFA_PARSER_CXFA_BOX_H_
 #define XFA_FXFA_PARSER_CXFA_BOX_H_
 
-#include <memory>
 #include <tuple>
 #include <vector>
 
@@ -48,7 +47,7 @@
            XFA_Element eType,
            pdfium::span<const PropertyData> properties,
            pdfium::span<const AttributeData> attributes,
-           std::unique_ptr<CJX_Object> js_node);
+           CJX_Object* js_node);
 
   XFA_AttributeValue GetHand();
 
diff --git a/xfa/fxfa/parser/cxfa_break.cpp b/xfa/fxfa/parser/cxfa_break.cpp
index d4cbacd..eb2f790 100644
--- a/xfa/fxfa/parser/cxfa_break.cpp
+++ b/xfa/fxfa/parser/cxfa_break.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_break.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -44,6 +43,8 @@
                 XFA_Element::Break,
                 kBreakPropertyData,
                 kBreakAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Break::~CXFA_Break() = default;
diff --git a/xfa/fxfa/parser/cxfa_breakafter.cpp b/xfa/fxfa/parser/cxfa_breakafter.cpp
index 0b91d81..e104836 100644
--- a/xfa/fxfa/parser/cxfa_breakafter.cpp
+++ b/xfa/fxfa/parser/cxfa_breakafter.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_breakafter.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -38,6 +37,8 @@
                 XFA_Element::BreakAfter,
                 kBreakAfterPropertyData,
                 kBreakAfterAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_BreakAfter::~CXFA_BreakAfter() = default;
diff --git a/xfa/fxfa/parser/cxfa_breakbefore.cpp b/xfa/fxfa/parser/cxfa_breakbefore.cpp
index db3972a..c4408de 100644
--- a/xfa/fxfa/parser/cxfa_breakbefore.cpp
+++ b/xfa/fxfa/parser/cxfa_breakbefore.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_breakbefore.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -38,6 +37,8 @@
                 XFA_Element::BreakBefore,
                 kBreakBeforePropertyData,
                 kBreakBeforeAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_BreakBefore::~CXFA_BreakBefore() = default;
diff --git a/xfa/fxfa/parser/cxfa_button.cpp b/xfa/fxfa/parser/cxfa_button.cpp
index 2d32c74..1b53ca1 100644
--- a/xfa/fxfa/parser/cxfa_button.cpp
+++ b/xfa/fxfa/parser/cxfa_button.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_button.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -34,7 +33,9 @@
                 XFA_Element::Button,
                 kButtonPropertyData,
                 kButtonAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Button::~CXFA_Button() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_cache.cpp b/xfa/fxfa/parser/cxfa_cache.cpp
index 16ec425..8df020c 100644
--- a/xfa/fxfa/parser/cxfa_cache.cpp
+++ b/xfa/fxfa/parser/cxfa_cache.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_cache.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -31,6 +30,8 @@
                 XFA_Element::Cache,
                 kCachePropertyData,
                 kCacheAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Cache::~CXFA_Cache() = default;
diff --git a/xfa/fxfa/parser/cxfa_calculate.cpp b/xfa/fxfa/parser/cxfa_calculate.cpp
index ad8b196..9ccc03c 100644
--- a/xfa/fxfa/parser/cxfa_calculate.cpp
+++ b/xfa/fxfa/parser/cxfa_calculate.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_calculate.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_message.h"
 #include "xfa/fxfa/parser/cxfa_script.h"
 #include "xfa/fxfa/parser/cxfa_text.h"
@@ -39,7 +38,9 @@
                 XFA_Element::Calculate,
                 kCalculatePropertyData,
                 kCalculateAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Calculate::~CXFA_Calculate() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_calendarsymbols.cpp b/xfa/fxfa/parser/cxfa_calendarsymbols.cpp
index 348d3bb..81bd196 100644
--- a/xfa/fxfa/parser/cxfa_calendarsymbols.cpp
+++ b/xfa/fxfa/parser/cxfa_calendarsymbols.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_calendarsymbols.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -35,6 +34,8 @@
                 XFA_Element::CalendarSymbols,
                 kCalendarSymbolsPropertyData,
                 kCalendarSymbolsAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_CalendarSymbols::~CXFA_CalendarSymbols() = default;
diff --git a/xfa/fxfa/parser/cxfa_caption.cpp b/xfa/fxfa/parser/cxfa_caption.cpp
index 227e417..682d40f 100644
--- a/xfa/fxfa/parser/cxfa_caption.cpp
+++ b/xfa/fxfa/parser/cxfa_caption.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_caption.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_font.h"
 #include "xfa/fxfa/parser/cxfa_margin.h"
 #include "xfa/fxfa/parser/cxfa_measurement.h"
@@ -43,7 +42,9 @@
                 XFA_Element::Caption,
                 kCaptionPropertyData,
                 kCaptionAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Caption::~CXFA_Caption() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_certificate.cpp b/xfa/fxfa/parser/cxfa_certificate.cpp
index 26f7f14..9d52cc1 100644
--- a/xfa/fxfa/parser/cxfa_certificate.cpp
+++ b/xfa/fxfa/parser/cxfa_certificate.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_certificate.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_textnode.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::Certificate,
                 {},
                 kCertificateAttributeData,
-                std::make_unique<CJX_TextNode>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_TextNode>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Certificate::~CXFA_Certificate() = default;
diff --git a/xfa/fxfa/parser/cxfa_certificates.cpp b/xfa/fxfa/parser/cxfa_certificates.cpp
index 38b2d91..65c09c9 100644
--- a/xfa/fxfa/parser/cxfa_certificates.cpp
+++ b/xfa/fxfa/parser/cxfa_certificates.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_certificates.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -38,6 +37,8 @@
                 XFA_Element::Certificates,
                 kCertificatesPropertyData,
                 kCertificatesAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Certificates::~CXFA_Certificates() = default;
diff --git a/xfa/fxfa/parser/cxfa_change.cpp b/xfa/fxfa/parser/cxfa_change.cpp
index d1e0fe1..c771c5c 100644
--- a/xfa/fxfa/parser/cxfa_change.cpp
+++ b/xfa/fxfa/parser/cxfa_change.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_change.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Change,
                 {},
                 kChangeAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Change::~CXFA_Change() = default;
diff --git a/xfa/fxfa/parser/cxfa_checkbutton.cpp b/xfa/fxfa/parser/cxfa_checkbutton.cpp
index 785d9f3..54c2ffa 100644
--- a/xfa/fxfa/parser/cxfa_checkbutton.cpp
+++ b/xfa/fxfa/parser/cxfa_checkbutton.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_checkbutton.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -40,7 +39,9 @@
                 XFA_Element::CheckButton,
                 kCheckButtonPropertyData,
                 kCheckButtonAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_CheckButton::~CXFA_CheckButton() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_choicelist.cpp b/xfa/fxfa/parser/cxfa_choicelist.cpp
index ff4921c..a089c29 100644
--- a/xfa/fxfa/parser/cxfa_choicelist.cpp
+++ b/xfa/fxfa/parser/cxfa_choicelist.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_choicelist.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -39,7 +38,9 @@
                 XFA_Element::ChoiceList,
                 kChoiceListPropertyData,
                 kChoiceListAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_ChoiceList::~CXFA_ChoiceList() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_color.cpp b/xfa/fxfa/parser/cxfa_color.cpp
index 5acbcd2..297c281 100644
--- a/xfa/fxfa/parser/cxfa_color.cpp
+++ b/xfa/fxfa/parser/cxfa_color.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_color.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -34,7 +33,9 @@
                 XFA_Element::Color,
                 kColorPropertyData,
                 kColorAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Color::~CXFA_Color() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_comb.cpp b/xfa/fxfa/parser/cxfa_comb.cpp
index 73c7b6c..f8a2f5a 100644
--- a/xfa/fxfa/parser/cxfa_comb.cpp
+++ b/xfa/fxfa/parser/cxfa_comb.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_comb.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::Comb,
                 {},
                 kCombAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Comb::~CXFA_Comb() = default;
diff --git a/xfa/fxfa/parser/cxfa_command.cpp b/xfa/fxfa/parser/cxfa_command.cpp
index aed9e43..6db322e 100644
--- a/xfa/fxfa/parser/cxfa_command.cpp
+++ b/xfa/fxfa/parser/cxfa_command.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_command.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -37,6 +36,8 @@
                 XFA_Element::Command,
                 kCommandPropertyData,
                 kCommandAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Command::~CXFA_Command() = default;
diff --git a/xfa/fxfa/parser/cxfa_common.cpp b/xfa/fxfa/parser/cxfa_common.cpp
index 8b4c334..968dbef 100644
--- a/xfa/fxfa/parser/cxfa_common.cpp
+++ b/xfa/fxfa/parser/cxfa_common.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_common.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -38,6 +37,8 @@
                 XFA_Element::Common,
                 kCommonPropertyData,
                 kCommonAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Common::~CXFA_Common() = default;
diff --git a/xfa/fxfa/parser/cxfa_compress.cpp b/xfa/fxfa/parser/cxfa_compress.cpp
index 83c30bb..a701595 100644
--- a/xfa/fxfa/parser/cxfa_compress.cpp
+++ b/xfa/fxfa/parser/cxfa_compress.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_compress.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::Compress,
                 {},
                 kCompressAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Compress::~CXFA_Compress() = default;
diff --git a/xfa/fxfa/parser/cxfa_compression.cpp b/xfa/fxfa/parser/cxfa_compression.cpp
index 238d649..078f0fc 100644
--- a/xfa/fxfa/parser/cxfa_compression.cpp
+++ b/xfa/fxfa/parser/cxfa_compression.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_compression.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -34,6 +33,8 @@
                 XFA_Element::Compression,
                 kCompressionPropertyData,
                 kCompressionAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Compression::~CXFA_Compression() = default;
diff --git a/xfa/fxfa/parser/cxfa_compresslogicalstructure.cpp b/xfa/fxfa/parser/cxfa_compresslogicalstructure.cpp
index 5e54470..5ba45de 100644
--- a/xfa/fxfa/parser/cxfa_compresslogicalstructure.cpp
+++ b/xfa/fxfa/parser/cxfa_compresslogicalstructure.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_compresslogicalstructure.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::CompressLogicalStructure,
                 {},
                 kCompressLogicalStructureAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_CompressLogicalStructure::~CXFA_CompressLogicalStructure() = default;
diff --git a/xfa/fxfa/parser/cxfa_compressobjectstream.cpp b/xfa/fxfa/parser/cxfa_compressobjectstream.cpp
index eb1ba7f..dbfee54 100644
--- a/xfa/fxfa/parser/cxfa_compressobjectstream.cpp
+++ b/xfa/fxfa/parser/cxfa_compressobjectstream.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_compressobjectstream.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::CompressObjectStream,
                 {},
                 kCompressObjectStreamAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_CompressObjectStream::~CXFA_CompressObjectStream() = default;
diff --git a/xfa/fxfa/parser/cxfa_config.cpp b/xfa/fxfa/parser/cxfa_config.cpp
index 67930e6..55abbfd 100644
--- a/xfa/fxfa/parser/cxfa_config.cpp
+++ b/xfa/fxfa/parser/cxfa_config.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_config.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -33,6 +32,8 @@
                 XFA_Element::Config,
                 kConfigPropertyData,
                 kConfigAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Config::~CXFA_Config() = default;
diff --git a/xfa/fxfa/parser/cxfa_conformance.cpp b/xfa/fxfa/parser/cxfa_conformance.cpp
index 4c7a522..6ead27d 100644
--- a/xfa/fxfa/parser/cxfa_conformance.cpp
+++ b/xfa/fxfa/parser/cxfa_conformance.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_conformance.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Conformance,
                 {},
                 kConformanceAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Conformance::~CXFA_Conformance() = default;
diff --git a/xfa/fxfa/parser/cxfa_connect.cpp b/xfa/fxfa/parser/cxfa_connect.cpp
index 5c2b3d2..f28eb35 100644
--- a/xfa/fxfa/parser/cxfa_connect.cpp
+++ b/xfa/fxfa/parser/cxfa_connect.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_connect.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -43,6 +42,8 @@
                 XFA_Element::Connect,
                 kConnectPropertyData,
                 kConnectAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Connect::~CXFA_Connect() = default;
diff --git a/xfa/fxfa/parser/cxfa_connectionset.cpp b/xfa/fxfa/parser/cxfa_connectionset.cpp
index 102df26..8ddbaa2 100644
--- a/xfa/fxfa/parser/cxfa_connectionset.cpp
+++ b/xfa/fxfa/parser/cxfa_connectionset.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_connectionset.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_model.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 CXFA_ConnectionSet::CXFA_ConnectionSet(CXFA_Document* doc,
                                        XFA_PacketType packet)
@@ -19,6 +18,8 @@
                 XFA_Element::ConnectionSet,
                 {},
                 {},
-                std::make_unique<CJX_Model>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Model>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_ConnectionSet::~CXFA_ConnectionSet() = default;
diff --git a/xfa/fxfa/parser/cxfa_connectstring.cpp b/xfa/fxfa/parser/cxfa_connectstring.cpp
index ff5fc65..5915b5a 100644
--- a/xfa/fxfa/parser/cxfa_connectstring.cpp
+++ b/xfa/fxfa/parser/cxfa_connectstring.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_connectstring.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_textnode.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -30,6 +29,8 @@
                 XFA_Element::ConnectString,
                 {},
                 kConnectStringAttributeData,
-                std::make_unique<CJX_TextNode>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_TextNode>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_ConnectString::~CXFA_ConnectString() = default;
diff --git a/xfa/fxfa/parser/cxfa_contentarea.cpp b/xfa/fxfa/parser/cxfa_contentarea.cpp
index e5b3f6a..43e01fd 100644
--- a/xfa/fxfa/parser/cxfa_contentarea.cpp
+++ b/xfa/fxfa/parser/cxfa_contentarea.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_contentarea.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_container.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -39,6 +38,8 @@
                 XFA_Element::ContentArea,
                 kContentAreaPropertyData,
                 kContentAreaAttributeData,
-                std::make_unique<CJX_Container>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Container>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_ContentArea::~CXFA_ContentArea() = default;
diff --git a/xfa/fxfa/parser/cxfa_contentcopy.cpp b/xfa/fxfa/parser/cxfa_contentcopy.cpp
index 5d09ebb..2cad8d1 100644
--- a/xfa/fxfa/parser/cxfa_contentcopy.cpp
+++ b/xfa/fxfa/parser/cxfa_contentcopy.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_contentcopy.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::ContentCopy,
                 {},
                 kContentCopyAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_ContentCopy::~CXFA_ContentCopy() = default;
diff --git a/xfa/fxfa/parser/cxfa_copies.cpp b/xfa/fxfa/parser/cxfa_copies.cpp
index 167b2e5..71e5747 100644
--- a/xfa/fxfa/parser/cxfa_copies.cpp
+++ b/xfa/fxfa/parser/cxfa_copies.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_copies.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Copies,
                 {},
                 kCopiesAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Copies::~CXFA_Copies() = default;
diff --git a/xfa/fxfa/parser/cxfa_corner.cpp b/xfa/fxfa/parser/cxfa_corner.cpp
index 0459df8..872bad1 100644
--- a/xfa/fxfa/parser/cxfa_corner.cpp
+++ b/xfa/fxfa/parser/cxfa_corner.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_corner.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -42,6 +41,8 @@
                   XFA_Element::Corner,
                   kCornerPropertyData,
                   kCornerAttributeData,
-                  std::make_unique<CJX_Node>(this)) {}
+                  cppgc::MakeGarbageCollected<CJX_Node>(
+                      doc->GetHeap()->GetAllocationHandle(),
+                      this)) {}
 
 CXFA_Corner::~CXFA_Corner() = default;
diff --git a/xfa/fxfa/parser/cxfa_creator.cpp b/xfa/fxfa/parser/cxfa_creator.cpp
index 0f38f9e..fd998aa 100644
--- a/xfa/fxfa/parser/cxfa_creator.cpp
+++ b/xfa/fxfa/parser/cxfa_creator.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_creator.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Creator,
                 {},
                 kCreatorAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Creator::~CXFA_Creator() = default;
diff --git a/xfa/fxfa/parser/cxfa_currencysymbol.cpp b/xfa/fxfa/parser/cxfa_currencysymbol.cpp
index 81f6422..c151c21 100644
--- a/xfa/fxfa/parser/cxfa_currencysymbol.cpp
+++ b/xfa/fxfa/parser/cxfa_currencysymbol.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_currencysymbol.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::CurrencySymbol,
                 {},
                 kCurrencySymbolAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_CurrencySymbol::~CXFA_CurrencySymbol() = default;
diff --git a/xfa/fxfa/parser/cxfa_currencysymbols.cpp b/xfa/fxfa/parser/cxfa_currencysymbols.cpp
index 4198e02..f066a7c 100644
--- a/xfa/fxfa/parser/cxfa_currencysymbols.cpp
+++ b/xfa/fxfa/parser/cxfa_currencysymbols.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_currencysymbols.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::CurrencySymbols,
                 kCurrencySymbolsPropertyData,
                 {},
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_CurrencySymbols::~CXFA_CurrencySymbols() = default;
diff --git a/xfa/fxfa/parser/cxfa_currentpage.cpp b/xfa/fxfa/parser/cxfa_currentpage.cpp
index e673b48..5880f78 100644
--- a/xfa/fxfa/parser/cxfa_currentpage.cpp
+++ b/xfa/fxfa/parser/cxfa_currentpage.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_currentpage.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::CurrentPage,
                 {},
                 kCurrentPageAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_CurrentPage::~CXFA_CurrentPage() = default;
diff --git a/xfa/fxfa/parser/cxfa_data.cpp b/xfa/fxfa/parser/cxfa_data.cpp
index 463efe1..9823314 100644
--- a/xfa/fxfa/parser/cxfa_data.cpp
+++ b/xfa/fxfa/parser/cxfa_data.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_data.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -35,6 +34,8 @@
                 XFA_Element::Data,
                 kDataPropertyData,
                 kDataAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Data::~CXFA_Data() = default;
diff --git a/xfa/fxfa/parser/cxfa_datagroup.cpp b/xfa/fxfa/parser/cxfa_datagroup.cpp
index 67caf00..7b632f8 100644
--- a/xfa/fxfa/parser/cxfa_datagroup.cpp
+++ b/xfa/fxfa/parser/cxfa_datagroup.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_datagroup.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -26,6 +25,8 @@
                 XFA_Element::DataGroup,
                 {},
                 kDataGroupAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_DataGroup::~CXFA_DataGroup() = default;
diff --git a/xfa/fxfa/parser/cxfa_datamodel.cpp b/xfa/fxfa/parser/cxfa_datamodel.cpp
index 8165458..63bda52 100644
--- a/xfa/fxfa/parser/cxfa_datamodel.cpp
+++ b/xfa/fxfa/parser/cxfa_datamodel.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_datamodel.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_model.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 CXFA_DataModel::CXFA_DataModel(CXFA_Document* doc, XFA_PacketType packet)
     : CXFA_Node(doc,
@@ -18,6 +17,8 @@
                 XFA_Element::DataModel,
                 {},
                 {},
-                std::make_unique<CJX_Model>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Model>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_DataModel::~CXFA_DataModel() = default;
diff --git a/xfa/fxfa/parser/cxfa_datavalue.cpp b/xfa/fxfa/parser/cxfa_datavalue.cpp
index 4c984be..f5c9c82 100644
--- a/xfa/fxfa/parser/cxfa_datavalue.cpp
+++ b/xfa/fxfa/parser/cxfa_datavalue.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_datavalue.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -31,6 +30,8 @@
                 XFA_Element::DataValue,
                 {},
                 kDataValueAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_DataValue::~CXFA_DataValue() = default;
diff --git a/xfa/fxfa/parser/cxfa_date.cpp b/xfa/fxfa/parser/cxfa_date.cpp
index 857c5d1..8c0e65d 100644
--- a/xfa/fxfa/parser/cxfa_date.cpp
+++ b/xfa/fxfa/parser/cxfa_date.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_date.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::Date,
                 {},
                 kDateAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Date::~CXFA_Date() = default;
diff --git a/xfa/fxfa/parser/cxfa_datepattern.cpp b/xfa/fxfa/parser/cxfa_datepattern.cpp
index 8b97787..65e5f87 100644
--- a/xfa/fxfa/parser/cxfa_datepattern.cpp
+++ b/xfa/fxfa/parser/cxfa_datepattern.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_datepattern.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::DatePattern,
                 {},
                 kDatePatternAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_DatePattern::~CXFA_DatePattern() = default;
diff --git a/xfa/fxfa/parser/cxfa_datepatterns.cpp b/xfa/fxfa/parser/cxfa_datepatterns.cpp
index f0c5a77..ab9548c 100644
--- a/xfa/fxfa/parser/cxfa_datepatterns.cpp
+++ b/xfa/fxfa/parser/cxfa_datepatterns.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_datepatterns.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -26,6 +25,8 @@
                 XFA_Element::DatePatterns,
                 kDatePatternsPropertyData,
                 {},
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_DatePatterns::~CXFA_DatePatterns() = default;
diff --git a/xfa/fxfa/parser/cxfa_datetime.cpp b/xfa/fxfa/parser/cxfa_datetime.cpp
index 193d66f..de09ddb 100644
--- a/xfa/fxfa/parser/cxfa_datetime.cpp
+++ b/xfa/fxfa/parser/cxfa_datetime.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_datetime.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::DateTime,
                 {},
                 kDateTimeAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_DateTime::~CXFA_DateTime() = default;
diff --git a/xfa/fxfa/parser/cxfa_datetimeedit.cpp b/xfa/fxfa/parser/cxfa_datetimeedit.cpp
index 026105d..43a46aa 100644
--- a/xfa/fxfa/parser/cxfa_datetimeedit.cpp
+++ b/xfa/fxfa/parser/cxfa_datetimeedit.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_datetimeedit.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -39,7 +38,9 @@
                 XFA_Element::DateTimeEdit,
                 kDateTimeEditPropertyData,
                 kDateTimeEditAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_DateTimeEdit::~CXFA_DateTimeEdit() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_datetimesymbols.cpp b/xfa/fxfa/parser/cxfa_datetimesymbols.cpp
index b1e25ce..2a65655 100644
--- a/xfa/fxfa/parser/cxfa_datetimesymbols.cpp
+++ b/xfa/fxfa/parser/cxfa_datetimesymbols.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_datetimesymbols.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 CXFA_DateTimeSymbols::CXFA_DateTimeSymbols(CXFA_Document* doc,
                                            XFA_PacketType packet)
@@ -19,6 +18,8 @@
                 XFA_Element::DateTimeSymbols,
                 {},
                 {},
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_DateTimeSymbols::~CXFA_DateTimeSymbols() = default;
diff --git a/xfa/fxfa/parser/cxfa_day.cpp b/xfa/fxfa/parser/cxfa_day.cpp
index 5f17763..c8d363c 100644
--- a/xfa/fxfa/parser/cxfa_day.cpp
+++ b/xfa/fxfa/parser/cxfa_day.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_day.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 CXFA_Day::CXFA_Day(CXFA_Document* doc, XFA_PacketType packet)
     : CXFA_Node(doc,
@@ -18,6 +17,8 @@
                 XFA_Element::Day,
                 {},
                 {},
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Day::~CXFA_Day() = default;
diff --git a/xfa/fxfa/parser/cxfa_daynames.cpp b/xfa/fxfa/parser/cxfa_daynames.cpp
index 5321f3f..609f20a 100644
--- a/xfa/fxfa/parser/cxfa_daynames.cpp
+++ b/xfa/fxfa/parser/cxfa_daynames.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_daynames.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -30,6 +29,8 @@
                 XFA_Element::DayNames,
                 kDayNamesPropertyData,
                 kDayNamesAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_DayNames::~CXFA_DayNames() = default;
diff --git a/xfa/fxfa/parser/cxfa_debug.cpp b/xfa/fxfa/parser/cxfa_debug.cpp
index 3381d65..6bcc393 100644
--- a/xfa/fxfa/parser/cxfa_debug.cpp
+++ b/xfa/fxfa/parser/cxfa_debug.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_debug.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -31,6 +30,8 @@
                 XFA_Element::Debug,
                 kDebugPropertyData,
                 kDebugAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Debug::~CXFA_Debug() = default;
diff --git a/xfa/fxfa/parser/cxfa_decimal.cpp b/xfa/fxfa/parser/cxfa_decimal.cpp
index 69a0ec8..b150821 100644
--- a/xfa/fxfa/parser/cxfa_decimal.cpp
+++ b/xfa/fxfa/parser/cxfa_decimal.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_decimal.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_object.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -31,6 +30,8 @@
                 XFA_Element::Decimal,
                 {},
                 kDecimalAttributeData,
-                std::make_unique<CJX_Object>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Object>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Decimal::~CXFA_Decimal() = default;
diff --git a/xfa/fxfa/parser/cxfa_defaulttypeface.cpp b/xfa/fxfa/parser/cxfa_defaulttypeface.cpp
index 23eee09..2ed9fec 100644
--- a/xfa/fxfa/parser/cxfa_defaulttypeface.cpp
+++ b/xfa/fxfa/parser/cxfa_defaulttypeface.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_defaulttypeface.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -30,6 +29,8 @@
                 XFA_Element::DefaultTypeface,
                 {},
                 kDefaultTypefaceAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_DefaultTypeface::~CXFA_DefaultTypeface() = default;
diff --git a/xfa/fxfa/parser/cxfa_defaultui.cpp b/xfa/fxfa/parser/cxfa_defaultui.cpp
index f0dbf02..d44844f 100644
--- a/xfa/fxfa/parser/cxfa_defaultui.cpp
+++ b/xfa/fxfa/parser/cxfa_defaultui.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_defaultui.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -32,7 +31,9 @@
                 XFA_Element::DefaultUi,
                 kDefaultUiPropertyData,
                 kDefaultUiAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_DefaultUi::~CXFA_DefaultUi() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_delete.cpp b/xfa/fxfa/parser/cxfa_delete.cpp
index 6647606..612c580 100644
--- a/xfa/fxfa/parser/cxfa_delete.cpp
+++ b/xfa/fxfa/parser/cxfa_delete.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_delete.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_textnode.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::Delete,
                 {},
                 kDeleteAttributeData,
-                std::make_unique<CJX_TextNode>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_TextNode>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Delete::~CXFA_Delete() = default;
diff --git a/xfa/fxfa/parser/cxfa_delta.cpp b/xfa/fxfa/parser/cxfa_delta.cpp
index bbb8bfb..0aaa04f 100644
--- a/xfa/fxfa/parser/cxfa_delta.cpp
+++ b/xfa/fxfa/parser/cxfa_delta.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_delta.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_delta.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 CXFA_Delta::CXFA_Delta(CXFA_Document* doc, XFA_PacketType packet)
     : CXFA_Node(doc,
@@ -18,6 +17,8 @@
                 XFA_Element::Delta,
                 {},
                 {},
-                std::make_unique<CJX_Delta>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Delta>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Delta::~CXFA_Delta() = default;
diff --git a/xfa/fxfa/parser/cxfa_desc.cpp b/xfa/fxfa/parser/cxfa_desc.cpp
index 043fdd1..eb2c8bb 100644
--- a/xfa/fxfa/parser/cxfa_desc.cpp
+++ b/xfa/fxfa/parser/cxfa_desc.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_desc.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_desc.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -36,6 +35,8 @@
                 XFA_Element::Desc,
                 kDescPropertyData,
                 kDescAttributeData,
-                std::make_unique<CJX_Desc>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Desc>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Desc::~CXFA_Desc() = default;
diff --git a/xfa/fxfa/parser/cxfa_destination.cpp b/xfa/fxfa/parser/cxfa_destination.cpp
index 982896e..fa66d48 100644
--- a/xfa/fxfa/parser/cxfa_destination.cpp
+++ b/xfa/fxfa/parser/cxfa_destination.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_destination.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Destination,
                 {},
                 kDestinationAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Destination::~CXFA_Destination() = default;
diff --git a/xfa/fxfa/parser/cxfa_digestmethod.cpp b/xfa/fxfa/parser/cxfa_digestmethod.cpp
index 9df7c5c..988c4f0 100644
--- a/xfa/fxfa/parser/cxfa_digestmethod.cpp
+++ b/xfa/fxfa/parser/cxfa_digestmethod.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_digestmethod.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::DigestMethod,
                 {},
                 kDigestMethodAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_DigestMethod::~CXFA_DigestMethod() = default;
diff --git a/xfa/fxfa/parser/cxfa_digestmethods.cpp b/xfa/fxfa/parser/cxfa_digestmethods.cpp
index 0987ea4..5014524 100644
--- a/xfa/fxfa/parser/cxfa_digestmethods.cpp
+++ b/xfa/fxfa/parser/cxfa_digestmethods.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_digestmethods.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -31,6 +30,8 @@
                 XFA_Element::DigestMethods,
                 {},
                 kDigestMethodsAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_DigestMethods::~CXFA_DigestMethods() = default;
diff --git a/xfa/fxfa/parser/cxfa_documentassembly.cpp b/xfa/fxfa/parser/cxfa_documentassembly.cpp
index 31238a6..84aff9d 100644
--- a/xfa/fxfa/parser/cxfa_documentassembly.cpp
+++ b/xfa/fxfa/parser/cxfa_documentassembly.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_documentassembly.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::DocumentAssembly,
                 {},
                 kDocumentAssemblyAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_DocumentAssembly::~CXFA_DocumentAssembly() = default;
diff --git a/xfa/fxfa/parser/cxfa_draw.cpp b/xfa/fxfa/parser/cxfa_draw.cpp
index 0f56e47..593778c 100644
--- a/xfa/fxfa/parser/cxfa_draw.cpp
+++ b/xfa/fxfa/parser/cxfa_draw.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_draw.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_draw.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -58,6 +57,8 @@
                 XFA_Element::Draw,
                 kDrawPropertyData,
                 kDrawAttributeData,
-                std::make_unique<CJX_Draw>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Draw>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Draw::~CXFA_Draw() = default;
diff --git a/xfa/fxfa/parser/cxfa_driver.cpp b/xfa/fxfa/parser/cxfa_driver.cpp
index fb9a28d..c8600e2 100644
--- a/xfa/fxfa/parser/cxfa_driver.cpp
+++ b/xfa/fxfa/parser/cxfa_driver.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_driver.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -33,6 +32,8 @@
                 XFA_Element::Driver,
                 kDriverPropertyData,
                 kDriverAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Driver::~CXFA_Driver() = default;
diff --git a/xfa/fxfa/parser/cxfa_dsigdata.cpp b/xfa/fxfa/parser/cxfa_dsigdata.cpp
index e746c72..e91018f 100644
--- a/xfa/fxfa/parser/cxfa_dsigdata.cpp
+++ b/xfa/fxfa/parser/cxfa_dsigdata.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_dsigdata.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -26,6 +25,8 @@
                 XFA_Element::DSigData,
                 {},
                 kDSigDataAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_DSigData::~CXFA_DSigData() = default;
diff --git a/xfa/fxfa/parser/cxfa_duplexoption.cpp b/xfa/fxfa/parser/cxfa_duplexoption.cpp
index 49c7239..09a5b17 100644
--- a/xfa/fxfa/parser/cxfa_duplexoption.cpp
+++ b/xfa/fxfa/parser/cxfa_duplexoption.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_duplexoption.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::DuplexOption,
                 {},
                 kDuplexOptionAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_DuplexOption::~CXFA_DuplexOption() = default;
diff --git a/xfa/fxfa/parser/cxfa_dynamicrender.cpp b/xfa/fxfa/parser/cxfa_dynamicrender.cpp
index ef7d274..25ad261 100644
--- a/xfa/fxfa/parser/cxfa_dynamicrender.cpp
+++ b/xfa/fxfa/parser/cxfa_dynamicrender.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_dynamicrender.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::DynamicRender,
                 {},
                 kDynamicRenderAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_DynamicRender::~CXFA_DynamicRender() = default;
diff --git a/xfa/fxfa/parser/cxfa_edge.cpp b/xfa/fxfa/parser/cxfa_edge.cpp
index 1c4fd06..bc8f435 100644
--- a/xfa/fxfa/parser/cxfa_edge.cpp
+++ b/xfa/fxfa/parser/cxfa_edge.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_edge.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -40,6 +39,8 @@
                   XFA_Element::Edge,
                   kEdgePropertyData,
                   kEdgeAttributeData,
-                  std::make_unique<CJX_Node>(this)) {}
+                  cppgc::MakeGarbageCollected<CJX_Node>(
+                      doc->GetHeap()->GetAllocationHandle(),
+                      this)) {}
 
 CXFA_Edge::~CXFA_Edge() = default;
diff --git a/xfa/fxfa/parser/cxfa_effectiveinputpolicy.cpp b/xfa/fxfa/parser/cxfa_effectiveinputpolicy.cpp
index b46bc14..e584122 100644
--- a/xfa/fxfa/parser/cxfa_effectiveinputpolicy.cpp
+++ b/xfa/fxfa/parser/cxfa_effectiveinputpolicy.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_effectiveinputpolicy.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -30,6 +29,8 @@
                 XFA_Element::EffectiveInputPolicy,
                 {},
                 kEffectiveInputPolicyAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_EffectiveInputPolicy::~CXFA_EffectiveInputPolicy() = default;
diff --git a/xfa/fxfa/parser/cxfa_effectiveoutputpolicy.cpp b/xfa/fxfa/parser/cxfa_effectiveoutputpolicy.cpp
index 15acdea..bafa7a8 100644
--- a/xfa/fxfa/parser/cxfa_effectiveoutputpolicy.cpp
+++ b/xfa/fxfa/parser/cxfa_effectiveoutputpolicy.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_effectiveoutputpolicy.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -30,6 +29,8 @@
                 XFA_Element::EffectiveOutputPolicy,
                 {},
                 kEffectiveOutputPolicyAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_EffectiveOutputPolicy::~CXFA_EffectiveOutputPolicy() = default;
diff --git a/xfa/fxfa/parser/cxfa_embed.cpp b/xfa/fxfa/parser/cxfa_embed.cpp
index edc7dab..b6e51bc 100644
--- a/xfa/fxfa/parser/cxfa_embed.cpp
+++ b/xfa/fxfa/parser/cxfa_embed.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_embed.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Embed,
                 {},
                 kEmbedAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Embed::~CXFA_Embed() = default;
diff --git a/xfa/fxfa/parser/cxfa_encoding.cpp b/xfa/fxfa/parser/cxfa_encoding.cpp
index 905bcac..541cf56 100644
--- a/xfa/fxfa/parser/cxfa_encoding.cpp
+++ b/xfa/fxfa/parser/cxfa_encoding.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_encoding.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::Encoding,
                 {},
                 kEncodingAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Encoding::~CXFA_Encoding() = default;
diff --git a/xfa/fxfa/parser/cxfa_encodings.cpp b/xfa/fxfa/parser/cxfa_encodings.cpp
index c0de859..2424d71 100644
--- a/xfa/fxfa/parser/cxfa_encodings.cpp
+++ b/xfa/fxfa/parser/cxfa_encodings.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_encodings.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -30,6 +29,8 @@
                 XFA_Element::Encodings,
                 {},
                 kEncodingsAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Encodings::~CXFA_Encodings() = default;
diff --git a/xfa/fxfa/parser/cxfa_encrypt.cpp b/xfa/fxfa/parser/cxfa_encrypt.cpp
index e82cc70..14e1ca6 100644
--- a/xfa/fxfa/parser/cxfa_encrypt.cpp
+++ b/xfa/fxfa/parser/cxfa_encrypt.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_encrypt.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_encrypt.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -35,6 +34,8 @@
           XFA_Element::Encrypt,
           kEncryptPropertyData,
           kEncryptAttributeData,
-          std::make_unique<CJX_Encrypt>(this)) {}
+          cppgc::MakeGarbageCollected<CJX_Encrypt>(
+              doc->GetHeap()->GetAllocationHandle(),
+              this)) {}
 
 CXFA_Encrypt::~CXFA_Encrypt() = default;
diff --git a/xfa/fxfa/parser/cxfa_encryption.cpp b/xfa/fxfa/parser/cxfa_encryption.cpp
index a9f1b50..4955c57 100644
--- a/xfa/fxfa/parser/cxfa_encryption.cpp
+++ b/xfa/fxfa/parser/cxfa_encryption.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_encryption.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -33,6 +32,8 @@
                 XFA_Element::Encryption,
                 kEncryptionPropertyData,
                 kEncryptionAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Encryption::~CXFA_Encryption() = default;
diff --git a/xfa/fxfa/parser/cxfa_encryptionlevel.cpp b/xfa/fxfa/parser/cxfa_encryptionlevel.cpp
index 49ae125..f0dc56b 100644
--- a/xfa/fxfa/parser/cxfa_encryptionlevel.cpp
+++ b/xfa/fxfa/parser/cxfa_encryptionlevel.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_encryptionlevel.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::EncryptionLevel,
                 {},
                 kEncryptionLevelAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_EncryptionLevel::~CXFA_EncryptionLevel() = default;
diff --git a/xfa/fxfa/parser/cxfa_encryptionmethod.cpp b/xfa/fxfa/parser/cxfa_encryptionmethod.cpp
index 7eaedef..a2010b1 100644
--- a/xfa/fxfa/parser/cxfa_encryptionmethod.cpp
+++ b/xfa/fxfa/parser/cxfa_encryptionmethod.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_encryptionmethod.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::EncryptionMethod,
                 {},
                 kEncryptionMethodAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_EncryptionMethod::~CXFA_EncryptionMethod() = default;
diff --git a/xfa/fxfa/parser/cxfa_encryptionmethods.cpp b/xfa/fxfa/parser/cxfa_encryptionmethods.cpp
index 0ce0852..1861efa 100644
--- a/xfa/fxfa/parser/cxfa_encryptionmethods.cpp
+++ b/xfa/fxfa/parser/cxfa_encryptionmethods.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_encryptionmethods.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -31,6 +30,8 @@
                 XFA_Element::EncryptionMethods,
                 {},
                 kEncryptionMethodsAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_EncryptionMethods::~CXFA_EncryptionMethods() = default;
diff --git a/xfa/fxfa/parser/cxfa_enforce.cpp b/xfa/fxfa/parser/cxfa_enforce.cpp
index c997256..4390b04 100644
--- a/xfa/fxfa/parser/cxfa_enforce.cpp
+++ b/xfa/fxfa/parser/cxfa_enforce.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_enforce.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Enforce,
                 {},
                 kEnforceAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Enforce::~CXFA_Enforce() = default;
diff --git a/xfa/fxfa/parser/cxfa_equate.cpp b/xfa/fxfa/parser/cxfa_equate.cpp
index 067decd..f71e776 100644
--- a/xfa/fxfa/parser/cxfa_equate.cpp
+++ b/xfa/fxfa/parser/cxfa_equate.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_equate.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -30,6 +29,8 @@
                 XFA_Element::Equate,
                 {},
                 kEquateAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Equate::~CXFA_Equate() = default;
diff --git a/xfa/fxfa/parser/cxfa_equaterange.cpp b/xfa/fxfa/parser/cxfa_equaterange.cpp
index 5c38253..1761876 100644
--- a/xfa/fxfa/parser/cxfa_equaterange.cpp
+++ b/xfa/fxfa/parser/cxfa_equaterange.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_equaterange.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -30,6 +29,8 @@
                 XFA_Element::EquateRange,
                 {},
                 kEquateRangeAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_EquateRange::~CXFA_EquateRange() = default;
diff --git a/xfa/fxfa/parser/cxfa_era.cpp b/xfa/fxfa/parser/cxfa_era.cpp
index db14202..8561197 100644
--- a/xfa/fxfa/parser/cxfa_era.cpp
+++ b/xfa/fxfa/parser/cxfa_era.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_era.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 CXFA_Era::CXFA_Era(CXFA_Document* doc, XFA_PacketType packet)
     : CXFA_Node(doc,
@@ -18,6 +17,8 @@
                 XFA_Element::Era,
                 {},
                 {},
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Era::~CXFA_Era() = default;
diff --git a/xfa/fxfa/parser/cxfa_eranames.cpp b/xfa/fxfa/parser/cxfa_eranames.cpp
index c68bbde..fc369bb 100644
--- a/xfa/fxfa/parser/cxfa_eranames.cpp
+++ b/xfa/fxfa/parser/cxfa_eranames.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_eranames.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -26,6 +25,8 @@
                 XFA_Element::EraNames,
                 kEraNamesPropertyData,
                 {},
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_EraNames::~CXFA_EraNames() = default;
diff --git a/xfa/fxfa/parser/cxfa_event.cpp b/xfa/fxfa/parser/cxfa_event.cpp
index 0f719af..8b80ef3 100644
--- a/xfa/fxfa/parser/cxfa_event.cpp
+++ b/xfa/fxfa/parser/cxfa_event.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_event.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_script.h"
 #include "xfa/fxfa/parser/cxfa_submit.h"
 
@@ -44,7 +43,9 @@
                 XFA_Element::Event,
                 kEventPropertyData,
                 kEventAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Event::~CXFA_Event() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_exclgroup.cpp b/xfa/fxfa/parser/cxfa_exclgroup.cpp
index 4dc6f55..f6c267b 100644
--- a/xfa/fxfa/parser/cxfa_exclgroup.cpp
+++ b/xfa/fxfa/parser/cxfa_exclgroup.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_exclgroup.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_exclgroup.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -61,6 +60,8 @@
                 XFA_Element::ExclGroup,
                 kExclGroupPropertyData,
                 kExclGroupAttributeData,
-                std::make_unique<CJX_ExclGroup>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_ExclGroup>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_ExclGroup::~CXFA_ExclGroup() = default;
diff --git a/xfa/fxfa/parser/cxfa_exclude.cpp b/xfa/fxfa/parser/cxfa_exclude.cpp
index 626bc0c..e904e72 100644
--- a/xfa/fxfa/parser/cxfa_exclude.cpp
+++ b/xfa/fxfa/parser/cxfa_exclude.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_exclude.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Exclude,
                 {},
                 kExcludeAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Exclude::~CXFA_Exclude() = default;
diff --git a/xfa/fxfa/parser/cxfa_excludens.cpp b/xfa/fxfa/parser/cxfa_excludens.cpp
index 3cd714d..3f74aba 100644
--- a/xfa/fxfa/parser/cxfa_excludens.cpp
+++ b/xfa/fxfa/parser/cxfa_excludens.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_excludens.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::ExcludeNS,
                 {},
                 kExcludeNSAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_ExcludeNS::~CXFA_ExcludeNS() = default;
diff --git a/xfa/fxfa/parser/cxfa_exdata.cpp b/xfa/fxfa/parser/cxfa_exdata.cpp
index 0927ae8..95d66e2 100644
--- a/xfa/fxfa/parser/cxfa_exdata.cpp
+++ b/xfa/fxfa/parser/cxfa_exdata.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_exdata.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_object.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -35,7 +34,9 @@
                 XFA_Element::ExData,
                 {},
                 kExDataAttributeData,
-                std::make_unique<CJX_Object>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Object>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_ExData::~CXFA_ExData() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_execute.cpp b/xfa/fxfa/parser/cxfa_execute.cpp
index 684cbf7..2b06c24 100644
--- a/xfa/fxfa/parser/cxfa_execute.cpp
+++ b/xfa/fxfa/parser/cxfa_execute.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_execute.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -33,6 +32,8 @@
                 XFA_Element::Execute,
                 {},
                 kExecuteAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Execute::~CXFA_Execute() = default;
diff --git a/xfa/fxfa/parser/cxfa_exobject.cpp b/xfa/fxfa/parser/cxfa_exobject.cpp
index 26fa48b..4510136 100644
--- a/xfa/fxfa/parser/cxfa_exobject.cpp
+++ b/xfa/fxfa/parser/cxfa_exobject.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_exobject.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -37,6 +36,8 @@
                 XFA_Element::ExObject,
                 kExObjectPropertyData,
                 kExObjectAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_ExObject::~CXFA_ExObject() = default;
diff --git a/xfa/fxfa/parser/cxfa_extras.cpp b/xfa/fxfa/parser/cxfa_extras.cpp
index 3b527cc..f047399 100644
--- a/xfa/fxfa/parser/cxfa_extras.cpp
+++ b/xfa/fxfa/parser/cxfa_extras.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_extras.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_extras.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -30,6 +29,8 @@
                 XFA_Element::Extras,
                 {},
                 kExtrasAttributeData,
-                std::make_unique<CJX_Extras>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Extras>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Extras::~CXFA_Extras() = default;
diff --git a/xfa/fxfa/parser/cxfa_field.cpp b/xfa/fxfa/parser/cxfa_field.cpp
index 46839a7..4fc5e09 100644
--- a/xfa/fxfa/parser/cxfa_field.cpp
+++ b/xfa/fxfa/parser/cxfa_field.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_field.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_field.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -64,6 +63,8 @@
                 XFA_Element::Field,
                 kFieldPropertyData,
                 kFieldAttributeData,
-                std::make_unique<CJX_Field>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Field>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Field::~CXFA_Field() = default;
diff --git a/xfa/fxfa/parser/cxfa_fill.cpp b/xfa/fxfa/parser/cxfa_fill.cpp
index ae92a66..2f9a1ff 100644
--- a/xfa/fxfa/parser/cxfa_fill.cpp
+++ b/xfa/fxfa/parser/cxfa_fill.cpp
@@ -6,10 +6,9 @@
 
 #include "xfa/fxfa/parser/cxfa_fill.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
 #include "xfa/fxfa/parser/cxfa_color.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_linear.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
 #include "xfa/fxfa/parser/cxfa_pattern.h"
@@ -47,7 +46,9 @@
                 XFA_Element::Fill,
                 kFillPropertyData,
                 kFillAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Fill::~CXFA_Fill() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_filter.cpp b/xfa/fxfa/parser/cxfa_filter.cpp
index e0f4883..975ac77 100644
--- a/xfa/fxfa/parser/cxfa_filter.cpp
+++ b/xfa/fxfa/parser/cxfa_filter.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_filter.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -39,6 +38,8 @@
                 XFA_Element::Filter,
                 kFilterPropertyData,
                 kFilterAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Filter::~CXFA_Filter() = default;
diff --git a/xfa/fxfa/parser/cxfa_fliplabel.cpp b/xfa/fxfa/parser/cxfa_fliplabel.cpp
index 9d9169a..8638bb1 100644
--- a/xfa/fxfa/parser/cxfa_fliplabel.cpp
+++ b/xfa/fxfa/parser/cxfa_fliplabel.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_fliplabel.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::FlipLabel,
                 {},
                 kFlipLabelAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_FlipLabel::~CXFA_FlipLabel() = default;
diff --git a/xfa/fxfa/parser/cxfa_float.cpp b/xfa/fxfa/parser/cxfa_float.cpp
index aa028e5..51c15a8 100644
--- a/xfa/fxfa/parser/cxfa_float.cpp
+++ b/xfa/fxfa/parser/cxfa_float.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_float.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_object.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::Float,
                 {},
                 kFloatAttributeData,
-                std::make_unique<CJX_Object>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Object>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Float::~CXFA_Float() = default;
diff --git a/xfa/fxfa/parser/cxfa_font.cpp b/xfa/fxfa/parser/cxfa_font.cpp
index c909008..91e6d4c 100644
--- a/xfa/fxfa/parser/cxfa_font.cpp
+++ b/xfa/fxfa/parser/cxfa_font.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_font.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_fill.h"
 #include "xfa/fxfa/parser/cxfa_measurement.h"
 
@@ -62,7 +61,9 @@
           XFA_Element::Font,
           kFontPropertyData,
           kFontAttributeData,
-          std::make_unique<CJX_Node>(this)) {}
+          cppgc::MakeGarbageCollected<CJX_Node>(
+              doc->GetHeap()->GetAllocationHandle(),
+              this)) {}
 
 CXFA_Font::~CXFA_Font() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_fontinfo.cpp b/xfa/fxfa/parser/cxfa_fontinfo.cpp
index 1d98633..9c34b3c 100644
--- a/xfa/fxfa/parser/cxfa_fontinfo.cpp
+++ b/xfa/fxfa/parser/cxfa_fontinfo.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_fontinfo.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -33,6 +32,8 @@
                 XFA_Element::FontInfo,
                 kFontInfoPropertyData,
                 kFontInfoAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_FontInfo::~CXFA_FontInfo() = default;
diff --git a/xfa/fxfa/parser/cxfa_form.cpp b/xfa/fxfa/parser/cxfa_form.cpp
index 50ccc5c..9a58b7b 100644
--- a/xfa/fxfa/parser/cxfa_form.cpp
+++ b/xfa/fxfa/parser/cxfa_form.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_form.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_form.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -26,6 +25,8 @@
                 XFA_Element::Form,
                 {},
                 kFormAttributeData,
-                std::make_unique<CJX_Form>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Form>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Form::~CXFA_Form() = default;
diff --git a/xfa/fxfa/parser/cxfa_format.cpp b/xfa/fxfa/parser/cxfa_format.cpp
index 62cf408..36b4168 100644
--- a/xfa/fxfa/parser/cxfa_format.cpp
+++ b/xfa/fxfa/parser/cxfa_format.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_format.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -33,6 +32,8 @@
                 XFA_Element::Format,
                 kFormatPropertyData,
                 kFormatAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Format::~CXFA_Format() = default;
diff --git a/xfa/fxfa/parser/cxfa_formfieldfilling.cpp b/xfa/fxfa/parser/cxfa_formfieldfilling.cpp
index a1df698..e7b4bdf 100644
--- a/xfa/fxfa/parser/cxfa_formfieldfilling.cpp
+++ b/xfa/fxfa/parser/cxfa_formfieldfilling.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_formfieldfilling.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::FormFieldFilling,
                 {},
                 kFormFieldFillingAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_FormFieldFilling::~CXFA_FormFieldFilling() = default;
diff --git a/xfa/fxfa/parser/cxfa_groupparent.cpp b/xfa/fxfa/parser/cxfa_groupparent.cpp
index 0f1a643..06e7bc6 100644
--- a/xfa/fxfa/parser/cxfa_groupparent.cpp
+++ b/xfa/fxfa/parser/cxfa_groupparent.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_groupparent.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::GroupParent,
                 {},
                 kGroupParentAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_GroupParent::~CXFA_GroupParent() = default;
diff --git a/xfa/fxfa/parser/cxfa_handler.cpp b/xfa/fxfa/parser/cxfa_handler.cpp
index ba37d69..8c38eee 100644
--- a/xfa/fxfa/parser/cxfa_handler.cpp
+++ b/xfa/fxfa/parser/cxfa_handler.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_handler.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_handler.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -30,6 +29,8 @@
                 XFA_Element::Handler,
                 {},
                 kHandlerAttributeData,
-                std::make_unique<CJX_Handler>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Handler>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Handler::~CXFA_Handler() = default;
diff --git a/xfa/fxfa/parser/cxfa_hyphenation.cpp b/xfa/fxfa/parser/cxfa_hyphenation.cpp
index 190cb4c..704df98 100644
--- a/xfa/fxfa/parser/cxfa_hyphenation.cpp
+++ b/xfa/fxfa/parser/cxfa_hyphenation.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_hyphenation.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -34,6 +33,8 @@
                 XFA_Element::Hyphenation,
                 {},
                 kHyphenationAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Hyphenation::~CXFA_Hyphenation() = default;
diff --git a/xfa/fxfa/parser/cxfa_ifempty.cpp b/xfa/fxfa/parser/cxfa_ifempty.cpp
index da19339..2244f69 100644
--- a/xfa/fxfa/parser/cxfa_ifempty.cpp
+++ b/xfa/fxfa/parser/cxfa_ifempty.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_ifempty.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::IfEmpty,
                 {},
                 kIfEmptyAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_IfEmpty::~CXFA_IfEmpty() = default;
diff --git a/xfa/fxfa/parser/cxfa_image.cpp b/xfa/fxfa/parser/cxfa_image.cpp
index d90f3a1..9c3e0f9 100644
--- a/xfa/fxfa/parser/cxfa_image.cpp
+++ b/xfa/fxfa/parser/cxfa_image.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_image.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -35,7 +34,9 @@
                 XFA_Element::Image,
                 {},
                 kImageAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Image::~CXFA_Image() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_imageedit.cpp b/xfa/fxfa/parser/cxfa_imageedit.cpp
index c094816..cdc2577 100644
--- a/xfa/fxfa/parser/cxfa_imageedit.cpp
+++ b/xfa/fxfa/parser/cxfa_imageedit.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_imageedit.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -36,7 +35,9 @@
                 XFA_Element::ImageEdit,
                 kImageEditPropertyData,
                 kImageEditAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_ImageEdit::~CXFA_ImageEdit() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_includexdpcontent.cpp b/xfa/fxfa/parser/cxfa_includexdpcontent.cpp
index 9f3bc70..3f22158 100644
--- a/xfa/fxfa/parser/cxfa_includexdpcontent.cpp
+++ b/xfa/fxfa/parser/cxfa_includexdpcontent.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_includexdpcontent.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::IncludeXDPContent,
                 {},
                 kIncludeXDPContentAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_IncludeXDPContent::~CXFA_IncludeXDPContent() = default;
diff --git a/xfa/fxfa/parser/cxfa_incrementalload.cpp b/xfa/fxfa/parser/cxfa_incrementalload.cpp
index 521d5d3..1ff8b18 100644
--- a/xfa/fxfa/parser/cxfa_incrementalload.cpp
+++ b/xfa/fxfa/parser/cxfa_incrementalload.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_incrementalload.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::IncrementalLoad,
                 {},
                 kIncrementalLoadAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_IncrementalLoad::~CXFA_IncrementalLoad() = default;
diff --git a/xfa/fxfa/parser/cxfa_incrementalmerge.cpp b/xfa/fxfa/parser/cxfa_incrementalmerge.cpp
index 4cb75e0..95ec7fd 100644
--- a/xfa/fxfa/parser/cxfa_incrementalmerge.cpp
+++ b/xfa/fxfa/parser/cxfa_incrementalmerge.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_incrementalmerge.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::IncrementalMerge,
                 {},
                 kIncrementalMergeAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_IncrementalMerge::~CXFA_IncrementalMerge() = default;
diff --git a/xfa/fxfa/parser/cxfa_insert.cpp b/xfa/fxfa/parser/cxfa_insert.cpp
index 42c2d6a..516d8ff 100644
--- a/xfa/fxfa/parser/cxfa_insert.cpp
+++ b/xfa/fxfa/parser/cxfa_insert.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_insert.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_textnode.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::Insert,
                 {},
                 kInsertAttributeData,
-                std::make_unique<CJX_TextNode>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_TextNode>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Insert::~CXFA_Insert() = default;
diff --git a/xfa/fxfa/parser/cxfa_instancemanager.cpp b/xfa/fxfa/parser/cxfa_instancemanager.cpp
index 0ffcf4b..921aabc 100644
--- a/xfa/fxfa/parser/cxfa_instancemanager.cpp
+++ b/xfa/fxfa/parser/cxfa_instancemanager.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_instancemanager.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_instancemanager.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -31,6 +30,8 @@
                 XFA_Element::InstanceManager,
                 kInstanceManagerPropertyData,
                 kInstanceManagerAttributeData,
-                std::make_unique<CJX_InstanceManager>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_InstanceManager>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_InstanceManager::~CXFA_InstanceManager() = default;
diff --git a/xfa/fxfa/parser/cxfa_integer.cpp b/xfa/fxfa/parser/cxfa_integer.cpp
index fdfff5f..5142ca6 100644
--- a/xfa/fxfa/parser/cxfa_integer.cpp
+++ b/xfa/fxfa/parser/cxfa_integer.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_integer.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_object.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -30,6 +29,8 @@
                 XFA_Element::Integer,
                 {},
                 kIntegerAttributeData,
-                std::make_unique<CJX_Object>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Object>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Integer::~CXFA_Integer() = default;
diff --git a/xfa/fxfa/parser/cxfa_interactive.cpp b/xfa/fxfa/parser/cxfa_interactive.cpp
index 3887c7e..4baf571 100644
--- a/xfa/fxfa/parser/cxfa_interactive.cpp
+++ b/xfa/fxfa/parser/cxfa_interactive.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_interactive.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Interactive,
                 {},
                 kInteractiveAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Interactive::~CXFA_Interactive() = default;
diff --git a/xfa/fxfa/parser/cxfa_issuers.cpp b/xfa/fxfa/parser/cxfa_issuers.cpp
index 2ff250d..a221271 100644
--- a/xfa/fxfa/parser/cxfa_issuers.cpp
+++ b/xfa/fxfa/parser/cxfa_issuers.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_issuers.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -30,6 +29,8 @@
                 XFA_Element::Issuers,
                 {},
                 kIssuersAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Issuers::~CXFA_Issuers() = default;
diff --git a/xfa/fxfa/parser/cxfa_items.cpp b/xfa/fxfa/parser/cxfa_items.cpp
index d79a2c3..56e66a7 100644
--- a/xfa/fxfa/parser/cxfa_items.cpp
+++ b/xfa/fxfa/parser/cxfa_items.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_items.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -33,6 +32,8 @@
                 XFA_Element::Items,
                 {},
                 kItemsAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Items::~CXFA_Items() = default;
diff --git a/xfa/fxfa/parser/cxfa_jog.cpp b/xfa/fxfa/parser/cxfa_jog.cpp
index 4f34d4d..6cd68f9 100644
--- a/xfa/fxfa/parser/cxfa_jog.cpp
+++ b/xfa/fxfa/parser/cxfa_jog.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_jog.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Jog,
                 {},
                 kJogAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Jog::~CXFA_Jog() = default;
diff --git a/xfa/fxfa/parser/cxfa_keep.cpp b/xfa/fxfa/parser/cxfa_keep.cpp
index f12ae74..e1a6dc4 100644
--- a/xfa/fxfa/parser/cxfa_keep.cpp
+++ b/xfa/fxfa/parser/cxfa_keep.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_keep.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -38,6 +37,8 @@
                 XFA_Element::Keep,
                 kKeepPropertyData,
                 kKeepAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Keep::~CXFA_Keep() = default;
diff --git a/xfa/fxfa/parser/cxfa_keyusage.cpp b/xfa/fxfa/parser/cxfa_keyusage.cpp
index f35f5a8..69b5d6e 100644
--- a/xfa/fxfa/parser/cxfa_keyusage.cpp
+++ b/xfa/fxfa/parser/cxfa_keyusage.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_keyusage.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -39,6 +38,8 @@
                 XFA_Element::KeyUsage,
                 {},
                 kKeyUsageAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_KeyUsage::~CXFA_KeyUsage() = default;
diff --git a/xfa/fxfa/parser/cxfa_labelprinter.cpp b/xfa/fxfa/parser/cxfa_labelprinter.cpp
index 2484c13..fa435e2 100644
--- a/xfa/fxfa/parser/cxfa_labelprinter.cpp
+++ b/xfa/fxfa/parser/cxfa_labelprinter.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_labelprinter.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -36,6 +35,8 @@
                 XFA_Element::LabelPrinter,
                 kLabelPrinterPropertyData,
                 kLabelPrinterAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_LabelPrinter::~CXFA_LabelPrinter() = default;
diff --git a/xfa/fxfa/parser/cxfa_layout.cpp b/xfa/fxfa/parser/cxfa_layout.cpp
index e80e3f0..e3af957 100644
--- a/xfa/fxfa/parser/cxfa_layout.cpp
+++ b/xfa/fxfa/parser/cxfa_layout.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_layout.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Layout,
                 {},
                 kLayoutAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Layout::~CXFA_Layout() = default;
diff --git a/xfa/fxfa/parser/cxfa_level.cpp b/xfa/fxfa/parser/cxfa_level.cpp
index 3f23fbc..205f7b0 100644
--- a/xfa/fxfa/parser/cxfa_level.cpp
+++ b/xfa/fxfa/parser/cxfa_level.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_level.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Level,
                 {},
                 kLevelAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Level::~CXFA_Level() = default;
diff --git a/xfa/fxfa/parser/cxfa_line.cpp b/xfa/fxfa/parser/cxfa_line.cpp
index d69de54..5669614 100644
--- a/xfa/fxfa/parser/cxfa_line.cpp
+++ b/xfa/fxfa/parser/cxfa_line.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_line.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_edge.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
 
@@ -38,7 +37,9 @@
                 XFA_Element::Line,
                 kLinePropertyData,
                 kLineAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Line::~CXFA_Line() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_linear.cpp b/xfa/fxfa/parser/cxfa_linear.cpp
index db5c1dd..adb4948 100644
--- a/xfa/fxfa/parser/cxfa_linear.cpp
+++ b/xfa/fxfa/parser/cxfa_linear.cpp
@@ -6,10 +6,9 @@
 
 #include "xfa/fxfa/parser/cxfa_linear.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
 #include "xfa/fxfa/parser/cxfa_color.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxgraphics/cxfa_geshading.h"
 
 namespace {
@@ -37,7 +36,9 @@
                 XFA_Element::Linear,
                 kLinearPropertyData,
                 kLinearAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Linear::~CXFA_Linear() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_linearized.cpp b/xfa/fxfa/parser/cxfa_linearized.cpp
index d0087dc..95428d8 100644
--- a/xfa/fxfa/parser/cxfa_linearized.cpp
+++ b/xfa/fxfa/parser/cxfa_linearized.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_linearized.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Linearized,
                 {},
                 kLinearizedAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Linearized::~CXFA_Linearized() = default;
diff --git a/xfa/fxfa/parser/cxfa_list.cpp b/xfa/fxfa/parser/cxfa_list.cpp
index bbbb509..fea7dcf 100644
--- a/xfa/fxfa/parser/cxfa_list.cpp
+++ b/xfa/fxfa/parser/cxfa_list.cpp
@@ -14,16 +14,13 @@
 #include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
 
-CXFA_List::CXFA_List(CXFA_Document* pDocument, std::unique_ptr<CJX_Object> obj)
-    : CXFA_List(pDocument,
-                XFA_ObjectType::List,
-                XFA_Element::List,
-                std::move(obj)) {}
+CXFA_List::CXFA_List(CXFA_Document* pDocument, CJX_Object* obj)
+    : CXFA_List(pDocument, XFA_ObjectType::List, XFA_Element::List, obj) {}
 
 CXFA_List::CXFA_List(CXFA_Document* pDocument,
                      XFA_ObjectType objectType,
                      XFA_Element eType,
-                     std::unique_ptr<CJX_Object> obj)
-    : CXFA_Object(pDocument, objectType, eType, std::move(obj)) {}
+                     CJX_Object* obj)
+    : CXFA_Object(pDocument, objectType, eType, obj) {}
 
 CXFA_List::~CXFA_List() = default;
diff --git a/xfa/fxfa/parser/cxfa_list.h b/xfa/fxfa/parser/cxfa_list.h
index 9317a34..3cf5625 100644
--- a/xfa/fxfa/parser/cxfa_list.h
+++ b/xfa/fxfa/parser/cxfa_list.h
@@ -7,7 +7,6 @@
 #ifndef XFA_FXFA_PARSER_CXFA_LIST_H_
 #define XFA_FXFA_PARSER_CXFA_LIST_H_
 
-#include <memory>
 
 #include "fxjs/gc/heap.h"
 #include "xfa/fxfa/parser/cxfa_object.h"
@@ -28,11 +27,11 @@
   virtual CXFA_Node* Item(size_t iIndex) = 0;
 
  protected:
-  CXFA_List(CXFA_Document* doc, std::unique_ptr<CJX_Object> js_obj);
+  CXFA_List(CXFA_Document* doc, CJX_Object* js_obj);
   CXFA_List(CXFA_Document* pDocument,
             XFA_ObjectType objectType,
             XFA_Element eType,
-            std::unique_ptr<CJX_Object> obj);
+            CJX_Object* obj);
 };
 
 #endif  // XFA_FXFA_PARSER_CXFA_LIST_H_
diff --git a/xfa/fxfa/parser/cxfa_locale.cpp b/xfa/fxfa/parser/cxfa_locale.cpp
index 0196027..bf13078 100644
--- a/xfa/fxfa/parser/cxfa_locale.cpp
+++ b/xfa/fxfa/parser/cxfa_locale.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_locale.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -35,6 +34,8 @@
                 XFA_Element::Locale,
                 kLocalePropertyData,
                 kLocaleAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Locale::~CXFA_Locale() = default;
diff --git a/xfa/fxfa/parser/cxfa_localeset.cpp b/xfa/fxfa/parser/cxfa_localeset.cpp
index 5db4626..d86e6cf 100644
--- a/xfa/fxfa/parser/cxfa_localeset.cpp
+++ b/xfa/fxfa/parser/cxfa_localeset.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_localeset.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::LocaleSet,
                 {},
                 kLocaleSetAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_LocaleSet::~CXFA_LocaleSet() = default;
diff --git a/xfa/fxfa/parser/cxfa_lockdocument.cpp b/xfa/fxfa/parser/cxfa_lockdocument.cpp
index 63cf55f..d9134f7 100644
--- a/xfa/fxfa/parser/cxfa_lockdocument.cpp
+++ b/xfa/fxfa/parser/cxfa_lockdocument.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_lockdocument.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -30,6 +29,8 @@
                 XFA_Element::LockDocument,
                 {},
                 kLockDocumentAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_LockDocument::~CXFA_LockDocument() = default;
diff --git a/xfa/fxfa/parser/cxfa_log.cpp b/xfa/fxfa/parser/cxfa_log.cpp
index efdcd9e..3caab1b 100644
--- a/xfa/fxfa/parser/cxfa_log.cpp
+++ b/xfa/fxfa/parser/cxfa_log.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_log.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -34,6 +33,8 @@
                 XFA_Element::Log,
                 kLogPropertyData,
                 kLogAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Log::~CXFA_Log() = default;
diff --git a/xfa/fxfa/parser/cxfa_manifest.cpp b/xfa/fxfa/parser/cxfa_manifest.cpp
index 9e98f3a..6ec8e3d 100644
--- a/xfa/fxfa/parser/cxfa_manifest.cpp
+++ b/xfa/fxfa/parser/cxfa_manifest.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_manifest.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_manifest.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -35,6 +34,8 @@
                 XFA_Element::Manifest,
                 kManifestPropertyData,
                 kManifestAttributeData,
-                std::make_unique<CJX_Manifest>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Manifest>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Manifest::~CXFA_Manifest() = default;
diff --git a/xfa/fxfa/parser/cxfa_map.cpp b/xfa/fxfa/parser/cxfa_map.cpp
index f41b320..eef1f55 100644
--- a/xfa/fxfa/parser/cxfa_map.cpp
+++ b/xfa/fxfa/parser/cxfa_map.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_map.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -33,6 +32,8 @@
                 XFA_Element::Map,
                 {},
                 kMapAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Map::~CXFA_Map() = default;
diff --git a/xfa/fxfa/parser/cxfa_margin.cpp b/xfa/fxfa/parser/cxfa_margin.cpp
index 0a9dcc9..7d363a5 100644
--- a/xfa/fxfa/parser/cxfa_margin.cpp
+++ b/xfa/fxfa/parser/cxfa_margin.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_margin.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -36,7 +35,9 @@
                 XFA_Element::Margin,
                 kMarginPropertyData,
                 kMarginAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Margin::~CXFA_Margin() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_mdp.cpp b/xfa/fxfa/parser/cxfa_mdp.cpp
index 419e979..a34e547 100644
--- a/xfa/fxfa/parser/cxfa_mdp.cpp
+++ b/xfa/fxfa/parser/cxfa_mdp.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_mdp.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -31,6 +30,8 @@
                 XFA_Element::Mdp,
                 {},
                 kMdpAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Mdp::~CXFA_Mdp() = default;
diff --git a/xfa/fxfa/parser/cxfa_medium.cpp b/xfa/fxfa/parser/cxfa_medium.cpp
index b030a35..8238ff9 100644
--- a/xfa/fxfa/parser/cxfa_medium.cpp
+++ b/xfa/fxfa/parser/cxfa_medium.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_medium.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -38,6 +37,8 @@
                 XFA_Element::Medium,
                 {},
                 kMediumAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Medium::~CXFA_Medium() = default;
diff --git a/xfa/fxfa/parser/cxfa_mediuminfo.cpp b/xfa/fxfa/parser/cxfa_mediuminfo.cpp
index 297e718..3f97e07 100644
--- a/xfa/fxfa/parser/cxfa_mediuminfo.cpp
+++ b/xfa/fxfa/parser/cxfa_mediuminfo.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_mediuminfo.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -31,6 +30,8 @@
                 XFA_Element::MediumInfo,
                 kMediumInfoPropertyData,
                 kMediumInfoAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_MediumInfo::~CXFA_MediumInfo() = default;
diff --git a/xfa/fxfa/parser/cxfa_meridiem.cpp b/xfa/fxfa/parser/cxfa_meridiem.cpp
index eee660c..f425468 100644
--- a/xfa/fxfa/parser/cxfa_meridiem.cpp
+++ b/xfa/fxfa/parser/cxfa_meridiem.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_meridiem.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 CXFA_Meridiem::CXFA_Meridiem(CXFA_Document* doc, XFA_PacketType packet)
     : CXFA_Node(doc,
@@ -18,6 +17,8 @@
                 XFA_Element::Meridiem,
                 {},
                 {},
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Meridiem::~CXFA_Meridiem() = default;
diff --git a/xfa/fxfa/parser/cxfa_meridiemnames.cpp b/xfa/fxfa/parser/cxfa_meridiemnames.cpp
index 3fce4e7..0370bcd 100644
--- a/xfa/fxfa/parser/cxfa_meridiemnames.cpp
+++ b/xfa/fxfa/parser/cxfa_meridiemnames.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_meridiemnames.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::MeridiemNames,
                 kMeridiemNamesPropertyData,
                 {},
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_MeridiemNames::~CXFA_MeridiemNames() = default;
diff --git a/xfa/fxfa/parser/cxfa_message.cpp b/xfa/fxfa/parser/cxfa_message.cpp
index b8db0c5..022171b 100644
--- a/xfa/fxfa/parser/cxfa_message.cpp
+++ b/xfa/fxfa/parser/cxfa_message.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_message.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -36,6 +35,8 @@
           XFA_Element::Message,
           kMessagePropertyData,
           kMessageAttributeData,
-          std::make_unique<CJX_Node>(this)) {}
+          cppgc::MakeGarbageCollected<CJX_Node>(
+              doc->GetHeap()->GetAllocationHandle(),
+              this)) {}
 
 CXFA_Message::~CXFA_Message() = default;
diff --git a/xfa/fxfa/parser/cxfa_messaging.cpp b/xfa/fxfa/parser/cxfa_messaging.cpp
index bfca282..acdb413 100644
--- a/xfa/fxfa/parser/cxfa_messaging.cpp
+++ b/xfa/fxfa/parser/cxfa_messaging.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_messaging.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Messaging,
                 {},
                 kMessagingAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Messaging::~CXFA_Messaging() = default;
diff --git a/xfa/fxfa/parser/cxfa_mode.cpp b/xfa/fxfa/parser/cxfa_mode.cpp
index d51711f..5822455 100644
--- a/xfa/fxfa/parser/cxfa_mode.cpp
+++ b/xfa/fxfa/parser/cxfa_mode.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_mode.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Mode,
                 {},
                 kModeAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Mode::~CXFA_Mode() = default;
diff --git a/xfa/fxfa/parser/cxfa_modifyannots.cpp b/xfa/fxfa/parser/cxfa_modifyannots.cpp
index 16273ca..5405586 100644
--- a/xfa/fxfa/parser/cxfa_modifyannots.cpp
+++ b/xfa/fxfa/parser/cxfa_modifyannots.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_modifyannots.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::ModifyAnnots,
                 {},
                 kModifyAnnotsAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_ModifyAnnots::~CXFA_ModifyAnnots() = default;
diff --git a/xfa/fxfa/parser/cxfa_month.cpp b/xfa/fxfa/parser/cxfa_month.cpp
index 2eed8a3..5e559ae 100644
--- a/xfa/fxfa/parser/cxfa_month.cpp
+++ b/xfa/fxfa/parser/cxfa_month.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_month.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 CXFA_Month::CXFA_Month(CXFA_Document* doc, XFA_PacketType packet)
     : CXFA_Node(doc,
@@ -18,6 +17,8 @@
                 XFA_Element::Month,
                 {},
                 {},
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Month::~CXFA_Month() = default;
diff --git a/xfa/fxfa/parser/cxfa_monthnames.cpp b/xfa/fxfa/parser/cxfa_monthnames.cpp
index aa89dcbe..4abf9da 100644
--- a/xfa/fxfa/parser/cxfa_monthnames.cpp
+++ b/xfa/fxfa/parser/cxfa_monthnames.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_monthnames.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -30,6 +29,8 @@
                 XFA_Element::MonthNames,
                 kMonthNamesPropertyData,
                 kMonthNamesAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_MonthNames::~CXFA_MonthNames() = default;
diff --git a/xfa/fxfa/parser/cxfa_msgid.cpp b/xfa/fxfa/parser/cxfa_msgid.cpp
index 8e3258b..e4c3da8 100644
--- a/xfa/fxfa/parser/cxfa_msgid.cpp
+++ b/xfa/fxfa/parser/cxfa_msgid.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_msgid.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::MsgId,
                 {},
                 kMsgIdAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_MsgId::~CXFA_MsgId() = default;
diff --git a/xfa/fxfa/parser/cxfa_nameattr.cpp b/xfa/fxfa/parser/cxfa_nameattr.cpp
index 480d299..7c7af23 100644
--- a/xfa/fxfa/parser/cxfa_nameattr.cpp
+++ b/xfa/fxfa/parser/cxfa_nameattr.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_nameattr.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::NameAttr,
                 {},
                 kNameAttrAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_NameAttr::~CXFA_NameAttr() = default;
diff --git a/xfa/fxfa/parser/cxfa_neverembed.cpp b/xfa/fxfa/parser/cxfa_neverembed.cpp
index 21a2ba3..c741fc8 100644
--- a/xfa/fxfa/parser/cxfa_neverembed.cpp
+++ b/xfa/fxfa/parser/cxfa_neverembed.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_neverembed.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::NeverEmbed,
                 {},
                 kNeverEmbedAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_NeverEmbed::~CXFA_NeverEmbed() = default;
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index 22fbc96..52f5cc9 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -989,8 +989,8 @@
                      XFA_Element eType,
                      pdfium::span<const PropertyData> properties,
                      pdfium::span<const AttributeData> attributes,
-                     std::unique_ptr<CJX_Object> js_object)
-    : CXFA_Object(pDoc, oType, eType, std::move(js_object)),
+                     CJX_Object* js_object)
+    : CXFA_Object(pDoc, oType, eType, js_object),
       m_Properties(properties),
       m_Attributes(attributes),
       m_ValidPackets(validPackets),
diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h
index fdccd76..fdea32a 100644
--- a/xfa/fxfa/parser/cxfa_node.h
+++ b/xfa/fxfa/parser/cxfa_node.h
@@ -7,7 +7,6 @@
 #ifndef XFA_FXFA_PARSER_CXFA_NODE_H_
 #define XFA_FXFA_PARSER_CXFA_NODE_H_
 
-#include <memory>
 #include <utility>
 #include <vector>
 
@@ -397,7 +396,7 @@
             XFA_Element eType,
             pdfium::span<const PropertyData> properties,
             pdfium::span<const AttributeData> attributes,
-            std::unique_ptr<CJX_Object> js_object);
+            CJX_Object* js_object);
 
   virtual XFA_Element GetValueNodeType() const;
   virtual XFA_FFWidgetType GetDefaultFFWidgetType() const;
diff --git a/xfa/fxfa/parser/cxfa_node_unittest.cpp b/xfa/fxfa/parser/cxfa_node_unittest.cpp
index 7bf4171..388b567 100644
--- a/xfa/fxfa/parser/cxfa_node_unittest.cpp
+++ b/xfa/fxfa/parser/cxfa_node_unittest.cpp
@@ -28,7 +28,9 @@
                   XFA_Element::Node,
                   {},
                   {},
-                  std::make_unique<CJX_Node>(this)) {}
+                  cppgc::MakeGarbageCollected<CJX_Node>(
+                      doc->GetHeap()->GetAllocationHandle(),
+                      this)) {}
 };
 
 }  // namespace
diff --git a/xfa/fxfa/parser/cxfa_numberofcopies.cpp b/xfa/fxfa/parser/cxfa_numberofcopies.cpp
index 3d02f85..a3e3f24 100644
--- a/xfa/fxfa/parser/cxfa_numberofcopies.cpp
+++ b/xfa/fxfa/parser/cxfa_numberofcopies.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_numberofcopies.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::NumberOfCopies,
                 {},
                 kNumberOfCopiesAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_NumberOfCopies::~CXFA_NumberOfCopies() = default;
diff --git a/xfa/fxfa/parser/cxfa_numberpattern.cpp b/xfa/fxfa/parser/cxfa_numberpattern.cpp
index f8298b8..d7bda3f 100644
--- a/xfa/fxfa/parser/cxfa_numberpattern.cpp
+++ b/xfa/fxfa/parser/cxfa_numberpattern.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_numberpattern.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::NumberPattern,
                 {},
                 kNumberPatternAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_NumberPattern::~CXFA_NumberPattern() = default;
diff --git a/xfa/fxfa/parser/cxfa_numberpatterns.cpp b/xfa/fxfa/parser/cxfa_numberpatterns.cpp
index 4c91f49..7c5006f 100644
--- a/xfa/fxfa/parser/cxfa_numberpatterns.cpp
+++ b/xfa/fxfa/parser/cxfa_numberpatterns.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_numberpatterns.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::NumberPatterns,
                 kNumberPatternsPropertyData,
                 {},
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_NumberPatterns::~CXFA_NumberPatterns() = default;
diff --git a/xfa/fxfa/parser/cxfa_numbersymbol.cpp b/xfa/fxfa/parser/cxfa_numbersymbol.cpp
index 3d242a3..ccc1dbe 100644
--- a/xfa/fxfa/parser/cxfa_numbersymbol.cpp
+++ b/xfa/fxfa/parser/cxfa_numbersymbol.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_numbersymbol.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::NumberSymbol,
                 {},
                 kNumberSymbolAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_NumberSymbol::~CXFA_NumberSymbol() = default;
diff --git a/xfa/fxfa/parser/cxfa_numbersymbols.cpp b/xfa/fxfa/parser/cxfa_numbersymbols.cpp
index 63a6d29..cbc10d6 100644
--- a/xfa/fxfa/parser/cxfa_numbersymbols.cpp
+++ b/xfa/fxfa/parser/cxfa_numbersymbols.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_numbersymbols.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::NumberSymbols,
                 kNumberSymbolsPropertyData,
                 {},
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_NumberSymbols::~CXFA_NumberSymbols() = default;
diff --git a/xfa/fxfa/parser/cxfa_numericedit.cpp b/xfa/fxfa/parser/cxfa_numericedit.cpp
index c82e7aa..c4dbf3a 100644
--- a/xfa/fxfa/parser/cxfa_numericedit.cpp
+++ b/xfa/fxfa/parser/cxfa_numericedit.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_numericedit.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -37,7 +36,9 @@
                 XFA_Element::NumericEdit,
                 kNumericEditPropertyData,
                 kNumericEditAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_NumericEdit::~CXFA_NumericEdit() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_object.cpp b/xfa/fxfa/parser/cxfa_object.cpp
index 3c36aed..60c2279 100644
--- a/xfa/fxfa/parser/cxfa_object.cpp
+++ b/xfa/fxfa/parser/cxfa_object.cpp
@@ -22,18 +22,19 @@
 CXFA_Object::CXFA_Object(CXFA_Document* pDocument,
                          XFA_ObjectType objectType,
                          XFA_Element elementType,
-                         std::unique_ptr<CJX_Object> jsObject)
-    : m_pDocument(pDocument),
-      m_objectType(objectType),
+                         CJX_Object* jsObject)
+    : m_objectType(objectType),
       m_elementType(elementType),
       m_elementName(XFA_ElementToName(elementType)),
       m_elementNameHash(FX_HashCode_GetAsIfW(m_elementName, false)),
-      m_pJSObject(std::move(jsObject)) {}
+      m_pDocument(pDocument),
+      m_pJSObject(jsObject) {}
 
 CXFA_Object::~CXFA_Object() = default;
 
 void CXFA_Object::Trace(cppgc::Visitor* visitor) const {
   visitor->Trace(m_pDocument);
+  visitor->Trace(m_pJSObject);
 }
 
 WideString CXFA_Object::GetSOMExpression() {
diff --git a/xfa/fxfa/parser/cxfa_object.h b/xfa/fxfa/parser/cxfa_object.h
index 176bf89..de25b06 100644
--- a/xfa/fxfa/parser/cxfa_object.h
+++ b/xfa/fxfa/parser/cxfa_object.h
@@ -7,8 +7,6 @@
 #ifndef XFA_FXFA_PARSER_CXFA_OBJECT_H_
 #define XFA_FXFA_PARSER_CXFA_OBJECT_H_
 
-#include <memory>
-
 #include "core/fxcrt/fx_string.h"
 #include "fxjs/gc/heap.h"
 #include "fxjs/xfa/fxjse.h"
@@ -79,8 +77,8 @@
   CXFA_TreeList* AsTreeList();
   CXFA_ThisProxy* AsThisProxy();
 
-  CJX_Object* JSObject() { return m_pJSObject.get(); }
-  const CJX_Object* JSObject() const { return m_pJSObject.get(); }
+  CJX_Object* JSObject() { return m_pJSObject; }
+  const CJX_Object* JSObject() const { return m_pJSObject; }
 
   bool HasCreatedUIWidget() const {
     return m_elementType == XFA_Element::Field ||
@@ -99,14 +97,14 @@
   CXFA_Object(CXFA_Document* pDocument,
               XFA_ObjectType objectType,
               XFA_Element eType,
-              std::unique_ptr<CJX_Object> jsObject);
+              CJX_Object* jsObject);
 
-  cppgc::WeakMember<CXFA_Document> m_pDocument;
   const XFA_ObjectType m_objectType;
   const XFA_Element m_elementType;
   const ByteStringView m_elementName;
   const uint32_t m_elementNameHash;
-  std::unique_ptr<CJX_Object> m_pJSObject;
+  cppgc::WeakMember<CXFA_Document> m_pDocument;
+  cppgc::Member<CJX_Object> m_pJSObject;
 };
 
 // Helper functions that permit nullptr arguments.
diff --git a/xfa/fxfa/parser/cxfa_occur.cpp b/xfa/fxfa/parser/cxfa_occur.cpp
index 6e80bd9..bdcfc3c 100644
--- a/xfa/fxfa/parser/cxfa_occur.cpp
+++ b/xfa/fxfa/parser/cxfa_occur.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_occur.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_occur.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -35,7 +34,9 @@
                 XFA_Element::Occur,
                 kOccurPropertyData,
                 kOccurAttributeData,
-                std::make_unique<CJX_Occur>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Occur>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Occur::~CXFA_Occur() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_oid.cpp b/xfa/fxfa/parser/cxfa_oid.cpp
index 3454df6..88653a1 100644
--- a/xfa/fxfa/parser/cxfa_oid.cpp
+++ b/xfa/fxfa/parser/cxfa_oid.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_oid.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_textnode.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::Oid,
                 {},
                 kOidAttributeData,
-                std::make_unique<CJX_TextNode>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_TextNode>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Oid::~CXFA_Oid() = default;
diff --git a/xfa/fxfa/parser/cxfa_oids.cpp b/xfa/fxfa/parser/cxfa_oids.cpp
index dcee670..127e4e4 100644
--- a/xfa/fxfa/parser/cxfa_oids.cpp
+++ b/xfa/fxfa/parser/cxfa_oids.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_oids.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -30,6 +29,8 @@
                 XFA_Element::Oids,
                 {},
                 kOidsAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Oids::~CXFA_Oids() = default;
diff --git a/xfa/fxfa/parser/cxfa_openaction.cpp b/xfa/fxfa/parser/cxfa_openaction.cpp
index 545f64d..518b154 100644
--- a/xfa/fxfa/parser/cxfa_openaction.cpp
+++ b/xfa/fxfa/parser/cxfa_openaction.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_openaction.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -31,6 +30,8 @@
                 XFA_Element::OpenAction,
                 kOpenActionPropertyData,
                 kOpenActionAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_OpenAction::~CXFA_OpenAction() = default;
diff --git a/xfa/fxfa/parser/cxfa_operation.cpp b/xfa/fxfa/parser/cxfa_operation.cpp
index dbfb191..98a50d6 100644
--- a/xfa/fxfa/parser/cxfa_operation.cpp
+++ b/xfa/fxfa/parser/cxfa_operation.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_operation.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_textnode.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -31,6 +30,8 @@
                 XFA_Element::Operation,
                 {},
                 kOperationAttributeData,
-                std::make_unique<CJX_TextNode>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_TextNode>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Operation::~CXFA_Operation() = default;
diff --git a/xfa/fxfa/parser/cxfa_output.cpp b/xfa/fxfa/parser/cxfa_output.cpp
index cce5a11..cf145d3 100644
--- a/xfa/fxfa/parser/cxfa_output.cpp
+++ b/xfa/fxfa/parser/cxfa_output.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_output.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -33,6 +32,8 @@
                 XFA_Element::Output,
                 kOutputPropertyData,
                 kOutputAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Output::~CXFA_Output() = default;
diff --git a/xfa/fxfa/parser/cxfa_outputbin.cpp b/xfa/fxfa/parser/cxfa_outputbin.cpp
index 3d87912..b9f1737 100644
--- a/xfa/fxfa/parser/cxfa_outputbin.cpp
+++ b/xfa/fxfa/parser/cxfa_outputbin.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_outputbin.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::OutputBin,
                 {},
                 kOutputBinAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_OutputBin::~CXFA_OutputBin() = default;
diff --git a/xfa/fxfa/parser/cxfa_outputxsl.cpp b/xfa/fxfa/parser/cxfa_outputxsl.cpp
index f36c6ac..d0a5ba4 100644
--- a/xfa/fxfa/parser/cxfa_outputxsl.cpp
+++ b/xfa/fxfa/parser/cxfa_outputxsl.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_outputxsl.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -31,6 +30,8 @@
                 XFA_Element::OutputXSL,
                 kOutputXSLPropertyData,
                 kOutputXSLAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_OutputXSL::~CXFA_OutputXSL() = default;
diff --git a/xfa/fxfa/parser/cxfa_overflow.cpp b/xfa/fxfa/parser/cxfa_overflow.cpp
index de2610b..00e518a 100644
--- a/xfa/fxfa/parser/cxfa_overflow.cpp
+++ b/xfa/fxfa/parser/cxfa_overflow.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_overflow.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -31,6 +30,8 @@
                 XFA_Element::Overflow,
                 {},
                 kOverflowAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Overflow::~CXFA_Overflow() = default;
diff --git a/xfa/fxfa/parser/cxfa_overprint.cpp b/xfa/fxfa/parser/cxfa_overprint.cpp
index 932b6dd..9b33ab0 100644
--- a/xfa/fxfa/parser/cxfa_overprint.cpp
+++ b/xfa/fxfa/parser/cxfa_overprint.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_overprint.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Overprint,
                 {},
                 kOverprintAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Overprint::~CXFA_Overprint() = default;
diff --git a/xfa/fxfa/parser/cxfa_packet.cpp b/xfa/fxfa/parser/cxfa_packet.cpp
index 9533849..141df4d 100644
--- a/xfa/fxfa/parser/cxfa_packet.cpp
+++ b/xfa/fxfa/parser/cxfa_packet.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_packet.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_packet.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 CXFA_Packet::CXFA_Packet(CXFA_Document* doc, XFA_PacketType packet)
     : CXFA_Node(doc,
@@ -18,6 +17,8 @@
                 XFA_Element::Packet,
                 {},
                 {},
-                std::make_unique<CJX_Packet>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Packet>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Packet::~CXFA_Packet() = default;
diff --git a/xfa/fxfa/parser/cxfa_packets.cpp b/xfa/fxfa/parser/cxfa_packets.cpp
index 4962428..619f820 100644
--- a/xfa/fxfa/parser/cxfa_packets.cpp
+++ b/xfa/fxfa/parser/cxfa_packets.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_packets.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Packets,
                 {},
                 kPacketsAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Packets::~CXFA_Packets() = default;
diff --git a/xfa/fxfa/parser/cxfa_pagearea.cpp b/xfa/fxfa/parser/cxfa_pagearea.cpp
index fe29363..d8a6e90 100644
--- a/xfa/fxfa/parser/cxfa_pagearea.cpp
+++ b/xfa/fxfa/parser/cxfa_pagearea.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_pagearea.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_container.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -45,6 +44,8 @@
                 XFA_Element::PageArea,
                 kPageAreaPropertyData,
                 kPageAreaAttributeData,
-                std::make_unique<CJX_Container>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Container>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_PageArea::~CXFA_PageArea() = default;
diff --git a/xfa/fxfa/parser/cxfa_pageoffset.cpp b/xfa/fxfa/parser/cxfa_pageoffset.cpp
index 6d1c09d..9e46c25 100644
--- a/xfa/fxfa/parser/cxfa_pageoffset.cpp
+++ b/xfa/fxfa/parser/cxfa_pageoffset.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_pageoffset.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::PageOffset,
                 {},
                 kPageOffsetAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_PageOffset::~CXFA_PageOffset() = default;
diff --git a/xfa/fxfa/parser/cxfa_pagerange.cpp b/xfa/fxfa/parser/cxfa_pagerange.cpp
index 76a3f2f..ad614e3 100644
--- a/xfa/fxfa/parser/cxfa_pagerange.cpp
+++ b/xfa/fxfa/parser/cxfa_pagerange.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_pagerange.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::PageRange,
                 {},
                 kPageRangeAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_PageRange::~CXFA_PageRange() = default;
diff --git a/xfa/fxfa/parser/cxfa_pageset.cpp b/xfa/fxfa/parser/cxfa_pageset.cpp
index 6b76044..0da1da2 100644
--- a/xfa/fxfa/parser/cxfa_pageset.cpp
+++ b/xfa/fxfa/parser/cxfa_pageset.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_pageset.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_container.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -39,6 +38,8 @@
                 XFA_Element::PageSet,
                 kPageSetPropertyData,
                 kPageSetAttributeData,
-                std::make_unique<CJX_Container>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Container>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_PageSet::~CXFA_PageSet() = default;
diff --git a/xfa/fxfa/parser/cxfa_pagination.cpp b/xfa/fxfa/parser/cxfa_pagination.cpp
index e326876..40d5111 100644
--- a/xfa/fxfa/parser/cxfa_pagination.cpp
+++ b/xfa/fxfa/parser/cxfa_pagination.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_pagination.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Pagination,
                 {},
                 kPaginationAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Pagination::~CXFA_Pagination() = default;
diff --git a/xfa/fxfa/parser/cxfa_paginationoverride.cpp b/xfa/fxfa/parser/cxfa_paginationoverride.cpp
index 3540c84..034de83 100644
--- a/xfa/fxfa/parser/cxfa_paginationoverride.cpp
+++ b/xfa/fxfa/parser/cxfa_paginationoverride.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_paginationoverride.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::PaginationOverride,
                 {},
                 kPaginationOverrideAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_PaginationOverride::~CXFA_PaginationOverride() = default;
diff --git a/xfa/fxfa/parser/cxfa_para.cpp b/xfa/fxfa/parser/cxfa_para.cpp
index 1d14eb2..7143912 100644
--- a/xfa/fxfa/parser/cxfa_para.cpp
+++ b/xfa/fxfa/parser/cxfa_para.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_para.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_measurement.h"
 
 namespace {
@@ -49,7 +48,9 @@
                 XFA_Element::Para,
                 kParaPropertyData,
                 kParaAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Para::~CXFA_Para() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_part.cpp b/xfa/fxfa/parser/cxfa_part.cpp
index b9ce87b..bee1e59 100644
--- a/xfa/fxfa/parser/cxfa_part.cpp
+++ b/xfa/fxfa/parser/cxfa_part.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_part.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Part,
                 {},
                 kPartAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Part::~CXFA_Part() = default;
diff --git a/xfa/fxfa/parser/cxfa_password.cpp b/xfa/fxfa/parser/cxfa_password.cpp
index 42beb5c..e4b2fa0 100644
--- a/xfa/fxfa/parser/cxfa_password.cpp
+++ b/xfa/fxfa/parser/cxfa_password.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_password.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_textnode.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::Password,
                 {},
                 kPasswordAttributeData,
-                std::make_unique<CJX_TextNode>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_TextNode>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Password::~CXFA_Password() = default;
diff --git a/xfa/fxfa/parser/cxfa_passwordedit.cpp b/xfa/fxfa/parser/cxfa_passwordedit.cpp
index 8f0e5de..be47664 100644
--- a/xfa/fxfa/parser/cxfa_passwordedit.cpp
+++ b/xfa/fxfa/parser/cxfa_passwordedit.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_passwordedit.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -37,7 +36,9 @@
                 XFA_Element::PasswordEdit,
                 kPasswordEditPropertyData,
                 kPasswordEditAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_PasswordEdit::~CXFA_PasswordEdit() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_pattern.cpp b/xfa/fxfa/parser/cxfa_pattern.cpp
index 7aaece9..bbfd9b8 100644
--- a/xfa/fxfa/parser/cxfa_pattern.cpp
+++ b/xfa/fxfa/parser/cxfa_pattern.cpp
@@ -6,10 +6,9 @@
 
 #include "xfa/fxfa/parser/cxfa_pattern.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
 #include "xfa/fxfa/parser/cxfa_color.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxgraphics/cxfa_gepattern.h"
 
 namespace {
@@ -37,7 +36,9 @@
                 XFA_Element::Pattern,
                 kPatternPropertyData,
                 kPatternAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Pattern::~CXFA_Pattern() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_pcl.cpp b/xfa/fxfa/parser/cxfa_pcl.cpp
index d33108c..e773ade 100644
--- a/xfa/fxfa/parser/cxfa_pcl.cpp
+++ b/xfa/fxfa/parser/cxfa_pcl.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_pcl.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -35,6 +34,8 @@
                 XFA_Element::Pcl,
                 kPclPropertyData,
                 kPclAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Pcl::~CXFA_Pcl() = default;
diff --git a/xfa/fxfa/parser/cxfa_pdf.cpp b/xfa/fxfa/parser/cxfa_pdf.cpp
index 4dd899e..40f3e32 100644
--- a/xfa/fxfa/parser/cxfa_pdf.cpp
+++ b/xfa/fxfa/parser/cxfa_pdf.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_pdf.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -50,6 +49,8 @@
                 XFA_Element::Pdf,
                 kPdfPropertyData,
                 kPdfAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Pdf::~CXFA_Pdf() = default;
diff --git a/xfa/fxfa/parser/cxfa_pdfa.cpp b/xfa/fxfa/parser/cxfa_pdfa.cpp
index bdb1000..f5e0ab5 100644
--- a/xfa/fxfa/parser/cxfa_pdfa.cpp
+++ b/xfa/fxfa/parser/cxfa_pdfa.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_pdfa.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -34,6 +33,8 @@
                 XFA_Element::Pdfa,
                 kPdfaPropertyData,
                 kPdfaAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Pdfa::~CXFA_Pdfa() = default;
diff --git a/xfa/fxfa/parser/cxfa_permissions.cpp b/xfa/fxfa/parser/cxfa_permissions.cpp
index 4bf6414..322650c 100644
--- a/xfa/fxfa/parser/cxfa_permissions.cpp
+++ b/xfa/fxfa/parser/cxfa_permissions.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_permissions.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -39,6 +38,8 @@
                 XFA_Element::Permissions,
                 kPermissionsPropertyData,
                 kPermissionsAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Permissions::~CXFA_Permissions() = default;
diff --git a/xfa/fxfa/parser/cxfa_picktraybypdfsize.cpp b/xfa/fxfa/parser/cxfa_picktraybypdfsize.cpp
index 7736cdd..bf66b9c 100644
--- a/xfa/fxfa/parser/cxfa_picktraybypdfsize.cpp
+++ b/xfa/fxfa/parser/cxfa_picktraybypdfsize.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_picktraybypdfsize.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::PickTrayByPDFSize,
                 {},
                 kPickTrayByPDFSizeAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_PickTrayByPDFSize::~CXFA_PickTrayByPDFSize() = default;
diff --git a/xfa/fxfa/parser/cxfa_picture.cpp b/xfa/fxfa/parser/cxfa_picture.cpp
index 84d65c2..b7f31ad 100644
--- a/xfa/fxfa/parser/cxfa_picture.cpp
+++ b/xfa/fxfa/parser/cxfa_picture.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_picture.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -31,6 +30,8 @@
           XFA_Element::Picture,
           {},
           kPictureAttributeData,
-          std::make_unique<CJX_Node>(this)) {}
+          cppgc::MakeGarbageCollected<CJX_Node>(
+              doc->GetHeap()->GetAllocationHandle(),
+              this)) {}
 
 CXFA_Picture::~CXFA_Picture() = default;
diff --git a/xfa/fxfa/parser/cxfa_plaintextmetadata.cpp b/xfa/fxfa/parser/cxfa_plaintextmetadata.cpp
index 08ea628..0afb8b0 100644
--- a/xfa/fxfa/parser/cxfa_plaintextmetadata.cpp
+++ b/xfa/fxfa/parser/cxfa_plaintextmetadata.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_plaintextmetadata.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::PlaintextMetadata,
                 {},
                 kPlaintextMetadataAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_PlaintextMetadata::~CXFA_PlaintextMetadata() = default;
diff --git a/xfa/fxfa/parser/cxfa_presence.cpp b/xfa/fxfa/parser/cxfa_presence.cpp
index e36107a..0293ec0 100644
--- a/xfa/fxfa/parser/cxfa_presence.cpp
+++ b/xfa/fxfa/parser/cxfa_presence.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_presence.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Presence,
                 {},
                 kPresenceAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Presence::~CXFA_Presence() = default;
diff --git a/xfa/fxfa/parser/cxfa_present.cpp b/xfa/fxfa/parser/cxfa_present.cpp
index 2759804..44658bf 100644
--- a/xfa/fxfa/parser/cxfa_present.cpp
+++ b/xfa/fxfa/parser/cxfa_present.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_present.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -44,6 +43,8 @@
                 XFA_Element::Present,
                 kPresentPropertyData,
                 kPresentAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Present::~CXFA_Present() = default;
diff --git a/xfa/fxfa/parser/cxfa_print.cpp b/xfa/fxfa/parser/cxfa_print.cpp
index ccce2cb..be71033 100644
--- a/xfa/fxfa/parser/cxfa_print.cpp
+++ b/xfa/fxfa/parser/cxfa_print.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_print.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Print,
                 {},
                 kPrintAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Print::~CXFA_Print() = default;
diff --git a/xfa/fxfa/parser/cxfa_printername.cpp b/xfa/fxfa/parser/cxfa_printername.cpp
index 65043b9..5834c19 100644
--- a/xfa/fxfa/parser/cxfa_printername.cpp
+++ b/xfa/fxfa/parser/cxfa_printername.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_printername.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::PrinterName,
                 {},
                 kPrinterNameAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_PrinterName::~CXFA_PrinterName() = default;
diff --git a/xfa/fxfa/parser/cxfa_printhighquality.cpp b/xfa/fxfa/parser/cxfa_printhighquality.cpp
index 53830fc..76c9de2 100644
--- a/xfa/fxfa/parser/cxfa_printhighquality.cpp
+++ b/xfa/fxfa/parser/cxfa_printhighquality.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_printhighquality.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::PrintHighQuality,
                 {},
                 kPrintHighQualityAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_PrintHighQuality::~CXFA_PrintHighQuality() = default;
diff --git a/xfa/fxfa/parser/cxfa_printscaling.cpp b/xfa/fxfa/parser/cxfa_printscaling.cpp
index 350b0cd..5b0a9e5 100644
--- a/xfa/fxfa/parser/cxfa_printscaling.cpp
+++ b/xfa/fxfa/parser/cxfa_printscaling.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_printscaling.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::PrintScaling,
                 {},
                 kPrintScalingAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_PrintScaling::~CXFA_PrintScaling() = default;
diff --git a/xfa/fxfa/parser/cxfa_producer.cpp b/xfa/fxfa/parser/cxfa_producer.cpp
index fd63ff6..2c201f8 100644
--- a/xfa/fxfa/parser/cxfa_producer.cpp
+++ b/xfa/fxfa/parser/cxfa_producer.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_producer.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Producer,
                 {},
                 kProducerAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Producer::~CXFA_Producer() = default;
diff --git a/xfa/fxfa/parser/cxfa_proto.cpp b/xfa/fxfa/parser/cxfa_proto.cpp
index b4b6fe1..d90a183 100644
--- a/xfa/fxfa/parser/cxfa_proto.cpp
+++ b/xfa/fxfa/parser/cxfa_proto.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_proto.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 CXFA_Proto::CXFA_Proto(CXFA_Document* doc, XFA_PacketType packet)
     : CXFA_Node(doc,
@@ -18,6 +17,8 @@
                 XFA_Element::Proto,
                 {},
                 {},
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Proto::~CXFA_Proto() = default;
diff --git a/xfa/fxfa/parser/cxfa_ps.cpp b/xfa/fxfa/parser/cxfa_ps.cpp
index 094c8ca..2e16a25 100644
--- a/xfa/fxfa/parser/cxfa_ps.cpp
+++ b/xfa/fxfa/parser/cxfa_ps.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_ps.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -35,6 +34,8 @@
                 XFA_Element::Ps,
                 kPsPropertyData,
                 kPsAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Ps::~CXFA_Ps() = default;
diff --git a/xfa/fxfa/parser/cxfa_psmap.cpp b/xfa/fxfa/parser/cxfa_psmap.cpp
index 7b93c73..0fa1b9c 100644
--- a/xfa/fxfa/parser/cxfa_psmap.cpp
+++ b/xfa/fxfa/parser/cxfa_psmap.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_psmap.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 CXFA_PsMap::CXFA_PsMap(CXFA_Document* doc, XFA_PacketType packet)
     : CXFA_Node(doc,
@@ -18,6 +17,8 @@
                 XFA_Element::PsMap,
                 {},
                 {},
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_PsMap::~CXFA_PsMap() = default;
diff --git a/xfa/fxfa/parser/cxfa_query.cpp b/xfa/fxfa/parser/cxfa_query.cpp
index 6af0db6..a178e52 100644
--- a/xfa/fxfa/parser/cxfa_query.cpp
+++ b/xfa/fxfa/parser/cxfa_query.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_query.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -36,6 +35,8 @@
                 XFA_Element::Query,
                 kQueryPropertyData,
                 kQueryAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Query::~CXFA_Query() = default;
diff --git a/xfa/fxfa/parser/cxfa_radial.cpp b/xfa/fxfa/parser/cxfa_radial.cpp
index 0dd8a08..87136e6 100644
--- a/xfa/fxfa/parser/cxfa_radial.cpp
+++ b/xfa/fxfa/parser/cxfa_radial.cpp
@@ -6,11 +6,11 @@
 
 #include "xfa/fxfa/parser/cxfa_radial.h"
 
-#include <memory>
 #include <utility>
 
 #include "fxjs/xfa/cjx_node.h"
 #include "xfa/fxfa/parser/cxfa_color.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxgraphics/cxfa_geshading.h"
 
 namespace {
@@ -38,7 +38,9 @@
                 XFA_Element::Radial,
                 kRadialPropertyData,
                 kRadialAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Radial::~CXFA_Radial() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_range.cpp b/xfa/fxfa/parser/cxfa_range.cpp
index ad65315..ec134d4 100644
--- a/xfa/fxfa/parser/cxfa_range.cpp
+++ b/xfa/fxfa/parser/cxfa_range.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_range.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Range,
                 {},
                 kRangeAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Range::~CXFA_Range() = default;
diff --git a/xfa/fxfa/parser/cxfa_reason.cpp b/xfa/fxfa/parser/cxfa_reason.cpp
index 2f9ae24..60abeb3 100644
--- a/xfa/fxfa/parser/cxfa_reason.cpp
+++ b/xfa/fxfa/parser/cxfa_reason.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_reason.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_textnode.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::Reason,
                 {},
                 kReasonAttributeData,
-                std::make_unique<CJX_TextNode>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_TextNode>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Reason::~CXFA_Reason() = default;
diff --git a/xfa/fxfa/parser/cxfa_reasons.cpp b/xfa/fxfa/parser/cxfa_reasons.cpp
index 9a10d04..0822eb6 100644
--- a/xfa/fxfa/parser/cxfa_reasons.cpp
+++ b/xfa/fxfa/parser/cxfa_reasons.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_reasons.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -30,6 +29,8 @@
                 XFA_Element::Reasons,
                 {},
                 kReasonsAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Reasons::~CXFA_Reasons() = default;
diff --git a/xfa/fxfa/parser/cxfa_record.cpp b/xfa/fxfa/parser/cxfa_record.cpp
index 2d5d2b2..967459f 100644
--- a/xfa/fxfa/parser/cxfa_record.cpp
+++ b/xfa/fxfa/parser/cxfa_record.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_record.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Record,
                 {},
                 kRecordAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Record::~CXFA_Record() = default;
diff --git a/xfa/fxfa/parser/cxfa_recordset.cpp b/xfa/fxfa/parser/cxfa_recordset.cpp
index 5857ad8..95df9a2 100644
--- a/xfa/fxfa/parser/cxfa_recordset.cpp
+++ b/xfa/fxfa/parser/cxfa_recordset.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_recordset.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -40,6 +39,8 @@
                 XFA_Element::RecordSet,
                 {},
                 kRecordSetAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_RecordSet::~CXFA_RecordSet() = default;
diff --git a/xfa/fxfa/parser/cxfa_rectangle.cpp b/xfa/fxfa/parser/cxfa_rectangle.cpp
index 0a7d720..6b7f749 100644
--- a/xfa/fxfa/parser/cxfa_rectangle.cpp
+++ b/xfa/fxfa/parser/cxfa_rectangle.cpp
@@ -11,6 +11,7 @@
 
 #include "fxjs/xfa/cjx_node.h"
 #include "xfa/fxfa/parser/cxfa_corner.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_stroke.h"
 
 namespace {
@@ -39,7 +40,9 @@
                XFA_Element::Rectangle,
                kRectanglePropertyData,
                kRectangleAttributeData,
-               std::make_unique<CJX_Node>(this)) {}
+               cppgc::MakeGarbageCollected<CJX_Node>(
+                   doc->GetHeap()->GetAllocationHandle(),
+                   this)) {}
 
 CXFA_Rectangle::CXFA_Rectangle(CXFA_Document* pDoc,
                                XFA_PacketType ePacket,
@@ -48,7 +51,7 @@
                                XFA_Element eType,
                                pdfium::span<const PropertyData> properties,
                                pdfium::span<const AttributeData> attributes,
-                               std::unique_ptr<CJX_Object> js_node)
+                               CJX_Object* js_node)
     : CXFA_Box(pDoc,
                ePacket,
                validPackets,
@@ -56,7 +59,7 @@
                eType,
                properties,
                attributes,
-               std::move(js_node)) {}
+               js_node) {}
 
 CXFA_Rectangle::~CXFA_Rectangle() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_rectangle.h b/xfa/fxfa/parser/cxfa_rectangle.h
index 7070f2e..40da50f 100644
--- a/xfa/fxfa/parser/cxfa_rectangle.h
+++ b/xfa/fxfa/parser/cxfa_rectangle.h
@@ -7,7 +7,6 @@
 #ifndef XFA_FXFA_PARSER_CXFA_RECTANGLE_H_
 #define XFA_FXFA_PARSER_CXFA_RECTANGLE_H_
 
-#include <memory>
 #include <vector>
 
 #include "xfa/fxfa/parser/cxfa_box.h"
@@ -35,7 +34,7 @@
                  XFA_Element eType,
                  pdfium::span<const PropertyData> properties,
                  pdfium::span<const AttributeData> attributes,
-                 std::unique_ptr<CJX_Object> js_node);
+                 CJX_Object* js_node);
 
   void Stroke(const std::vector<CXFA_Stroke*>& strokes,
               CXFA_Graphics* pGS,
diff --git a/xfa/fxfa/parser/cxfa_ref.cpp b/xfa/fxfa/parser/cxfa_ref.cpp
index e651430..286a3ba 100644
--- a/xfa/fxfa/parser/cxfa_ref.cpp
+++ b/xfa/fxfa/parser/cxfa_ref.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_ref.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_textnode.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::Ref,
                 {},
                 kRefAttributeData,
-                std::make_unique<CJX_TextNode>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_TextNode>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Ref::~CXFA_Ref() = default;
diff --git a/xfa/fxfa/parser/cxfa_relevant.cpp b/xfa/fxfa/parser/cxfa_relevant.cpp
index 37dcafc..c874f0c 100644
--- a/xfa/fxfa/parser/cxfa_relevant.cpp
+++ b/xfa/fxfa/parser/cxfa_relevant.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_relevant.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Relevant,
                 {},
                 kRelevantAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Relevant::~CXFA_Relevant() = default;
diff --git a/xfa/fxfa/parser/cxfa_rename.cpp b/xfa/fxfa/parser/cxfa_rename.cpp
index d1c9489..b600ffe 100644
--- a/xfa/fxfa/parser/cxfa_rename.cpp
+++ b/xfa/fxfa/parser/cxfa_rename.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_rename.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Rename,
                 {},
                 kRenameAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Rename::~CXFA_Rename() = default;
diff --git a/xfa/fxfa/parser/cxfa_renderpolicy.cpp b/xfa/fxfa/parser/cxfa_renderpolicy.cpp
index f67c6be..182e41d 100644
--- a/xfa/fxfa/parser/cxfa_renderpolicy.cpp
+++ b/xfa/fxfa/parser/cxfa_renderpolicy.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_renderpolicy.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::RenderPolicy,
                 {},
                 kRenderPolicyAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_RenderPolicy::~CXFA_RenderPolicy() = default;
diff --git a/xfa/fxfa/parser/cxfa_rootelement.cpp b/xfa/fxfa/parser/cxfa_rootelement.cpp
index a41a7e7..a17ee16 100644
--- a/xfa/fxfa/parser/cxfa_rootelement.cpp
+++ b/xfa/fxfa/parser/cxfa_rootelement.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_rootelement.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_textnode.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::RootElement,
                 {},
                 kRootElementAttributeData,
-                std::make_unique<CJX_TextNode>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_TextNode>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_RootElement::~CXFA_RootElement() = default;
diff --git a/xfa/fxfa/parser/cxfa_runscripts.cpp b/xfa/fxfa/parser/cxfa_runscripts.cpp
index 72e7a86..9bd545a 100644
--- a/xfa/fxfa/parser/cxfa_runscripts.cpp
+++ b/xfa/fxfa/parser/cxfa_runscripts.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_runscripts.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::RunScripts,
                 {},
                 kRunScriptsAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_RunScripts::~CXFA_RunScripts() = default;
diff --git a/xfa/fxfa/parser/cxfa_script.cpp b/xfa/fxfa/parser/cxfa_script.cpp
index 25073a7..39504cb 100644
--- a/xfa/fxfa/parser/cxfa_script.cpp
+++ b/xfa/fxfa/parser/cxfa_script.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_script.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_script.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -42,7 +41,9 @@
           XFA_Element::Script,
           kScriptPropertyData,
           kScriptAttributeData,
-          std::make_unique<CJX_Script>(this)) {}
+          cppgc::MakeGarbageCollected<CJX_Script>(
+              doc->GetHeap()->GetAllocationHandle(),
+              this)) {}
 
 CXFA_Script::~CXFA_Script() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_scriptmodel.cpp b/xfa/fxfa/parser/cxfa_scriptmodel.cpp
index 7c9d7b4..349d45e 100644
--- a/xfa/fxfa/parser/cxfa_scriptmodel.cpp
+++ b/xfa/fxfa/parser/cxfa_scriptmodel.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_scriptmodel.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::ScriptModel,
                 {},
                 kScriptModelAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_ScriptModel::~CXFA_ScriptModel() = default;
diff --git a/xfa/fxfa/parser/cxfa_select.cpp b/xfa/fxfa/parser/cxfa_select.cpp
index dd81c80..1b9a960 100644
--- a/xfa/fxfa/parser/cxfa_select.cpp
+++ b/xfa/fxfa/parser/cxfa_select.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_select.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_textnode.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::Select,
                 {},
                 kSelectAttributeData,
-                std::make_unique<CJX_TextNode>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_TextNode>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Select::~CXFA_Select() = default;
diff --git a/xfa/fxfa/parser/cxfa_setproperty.cpp b/xfa/fxfa/parser/cxfa_setproperty.cpp
index 7050905..cbb3c02 100644
--- a/xfa/fxfa/parser/cxfa_setproperty.cpp
+++ b/xfa/fxfa/parser/cxfa_setproperty.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_setproperty.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::SetProperty,
                 {},
                 kSetPropertyAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_SetProperty::~CXFA_SetProperty() = default;
diff --git a/xfa/fxfa/parser/cxfa_severity.cpp b/xfa/fxfa/parser/cxfa_severity.cpp
index cf5dfba..2367739 100644
--- a/xfa/fxfa/parser/cxfa_severity.cpp
+++ b/xfa/fxfa/parser/cxfa_severity.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_severity.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Severity,
                 {},
                 kSeverityAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Severity::~CXFA_Severity() = default;
diff --git a/xfa/fxfa/parser/cxfa_sharptext.cpp b/xfa/fxfa/parser/cxfa_sharptext.cpp
index 62a9a0d..40454f9 100644
--- a/xfa/fxfa/parser/cxfa_sharptext.cpp
+++ b/xfa/fxfa/parser/cxfa_sharptext.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_sharptext.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::Sharptext,
                 {},
                 kSharptextAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Sharptext::~CXFA_Sharptext() = default;
diff --git a/xfa/fxfa/parser/cxfa_sharpxhtml.cpp b/xfa/fxfa/parser/cxfa_sharpxhtml.cpp
index 2ed9d9d..560c296 100644
--- a/xfa/fxfa/parser/cxfa_sharpxhtml.cpp
+++ b/xfa/fxfa/parser/cxfa_sharpxhtml.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_sharpxhtml.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::SharpxHTML,
                 {},
                 kSharpxHTMLAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_SharpxHTML::~CXFA_SharpxHTML() = default;
diff --git a/xfa/fxfa/parser/cxfa_sharpxml.cpp b/xfa/fxfa/parser/cxfa_sharpxml.cpp
index ad647f7..931671d 100644
--- a/xfa/fxfa/parser/cxfa_sharpxml.cpp
+++ b/xfa/fxfa/parser/cxfa_sharpxml.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_sharpxml.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -26,6 +25,8 @@
                 XFA_Element::Sharpxml,
                 {},
                 kSharpxmlAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Sharpxml::~CXFA_Sharpxml() = default;
diff --git a/xfa/fxfa/parser/cxfa_signature.cpp b/xfa/fxfa/parser/cxfa_signature.cpp
index 09fa3c6..5a37e8d 100644
--- a/xfa/fxfa/parser/cxfa_signature.cpp
+++ b/xfa/fxfa/parser/cxfa_signature.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_signature.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -36,7 +35,9 @@
                 XFA_Element::Signature,
                 kSignaturePropertyData,
                 kSignatureAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Signature::~CXFA_Signature() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_signatureproperties.cpp b/xfa/fxfa/parser/cxfa_signatureproperties.cpp
index 599fd8c..a1eb460 100644
--- a/xfa/fxfa/parser/cxfa_signatureproperties.cpp
+++ b/xfa/fxfa/parser/cxfa_signatureproperties.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_signatureproperties.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::SignatureProperties,
                 {},
                 kSignaturePropertiesAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_SignatureProperties::~CXFA_SignatureProperties() = default;
diff --git a/xfa/fxfa/parser/cxfa_signdata.cpp b/xfa/fxfa/parser/cxfa_signdata.cpp
index 6ab81d1..7f9a8f8 100644
--- a/xfa/fxfa/parser/cxfa_signdata.cpp
+++ b/xfa/fxfa/parser/cxfa_signdata.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_signdata.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -37,6 +36,8 @@
                 XFA_Element::SignData,
                 kSignDataPropertyData,
                 kSignDataAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_SignData::~CXFA_SignData() = default;
diff --git a/xfa/fxfa/parser/cxfa_signing.cpp b/xfa/fxfa/parser/cxfa_signing.cpp
index 24f4497..5f8df1e 100644
--- a/xfa/fxfa/parser/cxfa_signing.cpp
+++ b/xfa/fxfa/parser/cxfa_signing.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_signing.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -30,6 +29,8 @@
                 XFA_Element::Signing,
                 {},
                 kSigningAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Signing::~CXFA_Signing() = default;
diff --git a/xfa/fxfa/parser/cxfa_silentprint.cpp b/xfa/fxfa/parser/cxfa_silentprint.cpp
index 4bfcfb5..d164311 100644
--- a/xfa/fxfa/parser/cxfa_silentprint.cpp
+++ b/xfa/fxfa/parser/cxfa_silentprint.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_silentprint.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -32,6 +31,8 @@
                 XFA_Element::SilentPrint,
                 kSilentPrintPropertyData,
                 kSilentPrintAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_SilentPrint::~CXFA_SilentPrint() = default;
diff --git a/xfa/fxfa/parser/cxfa_soapaction.cpp b/xfa/fxfa/parser/cxfa_soapaction.cpp
index 25d1a39..c5829e9 100644
--- a/xfa/fxfa/parser/cxfa_soapaction.cpp
+++ b/xfa/fxfa/parser/cxfa_soapaction.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_soapaction.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_textnode.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::SoapAction,
                 {},
                 kSoapActionAttributeData,
-                std::make_unique<CJX_TextNode>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_TextNode>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_SoapAction::~CXFA_SoapAction() = default;
diff --git a/xfa/fxfa/parser/cxfa_soapaddress.cpp b/xfa/fxfa/parser/cxfa_soapaddress.cpp
index 0730b0a..042ef37 100644
--- a/xfa/fxfa/parser/cxfa_soapaddress.cpp
+++ b/xfa/fxfa/parser/cxfa_soapaddress.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_soapaddress.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_textnode.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::SoapAddress,
                 {},
                 kSoapAddressAttributeData,
-                std::make_unique<CJX_TextNode>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_TextNode>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_SoapAddress::~CXFA_SoapAddress() = default;
diff --git a/xfa/fxfa/parser/cxfa_solid.cpp b/xfa/fxfa/parser/cxfa_solid.cpp
index 0291e0d..10a7d1c0 100644
--- a/xfa/fxfa/parser/cxfa_solid.cpp
+++ b/xfa/fxfa/parser/cxfa_solid.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_solid.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -32,6 +31,8 @@
                 XFA_Element::Solid,
                 kSolidPropertyData,
                 kSolidAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Solid::~CXFA_Solid() = default;
diff --git a/xfa/fxfa/parser/cxfa_source.cpp b/xfa/fxfa/parser/cxfa_source.cpp
index 039bdbc..8fcdaab 100644
--- a/xfa/fxfa/parser/cxfa_source.cpp
+++ b/xfa/fxfa/parser/cxfa_source.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_source.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_source.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -33,6 +32,8 @@
                 XFA_Element::Source,
                 kSourcePropertyData,
                 kSourceAttributeData,
-                std::make_unique<CJX_Source>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Source>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Source::~CXFA_Source() = default;
diff --git a/xfa/fxfa/parser/cxfa_sourceset.cpp b/xfa/fxfa/parser/cxfa_sourceset.cpp
index f6d2518..3cc8c90 100644
--- a/xfa/fxfa/parser/cxfa_sourceset.cpp
+++ b/xfa/fxfa/parser/cxfa_sourceset.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_sourceset.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_model.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::SourceSet,
                 {},
                 kSourceSetAttributeData,
-                std::make_unique<CJX_Model>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Model>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_SourceSet::~CXFA_SourceSet() = default;
diff --git a/xfa/fxfa/parser/cxfa_speak.cpp b/xfa/fxfa/parser/cxfa_speak.cpp
index 82f3e1c..3812057 100644
--- a/xfa/fxfa/parser/cxfa_speak.cpp
+++ b/xfa/fxfa/parser/cxfa_speak.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_speak.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_textnode.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -32,6 +31,8 @@
                 XFA_Element::Speak,
                 {},
                 kSpeakAttributeData,
-                std::make_unique<CJX_TextNode>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_TextNode>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Speak::~CXFA_Speak() = default;
diff --git a/xfa/fxfa/parser/cxfa_staple.cpp b/xfa/fxfa/parser/cxfa_staple.cpp
index 9d3dfec..bdec7d0 100644
--- a/xfa/fxfa/parser/cxfa_staple.cpp
+++ b/xfa/fxfa/parser/cxfa_staple.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_staple.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::Staple,
                 {},
                 kStapleAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Staple::~CXFA_Staple() = default;
diff --git a/xfa/fxfa/parser/cxfa_startnode.cpp b/xfa/fxfa/parser/cxfa_startnode.cpp
index 18880de..c94e756 100644
--- a/xfa/fxfa/parser/cxfa_startnode.cpp
+++ b/xfa/fxfa/parser/cxfa_startnode.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_startnode.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::StartNode,
                 {},
                 kStartNodeAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_StartNode::~CXFA_StartNode() = default;
diff --git a/xfa/fxfa/parser/cxfa_startpage.cpp b/xfa/fxfa/parser/cxfa_startpage.cpp
index af9dcfc..ea0a780 100644
--- a/xfa/fxfa/parser/cxfa_startpage.cpp
+++ b/xfa/fxfa/parser/cxfa_startpage.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_startpage.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::StartPage,
                 {},
                 kStartPageAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_StartPage::~CXFA_StartPage() = default;
diff --git a/xfa/fxfa/parser/cxfa_stipple.cpp b/xfa/fxfa/parser/cxfa_stipple.cpp
index f11b2f7..a28e0e0 100644
--- a/xfa/fxfa/parser/cxfa_stipple.cpp
+++ b/xfa/fxfa/parser/cxfa_stipple.cpp
@@ -6,10 +6,9 @@
 
 #include "xfa/fxfa/parser/cxfa_stipple.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
 #include "xfa/fxfa/parser/cxfa_color.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -35,7 +34,9 @@
                 XFA_Element::Stipple,
                 kStipplePropertyData,
                 kStippleAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Stipple::~CXFA_Stipple() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_stroke.cpp b/xfa/fxfa/parser/cxfa_stroke.cpp
index ca109c7..50637db 100644
--- a/xfa/fxfa/parser/cxfa_stroke.cpp
+++ b/xfa/fxfa/parser/cxfa_stroke.cpp
@@ -12,6 +12,7 @@
 #include "third_party/base/stl_util.h"
 #include "xfa/fxfa/cxfa_ffwidget.h"
 #include "xfa/fxfa/parser/cxfa_color.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_measurement.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
 #include "xfa/fxfa/parser/xfa_utils.h"
@@ -69,7 +70,7 @@
                          XFA_Element eType,
                          pdfium::span<const PropertyData> properties,
                          pdfium::span<const AttributeData> attributes,
-                         std::unique_ptr<CJX_Object> js_node)
+                         CJX_Object* js_node)
     : CXFA_Node(pDoc,
                 ePacket,
                 validPackets,
@@ -77,7 +78,7 @@
                 eType,
                 properties,
                 attributes,
-                std::move(js_node)) {}
+                js_node) {}
 
 CXFA_Stroke::~CXFA_Stroke() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_stroke.h b/xfa/fxfa/parser/cxfa_stroke.h
index e76d865..078c174 100644
--- a/xfa/fxfa/parser/cxfa_stroke.h
+++ b/xfa/fxfa/parser/cxfa_stroke.h
@@ -7,7 +7,6 @@
 #ifndef XFA_FXFA_PARSER_CXFA_STROKE_H_
 #define XFA_FXFA_PARSER_CXFA_STROKE_H_
 
-#include <memory>
 
 #include "core/fxge/fx_dib.h"
 #include "xfa/fxfa/fxfa_basic.h"
@@ -59,7 +58,7 @@
               XFA_Element eType,
               pdfium::span<const PropertyData> properties,
               pdfium::span<const AttributeData> attributes,
-              std::unique_ptr<CJX_Object> js_node);
+              CJX_Object* js_node);
 };
 
 #endif  // XFA_FXFA_PARSER_CXFA_STROKE_H_
diff --git a/xfa/fxfa/parser/cxfa_subform.cpp b/xfa/fxfa/parser/cxfa_subform.cpp
index aa0726b..4e4f695 100644
--- a/xfa/fxfa/parser/cxfa_subform.cpp
+++ b/xfa/fxfa/parser/cxfa_subform.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_subform.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_subform.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -72,6 +71,8 @@
                 XFA_Element::Subform,
                 kSubformPropertyData,
                 kSubformAttributeData,
-                std::make_unique<CJX_Subform>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Subform>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Subform::~CXFA_Subform() = default;
diff --git a/xfa/fxfa/parser/cxfa_subformset.cpp b/xfa/fxfa/parser/cxfa_subformset.cpp
index 97fe189..66ba542 100644
--- a/xfa/fxfa/parser/cxfa_subformset.cpp
+++ b/xfa/fxfa/parser/cxfa_subformset.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_subformset.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_container.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -38,6 +37,8 @@
                 XFA_Element::SubformSet,
                 kSubformSetPropertyData,
                 kSubformSetAttributeData,
-                std::make_unique<CJX_Container>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Container>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_SubformSet::~CXFA_SubformSet() = default;
diff --git a/xfa/fxfa/parser/cxfa_subjectdn.cpp b/xfa/fxfa/parser/cxfa_subjectdn.cpp
index 58178e7..a3d9f3e 100644
--- a/xfa/fxfa/parser/cxfa_subjectdn.cpp
+++ b/xfa/fxfa/parser/cxfa_subjectdn.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_subjectdn.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -30,6 +29,8 @@
                 XFA_Element::SubjectDN,
                 {},
                 kSubjectDNAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_SubjectDN::~CXFA_SubjectDN() = default;
diff --git a/xfa/fxfa/parser/cxfa_subjectdns.cpp b/xfa/fxfa/parser/cxfa_subjectdns.cpp
index 299265a..d984392 100644
--- a/xfa/fxfa/parser/cxfa_subjectdns.cpp
+++ b/xfa/fxfa/parser/cxfa_subjectdns.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_subjectdns.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -30,6 +29,8 @@
                 XFA_Element::SubjectDNs,
                 {},
                 kSubjectDNsAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_SubjectDNs::~CXFA_SubjectDNs() = default;
diff --git a/xfa/fxfa/parser/cxfa_submit.cpp b/xfa/fxfa/parser/cxfa_submit.cpp
index af5ecfa..f14f147 100644
--- a/xfa/fxfa/parser/cxfa_submit.cpp
+++ b/xfa/fxfa/parser/cxfa_submit.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_submit.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -38,7 +37,9 @@
                 XFA_Element::Submit,
                 kSubmitPropertyData,
                 kSubmitAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Submit::~CXFA_Submit() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_submitformat.cpp b/xfa/fxfa/parser/cxfa_submitformat.cpp
index 62e044f..4f0d629 100644
--- a/xfa/fxfa/parser/cxfa_submitformat.cpp
+++ b/xfa/fxfa/parser/cxfa_submitformat.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_submitformat.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::SubmitFormat,
                 {},
                 kSubmitFormatAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_SubmitFormat::~CXFA_SubmitFormat() = default;
diff --git a/xfa/fxfa/parser/cxfa_submiturl.cpp b/xfa/fxfa/parser/cxfa_submiturl.cpp
index aa936b4..2af55fc 100644
--- a/xfa/fxfa/parser/cxfa_submiturl.cpp
+++ b/xfa/fxfa/parser/cxfa_submiturl.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_submiturl.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::SubmitUrl,
                 {},
                 kSubmitUrlAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_SubmitUrl::~CXFA_SubmitUrl() = default;
diff --git a/xfa/fxfa/parser/cxfa_subsetbelow.cpp b/xfa/fxfa/parser/cxfa_subsetbelow.cpp
index 1be6357..4bada83 100644
--- a/xfa/fxfa/parser/cxfa_subsetbelow.cpp
+++ b/xfa/fxfa/parser/cxfa_subsetbelow.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_subsetbelow.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::SubsetBelow,
                 {},
                 kSubsetBelowAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_SubsetBelow::~CXFA_SubsetBelow() = default;
diff --git a/xfa/fxfa/parser/cxfa_suppressbanner.cpp b/xfa/fxfa/parser/cxfa_suppressbanner.cpp
index 72c138d..b96677a 100644
--- a/xfa/fxfa/parser/cxfa_suppressbanner.cpp
+++ b/xfa/fxfa/parser/cxfa_suppressbanner.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_suppressbanner.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::SuppressBanner,
                 {},
                 kSuppressBannerAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_SuppressBanner::~CXFA_SuppressBanner() = default;
diff --git a/xfa/fxfa/parser/cxfa_tagged.cpp b/xfa/fxfa/parser/cxfa_tagged.cpp
index d7899bd..1ee0931 100644
--- a/xfa/fxfa/parser/cxfa_tagged.cpp
+++ b/xfa/fxfa/parser/cxfa_tagged.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_tagged.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Tagged,
                 {},
                 kTaggedAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Tagged::~CXFA_Tagged() = default;
diff --git a/xfa/fxfa/parser/cxfa_template.cpp b/xfa/fxfa/parser/cxfa_template.cpp
index 0c86125..4057336 100644
--- a/xfa/fxfa/parser/cxfa_template.cpp
+++ b/xfa/fxfa/parser/cxfa_template.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_template.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_template.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -36,6 +35,8 @@
           XFA_Element::Template,
           kTemplatePropertyData,
           kTemplateAttributeData,
-          std::make_unique<CJX_Template>(this)) {}
+          cppgc::MakeGarbageCollected<CJX_Template>(
+              doc->GetHeap()->GetAllocationHandle(),
+              this)) {}
 
 CXFA_Template::~CXFA_Template() = default;
diff --git a/xfa/fxfa/parser/cxfa_templatecache.cpp b/xfa/fxfa/parser/cxfa_templatecache.cpp
index 38b7b09..ccc1d47 100644
--- a/xfa/fxfa/parser/cxfa_templatecache.cpp
+++ b/xfa/fxfa/parser/cxfa_templatecache.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_templatecache.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::TemplateCache,
                 {},
                 kTemplateCacheAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_TemplateCache::~CXFA_TemplateCache() = default;
diff --git a/xfa/fxfa/parser/cxfa_text.cpp b/xfa/fxfa/parser/cxfa_text.cpp
index 6d35db6..ddb0d0f 100644
--- a/xfa/fxfa/parser/cxfa_text.cpp
+++ b/xfa/fxfa/parser/cxfa_text.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_text.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_object.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -32,7 +31,9 @@
                 XFA_Element::Text,
                 {},
                 kTextAttributeData,
-                std::make_unique<CJX_Object>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Object>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Text::~CXFA_Text() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_textedit.cpp b/xfa/fxfa/parser/cxfa_textedit.cpp
index 306cefa..5846c5b 100644
--- a/xfa/fxfa/parser/cxfa_textedit.cpp
+++ b/xfa/fxfa/parser/cxfa_textedit.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_textedit.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -41,7 +40,9 @@
                 XFA_Element::TextEdit,
                 kTextEditPropertyData,
                 kTextEditAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_TextEdit::~CXFA_TextEdit() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_thisproxy.cpp b/xfa/fxfa/parser/cxfa_thisproxy.cpp
index 17b5fa5..b16d920 100644
--- a/xfa/fxfa/parser/cxfa_thisproxy.cpp
+++ b/xfa/fxfa/parser/cxfa_thisproxy.cpp
@@ -6,16 +6,18 @@
 
 #include "xfa/fxfa/parser/cxfa_thisproxy.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_object.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
 
 CXFA_ThisProxy::CXFA_ThisProxy(CXFA_Node* pThisNode, CXFA_Node* pScriptNode)
-    : CXFA_Object(pThisNode->GetDocument(),
-                  XFA_ObjectType::ThisProxy,
-                  XFA_Element::Object,
-                  std::make_unique<CJX_Object>(this)),
+    : CXFA_Object(
+          pThisNode->GetDocument(),
+          XFA_ObjectType::ThisProxy,
+          XFA_Element::Object,
+          cppgc::MakeGarbageCollected<CJX_Object>(
+              pThisNode->GetDocument()->GetHeap()->GetAllocationHandle(),
+              this)),
       m_pThisNode(pThisNode),
       m_pScriptNode(pScriptNode) {}
 
diff --git a/xfa/fxfa/parser/cxfa_threshold.cpp b/xfa/fxfa/parser/cxfa_threshold.cpp
index e817be3..5e1ef9b 100644
--- a/xfa/fxfa/parser/cxfa_threshold.cpp
+++ b/xfa/fxfa/parser/cxfa_threshold.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_threshold.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Threshold,
                 {},
                 kThresholdAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Threshold::~CXFA_Threshold() = default;
diff --git a/xfa/fxfa/parser/cxfa_time.cpp b/xfa/fxfa/parser/cxfa_time.cpp
index 9e258e2..d8f651d 100644
--- a/xfa/fxfa/parser/cxfa_time.cpp
+++ b/xfa/fxfa/parser/cxfa_time.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_time.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_object.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::Time,
                 {},
                 kTimeAttributeData,
-                std::make_unique<CJX_Object>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Object>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Time::~CXFA_Time() = default;
diff --git a/xfa/fxfa/parser/cxfa_timepattern.cpp b/xfa/fxfa/parser/cxfa_timepattern.cpp
index 0a3efe1..6069499 100644
--- a/xfa/fxfa/parser/cxfa_timepattern.cpp
+++ b/xfa/fxfa/parser/cxfa_timepattern.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_timepattern.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::TimePattern,
                 {},
                 kTimePatternAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_TimePattern::~CXFA_TimePattern() = default;
diff --git a/xfa/fxfa/parser/cxfa_timepatterns.cpp b/xfa/fxfa/parser/cxfa_timepatterns.cpp
index 6c93395..6e7de19 100644
--- a/xfa/fxfa/parser/cxfa_timepatterns.cpp
+++ b/xfa/fxfa/parser/cxfa_timepatterns.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_timepatterns.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -26,6 +25,8 @@
                 XFA_Element::TimePatterns,
                 kTimePatternsPropertyData,
                 {},
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_TimePatterns::~CXFA_TimePatterns() = default;
diff --git a/xfa/fxfa/parser/cxfa_timestamp.cpp b/xfa/fxfa/parser/cxfa_timestamp.cpp
index e7e263d..2ed958f 100644
--- a/xfa/fxfa/parser/cxfa_timestamp.cpp
+++ b/xfa/fxfa/parser/cxfa_timestamp.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_timestamp.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -31,6 +30,8 @@
                 XFA_Element::TimeStamp,
                 {},
                 kTimeStampAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_TimeStamp::~CXFA_TimeStamp() = default;
diff --git a/xfa/fxfa/parser/cxfa_to.cpp b/xfa/fxfa/parser/cxfa_to.cpp
index e1e6468..58b3306 100644
--- a/xfa/fxfa/parser/cxfa_to.cpp
+++ b/xfa/fxfa/parser/cxfa_to.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_to.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::To,
                 {},
                 kToAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_To::~CXFA_To() = default;
diff --git a/xfa/fxfa/parser/cxfa_tooltip.cpp b/xfa/fxfa/parser/cxfa_tooltip.cpp
index f2ca5ef..b8a4b6e 100644
--- a/xfa/fxfa/parser/cxfa_tooltip.cpp
+++ b/xfa/fxfa/parser/cxfa_tooltip.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_tooltip.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_textnode.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::ToolTip,
                 {},
                 kToolTipAttributeData,
-                std::make_unique<CJX_TextNode>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_TextNode>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_ToolTip::~CXFA_ToolTip() = default;
diff --git a/xfa/fxfa/parser/cxfa_trace.cpp b/xfa/fxfa/parser/cxfa_trace.cpp
index 2221dee..e2ac602 100644
--- a/xfa/fxfa/parser/cxfa_trace.cpp
+++ b/xfa/fxfa/parser/cxfa_trace.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_trace.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Trace,
                 {},
                 kTraceAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Trace::~CXFA_Trace() = default;
diff --git a/xfa/fxfa/parser/cxfa_transform.cpp b/xfa/fxfa/parser/cxfa_transform.cpp
index db77e58..c2ab491 100644
--- a/xfa/fxfa/parser/cxfa_transform.cpp
+++ b/xfa/fxfa/parser/cxfa_transform.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_transform.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -35,6 +34,8 @@
                 XFA_Element::Transform,
                 kTransformPropertyData,
                 kTransformAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Transform::~CXFA_Transform() = default;
diff --git a/xfa/fxfa/parser/cxfa_traversal.cpp b/xfa/fxfa/parser/cxfa_traversal.cpp
index ea5dba1..a190e59 100644
--- a/xfa/fxfa/parser/cxfa_traversal.cpp
+++ b/xfa/fxfa/parser/cxfa_traversal.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_traversal.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -32,6 +31,8 @@
                 XFA_Element::Traversal,
                 kTraversalPropertyData,
                 kTraversalAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Traversal::~CXFA_Traversal() = default;
diff --git a/xfa/fxfa/parser/cxfa_traverse.cpp b/xfa/fxfa/parser/cxfa_traverse.cpp
index 0d9318e..4f8348b 100644
--- a/xfa/fxfa/parser/cxfa_traverse.cpp
+++ b/xfa/fxfa/parser/cxfa_traverse.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_traverse.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -36,6 +35,8 @@
                 XFA_Element::Traverse,
                 kTraversePropertyData,
                 kTraverseAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Traverse::~CXFA_Traverse() = default;
diff --git a/xfa/fxfa/parser/cxfa_treelist.cpp b/xfa/fxfa/parser/cxfa_treelist.cpp
index 68eabc4..dcc7f76 100644
--- a/xfa/fxfa/parser/cxfa_treelist.cpp
+++ b/xfa/fxfa/parser/cxfa_treelist.cpp
@@ -6,17 +6,18 @@
 
 #include "xfa/fxfa/parser/cxfa_treelist.h"
 
-#include <memory>
-
 #include "core/fxcrt/fx_extension.h"
 #include "fxjs/xfa/cjx_treelist.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
 
-CXFA_TreeList::CXFA_TreeList(CXFA_Document* pDocument)
-    : CXFA_List(pDocument,
+CXFA_TreeList::CXFA_TreeList(CXFA_Document* doc)
+    : CXFA_List(doc,
                 XFA_ObjectType::TreeList,
                 XFA_Element::TreeList,
-                std::make_unique<CJX_TreeList>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_TreeList>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_TreeList::~CXFA_TreeList() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_type.cpp b/xfa/fxfa/parser/cxfa_type.cpp
index 0a17f8f..e3e6b63 100644
--- a/xfa/fxfa/parser/cxfa_type.cpp
+++ b/xfa/fxfa/parser/cxfa_type.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_type.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Type,
                 {},
                 kTypeAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Type::~CXFA_Type() = default;
diff --git a/xfa/fxfa/parser/cxfa_typeface.cpp b/xfa/fxfa/parser/cxfa_typeface.cpp
index 1441212..c391b82 100644
--- a/xfa/fxfa/parser/cxfa_typeface.cpp
+++ b/xfa/fxfa/parser/cxfa_typeface.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_typeface.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -26,6 +25,8 @@
                 XFA_Element::Typeface,
                 {},
                 kTypefaceAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Typeface::~CXFA_Typeface() = default;
diff --git a/xfa/fxfa/parser/cxfa_typefaces.cpp b/xfa/fxfa/parser/cxfa_typefaces.cpp
index 882876b..3b624e4 100644
--- a/xfa/fxfa/parser/cxfa_typefaces.cpp
+++ b/xfa/fxfa/parser/cxfa_typefaces.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_typefaces.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 CXFA_Typefaces::CXFA_Typefaces(CXFA_Document* doc, XFA_PacketType packet)
     : CXFA_Node(doc,
@@ -18,6 +17,8 @@
                 XFA_Element::Typefaces,
                 {},
                 {},
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Typefaces::~CXFA_Typefaces() = default;
diff --git a/xfa/fxfa/parser/cxfa_ui.cpp b/xfa/fxfa/parser/cxfa_ui.cpp
index 840d4ad..8e8a1f4 100644
--- a/xfa/fxfa/parser/cxfa_ui.cpp
+++ b/xfa/fxfa/parser/cxfa_ui.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_ui.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -44,7 +43,9 @@
                 XFA_Element::Ui,
                 kUiPropertyData,
                 kUiAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Ui::~CXFA_Ui() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_update.cpp b/xfa/fxfa/parser/cxfa_update.cpp
index de06847..718a90f 100644
--- a/xfa/fxfa/parser/cxfa_update.cpp
+++ b/xfa/fxfa/parser/cxfa_update.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_update.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_textnode.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::Update,
                 {},
                 kUpdateAttributeData,
-                std::make_unique<CJX_TextNode>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_TextNode>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Update::~CXFA_Update() = default;
diff --git a/xfa/fxfa/parser/cxfa_uri.cpp b/xfa/fxfa/parser/cxfa_uri.cpp
index b2f7828..f60fd7d 100644
--- a/xfa/fxfa/parser/cxfa_uri.cpp
+++ b/xfa/fxfa/parser/cxfa_uri.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_uri.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_textnode.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -31,6 +30,8 @@
                 XFA_Element::Uri,
                 {},
                 kUriAttributeData,
-                std::make_unique<CJX_TextNode>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_TextNode>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Uri::~CXFA_Uri() = default;
diff --git a/xfa/fxfa/parser/cxfa_user.cpp b/xfa/fxfa/parser/cxfa_user.cpp
index 61f5054..414b4d4 100644
--- a/xfa/fxfa/parser/cxfa_user.cpp
+++ b/xfa/fxfa/parser/cxfa_user.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_user.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_textnode.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::User,
                 {},
                 kUserAttributeData,
-                std::make_unique<CJX_TextNode>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_TextNode>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_User::~CXFA_User() = default;
diff --git a/xfa/fxfa/parser/cxfa_validate.cpp b/xfa/fxfa/parser/cxfa_validate.cpp
index db65790..29f46db 100644
--- a/xfa/fxfa/parser/cxfa_validate.cpp
+++ b/xfa/fxfa/parser/cxfa_validate.cpp
@@ -6,10 +6,9 @@
 
 #include "xfa/fxfa/parser/cxfa_validate.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
 #include "fxjs/xfa/cjx_object.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_message.h"
 #include "xfa/fxfa/parser/cxfa_picture.h"
 #include "xfa/fxfa/parser/cxfa_script.h"
@@ -52,7 +51,9 @@
           XFA_Element::Validate,
           kValidatePropertyData,
           kValidateAttributeData,
-          std::make_unique<CJX_Node>(this)) {}
+          cppgc::MakeGarbageCollected<CJX_Node>(
+              doc->GetHeap()->GetAllocationHandle(),
+              this)) {}
 
 CXFA_Validate::~CXFA_Validate() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_validateapprovalsignatures.cpp b/xfa/fxfa/parser/cxfa_validateapprovalsignatures.cpp
index e06621d..1607cf0 100644
--- a/xfa/fxfa/parser/cxfa_validateapprovalsignatures.cpp
+++ b/xfa/fxfa/parser/cxfa_validateapprovalsignatures.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_validateapprovalsignatures.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::ValidateApprovalSignatures,
                 {},
                 kValidateApprovalSignaturesAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_ValidateApprovalSignatures::~CXFA_ValidateApprovalSignatures() = default;
diff --git a/xfa/fxfa/parser/cxfa_validationmessaging.cpp b/xfa/fxfa/parser/cxfa_validationmessaging.cpp
index 92ec267..264b964 100644
--- a/xfa/fxfa/parser/cxfa_validationmessaging.cpp
+++ b/xfa/fxfa/parser/cxfa_validationmessaging.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_validationmessaging.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::ValidationMessaging,
                 {},
                 kValidationMessagingAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_ValidationMessaging::~CXFA_ValidationMessaging() = default;
diff --git a/xfa/fxfa/parser/cxfa_value.cpp b/xfa/fxfa/parser/cxfa_value.cpp
index 07c623d..d59b6e1 100644
--- a/xfa/fxfa/parser/cxfa_value.cpp
+++ b/xfa/fxfa/parser/cxfa_value.cpp
@@ -6,11 +6,10 @@
 
 #include "xfa/fxfa/parser/cxfa_value.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
 #include "fxjs/xfa/cjx_object.h"
 #include "xfa/fxfa/parser/cxfa_arc.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_exdata.h"
 #include "xfa/fxfa/parser/cxfa_image.h"
 #include "xfa/fxfa/parser/cxfa_line.h"
@@ -52,7 +51,9 @@
                 XFA_Element::Value,
                 kValuePropertyData,
                 kValueAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Value::~CXFA_Value() = default;
 
diff --git a/xfa/fxfa/parser/cxfa_variables.cpp b/xfa/fxfa/parser/cxfa_variables.cpp
index c8134f8..7aaec81 100644
--- a/xfa/fxfa/parser/cxfa_variables.cpp
+++ b/xfa/fxfa/parser/cxfa_variables.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_variables.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_container.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -28,6 +27,8 @@
                 XFA_Element::Variables,
                 {},
                 kVariablesAttributeData,
-                std::make_unique<CJX_Container>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Container>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Variables::~CXFA_Variables() = default;
diff --git a/xfa/fxfa/parser/cxfa_version.cpp b/xfa/fxfa/parser/cxfa_version.cpp
index ffd3990..c0affe8 100644
--- a/xfa/fxfa/parser/cxfa_version.cpp
+++ b/xfa/fxfa/parser/cxfa_version.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_version.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Version,
                 {},
                 kVersionAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Version::~CXFA_Version() = default;
diff --git a/xfa/fxfa/parser/cxfa_versioncontrol.cpp b/xfa/fxfa/parser/cxfa_versioncontrol.cpp
index 73dd0b4..f9d8a8f 100644
--- a/xfa/fxfa/parser/cxfa_versioncontrol.cpp
+++ b/xfa/fxfa/parser/cxfa_versioncontrol.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_versioncontrol.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -33,6 +32,8 @@
                 XFA_Element::VersionControl,
                 {},
                 kVersionControlAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_VersionControl::~CXFA_VersionControl() = default;
diff --git a/xfa/fxfa/parser/cxfa_viewerpreferences.cpp b/xfa/fxfa/parser/cxfa_viewerpreferences.cpp
index 65408f2..596a49f 100644
--- a/xfa/fxfa/parser/cxfa_viewerpreferences.cpp
+++ b/xfa/fxfa/parser/cxfa_viewerpreferences.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_viewerpreferences.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -40,6 +39,8 @@
                 XFA_Element::ViewerPreferences,
                 kViewerPreferencesPropertyData,
                 kViewerPreferencesAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_ViewerPreferences::~CXFA_ViewerPreferences() = default;
diff --git a/xfa/fxfa/parser/cxfa_webclient.cpp b/xfa/fxfa/parser/cxfa_webclient.cpp
index 99d569a..e46e10f 100644
--- a/xfa/fxfa/parser/cxfa_webclient.cpp
+++ b/xfa/fxfa/parser/cxfa_webclient.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_webclient.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -33,6 +32,8 @@
                 XFA_Element::WebClient,
                 kWebClientPropertyData,
                 kWebClientAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_WebClient::~CXFA_WebClient() = default;
diff --git a/xfa/fxfa/parser/cxfa_whitespace.cpp b/xfa/fxfa/parser/cxfa_whitespace.cpp
index 99b887d..c002b03 100644
--- a/xfa/fxfa/parser/cxfa_whitespace.cpp
+++ b/xfa/fxfa/parser/cxfa_whitespace.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_whitespace.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Whitespace,
                 {},
                 kWhitespaceAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Whitespace::~CXFA_Whitespace() = default;
diff --git a/xfa/fxfa/parser/cxfa_window.cpp b/xfa/fxfa/parser/cxfa_window.cpp
index 524bcc4..2ac8aef 100644
--- a/xfa/fxfa/parser/cxfa_window.cpp
+++ b/xfa/fxfa/parser/cxfa_window.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_window.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -27,6 +26,8 @@
                 XFA_Element::Window,
                 {},
                 kWindowAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Window::~CXFA_Window() = default;
diff --git a/xfa/fxfa/parser/cxfa_wsdladdress.cpp b/xfa/fxfa/parser/cxfa_wsdladdress.cpp
index 83de0d5..07d176c 100644
--- a/xfa/fxfa/parser/cxfa_wsdladdress.cpp
+++ b/xfa/fxfa/parser/cxfa_wsdladdress.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_wsdladdress.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_textnode.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -29,6 +28,8 @@
                 XFA_Element::WsdlAddress,
                 {},
                 kWsdlAddressAttributeData,
-                std::make_unique<CJX_TextNode>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_TextNode>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_WsdlAddress::~CXFA_WsdlAddress() = default;
diff --git a/xfa/fxfa/parser/cxfa_wsdlconnection.cpp b/xfa/fxfa/parser/cxfa_wsdlconnection.cpp
index 4fd9504..7905041 100644
--- a/xfa/fxfa/parser/cxfa_wsdlconnection.cpp
+++ b/xfa/fxfa/parser/cxfa_wsdlconnection.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_wsdlconnection.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_wsdlconnection.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -37,6 +36,8 @@
                 XFA_Element::WsdlConnection,
                 kWsdlConnectionPropertyData,
                 kWsdlConnectionAttributeData,
-                std::make_unique<CJX_WsdlConnection>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_WsdlConnection>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_WsdlConnection::~CXFA_WsdlConnection() = default;
diff --git a/xfa/fxfa/parser/cxfa_xdc.cpp b/xfa/fxfa/parser/cxfa_xdc.cpp
index 6ff318a..9b61fa6 100644
--- a/xfa/fxfa/parser/cxfa_xdc.cpp
+++ b/xfa/fxfa/parser/cxfa_xdc.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_xdc.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -32,6 +31,8 @@
                 XFA_Element::Xdc,
                 kXdcPropertyData,
                 kXdcAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Xdc::~CXFA_Xdc() = default;
diff --git a/xfa/fxfa/parser/cxfa_xdp.cpp b/xfa/fxfa/parser/cxfa_xdp.cpp
index a0f84ec..c235895 100644
--- a/xfa/fxfa/parser/cxfa_xdp.cpp
+++ b/xfa/fxfa/parser/cxfa_xdp.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_xdp.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -31,6 +30,8 @@
                 XFA_Element::Xdp,
                 kXdpPropertyData,
                 kXdpAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Xdp::~CXFA_Xdp() = default;
diff --git a/xfa/fxfa/parser/cxfa_xfa.cpp b/xfa/fxfa/parser/cxfa_xfa.cpp
index 620cec4..e38172c 100644
--- a/xfa/fxfa/parser/cxfa_xfa.cpp
+++ b/xfa/fxfa/parser/cxfa_xfa.cpp
@@ -7,6 +7,7 @@
 #include "xfa/fxfa/parser/cxfa_xfa.h"
 
 #include "fxjs/xfa/cjx_xfa.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -25,6 +26,8 @@
                 XFA_Element::Xfa,
                 {},
                 kXfaAttributeData,
-                std::make_unique<CJX_Xfa>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Xfa>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Xfa::~CXFA_Xfa() = default;
diff --git a/xfa/fxfa/parser/cxfa_xmlconnection.cpp b/xfa/fxfa/parser/cxfa_xmlconnection.cpp
index 81b8282..f10745c 100644
--- a/xfa/fxfa/parser/cxfa_xmlconnection.cpp
+++ b/xfa/fxfa/parser/cxfa_xmlconnection.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_xmlconnection.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -32,6 +31,8 @@
                 XFA_Element::XmlConnection,
                 kXmlConnectionPropertyData,
                 kXmlConnectionAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_XmlConnection::~CXFA_XmlConnection() = default;
diff --git a/xfa/fxfa/parser/cxfa_xsdconnection.cpp b/xfa/fxfa/parser/cxfa_xsdconnection.cpp
index e40f76e..838f4a3 100644
--- a/xfa/fxfa/parser/cxfa_xsdconnection.cpp
+++ b/xfa/fxfa/parser/cxfa_xsdconnection.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_xsdconnection.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -33,6 +32,8 @@
                 XFA_Element::XsdConnection,
                 kXsdConnectionPropertyData,
                 kXsdConnectionAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_XsdConnection::~CXFA_XsdConnection() = default;
diff --git a/xfa/fxfa/parser/cxfa_xsl.cpp b/xfa/fxfa/parser/cxfa_xsl.cpp
index 2b6dc04..af4ec0b 100644
--- a/xfa/fxfa/parser/cxfa_xsl.cpp
+++ b/xfa/fxfa/parser/cxfa_xsl.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_xsl.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -32,6 +31,8 @@
                 XFA_Element::Xsl,
                 kXslPropertyData,
                 kXslAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Xsl::~CXFA_Xsl() = default;
diff --git a/xfa/fxfa/parser/cxfa_zpl.cpp b/xfa/fxfa/parser/cxfa_zpl.cpp
index d1d83fe..fc235d8 100644
--- a/xfa/fxfa/parser/cxfa_zpl.cpp
+++ b/xfa/fxfa/parser/cxfa_zpl.cpp
@@ -6,9 +6,8 @@
 
 #include "xfa/fxfa/parser/cxfa_zpl.h"
 
-#include <memory>
-
 #include "fxjs/xfa/cjx_node.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
 
 namespace {
 
@@ -35,6 +34,8 @@
                 XFA_Element::Zpl,
                 kZplPropertyData,
                 kZplAttributeData,
-                std::make_unique<CJX_Node>(this)) {}
+                cppgc::MakeGarbageCollected<CJX_Node>(
+                    doc->GetHeap()->GetAllocationHandle(),
+                    this)) {}
 
 CXFA_Zpl::~CXFA_Zpl() = default;