K. Moon | 832a694 | 2022-10-31 20:11:31 +0000 | [diff] [blame] | 1 | // Copyright 2017 The PDFium Authors |
Dan Sinclair | f473672 | 2017-11-27 18:10:47 +0000 | [diff] [blame] | 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 | #include "xfa/fxfa/parser/cxfa_extras.h" |
| 8 | |
Dan Sinclair | fe9d640 | 2017-12-14 19:45:53 +0000 | [diff] [blame] | 9 | #include "fxjs/xfa/cjx_extras.h" |
Tom Sepez | 757a6bf | 2020-09-17 17:22:38 +0000 | [diff] [blame] | 10 | #include "xfa/fxfa/parser/cxfa_document.h" |
Dan Sinclair | fe9d640 | 2017-12-14 19:45:53 +0000 | [diff] [blame] | 11 | |
Dan Sinclair | f473672 | 2017-11-27 18:10:47 +0000 | [diff] [blame] | 12 | namespace { |
| 13 | |
Lei Zhang | ec7d8e2 | 2018-02-07 19:57:25 +0000 | [diff] [blame] | 14 | const CXFA_Node::AttributeData kExtrasAttributeData[] = { |
Dan Sinclair | 21b0827 | 2017-11-30 20:22:20 +0000 | [diff] [blame] | 15 | {XFA_Attribute::Id, XFA_AttributeType::CData, nullptr}, |
| 16 | {XFA_Attribute::Name, XFA_AttributeType::CData, nullptr}, |
| 17 | {XFA_Attribute::Use, XFA_AttributeType::CData, nullptr}, |
| 18 | {XFA_Attribute::Usehref, XFA_AttributeType::CData, nullptr}, |
Tom Sepez | a8c86c2 | 2019-01-25 22:06:03 +0000 | [diff] [blame] | 19 | }; |
Dan Sinclair | f473672 | 2017-11-27 18:10:47 +0000 | [diff] [blame] | 20 | |
Dan Sinclair | f473672 | 2017-11-27 18:10:47 +0000 | [diff] [blame] | 21 | } // namespace |
| 22 | |
Dan Sinclair | c40c5aa | 2017-11-30 21:29:11 +0000 | [diff] [blame] | 23 | CXFA_Extras::CXFA_Extras(CXFA_Document* doc, XFA_PacketType packet) |
Dan Sinclair | f473672 | 2017-11-27 18:10:47 +0000 | [diff] [blame] | 24 | : CXFA_Node(doc, |
| 25 | packet, |
Tom Sepez | 0c05758 | 2021-08-17 17:37:23 +0000 | [diff] [blame] | 26 | {XFA_XDPPACKET::kSourceSet, XFA_XDPPACKET::kTemplate, |
| 27 | XFA_XDPPACKET::kForm}, |
Dan Sinclair | f473672 | 2017-11-27 18:10:47 +0000 | [diff] [blame] | 28 | XFA_ObjectType::Node, |
| 29 | XFA_Element::Extras, |
Tom Sepez | c0fa5f6 | 2019-01-25 20:07:27 +0000 | [diff] [blame] | 30 | {}, |
Lei Zhang | ec7d8e2 | 2018-02-07 19:57:25 +0000 | [diff] [blame] | 31 | kExtrasAttributeData, |
Tom Sepez | 757a6bf | 2020-09-17 17:22:38 +0000 | [diff] [blame] | 32 | cppgc::MakeGarbageCollected<CJX_Extras>( |
| 33 | doc->GetHeap()->GetAllocationHandle(), |
| 34 | this)) {} |
Dan Sinclair | f473672 | 2017-11-27 18:10:47 +0000 | [diff] [blame] | 35 | |
Tom Sepez | 7fc43dd | 2018-12-13 17:54:26 +0000 | [diff] [blame] | 36 | CXFA_Extras::~CXFA_Extras() = default; |