summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_node.cpp
AgeCommit message (Collapse)Author
2018-04-17Add ownership to CFX_XMLNode childrendan sinclair
This CL sets the CFX_XML tree ownership. The pointers set into the tree must be unique_ptrs and the CFX_XMLNode children are set to be either unique_ptrs or UnownedPtrs. Change-Id: Ib0db495c81471e40f5b4533503f7bbe5a784fd77 Reviewed-on: https://pdfium-review.googlesource.com/30711 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-16Merge CFX_XMLElement and CFX_XMLAttributeNodedan sinclair
CFX_XMLElement is the only subclass of CFX_XMLAttributeNode. This CL merges the two classes together. The {Set|Get}String method has been renamed to {Set|Get}Attribute to make it clearer what you're retrieving. Change-Id: I158c961d4d8c5f563d937a3e7a35321a33622562 Reviewed-on: https://pdfium-review.googlesource.com/30710 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-04-16Split GetNumbericSymbol into individual methodsdan sinclair
This CL removes the GetNumbericSymbol method and adds individual methods for each symbol we retrieve. Change-Id: Id14108e5ea43a76250e18a1aa13bdbb05e928cdc Reviewed-on: https://pdfium-review.googlesource.com/30695 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-04-12Rename CXFA_SimpleParser to CXFA_DocumentParserDan Sinclair
The CXFA_SimpleParser is handling the XFA document parsing. This CL renames the class to make it clearer that this is the XFA document parser. Change-Id: Ia290df2671fba9efa221ae997156ee4846749b02 Reviewed-on: https://pdfium-review.googlesource.com/30231 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-09Revert "Remove CXFA nodes instead of CFX_XML nodes"dsinclair
This reverts commit 2b4ad9ff5bf1727d12ef2bcce7e3fa925bbe8978. Reason for revert: Causing crashes on windows: Rendering PDF file E:\b\build\slave\windows_xfa\build\pdfium\out\debug_xfa_v8\gen\pdfium\testing\pixel\static_list_box_caption.pdf. ==== C stack trace =============================== diff: 0.00% passed std::tuple<CXFA_Node * __ptr64 const & __ptr64>::tuple<CXFA_Node * __ptr64 const & __ptr64> [0x0000000141785700+48] ??@875fbed02c72fe689afc0ad24a247bf8@ [0x000000013F7BB443+131] ??$_Buynode@AEBUpiecewise_construct_t@std@@V?$tuple@AEBQEAVCXFA_Node@@@2@V?$tuple@$$V@2@@?$_Tree_comp_alloc@V?$_Tmap_traits@PEAVCXFA_Node@@V?$unique_ptr@V?$map@IV?$unique_ptr@U?$pair@V?$set@PEAVCXFA_Node@@U?$less@PEAVCXFA_Node@@@std@@V?$allocator@PEAVCXFA [0x0000000141785309+169] ??@2b14910fe4cc3866ca68e10bfed05253@ [0x000000013F7CCB09+185] CJX_Object::SetAttributeValue [0x000000013FAE0F7E+302] v8::internal::compiler::Int64Lowering::LowerNode [0x000000013FBB04C0+31920] CXFA_Document::DataMerge_CopyContainer [0x00000001417A43A3+9603] CXFA_Document::DataMerge_CopyContainer [0x00000001417A2048+552] CXFA_Document::DataMerge_CopyContainer [0x00000001417A3436+5654] CXFA_Document::DataMerge_CopyContainer [0x00000001417A1FEE+462] CXFA_Document::DoDataMerge [0x00000001417A5F96+3142] CXFA_FFDocView::StartLayout [0x00000001416BECCD+93] CPDFXFA_Context::LoadXFADoc [0x000000014169162D+669] FPDF_LoadXFA [0x0000000140AC5A2A+42] std::_Compressed_pair<std::default_delete<CFWL_WidgetProperties>,CFWL_WidgetProperties * __ptr64,1>::_Get_first [0x000000013F72A648+1432] main [0x000000013F727C05+1685] invoke_main [0x0000000141CDB924+52] (f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:79) __scrt_common_main_seh [0x0000000141CDB817+295] (f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283) __scrt_common_main [0x0000000141CDB6DE+14] (f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:326) mainCRTStartup [0x0000000141CDB9B9+9] (f:\dd\vctools\crt\vcstartup\src\startup\exe_main.cpp:17) BaseThreadInitThunk [0x0000000077415A4D+13] RtlUserThreadStart [0x000000007764B831+33] Rendering PDF file E:\b\build\slave\windows_xfa\build\pdfium\out\debug_xfa_v8\gen\pdfium\testing\pixel\resolve_nodes.pdf. ==== C stack trace =============================== std::tuple<CXFA_Node * __ptr64 const & __ptr64>::tuple<CXFA_Node * __ptr64 const & __ptr64> [0x0000000141785700+48] ??@875fbed02c72fe689afc0ad24a247bf8@ [0x000000013F7BB443+131] ??$_Buynode@AEBUpiecewise_construct_t@std@@V?$tuple@AEBQEAVCXFA_Node@@@2@V?$tuple@$$V@2@@?$_Tree_comp_alloc@V?$_Tmap_traits@PEAVCXFA_Node@@V?$unique_ptr@V?$map@IV?$unique_ptr@U?$pair@V?$set@PEAVCXFA_Node@@U?$less@PEAVCXFA_Node@@@std@@V?$allocator@PEAVCXFA [0x0000000141785309+169] ??@2b14910fe4cc3866ca68e10bfed05253@ [0x000000013F7CCB09+185] CJX_Object::SetAttributeValue [0x000000013FAE0F7E+302] v8::internal::compiler::Int64Lowering::LowerNode [0x000000013FBB03F6+31718] CXFA_Document::DataMerge_UpdateBindingRelations [0x00000001417A48DA+1066] CXFA_Document::DataMerge_UpdateBindingRelations [0x00000001417A4ED8+2600] CXFA_Document::DataMerge_UpdateBindingRelations [0x00000001417A4ED8+2600] CXFA_Document::DataMerge_UpdateBindingRelations [0x00000001417A4ED8+2600] CXFA_Document::DataMerge_UpdateBindingRelations [0x00000001417A4ED8+2600] CXFA_Document::DataMerge_UpdateBindingRelations [0x00000001417A4512+98] CXFA_Document::DoDataMerge [0x00000001417A5FF8+3240] CXFA_FFDocView::StartLayout [0x00000001416BECCD+93] CPDFXFA_Context::LoadXFADoc [0x000000014169162D+669] FPDF_LoadXFA [0x0000000140AC5A2A+42] std::_Compressed_pair<std::default_delete<CFWL_WidgetProperties>,CFWL_WidgetProperties * __ptr64,1>::_Get_first [0x000000013F72A648+1432] main [0x000000013F727C05+1685] invoke_main [0x0000000141CDB924+52] (f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:79) __scrt_common_main_seh [0x0000000141CDB817+295] (f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283) __scrt_common_main [0x0000000141CDB6DE+14] (f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:326) mainCRTStartup [0x0000000141CDB9B9+9] (f:\dd\vctools\crt\vcstartup\src\startup\exe_main.cpp:17) BaseThreadInitThunk [0x0000000077415A4D+13] RtlUserThreadStart [0x000000007764B831+33] FAILURE: static_list_box_caption.pdf; Command '['E:\\b\\build\\slave\\windows_xfa\\build\\pdfium\\out\\debug_xfa_v8\\pdfium_test.exe', '--send-events', '--png', '--md5', 'E:\\b\\build\\slave\\windows_xfa\\build\\pdfium\\out\\debug_xfa_v8\\gen\\pdfium\\testing\\pixel\\static_list_box_caption.pdf']' returned non-zero exit status -1073741819 Rendering PDF file E:\b\build\slave\windows_xfa\build\pdfium\out\debug_xfa_v8\gen\pdfium\testing\pixel\standard_symbols.pdf. ==== C stack trace =============================== std::tuple<CXFA_Node * __ptr64 const & __ptr64>::tuple<CXFA_Node * __ptr64 const & __ptr64> [0x0000000141785700+48] FAILURE: resolve_nodes.pdf; Command '['E:\\b\\build\\slave\\windows_xfa\\build\\pdfium\\out\\debug_xfa_v8\\pdfium_test.exe', '--send-events', '--png', '--md5', 'E:\\b\\build\\slave\\windows_xfa\\build\\pdfium\\out\\debug_xfa_v8\\gen\\pdfium\\testing\\pixel\\resolve_nodes.pdf']' returned non-zero exit status -1073741819 ??@875fbed02c72fe689afc0ad24a247bf8@ [0x000000013F7BB443+131] ??$_Buynode@AEBUpiecewise_construct_t@std@@V?$tuple@AEBQEAVCXFA_Node@@@2@V?$tuple@$$V@2@@?$_Tree_comp_alloc@V?$_Tmap_traits@PEAVCXFA_Node@@V?$unique_ptr@V?$map@IV?$unique_ptr@U?$pair@V?$set@PEAVCXFA_Node@@U?$less@PEAVCXFA_Node@@@std@@V?$allocator@PEAVCXFA [0x0000000141785309+169] ??@2b14910fe4cc3866ca68e10bfed05253@ [0x000000013F7CCB09+185] CJX_Object::SetAttributeValue [0x000000013FAE0F7E+302] v8::internal::compiler::Int64Lowering::LowerNode [0x000000013FBB04C0+31920] CXFA_Document::DataMerge_CopyContainer [0x00000001417A43A3+9603] CXFA_Document::DataMerge_CopyContainer [0x00000001417A2048+552] CXFA_Document::DataMerge_CopyContainer [0x00000001417A3436+5654] CXFA_Document::DataMerge_CopyContainer [0x00000001417A1FEE+462] CXFA_Document::DoDataMerge [0x00000001417A5F96+3142] CXFA_FFDocView::StartLayout [0x00000001416BECCD+93] CPDFXFA_Context::LoadXFADoc [0x000000014169162D+669] FPDF_LoadXFA [0x0000000140AC5A2A+42] std::_Compressed_pair<std::default_delete<CFWL_WidgetProperties>,CFWL_WidgetProperties * __ptr64,1>::_Get_first [0x000000013F72A648+1432] main [0x000000013F727C05+1685] invoke_main [0x0000000141CDB924+52] (f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:79) __scrt_common_main_seh [0x0000000141CDB817+295] (f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283) __scrt_common_main [0x0000000141CDB6DE+14] (f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:326) mainCRTStartup [0x0000000141CDB9B9+9] (f:\dd\vctools\crt\vcstartup\src\startup\exe_main.cpp:17) BaseThreadInitThunk [0x0000000077415A4D+13] RtlUserThreadStart [0x000000007764B831+33] FAILURE: standard_symbols.pdf; Command '['E:\\b\\build\\slave\\windows_xfa\\build\\pdfium\\out\\debug_xfa_v8\\pdfium_test.exe', '--send-events', '--png', '--md5', 'E:\\b\\build\\slave\\windows_xfa\\build\\pdfium\\out\\debug_xfa_v8\\gen\\pdfium\\testing\\pixel\\standard_symbols.pdf']' returned non-zero exit status -1073741819 Original change's description: > Remove CXFA nodes instead of CFX_XML nodes > > When we set data into the CJX nodes, we need to update the backing store > of the XFA nodes, which are the XML nodes. When we update the backing > store, there are cases where we need to remove the children (setting > CData on a node or setting the value of an Attribute which is backed by > a real node). > > Currently we call DeleteChildren on the XML node. This causes issues > when we cleanup the tree as XFA nodes may point to these deleted XML > nodes. > > Instead, this CL cleans up the XFA nodes which will in turn clean up the > XML nodes. This seems like the right thing to do as we no longer have > the backing nodes, so we should no longer have the XFA nodes on top of > them. > > Bug: chromium:813155 > Change-Id: I63d53fd56999ec9d3b3af2ab5952b374663f040c > Reviewed-on: https://pdfium-review.googlesource.com/29950 > Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> > Commit-Queue: dsinclair <dsinclair@chromium.org> TBR=thestig@chromium.org,dsinclair@chromium.org,hnakashima@chromium.org Change-Id: Ic6b2fbeb9f8217292da0a722e143d96f9972056a No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:813155 Reviewed-on: https://pdfium-review.googlesource.com/29974 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-09Remove CXFA nodes instead of CFX_XML nodesDan Sinclair
When we set data into the CJX nodes, we need to update the backing store of the XFA nodes, which are the XML nodes. When we update the backing store, there are cases where we need to remove the children (setting CData on a node or setting the value of an Attribute which is backed by a real node). Currently we call DeleteChildren on the XML node. This causes issues when we cleanup the tree as XFA nodes may point to these deleted XML nodes. Instead, this CL cleans up the XFA nodes which will in turn clean up the XML nodes. This seems like the right thing to do as we no longer have the backing nodes, so we should no longer have the XFA nodes on top of them. Bug: chromium:813155 Change-Id: I63d53fd56999ec9d3b3af2ab5952b374663f040c Reviewed-on: https://pdfium-review.googlesource.com/29950 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-09Move code to set XML value to CXFA_NodeDan Sinclair
This CL moves the code to set the XML node data from CJX_Node to CXFA_Node. The XML node is owned by the XFA node, not the CJX node so it makes more sense to have the modifications happen there. This combines the duplicate code in CJX_Node into a single SetToXML method. Bug: chromium:813155 Change-Id: I493725d1412688cb1a0d04bd9ae9fa5a36caebf3 Reviewed-on: https://pdfium-review.googlesource.com/29858 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-04Fix XFA caret blinking only while mouse moves.chromium/3389Henrique Nakashima
Currently rect invalidations in XFA are only sent to the embedder only when RunInvalidate() is executed. For things which redraw on a timer, such as the caret, there was no user event to call RunInvalidate() so the page would not redraw. This CL changes the XFA code to send the invalidations to the embedder immediately and expects the embedder to combine the invalidations to limit overdraw. Bug: chromium:828561 Change-Id: I298052fd7d0c373b029eec191cc6c74c63978348 Reviewed-on: https://pdfium-review.googlesource.com/29670 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-27Cleanup CXFA_LocaleMgrDan Sinclair
This CL cleans up code for the CXFA_LocaleMgr class. Change-Id: I4a3c9394be021d6605dadd8003c7619b19bb9fc0 Reviewed-on: https://pdfium-review.googlesource.com/29250 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-03-06Rename core/fxcrt IFX files to IfaceDan Sinclair
This CL renames the 3 IFX files in core/fxcrt to Iface instead. Change-Id: I7cee6836650b71bc5c5729a8147fda62f0910fe3 Reviewed-on: https://pdfium-review.googlesource.com/27970 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-02-16Fix fallthroughs in XFA code.chromium/3350Henrique Nakashima
Change-Id: I1fd4bf85cd709de1c14ed2895d045018f79bc61f Reviewed-on: https://pdfium-review.googlesource.com/26950 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-02-15Make the CFX_XMLNode a MaybeOwned pointerDan Sinclair
This CL removes the HasOwnXML flag from the CXFA_Node objects and instead uses a MaybeOwned pointer to keep track of the XML nodes. Change-Id: Ie678258247ec21ecb15c639647b189e140586d25 Reviewed-on: https://pdfium-review.googlesource.com/26811 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-02-14Cleanup some CXFA_Node flags and methods.Dan Sinclair
This CL removes one unused flag and inlines the check for if the node has an owned XML node. Change-Id: Id750192b37f09901a81e2faaa929a81d2262d4c7 Reviewed-on: https://pdfium-review.googlesource.com/26770 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-02-14Cleanup CXFA_Node::SetFlagDan Sinclair
The SetFlag method has a signature of (flag, bool) which, looking at the callsites makes you think it will set the flag to the boolean. This isn't what happens, the flag is always set to true and the boolean decides if we execute some notification code. This CL splits SetFlag into SetFlag(flag) and SetFlagAndNotify(flag) to make it a lot clearer what is happening. Change-Id: I3e067c87532cce10b94bda10cc88feb62b948eb0 Reviewed-on: https://pdfium-review.googlesource.com/26750 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-02-13Cleanup CFX_XMLNode pointersDan Sinclair
This CL cleans up hte CFX_XMLNode pointers. Each pointer has been renamed to make the usage clearer, the NodeItems method has been removed in favour of distinct accessors and the node pointers have been made private. Change-Id: I5459a77a0ae93b08741a0cd59266ef9c81ddad75 Reviewed-on: https://pdfium-review.googlesource.com/26550 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-02-13Cleanup CXFA_Node ownershipDan Sinclair
Currently a CXFA_Node can be owned by the CXFA_Document root pointer, the CXFA_Document Purge list or as a child of another CXFA_Node. This makes it hard to know who currently owns what. This CL moves all ownership of nodes into a CXFA_NodeOwner class which CXFA_Document subclasses. The node owner always owns all nodes and is responsible for cleaning them up upon destruction. The destruction order is not guarenteed to be in tree order as nodes can be inserted and moved around the tree. Change-Id: I6b202b8e844999ba835093dcdd1a808938b6d9a8 Reviewed-on: https://pdfium-review.googlesource.com/26434 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-02-13Convert ASSERT to PDFIUM_IMMEDIATE_CRASHDan Sinclair
This CL changes the ASSERTs used in CXFA_Node::InsertChild and RemoveChild to PDFIUM_IMMEDIATE_CRASH. The ASSERTs are compiled out in Release mode, we want to make sure we don't accidentally build invalid node trees in Release. Change-Id: Ic96c8ab457631d1f32d36d7d12bd5888f1cf4b0a Reviewed-on: https://pdfium-review.googlesource.com/26431 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-02-13Add previous sibling pointer to CXFA_NodeDan Sinclair
This CL adds a prev_sibling_ pointer into CXFA_Node and updates the code as needed. Change-Id: I3125f59780da34dc26a176c7264a31335be528fe Reviewed-on: https://pdfium-review.googlesource.com/26410 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-02-13Add tests for CXFA_Node child manipulationDan Sinclair
This CL adds tests for CXFA_Node::InsertChild and CXFA_Node::RemoveChild methods. Change-Id: I6ef9e76dfbfa8a9b8246620ecf80c88812b332fc Reviewed-on: https://pdfium-review.googlesource.com/26371 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-02-12Cleanup CXFA_Node tree pointerschromium/3346Dan Sinclair
This CL changes the CXFA_Node parent pointer back to a raw pointer from an UnownedPtr. The other tree pointers have been renamed for clarity. Change-Id: I366a0b5b41d49d87b11bec0eea9890fbc79c1c62 Reviewed-on: https://pdfium-review.googlesource.com/26370 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-02-08Revert "Convert CXFA_Node to store a vector of children"dsinclair
This reverts commit f0e386de64e030f6d692acfa27e2bc0a50018710. Reason for revert: After chatting with tsepez@, we've got a better direction to take these changes. Original change's description: > Convert CXFA_Node to store a vector of children > > This CL changes CXFA_Node to use a vector of nodes as children instead > of a singly linked list of siblings and child pointers. > > Change-Id: Ica8219f63d783a07d90b9541ae62a35c49166e44 > Reviewed-on: https://pdfium-review.googlesource.com/26030 > Reviewed-by: Ryan Harrison <rharrison@chromium.org> > Commit-Queue: dsinclair <dsinclair@chromium.org> TBR=dsinclair@chromium.org,hnakashima@chromium.org,rharrison@chromium.org Change-Id: I115779a292d39694ad5faf0b748a617c491b40f0 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://pdfium-review.googlesource.com/26070 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-02-08Convert CXFA_Node to store a vector of childrenDan Sinclair
This CL changes CXFA_Node to use a vector of nodes as children instead of a singly linked list of siblings and child pointers. Change-Id: Ica8219f63d783a07d90b9541ae62a35c49166e44 Reviewed-on: https://pdfium-review.googlesource.com/26030 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-02-07Remove unused return values from CXFA_NodeDan Sinclair
This CL removes the unused return values from InsertChild and RemoveChild methods in CXFA_Node. Bug: chromium:807863 Change-Id: Iac468afc5c48f51e7df3ea12d11b128a0ac124ea Reviewed-on: https://pdfium-review.googlesource.com/25670 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-02-06Make the CXFA_Node parent pointer UnownedDan Sinclair
This CL converts the CXFA_Node parent pointer to be an Unowned pointer instead of a raw pointer. Bug: chromium:807863 Change-Id: I266c9216cfe8153e234bf66b88fbac6c8d96ebb4 Reviewed-on: https://pdfium-review.googlesource.com/25650 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-31Create CXFA_Node::PresenceRequiresSpaceDan Sinclair
This CL replaces XFA_ItemLayoutProcessor_IsTakingSpace with a PresenceRequiresSpace call on CXFA_Node. Change-Id: Ibf570f25eeb3404d72e87cb62e06a7ad70f0916f Reviewed-on: https://pdfium-review.googlesource.com/24850 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-31Remove NumericLimit params which are always the sameDan Sinclair
This CL removes the two params from NumericLmits which are always set to the same value and retrieves the values in the method itself. Change-Id: Ibeabdc7187faa58e93ffbe00063171fec0842256 Reviewed-on: https://pdfium-review.googlesource.com/24717 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-30Shuffle more code out of CXFA_NodeDan Sinclair
This CL moves more code out of the CXFA_Node class and into specific subclasses. Change-Id: Idca36f251431bf7efd4da045aeabf097ab23f0ce Reviewed-on: https://pdfium-review.googlesource.com/24714 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-30Move CheckButton code from CXFA_Node to CXFA_CheckButtonDan Sinclair
This CL moves some of the code specific to CheckButtons out of CXFA_Node and into the CXFA_CheckButton class. The CheckButton is passed as a parameter to the CXFA_FFCheckButton class. Change-Id: I3344c484d90e3b8d1024024a2851685044113a23 Reviewed-on: https://pdfium-review.googlesource.com/24711 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-29Cleanup CXFA_Node visibilityDan Sinclair
Make methods private or remove if not needed. Change-Id: I2f9f718ba08a4b49332c896d2385ec60cf9cf01b Reviewed-on: https://pdfium-review.googlesource.com/24490 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-29Fold single caller methods into callsiteDan Sinclair
This CL folds the GetNodeSameClassIndex, GetNodeSameNameIndex from CXFA_Node into the CJX_Tree callsites. Change-Id: Ia4f7750543e786ddd82abb4b6b4bde1bf1710f19 Reviewed-on: https://pdfium-review.googlesource.com/24471 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-29Move barcode code to CXFA_BarcodeDan Sinclair
This CL moves the barcode specific code out of CXFA_Node and into CXFA_Barcode. The CXFA_FFBarcode widget was modified to take the barcode as a parameter. Change-Id: I8ff91cb58402665f4ba63f2eeced45feeaa9ff50 Reviewed-on: https://pdfium-review.googlesource.com/24450 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-01-29Cleanup the FFWidget determination code.Dan Sinclair
This CL converts the UIType to an XFA_FFWidgetType instead of reusing the XFA_Element type. The creation code is cleaned up to make it clearer what's happening. Change-Id: I5d3e4967d5c8b8a50dbb25e574b0d31fe0cf407a Reviewed-on: https://pdfium-review.googlesource.com/24390 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-24Move retrieval of UIChild earlier in CreateUIChildDan Sinclair
This CL shifts the retrieval of the UI child earlier in the method so we can group all of the code which sets the widget type. Change-Id: Iabdbd7ae2e6d3f648ce78e93c263be66f62946ba Reviewed-on: https://pdfium-review.googlesource.com/23790 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-24Rename eUIType for clarityDan Sinclair
This CL renames eUIType to make it clear it's the type for the value node we need to create, not the UI node we're creating. Change-Id: I7ffe86b07a2ccf81114e7d1a6a41f520b864a61f Reviewed-on: https://pdfium-review.googlesource.com/23771 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-01-24Cleanup CreateUIChild node creationDan Sinclair
This CL cleans up some of the code around creating the XML nodes related to the UI widgets. Change-Id: Ib91364439ab039f46e44690e92cc0cb93a8da203 Reviewed-on: https://pdfium-review.googlesource.com/23770 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-24Cleanup CreateUIChild pUI usageDan Sinclair
This CL cleans up the usage of pUI in CreateUIChild. The node can't be null per spec so ASSERT that's true. Cleanup the search for children to make it clearer what is happening. Change-Id: I856de8ebf89fe0bc61942e7ad2a1131a7878c511 Reviewed-on: https://pdfium-review.googlesource.com/23730 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-24Update code to assume a Value node exists.Dan Sinclair
When we retrieve the first Value node from a Field or a Draw element it either must exist, or must be created. If that doesn't happen something has gone very wrong. Change-Id: I818aaf9d361336c898035fe542e5b37a33fef0ea Reviewed-on: https://pdfium-review.googlesource.com/23710 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-24Make CreateUIChild a method of CXFA_NodeDan Sinclair
This CL changes CreateUIChild to be a method on node instead of accepting the node as a parameter. Change-Id: I5bf84cee010c1c02966def987a3bc2bcc7db0324 Reviewed-on: https://pdfium-review.googlesource.com/23690 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-01-24Clarify CreateUIChild is only for Field or Draw elementsDan Sinclair
This CL changes the code to only call CreateUIChild for Field and Draw elements. Other types are handled all the callsite. Change-Id: I2dd2553c14ebc1f0849b3bfd311e75ad8922aa0d Reviewed-on: https://pdfium-review.googlesource.com/23670 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-23Remove CXFA_Node::GetNode and m_pNodeDan Sinclair
This CL removes the node scaffolding added when merging CXFA_WidgetAcc into CXFA_Node. Change-Id: I02a6b80d2c910816b1aec613078d4871c29369b3 Reviewed-on: https://pdfium-review.googlesource.com/23650 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-01-23Remove GetWidgetAcc callsDan Sinclair
This CL removes the calls to CXFA_Node::GetWidgetAcc() as they redundantly return the node they were called upon. Change-Id: I46e66cf98137a1dee7cd3fa8bc7d379eb97fded5 Reviewed-on: https://pdfium-review.googlesource.com/23630 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-23Merge CXFA_WidgetAcc into CXFA_Nodechromium/3330Dan Sinclair
This CL merges CXFA_WidgetAcc into CXFA_Node. Change-Id: Iab52ca7f98c9dcd4ab089c61b8f1324a565bf647 Reviewed-on: https://pdfium-review.googlesource.com/23610 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-23Remove CXFA_WidgetAcc from CXFA_FFDocView methodsDan Sinclair
This CL updates CXFA_FFDocView methods and members to use CXFA_Node objects instead of CXFA_WidgetAcc objects. Change-Id: Ic79af39ef49152a6d50ed5acfc153063db39353d Reviewed-on: https://pdfium-review.googlesource.com/23590 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-22Convert CXFA_EventParam to store a CXFA_NodeDan Sinclair
This CL changes the CXFA_EventParam code to store a CXFA_Node instead of a CXFA_WidgetAcc. Change-Id: I21510674b0b6435ca9b87bfbf97914f54e5e3464 Reviewed-on: https://pdfium-review.googlesource.com/23451 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-01-22Convert CXFA_FFWidgetHandler to use CXFA_NodeDan Sinclair
This CL removes CXFA_WidgetAcc from CXFA_FFWidgetHandler and uses CXFA_Node directly. Change-Id: I88cf1edc53f4489aeac018a95e9d5936d85106db Reviewed-on: https://pdfium-review.googlesource.com/23450 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-01-22Change GetContainerWidgetAcc to GetContainerNodeDan Sinclair
This Cl converts the code which retrieved the containers WidgetAcc to retrieve the container itself and then get the WidgetAcc from the container. Change-Id: Ib279a150500d1204e3d18f11f6a638c1f6c368ec Reviewed-on: https://pdfium-review.googlesource.com/23350 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-22Move WidgetAcc and IsWidgetReady to CXFA_NodeDan Sinclair
This CL moves the widget_acc storage and the is_widget_ready flag from CXFA_Object to CXFA_Node. Change-Id: I96aeb38a854f227985a5549dc67f1b84d924abb8 Reviewed-on: https://pdfium-review.googlesource.com/23330 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-01-22Move IsNull and PreNull to CXFA_NodeDan Sinclair
This CL moves the m_bIsNull and m_bPreNull flags from CXFA_WidgetAcc to CXFA_Node. Change-Id: Ibdcdb8611699d6d908ab3c6ed05cbce7bba872ae Reviewed-on: https://pdfium-review.googlesource.com/23310 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-22Move the UI elements from CXFA_WidgetAcc to CXFA_NodeDan Sinclair
This CL moves the methods and members related to the UI nodes from the CXFA_WidgetAcc class to the CXFA_Node class. Change-Id: I1fdc5173787141065f1e607bbfefa3b22af738b4 Reviewed-on: https://pdfium-review.googlesource.com/23290 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-22Add flag to notify if a node widget is readyDan Sinclair
This CL updates CXFA_Object to have a flag which annotates if the node is ready. Ready means that we've gone through the OnNodeReady call in CXFA_FFNotify. Previously we'd check if the WidgetAcc exists on the node which is created in OnNodeReady. This CL replaces all the points where we check for a WidgetAcc existing with a IsWidgetReady() call. Change-Id: I54e8160269c3104cdae7a516c1814c13bee15130 Reviewed-on: https://pdfium-review.googlesource.com/23190 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>