summaryrefslogtreecommitdiff
path: root/fxjs/cjx_node.cpp
AgeCommit message (Collapse)Author
2017-11-14Cleanup XFA default value codeDan Sinclair
This CL adds helper methods to CXFA_Node to retrieve the default values for attributes with the correct data types. Change-Id: I644435b4b430819f1060a95fa4fffe4ba2826cfe Reviewed-on: https://pdfium-review.googlesource.com/18450 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-14Fixing nits in CJX_NodeDan Sinclair
Change-Id: I3c894f0e7038d4b12b0363d8931dab50687b5495 Reviewed-on: https://pdfium-review.googlesource.com/18150 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-08Convert XFA_SCRIPT_TYPE to an enum classDan Sinclair
This CL converts the XFA_SCRIPT_TYPE enum to the XFA_ScriptType enum class. Change-Id: If30ccd7128aaec63a3d1cb9b1c6f72d3048e4529 Reviewed-on: https://pdfium-review.googlesource.com/18031 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-08Convert XFA_ATTRIBUTETYPE to an enum classDan Sinclair
This CL converts XFA_ATTRIBUTETYPE to an enum class XFA_AttributeType. Change-Id: I76185da08fcc8a7a4026ce430238db1b2cecf192 Reviewed-on: https://pdfium-review.googlesource.com/18051 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-08Convert XFA_ATTRIBUTE to an enum classDan Sinclair
This CL converts the XFA_ATTRIBUTE enum to an enum class and fixes up various usages. Change-Id: I3dd17cc412d97eb212a65ce63bb9fa19605e1e91 Reviewed-on: https://pdfium-review.googlesource.com/18050 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-08Fix XFA_SCRIPTATTRIBUTEINFO attribute typeDan Sinclair
This CL changes XFA_SCRIPTATTRIBUTEINFO attribute field to be a XFA_ATTRIBUTE from an in32_t. This necessitated adding an XFA_ATTRIBUTE_Unknown and updating the various -1 values in the script data description. Change-Id: I837602e38b3785d7c8515830fae8dc427d449e9f Reviewed-on: https://pdfium-review.googlesource.com/18030 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-07Rename CXFA_Value to CXFA_ValueDatachromium/3262Dan Sinclair
This CL renames CXFA_Value to CXFA_ValueData to show it's part of the data hierarchy. Change-Id: I4693234f503903a2c11d76a56dbbb6de5f0c3718 Reviewed-on: https://pdfium-review.googlesource.com/18018 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-07Rename CXFA_Validate to CXFA_ValidateDataDan Sinclair
This CL renames CXFA_Validate to CXFA_ValidateData to signify it is part of the data hierarchy. Change-Id: Ib6f743513160990b6d64c4b10618f16554dc5c08 Reviewed-on: https://pdfium-review.googlesource.com/18017 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-07Rename CXFA_Stroke to CXFA_StrokeDataDan Sinclair
This CL renames CXFA_Stroke to CXFA_StrokeData to show it is part of the data hierarchy. Change-Id: If0041c410630c61129ed1ff0879c68244ad01aa5 Reviewed-on: https://pdfium-review.googlesource.com/18013 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-07Rename CXFA_Occur to CXFA_OccurDataDan Sinclair
This CL renames CXFA_Occur to CXFA_OccurData to show it is part of the data hierarchy. Change-Id: I55096747338a9ff83ab24f528f6715a6f4302ba7 Reviewed-on: https://pdfium-review.googlesource.com/17988 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-07Rename CXFA_Font to CXFA_FontDataDan Sinclair
This CL renames CXFA_Font to CXFA_FontData to make it clear this is part of the data hierarchy. The GetFontNode methods were renamed to GetFontData to match the return type. Change-Id: I5d5b9200eedc9c8c1bd8929a5a0df3d2663d7e3d Reviewed-on: https://pdfium-review.googlesource.com/17983 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-07Rename CXFA_Fill to CXFA_FillDataDan Sinclair
This CL renames CXFA_Fill to CXFA_FillData to show it is part of the data hierarchy. Change-Id: I4f1f3e83621dee4f9ccddb3b3d04785d094315b8 Reviewed-on: https://pdfium-review.googlesource.com/17981 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-07Rename CXFA_Edge to CXFA_EdgeDataDan Sinclair
This CL renames CXFA_Edge to CXFA_EdgeData to make it clear it's part of the data hierarchy. Change-Id: Id67526cafe1927803c36159b106656c32e770d6b Reviewed-on: https://pdfium-review.googlesource.com/17979 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-07Rename CXFA_Border to CXFA_BorderDataDan Sinclair
This CL renames CXFA_Border to CXFA_BorderData to make it clear it's part of the Data hierarchy. Change-Id: Icfe8dc07d527ba54413f073f5a444fb7b2a71271 Reviewed-on: https://pdfium-review.googlesource.com/17974 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-06Call CJX methods directly instead of proxyingDan Sinclair
This CL updates the XFA JS code to call the methods on the CJX objects directly instead of proxying through the CXFA objects. The script methods have been removed from the CXFA objects. Change-Id: I2d7b502473a8e88a7af88b10aa0da602d4998394 Reviewed-on: https://pdfium-review.googlesource.com/17851 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-06Make XFA_MAPMODULESDATA a unique_ptrDan Sinclair
Change-Id: Icd72ee8d098fa0140119519f7079745bd5280a84 Reviewed-on: https://pdfium-review.googlesource.com/17592 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-06Remove recursive paramter from CJX_Node::MoveBufferMapDataDan Sinclair
The recursive paramter is always true, so remove it and fixup code as needed. Change-Id: I18395c1bca415d8a5d85c1eee6a32870c5d7f7e3 Reviewed-on: https://pdfium-review.googlesource.com/17591 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-04Remove default values from CXFA_Node::GetNodeListDan Sinclair
This CL removes the default values and inlines in the call sites. Change-Id: Iae95653a5d724918c5944f860a0743053e98fe88 Reviewed-on: https://pdfium-review.googlesource.com/17615 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-04Remove default params for CXFA_Node::{Insert|Remove}ChildDan Sinclair
This CL removes the default values and inlines in the call sites as needed. Change-Id: I68925d57b6230400429421ce728dd5524e5fc9a1 Reviewed-on: https://pdfium-review.googlesource.com/17710 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-04Remove default values from CXFA_Node::{CountChildren|GetChild}chromium/3259Dan Sinclair
This CL removes the default values and inlines into the call sites as needed. Change-Id: I554e9d5ac781003695f90522f9c6c3160653eb59 Reviewed-on: https://pdfium-review.googlesource.com/17572 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-04Remove default values from CXFA_Node::{Remove|Insert|Item}Dan Sinclair
This CL removes the default values and inlines into the call sites as needed. Change-Id: I8ba6acfc99b5db508ce8711108e0676465eda47b Reviewed-on: https://pdfium-review.googlesource.com/17670 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-04Remove default from CJX_Node::MoveBufferMapDataDan Sinclair
This CL removes the default value from the bRecursive flag. Change-Id: I88882fd1206d82facd977f97bda4e585571ce5e0 Reviewed-on: https://pdfium-review.googlesource.com/17571 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-02Split CJX_Node::RemoveMapModuleKeyDan Sinclair
This CL splits RemoveMapModuleKey to extract ClearMapModuleBuffer which is called on destroy to clear the buffer. This also fixes a potential bug where when we lookup the key, if the hashcode for the key returns 0 we will end up with a nullptr key. Change-Id: Ic2b0529a999f6f789dd81fbc4e02ecfbbf7a7632 Reviewed-on: https://pdfium-review.googlesource.com/17614 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-02Remove default params from some Map Module methodsDan Sinclair
This CL removes the default value from {Set|Get}MapModuleBuffer and inlines into the call sites. Change-Id: Ia003bec3908a1531e572e25ea0a762973b8beebe Reviewed-on: https://pdfium-review.googlesource.com/17630 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-02Roll {Set|Get}ScriptContent into {Set|Get}ContentDan Sinclair
The SetContent method was a proxy to SetScriptContent. The GetContent added a default param value. The methods have been merged and the GetContent call sites updated to pass in the needed value. Change-Id: I61f950bef8beec7157bdb22e0a25904729f9e00a Reviewed-on: https://pdfium-review.googlesource.com/17613 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-02Remove default values from CJX_Node::{TryUserData|GetScriptContent}Dan Sinclair
This CL removes the default values an inlines into the call sites. Change-Id: Ic4d05db306eafc037a2f312a6780dbae79097b6c Reviewed-on: https://pdfium-review.googlesource.com/17612 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-02Fix visibility of some CJX_Node methodsDan Sinclair
This CL fixes the visibility of several CJX_Node methods by making them private. The corresponding methods in CXFA_Node were removed as they aren't called. The OnChanged and OnChanging methods are moved to CJX_Node as they make more sense on the JS object. Change-Id: I2f791915508ec7732647de0db700c06edc4e011d Reviewed-on: https://pdfium-review.googlesource.com/17611 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-02Remove default values from Set{UserData|Object} and GetUserData.Dan Sinclair
This CL removes the default values and inlines at the call sites. Change-Id: I47ff04a01c30af89949e9c8dd5d51f7ffaef1f98 Reviewed-on: https://pdfium-review.googlesource.com/17610 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-02Remove default values from CJX_Node::TryContentDan Sinclair
This CL removes the default values from TryContent and inlines into the call sites. Change-Id: I2d3f41f77364a0b923931479a60e07eae98dd5a9 Reviewed-on: https://pdfium-review.googlesource.com/17550 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-02Remove default values from CJX_Node::SetCDataDan Sinclair
This CL removes the default values from SetCData and inlines at the call sites. Change-Id: I664338a8c7fec2ee9ec0c9ed9f892e57ea1ced43 Reviewed-on: https://pdfium-review.googlesource.com/17534 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-02Cleanup params to CJX_Node::TryCDataDan Sinclair
This CL removes the bProto param as it was never set and inlines the value where needed in the methods. The default value was removed from bUseDefault and inlined into callsites as needed. Change-Id: I773261d19aa3799bc607e7df482b5f5e5217bee6 Reviewed-on: https://pdfium-review.googlesource.com/17533 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-02Remove default value from CJX_Node::GetPropertyDan Sinclair
This CL removes the GetProperty default value and inlines into the callers. Change-Id: I0e18f27b51046fdf37ddc57f34a31154729c8db0 Reviewed-on: https://pdfium-review.googlesource.com/17510 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-02Remove default values from CJX_Node::SetAttributeValueDan Sinclair
This CL removes the default parameters from SetAttributeValue and inlines into the call sites as needed. Change-Id: Ibb4e4747141a49c2367743421254c251aff71eeb Reviewed-on: https://pdfium-review.googlesource.com/17490 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-02Remove default params from CJX_Node::SetScriptContentDan Sinclair
This CL removes the default values and adds them to the call sites as needed. Change-Id: I7c9654a7b6320f1c81a129808b3afa3eed9d4159 Reviewed-on: https://pdfium-review.googlesource.com/17471 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-02Remove default value from CJX_Node::GetAttributeDan Sinclair
This CL moves the default value to CJX_Node::GetAttribute to the call sites and removes the default. Change-Id: I2b875e3c612b91ca67af106e271b040cc51c56ef Reviewed-on: https://pdfium-review.googlesource.com/17470 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-02Remove default value to CJX_Node::SetAttributeDan Sinclair
The bNotify value has been moved into the call sites and the default removed. Change-Id: Ifd2c0252b0f1421f7fc244d69e6f6bddc80e5591 Reviewed-on: https://pdfium-review.googlesource.com/17450 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-02Move CJX_Node definitions to cpp fileDan Sinclair
This CL moves some method bodies from the .h to the .cpp file. This makes the .h file a lot easier to read. Change-Id: Ia6366d3b8dcfdb1b626814577fd93b027250474c Reviewed-on: https://pdfium-review.googlesource.com/17430 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-01Remove default value from CJX_Node::HasAttributechromium/3256Dan Sinclair
The attribute is always false, removed and simplified the code. Change-Id: Ic20ffe8d91fc3fcd66835e1bc2b1bce3da69be16 Reviewed-on: https://pdfium-review.googlesource.com/17316 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-01Add GetDocument() helper to CJX_ObjectDan Sinclair
Change-Id: I710ea0baa1befb093d7174d4fc61a5ab28e9f92a Reviewed-on: https://pdfium-review.googlesource.com/17315 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-01Move the item methods into CXFA_Node propertlyDan Sinclair
When CreateInstance, GetCount, GetItem, RemoveItem and InsertItem were moved out of the anonymous namespace they were not updated to remove the first parameter. This Cl removes the first parameter and uses the CXFA_Node as the thing to operate on. Change-Id: I1b6dc956844786c8ba88ae508547c9cf6e91242a Reviewed-on: https://pdfium-review.googlesource.com/17311 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-01Split JS methods out of CXFA_ObjectDan Sinclair
This CL moves the javascript code from CXFA_Object to CJX_Object. The Script_* methods are proxied to CJX_Object. The ownership of the CJX_ object was removed from CXFA_Node and moved up to CXFA_Object. Change-Id: I58d286e6bb0151aa88d4f673bc7729987417bde6 Reviewed-on: https://pdfium-review.googlesource.com/17310 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-01Split JS code out of CXFA_Node.Dan Sinclair
This CL moves JS code out of CXFA_Node and places it into fxjs/cjx_node. The CXFA_Node then has a CJX_Node as a member and, currently, proxies JS calls to the CJX_Node member. Change-Id: Ic5b95184c8fd2347f0bdcfbccfa89bb6b52835b6 Reviewed-on: https://pdfium-review.googlesource.com/17290 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>