summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser
AgeCommit message (Collapse)Author
2018-05-10Do not build BMP when codec is disabledRyan Harrison
Currently all of the BMP related code is being built when support for the codec is disabled, it just isn't being utilized. Depending on the settings being used, this unneeded code may or may not get stripped during linking. This CL explicitly turns off building the BMP codec code if support for BMP is turned off. BUG=pdfium:1080 Change-Id: I56d40639a5a3631f9c601a1eef3f98873feac94f Reviewed-on: https://pdfium-review.googlesource.com/32370 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-05-09Do not build GIF when codec is disabledRyan Harrison
Currently all of the GIF related code is being built when support for the codec is disabled, it just isn't being utilized. Depending on the settings being used, this unneeded code may or may not get stripped during linking. This CL explicitly turns off building the GIF codec code if support for GIF is turned off. This also catches a few missed cases from previous CLs. BUG=pdfium:1080 Change-Id: Ie7fe2d894d2ae2f8f36ae05e0ff256f2ce6ef8d4 Reviewed-on: https://pdfium-review.googlesource.com/32330 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-05-09Do not build PNG when codec is disabledRyan Harrison
Currently all of the PNG related code is being built when support for the codec is disabled, it just isn't being utilized. Depending on the settings being used, this unneeded code may or may not get stripped during linking. This CL explicitly turns off building the PNG codec code if support for PNG is turned off. BUG=pdfium:1080 Change-Id: I9c5247145fcadbcb1bd2243aa83350304ba421ff Reviewed-on: https://pdfium-review.googlesource.com/32270 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-05-09Do not build TIFF when codec is disabledRyan Harrison
Currently all of the TIFF related code is being built when support for the codec is disabled, it just isn't being utilized. Depending on the settings being used, this unneeded code may or may not get stripped during linking. This CL explicitly turns off building the TIFF codec code if support for TIFF is turned off. It also fixes cases in the code base where tif was being used instead of tiff. BUG=pdfium:1080 Change-Id: If6aaa8af5160fdd5b261e63bab7d5984196efcc9 Reviewed-on: https://pdfium-review.googlesource.com/32193 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-05-07Restore logic of CreateChildUIAndValueNodesIfNeeded().Henrique Nakashima
CreateUIChild() was changed and renamed to CreateChildUIAndValueNodesIfNeeded() in: https://pdfium-review.googlesource.com/c/pdfium/+/24390 This caused some bugs but it's too far back for a rollback. This cl restores the logic of CreateUIChild() keeping the new signature. Bug: chromium:838994 Change-Id: I44ce741fdb90f8b0fd11379b5e881e376c307f0c Reviewed-on: https://pdfium-review.googlesource.com/32090 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-05-03[xfa] Verify field count before accessingDan Sinclair
When processing items for layout it's possible for the iBlockIndex*3 value could be larger then the field split count. If this is the case we'll walk off the end of the split array. This CL verifys that we have enough data before attempting to walk the splits and returns early if we don't have enough data. Bug: chromium:837585 Change-Id: I534298b4ee354ce079442d893202f811431155a0 Reviewed-on: https://pdfium-review.googlesource.com/32051 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-05-02Use pointer instead of ref for CXFA_Box::GetPathArcOrRounded param.Henrique Nakashima
Change-Id: I1bfada610b8bf2e1f8e0f79a9421db9ebedc7311 Reviewed-on: https://pdfium-review.googlesource.com/32010 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-05-02Add a CFX_XMLDocument class.Dan Sinclair
This CL adds a CFX_XMLDocument to act as the XML node container. All nodes are now owned by the document and the document is returned by the CFX_XMLParser. Classes which parse XML files now store the document instead of the root node. BUG: chromium:835636 Change-Id: I1e07d6115cf14714911d6fd4c3fa920c94fd5faf Reviewed-on: https://pdfium-review.googlesource.com/31313 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-05-02Remove out params from CalculateAccWidthAndHeight. Return CFX_Size.Henrique Nakashima
Change-Id: I1088abd4ce8f6276043213218867c4d6fb0a46a9 Reviewed-on: https://pdfium-review.googlesource.com/31914 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-05-02Remove int out params from reference to pointer in CXFA_Node.Henrique Nakashima
Return a CFX_Size instead. Change-Id: I3bef1093fbc887237aa69dc942f878af27b4e8e9 Reviewed-on: https://pdfium-review.googlesource.com/31911 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-05-01Transform float out params from reference to pointer in CXFA_Node.Henrique Nakashima
Change-Id: I4039917c5342f6a4c6568029a293066901bb5db4 Reviewed-on: https://pdfium-review.googlesource.com/31870 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-05-01Transform size out param from reference to pointer in CXFA_Node.Henrique Nakashima
Change-Id: I3ed6cbadeb9da756b30634b48ffdd1026a70b8a0 Reviewed-on: https://pdfium-review.googlesource.com/31853 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-05-01Transform rect out param from reference to pointer in XFA code.Henrique Nakashima
Change-Id: Ib5f8b8754bca8198d9122700d7d876b45d1428da Reviewed-on: https://pdfium-review.googlesource.com/31852 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-05-01Fixes XML Instruction handling in CXFA_DocumentParser.Dan Sinclair
This CL fixes issues with handling XML instructions in CXFA_DocumentParser. Unittests were added to verify the behaviour. Change-Id: Iff8d51d0e6d411419473c9b2c32c700d4bbf86f5 Reviewed-on: https://pdfium-review.googlesource.com/31810 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-04-27Add DEPS include_rules for xfa/fwl.Lei Zhang
BUG=pdfium:507 Change-Id: I28eeb9a5f6d7099eef6d8e7e37d425cd4613c49c Reviewed-on: https://pdfium-review.googlesource.com/31430 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-04-26Replace some c-style cast with static_cast<>Tom Sepez
Change-Id: I9dd6a36770f77f3df6c4395572785d37402eadc2 Reviewed-on: https://pdfium-review.googlesource.com/31350 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-04-25Replace reinterpret_cast with static_cast where possibleTom Sepez
Change-Id: Ic62f1def8e043494c9fa6c08a937d7d872513567 Reviewed-on: https://pdfium-review.googlesource.com/31314 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-04-24Switch declaration order to prevent UAFRyan Harrison
This is occuring when the variables go out of scope, due to C++s first in, last out destruction policy. BUG=chromium:808333 Change-Id: I44f37520a22720bc23df4c8a72ff73994c37eea1 Reviewed-on: https://pdfium-review.googlesource.com/31278 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-04-23Revert "Change CFX_XML Save to take a write stream"dsinclair
This reverts commit 9a3a7709103a872037dcea1f3cf0b7785a3da191. Reason for revert: Gerrit did not do what I expected.... Original change's description: > Change CFX_XML Save to take a write stream > > This CL changes CFX_XML to use an IFX_SeekableWriteStream instead of the more > generic IFX_SeekableStream. > > Change-Id: I6e4def380c43eca755d91ad5cb6146c2dfdaee10 > Reviewed-on: https://pdfium-review.googlesource.com/30877 > Commit-Queue: dsinclair <dsinclair@chromium.org> > Reviewed-by: Tom Sepez <tsepez@chromium.org> TBR=tsepez@chromium.org,dsinclair@chromium.org,hnakashima@chromium.org Change-Id: I137e53bf93285b88ade6832dedefca66e3b61e13 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://pdfium-review.googlesource.com/31211 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-23Change CFX_XML Save to take a write streamDan Sinclair
This CL changes CFX_XML to use an IFX_SeekableWriteStream instead of the more generic IFX_SeekableStream. Change-Id: I6e4def380c43eca755d91ad5cb6146c2dfdaee10 Reviewed-on: https://pdfium-review.googlesource.com/30877 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-04-17CFX_XML Cleanupdan sinclair
Cleanup formatting and unused variables in the CFX_XML classes. Change-Id: I1aff6317a3da38a141a071ba69c7893d0f669732 Reviewed-on: https://pdfium-review.googlesource.com/30730 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
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-17Remove unimplemented CXFA_DataExporter private headerdan sinclair
The Export which takes a CFX_SeekableStreamProxy is never implemented. Removed. Change-Id: I130baeaf2bea7e5ebb0738330fa5de7152304367 Reviewed-on: https://pdfium-review.googlesource.com/30857 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-17Convert CFX_XMLParser to take a IFX_SeekableStreamdan sinclair
This CL changes the CFX_XMLParser to accept an IFX_SeekableStream intead of a CFX_SeekableStreamProxy. Change-Id: I3534288a8a00095acd78a60bf6b925c6a0357892 Reviewed-on: https://pdfium-review.googlesource.com/30856 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-17Remove write abilities from CFX_SeekableStreamProxydan sinclair
This CL removes the abliity to write to the seekable stream proxy class. Change-Id: I0eda2619714df190d326c23dfdcd4527d4312779 Reviewed-on: https://pdfium-review.googlesource.com/30853 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-17Use IFX_SeekableStream in xfa_utilsdan sinclair
This CL converts xfa_utils to use an IFX_SeekableStream instead of a CFX_SeekableStreamProxy. Change-Id: I824b477351ac29d54118df2f3c5442c503aa3671 Reviewed-on: https://pdfium-review.googlesource.com/30852 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-04-17Use an IFX_SeekableStream for XML savingdan sinclair
This CL converts the CFX_XML Save methods to take an IFX_SeekableStream instead of a CFX_SeekableStreamProxy. Change-Id: I6b3f6acc9f51e73b3c863b965b4dcdcbd25ba949 Reviewed-on: https://pdfium-review.googlesource.com/30850 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-04-17Use span in CXFA_LocaleValue::GetDoubleNum()chromium/3399Tom Sepez
Get runtime checks instead of just asserts. Use early return while at it to save some indentation. Fix one out-of-bounds case noted by inspection. Add tests, and fix bugs that gave the wrong answers. This should be removed at our earliest convenience. Its likely to still be wrong. Change-Id: I2a68edc854c8b28c434fe28397b7834e5c9c3670 Reviewed-on: https://pdfium-review.googlesource.com/30530 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-04-17Reland "Return pdfium::span<wchar_t> from WideString::GetBuffer().""Tom Sepez
This reverts commit 0d32b8fda53e02c1036d39f7290d4f59f2b58ca4. Restore behaviour on trunk. TBR: dsinclair@chromium.org Change-Id: Ia867f09ae9d2885595c4d9b300a058431dfd84f2 Reviewed-on: https://pdfium-review.googlesource.com/30811 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Tom Sepez <tsepez@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-16Revert "Return pdfium::span<wchar_t> from WideString::GetBuffer()."Tom Sepez
This reverts commit 154e18f9a862975abecebe77b8f5fb418418d14c. Reason for revert: Generate CL to merge to beta branch Original change's description: > Return pdfium::span<wchar_t> from WideString::GetBuffer(). > > Adds bounds checking "for free", but beware of span outliving > a ReleaseBuffer() call. Scoping as such avoids the possibility > of using an invalid span (and it is flagged as a lifetime issue). > > Change-Id: Ica63f4b1429823d0254ec6951aeaeb08160cb93c > Reviewed-on: https://pdfium-review.googlesource.com/30310 > Reviewed-by: dsinclair <dsinclair@chromium.org> > Commit-Queue: Tom Sepez <tsepez@chromium.org> TBR=tsepez@chromium.org,dsinclair@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: Ie1ec9434215584a024538ca8edeb59dea555af48 Reviewed-on: https://pdfium-review.googlesource.com/30830 Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@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-16Convert CXFA_XMLLocale to CFX_XMLdan sinclair
This CL converts CXFA_XMLLocale to use CFX_XML instead of CXML. Change-Id: I1db617a658548ae5979f2f38d72c5b3000998663 Reviewed-on: https://pdfium-review.googlesource.com/30693 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-16Add CXFA_XMLLocale unittestsdan sinclair
This CL adds unittests for the CXFA_XMLLocale class. Change-Id: I1a610754933e5f33e87cb4c13b9bf540e366e6ed Reviewed-on: https://pdfium-review.googlesource.com/30692 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-04-13Hide XML parsing inside CXFA_XMLLocaledan sinclair
This CL moves the parsing of the XML document into a static method of CXFA_XMLLocale. This removes the need for CXFA_LocaleMgr to care about the XML parser used. Change-Id: I04d14d78f458bfb37f0370fac2eb752e9840bfd6 Reviewed-on: https://pdfium-review.googlesource.com/30390 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-04-13Move SharedForm check to CPDF_Metadata classdan sinclair
This CL moves code related to shared form detection into the CPDF_Metadata class. This allows us to hide the usage of CXML inside CPDF_Metadata. Change-Id: I547471a2bcc119221565c415a58211c1500cbb3c Reviewed-on: https://pdfium-review.googlesource.com/30370 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-13Make CFX_XMLInstruction a subclass of CFX_XMLNodedan sinclair
The CFX_XMLInstruction handles the <?blah?> blocks at the top of an XML file. It was inheriting from CFX_XMLAttributeNode in order to store the tag name. This CL moves the tag name into CFX_XMLInstruction and subclasses from CFX_XMLNode. Change-Id: I8f7ff0dde19ed43b46d095b0d45df4bf06875af5 Reviewed-on: https://pdfium-review.googlesource.com/30490 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-04-12Return pdfium::span<wchar_t> from WideString::GetBuffer().Tom Sepez
Adds bounds checking "for free", but beware of span outliving a ReleaseBuffer() call. Scoping as such avoids the possibility of using an invalid span (and it is flagged as a lifetime issue). Change-Id: Ica63f4b1429823d0254ec6951aeaeb08160cb93c Reviewed-on: https://pdfium-review.googlesource.com/30310 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-04-12Remove CXFA_DocumentParser::m_bDocumentParser flagDan Sinclair
This CL removes the import data behaviour as it was never called and cleans up the m_bDocumentParser flag as it will always be used in the true case. Change-Id: If90a0a55cc76f406e9987aa71580e90edeaa01ba Reviewed-on: https://pdfium-review.googlesource.com/30292 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-12Remove CFX_XMLDoc and call the parser directlyDan Sinclair
This CL removes the CFX_XMLDoc and calls the CFX_XMLParser directly from CXFA_DocumentParser. Change-Id: I4d715cca90cd15b5e1d79827e0bb2781e873e371 Reviewed-on: https://pdfium-review.googlesource.com/30251 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@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-12Fold CXFA_DocumentParser into CXFA_FFDocDan Sinclair
The CXFA_DocumentParser is a thin wrapper around CXFA_SimpleParser. This CL folds CXFA_DocumentParser into a ParseDoc method of CXFA_FFDoc. Change-Id: I7e7073899436f0435c4ebfd548241ae842a2a276 Reviewed-on: https://pdfium-review.googlesource.com/30213 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-12Retrieve the XML tree in the DocumentParserDan Sinclair
This CL changes the document parser to store the parsed XML tree. That way we no longer need to store the pointer to the CXFA_SimpleParser in the CXFA_DocumentParser. Change-Id: I9272150e73613411cb1bb59c3cf77c7af6cc799d Reviewed-on: https://pdfium-review.googlesource.com/30211 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-12Allow retrieving the XML tree from the CFX_XMLDocDan Sinclair
This CL allows the CXFA_SimpleParser to retrieve the XML tree from the CFX_XMLDoc. This way, we don't have to keep the doc around and can store the pointer to the tree in the CXFA_SimpleParser. Change-Id: I5b478acbe61e6f1ca5fa04d03133a2b327a0cb1c Reviewed-on: https://pdfium-review.googlesource.com/30210 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-12Cleanup some CFX_XMLParser codeDan Sinclair
This CL cleans up minor nits in the CFX_XMLParser code. Change-Id: Ie19d12d3dcce16c9ce6088160ecdec3d9855c11f Reviewed-on: https://pdfium-review.googlesource.com/30170 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-12[xfa] Remove form checksum abilitiesDan Sinclair
This CL removes the code for verifying and creating checksums associated with form elements in XFA documents. This was the only code requiring the SAXReader which has also been removed. According to the XFA spec and application can decide which parts of the signatures are supported. This feature is being removed until we determine if/when it is needed. Bug: pdfium:1063 Change-Id: Iec2261282340f8fc72a1225d2e0d3e6ddf05edcb Reviewed-on: https://pdfium-review.googlesource.com/30150 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-10Merge CXFA_SimpleParser::{Start|Do}Parsechromium/3394Dan Sinclair
The StartParse and DoParse methods have been merged into a single Parse method. Change-Id: I1310bda90b853c11af8b8d1794de6b5c19e931cf Reviewed-on: https://pdfium-review.googlesource.com/30010 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-04-09Merge CXFA_DocumentParser::{Start|Do}Parse methodsDan Sinclair
This CL combines the StartParse and DoParse methods of CXFA_DocumentParser into a single Parse method since they are always called together. Change-Id: I45f38b2730f47c4719ca4f54c32ee8db6f11470d Reviewed-on: https://pdfium-review.googlesource.com/29991 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-09Move the CFX_XMLParser out of CXFA_SimpleParserDan Sinclair
This CL removes the CFX_XMLParser from CXFA_SimpleParser and constructs it in the CFX_XMLDoc. Change-Id: Id69b396f091892170a4c4654ac1d0fd65d1efbb6 Reviewed-on: https://pdfium-review.googlesource.com/29970 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>