Age | Commit message (Collapse) | Author |
|
This CL makes minor clarity cleanups to the formcalc parser and attempts
to record the productions each method is processing.
Change-Id: Ie12bb55647abf06251d1734fd05d08a964a32ebc
Reviewed-on: https://pdfium-review.googlesource.com/27550
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL switches the empty destructors in the FormCalc expressions to
use default.
Change-Id: I0a2ea520c89a96d29a2e2564572a7cf345f9f31a
Reviewed-on: https://pdfium-review.googlesource.com/27510
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
In all the places we call ParseBlockExpression we really mean to parse
an ExpressionList. Using ParseBlockExpression is confusing because the
formcalc grammar has a BlockExpression defined which corresponds to our
ParseDoExpression.
This CL converts the use of ParseBlockExpression into calls to
ParseExpressionList and then builds the BlockExpression class as needed.
Change-Id: Iab9b6e783f01d35df905539d4dbc20ba18a7b0f9
Reviewed-on: https://pdfium-review.googlesource.com/27470
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
The expression type is no longer used, removed.
Change-Id: I4c8b17ed1644560afd7fc87a7fb6c7d893b9de5c
Reviewed-on: https://pdfium-review.googlesource.com/27450
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL combines the elseif and else output code for formcalc. This
causes an extra set of {}'s to be output in the else case but should be
syntactically the same.
Change-Id: Ie30a51efadae2034d117f4bf280b9f7abc950a23
Reviewed-on: https://pdfium-review.googlesource.com/27431
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
The if token in formcalc is an internal keyword and can not be used as
an identifier. The current if parsing code will turn if into an
identifier if it fails to find the 'then' statement after the argument
list.
This should be a failed parse instead of coverting if to an identifier
and resetting the lexer.
Change-Id: Ieebf6a1aabc27482fcaeaf7a9bd4be40fc01e9ad
Reviewed-on: https://pdfium-review.googlesource.com/27430
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
The recorded line number from the formcalc parse is never used. This Cl
removes the parameter and removes the need to pass it through all of the
constructors.
Change-Id: Ice716cc4880dd17dc05bffcdce1dc1e4745108ea
Reviewed-on: https://pdfium-review.googlesource.com/27412
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This Cl moves the code to create literals in the AST from
ParsePrimaryExpression to ParseLiteral.
Change-Id: I41ba20f28f1cb1d76d753c5baec790872acdf1da
Reviewed-on: https://pdfium-review.googlesource.com/27411
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I11ede1eb4f984b516275f03798996e6fc34880dc
Reviewed-on: https://pdfium-review.googlesource.com/27410
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
No behavior change.
Bug: none
Change-Id: I59a40e5d38d561da1ebf20a40feb3933f7fef14a
Reviewed-on: https://pdfium-review.googlesource.com/27390
Commit-Queue: Nico Weber <thakis@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the code from PrimaryExpression which converts the if
token into an indentifier. if() is a reserved keyword and can't be used
as an indentifier according to the spec.
Change-Id: I5644cdbe57ef62f4089b4704e1b8d196927e68a4
Reviewed-on: https://pdfium-review.googlesource.com/27370
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
The assignment operator can not be chained. This Cl removes the while
loop for assignments and changes it to an if(). We also can not have an
assignment inside ()'s so remove that option.
Bug: chromium:779349
Change-Id: I6934e18815f843ae8241023df6c03d8bbcd8168d
Reviewed-on: https://pdfium-review.googlesource.com/27350
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Duplicate checks, remove.
Change-Id: Ic2f49651c50ed66328233817bc8cd24f7c9636c2
Reviewed-on: https://pdfium-review.googlesource.com/27330
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Currently the parser builds assignment statements as part of the
SimpleExpression declaration. This isn't correct according to the
grammar where AssignmentExpression and SimpleExpression are siblings.
This CL moves the assignment calculation into the ExpExpression
declaration to make it a sibling of the SimpleExpression.
Change-Id: I6afac2379ab6783b84ee619863c8308ca0db454d
Reviewed-on: https://pdfium-review.googlesource.com/27310
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL cleans up the FormCalc inheritance. The binary and unary items
all share ToJavaScript methods now.
Change-Id: I7bf0978449395fa2eb90b954cf2118d7aa3f71c6
Reviewed-on: https://pdfium-review.googlesource.com/27290
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the Loop base class as it adds no functionality. Other
base classes have had their ToJavaScript methods set as pure virtual and
their constructors made protected.
Change-Id: I5c77b8734d23c576dd52db7f72396ecdf2f7bd22
Reviewed-on: https://pdfium-review.googlesource.com/27270
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL cleans up some of the JS generation code to make it easier to
see what JavaScript is begin created.
Change-Id: I4265226cca0e4de400d05cc0fea3f8c76608115e
Reviewed-on: https://pdfium-review.googlesource.com/27250
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL inlines the FormCalc method names instead of using a lookup
array. Many of the names were only referenced once and this makes the
code a lot simpler to read.
Change-Id: Ib80f5bfa0097e4f1bad232e7de452f067db2a758
Reviewed-on: https://pdfium-review.googlesource.com/27211
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL inlines the RUNTIMEFUNCTIONRETURNVALUE and
EXCLAMATION_IN_IDENTIFIER defines to make the output code easier to
read.
Change-Id: I4a86da2aefc75ff137d9a7cff0351515b275f1b1
Reviewed-on: https://pdfium-review.googlesource.com/27230
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL merges the ToJavaScript and the ToImpliedJS methods in the
FormCalc expressions. The type of return is passed as a paramter to
ToJavaScript.
Change-Id: Idff83677bc70b964d95aa6ff6b0e2c1bf8c603ea
Reviewed-on: https://pdfium-review.googlesource.com/27210
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL converts the CXFA_FMToken usages into an object instead of a
pointer. A copy constructor has been added. The line number was removed
from the token and is retrieved from the lexer where needed.
Change-Id: I94c632653e9bf1439d2ddf374a816ae0d10b5b67
Reviewed-on: https://pdfium-review.googlesource.com/27192
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
This CL changes XFA to skip font loading for embedder tests. This takes
the runtime for the CFXJSE_Formcalc_ECFXJSE_FormCalcContextEmbedderTest
run from ~25sec to ~5sec.
Change-Id: If9989c5a3474cccd3915ec3f5c178d7af48aae37
Reviewed-on: https://pdfium-review.googlesource.com/27191
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
The keyword list in the formcalc lexer is only used to match
identifiers. We don't need to store the non-identifier tokens in the
list, so they're removed. The hash is removed and the list is compared
by string instead.
The token names have been moved to DEBUG so they won't be included in
Release builds.
Change-Id: Ieec00e9944960e559079083a605e3249c4128841
Reviewed-on: https://pdfium-review.googlesource.com/27190
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Change-Id: Ibaf53ee27eefc692ac4f002c3ab28b7738676b31
Reviewed-on: https://pdfium-review.googlesource.com/26991
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: Ic1d63e8ef54a820b01d67dbf1dd6f6f72a06b77c
Reviewed-on: https://pdfium-review.googlesource.com/26990
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I1fd4bf85cd709de1c14ed2895d045018f79bc61f
Reviewed-on: https://pdfium-review.googlesource.com/26950
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
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>
|
|
Currently it's possible to create a formcalc script which creates a
large number of expressions. This will eventually cause stack exhaustion
as we try to allocate the needed expression objects.
This CL limits the number of parsed expressions in the PostExpression
section in order to keep from failing due to stack overflow.
Bug: chromium:799721
Change-Id: I69fca35db7f75ef97aec21c22fc06d926dfe2df6
Reviewed-on: https://pdfium-review.googlesource.com/26870
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
When the document creates anew data root element it assigns it into the
CXFA_Node but fails to set that node as owing the XML node. The XML node
is never inserted into another XML tree so it ends up being leaked.
This CL sets the CXFA_Node to own the XML data tree node so it will be
cleaned up properly.
Bug: chromium:807863
Change-Id: I72a1b8f7b1f1a50bf7139d8bd0ecc8e504ccfc91
Reviewed-on: https://pdfium-review.googlesource.com/26790
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
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>
|
|
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>
|
|
This CL marks methods const where possible and removes redundant
methods from CXFA_Document.
Change-Id: I34804425469dfd52469daba68f64a4b511e5d4d0
Reviewed-on: https://pdfium-review.googlesource.com/26730
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
This CL adds the list_child_ member into CFX_XMLNode to keep it
consistent with other tree's in the system.
Change-Id: I2e64f11fb9c7df40dd3467edcce177fc492d2cd2
Reviewed-on: https://pdfium-review.googlesource.com/26670
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the switch from SaveXMLNode and moves the required code
into override methods in the child classes. The method is renamed from
SaveXMLNode to just Save.
Change-Id: I2011b80525e99635c573b4e0cf977e94f6b7cea6
Reviewed-on: https://pdfium-review.googlesource.com/26590
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
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>
|
|
The CFX_XMLDoc::SaveXMLNode method is almost an exact copy of the
CFX_XMLNode::SaveXMLNode. This CL removes the XMLDoc variant and calls
the XMLNode method directly.
This Removes the need to pass the CXFA_DocumentParser into CXFA_Document
and we can instead pass in the CXFA_FFNotify object directly.
Change-Id: Ic3c8c66375483fe73b44dd84064a1b71b039d61c
Reviewed-on: https://pdfium-review.googlesource.com/26530
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL removes unused methods from CFX_XMLNode, adds an AppendChild to
handle the case of a -1 index to InsertChildNode, removes the
InsertChildNode return value which is unused and cleans up various other
things.
Change-Id: I3a022e4dc2afffa6893ad11014034dd7ed301f13
Reviewed-on: https://pdfium-review.googlesource.com/26510
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
The existing code has a couple of issues that need to be
addressed. First it assumes that for a hash, there will be an entry in
the map and blindly calls the [] operator and takes the address of the
result. If there isn't an entry for the hash then this will cause a
crash. This has been converted to a call to find and returning
nullptr, which is the fail result, if it cannot find an entry for the
hash.
The other issue is that it assumed that the first entry in the vector
would be a valid pointer. When removing fonts from the vector,
RemoveFont, first nulls out entries. Once all of the entries have been
removed from a vector on subsequent calls to RemoveFont, then the
vector is removed from the map. Thus the first entry in the vector
might not be the correct value to return. This has been changed to a
linear scan of the vector for a valid pointer.
BUG=chromium:648177
Change-Id: Ife758636545f0d10fb726c243e3e0a5b7c1d1138
Reviewed-on: https://pdfium-review.googlesource.com/25930
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
CFWL_Edit::UpdateCursorRect now checks if the edit is empty before
getting the caret position.
Bug: chromium:592750
Change-Id: I792e90537741a78141fa084a646380bfe7ce4637
Reviewed-on: https://pdfium-review.googlesource.com/25910
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Mechanically uniquify all the kFoo variables in xfa/fxfa/parser.
BUG=pdfium:964
Change-Id: Iffe15015282d572147f31f2101fa0127f2198620
Reviewed-on: https://pdfium-review.googlesource.com/25890
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
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>
|
|
In the existing code pCharPos is manipulated directly without being
reset. This means that for the second iteration it is at the end of
the range instead of the start. This CL introduces temporary iterators
that are intialized to the value of pCharPos and then manipulated to
avoid this issue and having to reset pCharPos.
BUG=chromium:648177
Change-Id: I5c9344c1b67a015b01470a0dc337361552ffd447
Reviewed-on: https://pdfium-review.googlesource.com/25750
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
This makes the caret appear (again?), blink, and fixes its positioning
to be a little spaced from the last character.
Known issue: when the edit is empty, the caret is not necessarily
aligned with where the text will be.
Bug: chromium:592750
Change-Id: I950b0ea236db8855c6ed50f48ec1935d97e6ccf8
Reviewed-on: https://pdfium-review.googlesource.com/25451
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|