xref: /aosp_15_r20/external/pdfium/xfa/fxfa/parser/cxfa_node.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2017 The PDFium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 
7 #ifndef XFA_FXFA_PARSER_CXFA_NODE_H_
8 #define XFA_FXFA_PARSER_CXFA_NODE_H_
9 
10 #include <stddef.h>
11 #include <stdint.h>
12 
13 #include <utility>
14 #include <vector>
15 
16 #include "core/fxcrt/fx_coordinates.h"
17 #include "core/fxcrt/mask.h"
18 #include "core/fxcrt/retain_ptr.h"
19 #include "core/fxcrt/unowned_ptr.h"
20 #include "core/fxcrt/unowned_ptr_exclusion.h"
21 #include "core/fxcrt/widestring.h"
22 #include "core/fxge/dib/fx_dib.h"
23 #include "fxjs/gc/gced_tree_node_mixin.h"
24 #include "third_party/abseil-cpp/absl/types/optional.h"
25 #include "third_party/base/containers/span.h"
26 #include "v8/include/cppgc/member.h"
27 #include "v8/include/cppgc/visitor.h"
28 #include "xfa/fxfa/cxfa_ffwidget_type.h"
29 #include "xfa/fxfa/fxfa.h"
30 #include "xfa/fxfa/parser/cxfa_object.h"
31 
32 class CFGAS_GEFont;
33 class CFX_DIBitmap;
34 class CFX_XMLDocument;
35 class CFX_XMLNode;
36 class CXFA_Bind;
37 class CXFA_Border;
38 class CXFA_Calculate;
39 class CXFA_Caption;
40 class CXFA_Event;
41 class CXFA_EventParam;
42 class CXFA_FFDoc;
43 class CXFA_FFDocView;
44 class CXFA_Font;
45 class CXFA_Keep;
46 class CXFA_Margin;
47 class CXFA_Measurement;
48 class CXFA_Occur;
49 class CXFA_Para;
50 class CXFA_Script;
51 class CXFA_TextLayout;
52 class CXFA_Ui;
53 class CXFA_Validate;
54 class CXFA_Value;
55 class CXFA_WidgetLayoutData;
56 class GCedLocaleIface;
57 
58 enum class XFA_NodeFilter : uint8_t {
59   kChildren = 1 << 0,
60   kProperties = 1 << 1,
61   kOneOfProperty = 1 << 2,
62 };
63 
64 enum class XFA_CheckState : uint8_t {
65   kOn = 0,
66   kOff = 1,
67   kNeutral = 2,
68 };
69 
70 enum class XFA_ValuePicture : uint8_t {
71   kRaw = 0,
72   kDisplay,
73   kEdit,
74   kDataBind,
75 };
76 
77 enum class XFA_NodeFlag : uint8_t {
78   kNone = 0,
79   kInitialized = 1 << 0,
80   kHasRemovedChildren = 1 << 1,
81   kNeedsInitApp = 1 << 2,
82   kBindFormItems = 1 << 3,
83   kUserInteractive = 1 << 4,
84   kUnusedNode = 1 << 5,
85   kLayoutGeneratedNode = 1 << 6
86 };
87 
88 enum class XFA_PropertyFlag : uint8_t {
89   kOneOf = 1 << 0,
90   kDefaultOneOf = 1 << 1,
91 };
92 
93 class CXFA_Node : public CXFA_Object, public GCedTreeNodeMixin<CXFA_Node> {
94  public:
95   struct PropertyData {
96     PropertyData() = delete;
PropertyDataPropertyData97     constexpr PropertyData(XFA_Element property,
98                            uint8_t occurrence_count,
99                            Mask<XFA_PropertyFlag> flags)
100         : property(property),
101           occurrence_count(occurrence_count),
102           flags(flags) {}
103 
104     XFA_Element property;
105     uint8_t occurrence_count;
106     Mask<XFA_PropertyFlag> flags;
107   };
108 
109   struct AttributeData {
110     XFA_Attribute attribute;
111     XFA_AttributeType type;
112     UNOWNED_PTR_EXCLUSION void* default_value;  // POD type.
113   };
114 
115   // Node is created from cppgc heap.
116   static CXFA_Node* Create(CXFA_Document* doc,
117                            XFA_Element element,
118                            XFA_PacketType packet);
119 
120   ~CXFA_Node() override;
121 
122   // CXFA_Object:
123   void Trace(cppgc::Visitor* visitor) const override;
124 
125   bool HasProperty(XFA_Element property) const;
126   bool HasPropertyFlag(XFA_Element property, XFA_PropertyFlag flag) const;
127   uint8_t PropertyOccurrenceCount(XFA_Element property) const;
128 
129   std::pair<CXFA_Node*, int32_t> GetProperty(int32_t index,
130                                              XFA_Element eProperty) const;
131   CXFA_Node* GetOrCreateProperty(int32_t index, XFA_Element eProperty);
132 
133   void SendAttributeChangeMessage(XFA_Attribute eAttribute, bool bScriptModify);
134 
135   bool HasAttribute(XFA_Attribute attr) const;
136   XFA_AttributeType GetAttributeType(XFA_Attribute type) const;
137 
138   // Note: returns XFA_Attribute::Unknown for invalid indicies.
139   XFA_Attribute GetAttribute(size_t i) const;
140 
GetPacketType()141   XFA_PacketType GetPacketType() const { return m_ePacket; }
142 
143   void SetInitializedFlagAndNotify();
144   void SetFlag(XFA_NodeFlag dwFlag);
145   void ClearFlag(XFA_NodeFlag dwFlag);
146 
147   CXFA_Node* CreateInstanceIfPossible(bool bDataMerge);
148   int32_t GetCount();
149   CXFA_Node* GetItemIfExists(int32_t iIndex);
150   void RemoveItem(CXFA_Node* pRemoveInstance, bool bRemoveDataBinding);
151   void InsertItem(CXFA_Node* pNewInstance,
152                   int32_t iPos,
153                   int32_t iCount,
154                   bool bMoveDataBindingNodes);
155 
IsInitialized()156   bool IsInitialized() const { return HasFlag(XFA_NodeFlag::kInitialized); }
IsUserInteractive()157   bool IsUserInteractive() const {
158     return HasFlag(XFA_NodeFlag::kUserInteractive);
159   }
IsUnusedNode()160   bool IsUnusedNode() const { return HasFlag(XFA_NodeFlag::kUnusedNode); }
IsLayoutGeneratedNode()161   bool IsLayoutGeneratedNode() const {
162     return HasFlag(XFA_NodeFlag::kLayoutGeneratedNode);
163   }
164 
165   bool PresenceRequiresSpace() const;
166   void SetBindingNode(CXFA_Node* node);
167   void SetNodeAndDescendantsUnused();
168 
HasRemovedChildren()169   bool HasRemovedChildren() const {
170     return HasFlag(XFA_NodeFlag::kHasRemovedChildren);
171   }
172 
173   bool IsAttributeInXML();
IsFormContainer()174   bool IsFormContainer() const {
175     return m_ePacket == XFA_PacketType::Form && IsContainerNode();
176   }
177 
SetXMLMappingNode(CFX_XMLNode * node)178   void SetXMLMappingNode(CFX_XMLNode* node) { xml_node_ = node; }
GetXMLMappingNode()179   CFX_XMLNode* GetXMLMappingNode() const { return xml_node_; }
180   CFX_XMLNode* CreateXMLMappingNode();
181   bool IsNeedSavingXMLNode() const;
182 
183   void SetToXML(const WideString& value);
184 
GetNameHash()185   uint32_t GetNameHash() const { return m_dwNameHash; }
IsUnnamed()186   bool IsUnnamed() const { return m_dwNameHash == 0; }
187   CXFA_Node* GetModelNode();
188   void UpdateNameHash();
189 
190   size_t CountChildren(XFA_Element eType, bool bOnlyChild);
191 
192   template <typename T>
GetChild(size_t index,XFA_Element eType,bool bOnlyChild)193   T* GetChild(size_t index, XFA_Element eType, bool bOnlyChild) {
194     return static_cast<T*>(GetChildInternal(index, eType, bOnlyChild));
195   }
196 
197   template <typename T>
GetChild(size_t index,XFA_Element eType,bool bOnlyChild)198   const T* GetChild(size_t index, XFA_Element eType, bool bOnlyChild) const {
199     return static_cast<const T*>(GetChildInternal(index, eType, bOnlyChild));
200   }
201 
202   bool IsAncestorOf(const CXFA_Node* that) const;
203 
204   void InsertChildAndNotify(int32_t index, CXFA_Node* pNode);
205   void InsertChildAndNotify(CXFA_Node* pNode, CXFA_Node* pBeforeNode);
206   void RemoveChildAndNotify(CXFA_Node* pNode, bool bNotify);
207 
208   CXFA_Node* Clone(bool bRecursive);
209 
210   CXFA_Node* GetNextContainerSibling() const;
211   CXFA_Node* GetPrevContainerSibling() const;
212   CXFA_Node* GetFirstContainerChild() const;
213   CXFA_Node* GetContainerParent() const;
214 
215   std::vector<CXFA_Node*> GetNodeListForType(XFA_Element eTypeFilter);
216   std::vector<CXFA_Node*> GetNodeListWithFilter(Mask<XFA_NodeFilter> dwFilter);
217   CXFA_Node* CreateSamePacketNode(XFA_Element eType);
218   CXFA_Node* CloneTemplateToForm(bool bRecursive);
219   CXFA_Node* GetTemplateNodeIfExists() const;
220   void SetTemplateNode(CXFA_Node* pTemplateNode);
221   CXFA_Node* GetDataDescriptionNode();
222   void SetDataDescriptionNode(CXFA_Node* pDataDescriptionNode);
223   CXFA_Node* GetBindData();
HasBindItems()224   bool HasBindItems() const { return !binding_nodes_.empty(); }
225   std::vector<CXFA_Node*> GetBindItemsCopy() const;
226   void AddBindItem(CXFA_Node* pFormNode);
227   // Returns true if there are still more items.
228   bool RemoveBindItem(CXFA_Node* pFormNode);
229   bool HasBindItem() const;
230   CXFA_Node* GetContainerNode();
231   GCedLocaleIface* GetLocale();
232   absl::optional<WideString> GetLocaleName();
233   XFA_AttributeValue GetIntact();
234   WideString GetNameExpression();
235 
236   CXFA_Node* GetFirstChildByName(WideStringView wsNodeName) const;
237   CXFA_Node* GetFirstChildByName(uint32_t dwNodeNameHash) const;
238   template <typename T>
GetFirstChildByClass(XFA_Element eType)239   T* GetFirstChildByClass(XFA_Element eType) const {
240     return static_cast<T*>(GetFirstChildByClassInternal(eType));
241   }
242   CXFA_Node* GetNextSameNameSibling(uint32_t dwNodeNameHash) const;
243   template <typename T>
GetNextSameNameSibling(WideStringView wsNodeName)244   T* GetNextSameNameSibling(WideStringView wsNodeName) const {
245     return static_cast<T*>(GetNextSameNameSiblingInternal(wsNodeName));
246   }
247   template <typename T>
GetNextSameClassSibling(XFA_Element eType)248   T* GetNextSameClassSibling(XFA_Element eType) const {
249     return static_cast<T*>(GetNextSameClassSiblingInternal(eType));
250   }
251 
252   CXFA_Node* GetOneChildNamed(WideStringView wsName);
253   CXFA_Node* GetOneChildOfClass(WideStringView wsClass);
254 
255   std::vector<CXFA_Node*> GetSiblings(bool bIsClassName);
256   size_t GetIndex(bool bIsProperty, bool bIsClassIndex);
257   size_t GetIndexByName();
258   size_t GetIndexByClassName();
259 
260   CXFA_Node* GetInstanceMgrOfSubform();
261 
262   absl::optional<bool> GetDefaultBoolean(XFA_Attribute attr) const;
263   absl::optional<int32_t> GetDefaultInteger(XFA_Attribute attr) const;
264   absl::optional<CXFA_Measurement> GetDefaultMeasurement(
265       XFA_Attribute attr) const;
266   absl::optional<WideString> GetDefaultCData(XFA_Attribute attr) const;
267   absl::optional<XFA_AttributeValue> GetDefaultEnum(XFA_Attribute attr) const;
268 
269   bool IsOpenAccess() const;
270 
271   CXFA_Occur* GetOccurIfExists();
272   CXFA_Border* GetBorderIfExists() const;
273   CXFA_Border* GetOrCreateBorderIfPossible();
274   CXFA_Caption* GetCaptionIfExists() const;
275   CXFA_Font* GetFontIfExists() const;
276   CXFA_Font* GetOrCreateFontIfPossible();
277 
278   float GetFontSize() const;
279   FX_ARGB GetTextColor() const;
280   float GetLineHeight() const;
281 
282   CXFA_Margin* GetMarginIfExists() const;
283   CXFA_Para* GetParaIfExists() const;
284   CXFA_Calculate* GetCalculateIfExists() const;
285   CXFA_Validate* GetValidateIfExists() const;
286   CXFA_Validate* GetOrCreateValidateIfPossible();
287 
288   CXFA_Value* GetFormValueIfExists() const;
289   WideString GetRawValue() const;
290 
291   int32_t GetRotate() const;
292   absl::optional<float> TryWidth();
293 
294   CXFA_Node* GetExclGroupIfExists();
295 
296   XFA_EventError ProcessEvent(CXFA_FFDocView* pDocView,
297                               XFA_AttributeValue iActivity,
298                               CXFA_EventParam* pEventParam);
299   XFA_EventError ProcessCalculate(CXFA_FFDocView* pDocView);
300   XFA_EventError ProcessValidate(CXFA_FFDocView* pDocView, int32_t iFlags);
301   XFA_EventError ExecuteScript(CXFA_FFDocView* pDocView,
302                                CXFA_Script* script,
303                                CXFA_EventParam* pEventParam);
304   std::pair<XFA_EventError, bool> ExecuteBoolScript(
305       CXFA_FFDocView* pDocView,
306       CXFA_Script* script,
307       CXFA_EventParam* pEventParam);
308 
309   CXFA_Node* GetUIChildNode();
310 
311   // NOTE: value returned is often determined by child UI node, and
312   // can't be used to infer anything about this particual node itself.
313   XFA_FFWidgetType GetFFWidgetType();
314 
315   CFX_RectF GetUIMargin();
316   CXFA_Border* GetUIBorder();
317 
SetPreNull(bool val)318   void SetPreNull(bool val) { m_bPreNull = val; }
IsNull()319   bool IsNull() const { return m_bIsNull; }
SetIsNull(bool val)320   void SetIsNull(bool val) { m_bIsNull = val; }
321 
SetWidgetReady()322   void SetWidgetReady() { is_widget_ready_ = true; }
IsWidgetReady()323   bool IsWidgetReady() const { return is_widget_ready_; }
324   std::vector<CXFA_Event*> GetEventByActivity(XFA_AttributeValue iActivity,
325                                               bool bIsFormReady);
326 
327   void ResetData();
328   void StartWidgetLayout(CXFA_FFDoc* doc,
329                          float* pCalcWidth,
330                          float* pCalcHeight);
331   absl::optional<float> FindSplitPos(CXFA_FFDocView* pDocView,
332                                      size_t szBlockIndex,
333                                      float fCalcHeight);
334 
335   bool LoadCaption(CXFA_FFDoc* doc);
336   CXFA_TextLayout* GetCaptionTextLayout();
337   CXFA_TextLayout* GetTextLayout();
338 
339   bool LoadLayoutImage(CXFA_FFDoc* doc);
340   bool LoadEditImage(CXFA_FFDoc* doc);
341   CFX_Size GetLayoutImageDpi() const;
342   CFX_Size GetEditImageDpi() const;
343   RetainPtr<CFX_DIBitmap> GetLayoutImage();
344   RetainPtr<CFX_DIBitmap> GetEditImage();
345   void SetLayoutImage(RetainPtr<CFX_DIBitmap> newImage);
346   void SetEditImage(RetainPtr<CFX_DIBitmap> newImage);
347 
348   RetainPtr<CFGAS_GEFont> GetFGASFont(CXFA_FFDoc* doc);
349 
350   bool IsListBox();
351   bool IsRadioButton();
352   bool IsMultiLine();
353 
354   bool HasButtonRollover() const;
355   bool HasButtonDown() const;
356 
357   float GetCheckButtonSize();
358 
359   XFA_CheckState GetCheckState();
360   void SetCheckState(XFA_CheckState eCheckState);
361 
362   CXFA_Node* GetSelectedMember();
363   CXFA_Node* SetSelectedMember(WideStringView wsName);
364   void SetSelectedMemberByValue(WideStringView wsValue,
365                                 bool bNotify,
366                                 bool bScriptModify,
367                                 bool bSyncData);
368 
369   CXFA_Node* GetExclGroupFirstMember();
370   CXFA_Node* GetExclGroupNextMember(CXFA_Node* pNode);
371 
372   bool IsChoiceListAllowTextEntry();
373   size_t CountChoiceListItems(bool bSaveValue);
374   absl::optional<WideString> GetChoiceListItem(int32_t nIndex, bool bSaveValue);
375   bool IsChoiceListMultiSelect();
376   bool IsChoiceListCommitOnSelect();
377   std::vector<WideString> GetChoiceListItems(bool bSaveValue);
378 
379   int32_t CountSelectedItems();
380   int32_t GetSelectedItem(int32_t nIndex);
381   std::vector<int32_t> GetSelectedItems();
382   std::vector<WideString> GetSelectedItemsValue();
383   void SetSelectedItems(const std::vector<int32_t>& iSelArray,
384                         bool bNotify,
385                         bool bScriptModify,
386                         bool bSyncData);
387   void InsertItem(const WideString& wsLabel,
388                   const WideString& wsValue,
389                   bool bNotify);
390   bool DeleteItem(int32_t nIndex, bool bNotify, bool bScriptModify);
391   void ClearAllSelections();
392 
393   bool GetItemState(int32_t nIndex);
394   void SetItemState(int32_t nIndex,
395                     bool bSelected,
396                     bool bNotify,
397                     bool bScriptModify);
398 
399   WideString GetItemValue(WideStringView wsLabel);
400 
401   bool IsHorizontalScrollPolicyOff();
402   bool IsVerticalScrollPolicyOff();
403   absl::optional<int32_t> GetNumberOfCells();
404 
405   bool SetValue(XFA_ValuePicture eValueType, const WideString& wsValue);
406   WideString GetValue(XFA_ValuePicture eValueType);
407   WideString GetPictureContent(XFA_ValuePicture ePicture);
408   WideString GetNormalizeDataValue(const WideString& wsValue);
409   WideString GetFormatDataValue(const WideString& wsValue);
410   WideString NormalizeNumStr(const WideString& wsValue);
411 
412   std::pair<XFA_Element, int32_t> GetMaxChars() const;
413   int32_t GetFracDigits() const;
414   int32_t GetLeadDigits() const;
415 
416   WideString NumericLimit(const WideString& wsValue);
417 
418   bool IsTransparent() const;
419   bool IsProperty() const;
420 
421  protected:
422   CXFA_Node(CXFA_Document* pDoc,
423             XFA_PacketType ePacket,
424             Mask<XFA_XDPPACKET> validPackets,
425             XFA_ObjectType oType,
426             XFA_Element eType,
427             pdfium::span<const PropertyData> properties,
428             pdfium::span<const AttributeData> attributes,
429             CJX_Object* js_object);
430 
431   virtual XFA_Element GetValueNodeType() const;
432   virtual XFA_FFWidgetType GetDefaultFFWidgetType() const;
433 
434  private:
435   void ProcessScriptTestValidate(CXFA_FFDocView* pDocView,
436                                  CXFA_Validate* validate,
437                                  bool bVersionFlag);
438   XFA_EventError ProcessFormatTestValidate(CXFA_FFDocView* pDocView,
439                                            CXFA_Validate* validate,
440                                            bool bVersionFlag);
441   XFA_EventError ProcessNullTestValidate(CXFA_FFDocView* pDocView,
442                                          CXFA_Validate* validate,
443                                          int32_t iFlags,
444                                          bool bVersionFlag);
445   WideString GetValidateCaptionName(bool bVersionFlag);
446   WideString GetValidateMessage(bool bError, bool bVersionFlag);
447 
448   bool HasFlag(XFA_NodeFlag dwFlag) const;
449   const PropertyData* GetPropertyData(XFA_Element property) const;
450   const AttributeData* GetAttributeData(XFA_Attribute attr) const;
451   absl::optional<XFA_Element> GetFirstPropertyWithFlag(
452       XFA_PropertyFlag flag) const;
453   void OnRemoved(bool bNotify) const;
454   absl::optional<void*> GetDefaultValue(XFA_Attribute attr,
455                                         XFA_AttributeType eType) const;
456   CXFA_Node* GetChildInternal(size_t index,
457                               XFA_Element eType,
458                               bool bOnlyChild) const;
459   CXFA_Node* GetFirstChildByClassInternal(XFA_Element eType) const;
460   CXFA_Node* GetNextSameNameSiblingInternal(WideStringView wsNodeName) const;
461   CXFA_Node* GetNextSameClassSiblingInternal(XFA_Element eType) const;
462   void CalcCaptionSize(CXFA_FFDoc* doc, CFX_SizeF* pszCap);
463   bool CalculateFieldAutoSize(CXFA_FFDoc* doc, CFX_SizeF* pSize);
464   bool CalculateWidgetAutoSize(CFX_SizeF* pSize);
465   bool CalculateTextEditAutoSize(CXFA_FFDoc* doc, CFX_SizeF* pSize);
466   bool CalculateCheckButtonAutoSize(CXFA_FFDoc* doc, CFX_SizeF* pSize);
467   bool CalculatePushButtonAutoSize(CXFA_FFDoc* doc, CFX_SizeF* pSize);
468   CFX_SizeF CalculateImageSize(float img_width,
469                                float img_height,
470                                const CFX_Size& dpi);
471   bool CalculateImageEditAutoSize(CXFA_FFDoc* doc, CFX_SizeF* pSize);
472   bool CalculateImageAutoSize(CXFA_FFDoc* doc, CFX_SizeF* pSize);
473   float CalculateWidgetAutoHeight(float fHeightCalc);
474   float CalculateWidgetAutoWidth(float fWidthCalc);
475   float GetWidthWithoutMargin(float fWidthCalc) const;
476   float GetHeightWithoutMargin(float fHeightCalc) const;
477   void CalculateTextContentSize(CXFA_FFDoc* doc, CFX_SizeF* pSize);
478   CFX_SizeF CalculateAccWidthAndHeight(CXFA_FFDoc* doc, float fWidth);
479   void InitLayoutData(CXFA_FFDoc* doc);
480   void StartTextLayout(CXFA_FFDoc* doc, float* pCalcWidth, float* pCalcHeight);
481 
482   void InsertListTextItem(CXFA_Node* pItems,
483                           const WideString& wsText,
484                           int32_t nIndex);
485   WideString GetItemLabel(WideStringView wsValue) const;
486 
487   std::pair<XFA_FFWidgetType, CXFA_Ui*> CreateChildUIAndValueNodesIfNeeded();
488   void CreateValueNodeIfNeeded(CXFA_Value* value, CXFA_Node* pUIChild);
489   CXFA_Node* CreateUINodeIfNeeded(CXFA_Ui* ui, XFA_Element type);
490   bool IsValidInPacket(XFA_PacketType packet) const;
491   void SetImageEdit(const WideString& wsContentType,
492                     const WideString& wsHref,
493                     const WideString& wsData);
GetBindingNode()494   CXFA_Node* GetBindingNode() const {
495     if (binding_nodes_.empty())
496       return nullptr;
497     return binding_nodes_[0];
498   }
BindsFormItems()499   bool BindsFormItems() const { return HasFlag(XFA_NodeFlag::kBindFormItems); }
NeedsInitApp()500   bool NeedsInitApp() const { return HasFlag(XFA_NodeFlag::kNeedsInitApp); }
501   void SyncValue(const WideString& wsValue, bool bNotify);
502   CXFA_Value* GetDefaultValueIfExists();
503   CXFA_Bind* GetBindIfExists() const;
504   absl::optional<XFA_AttributeValue> GetIntactFromKeep(
505       const CXFA_Keep* pKeep,
506       XFA_AttributeValue eLayoutType) const;
507   CXFA_Node* GetTransparentParent();
508 
509   absl::optional<float> TryHeight();
510   absl::optional<float> TryMinWidth();
511   absl::optional<float> TryMinHeight();
512   absl::optional<float> TryMaxWidth();
513   absl::optional<float> TryMaxHeight();
514   XFA_EventError ProcessEventInternal(CXFA_FFDocView* pDocView,
515                                       XFA_AttributeValue iActivity,
516                                       CXFA_Event* event,
517                                       CXFA_EventParam* pEventParam);
518 
519   CFX_XMLDocument* GetXMLDocument() const;
520 
521   XFA_FFWidgetType ff_widget_type_ = XFA_FFWidgetType::kNone;
522   bool m_bIsNull = true;
523   bool m_bPreNull = true;
524   bool is_widget_ready_ = false;
525   const pdfium::span<const PropertyData> m_Properties;
526   const pdfium::span<const AttributeData> m_Attributes;
527   const Mask<XFA_XDPPACKET> m_ValidPackets;
528   UnownedPtr<CFX_XMLNode> xml_node_;
529   const XFA_PacketType m_ePacket;
530   uint8_t m_ExecuteRecursionDepth = 0;
531   Mask<XFA_NodeFlag> m_uNodeFlags = XFA_NodeFlag::kNone;
532   uint32_t m_dwNameHash = 0;
533   cppgc::Member<CXFA_Node> m_pAuxNode;
534   std::vector<cppgc::Member<CXFA_Node>> binding_nodes_;
535   cppgc::Member<CXFA_WidgetLayoutData> m_pLayoutData;
536   cppgc::Member<CXFA_Ui> ui_;
537 };
538 
539 #endif  // XFA_FXFA_PARSER_CXFA_NODE_H_
540