summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-03-06Rename IFX classes in core/fxge to Ifacechromium/3364Dan Sinclair
This CL renames IFX classes in core/fxge to Iface. Change-Id: I137167ddd4ff1563d8002d9501222c27183408cc Reviewed-on: https://pdfium-review.googlesource.com/27990 Reviewed-by: Tom Sepez <tsepez@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-03-06[formcalc] Allow empty declaration bodiesDan Sinclair
This CL removes the checks for empty declaration bodies. Change-Id: I06a8f602f49d7709bce86442cae2d38991fa5d82 Reviewed-on: https://pdfium-review.googlesource.com/27950 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-03-05[formcalc] Simplify function signature parsingchromium/3363Dan Sinclair
This CL refactors the signature parsing for formcalc functions. Change-Id: I69634968ab1cbd9698a3ce3ae321e14bafe918c6 Reviewed-on: https://pdfium-review.googlesource.com/27930 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-03-05[formcalc] Cleanup m_error handlingDan Sinclair
This CL cleans up the setting of m_error. In most cases we don't need to set m_error it will be set when we bubble up the nullptr return from the various parse methods. The m_error was set inconsitently previously and was confusing on if it needed to be set or not. Change-Id: I8648b6296ef15239bd2663e6543a960b88177721 Reviewed-on: https://pdfium-review.googlesource.com/27910 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-03-05Cleanup CFWL_ScrollBar::Timer::Run.Henrique Nakashima
Change-Id: Icd76a6a98a66c977e45ed82663b68f6b05479e76 Reviewed-on: https://pdfium-review.googlesource.com/27891 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-03-05Fix crash when dragging scrollbar in XFA form.Henrique Nakashima
Bug: chromium:809612 Change-Id: I171d836927fc707388444726d3918b2cbbb39002 Reviewed-on: https://pdfium-review.googlesource.com/27890 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-03-05Clean up CPDF_DIBSource.Lei Zhang
- Deduplicate code. - Rearrange some functions for early returns. Change-Id: I901d9041a42ff66002b1454193e5e122e5a379cd Reviewed-on: https://pdfium-review.googlesource.com/27810 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-05Make FPDFBitmap_GetFormat() work for JBIG images.Lei Zhang
BUG=pdfium:945 Change-Id: I2a880e747b6f5a2fabed4d34ce47b69ff589ce3f Reviewed-on: https://pdfium-review.googlesource.com/27814 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-05Use CPDF_DIBSource::LoadState enum class in more places.Lei Zhang
Change-Id: Iaf124c1b1ceca86d220ae654d9d18af7475209b6 Reviewed-on: https://pdfium-review.googlesource.com/27870 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-05Change CPDF_DIBSource::LoadJpxBitmap() to return a bitmap.Lei Zhang
Change-Id: If819bee4809142e2f9c9b0830f00264b0fbaf862 Reviewed-on: https://pdfium-review.googlesource.com/27852 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-05Change return types for some rendering Start/Continue methods.Lei Zhang
Either return a bool or a CPDF_DIBSource::LoadState. Explain what the bool return value means. Change-Id: I6346d0cd61d5faee5290df181cfff3b9e4d5d84e Reviewed-on: https://pdfium-review.googlesource.com/27851 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-05Add CPDF_DIBSource::LoadState enum class.Lei Zhang
Change-Id: I97819912e564e4b52fcdae4ce7f865188fb1a520 Reviewed-on: https://pdfium-review.googlesource.com/27850 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-02Make EmbedderTest::WriteBitmapToPng() work with grayscale images.chromium/3362chromium/3361chromium/3360Lei Zhang
Change-Id: I88d350171e2b18dc7776d17e845b55c361845721 Reviewed-on: https://pdfium-review.googlesource.com/27811 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-01Disable XFA tests without embedded fontsRyan Harrison
These are being flakey due to subtle differences between builders, so turning them off while resolving that. Change-Id: I7f400a7a95076bafb2739ff78786eb3cc147953c Reviewed-on: https://pdfium-review.googlesource.com/27830 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-01Add a test for FPDFImageObj_GetBitmap() with a JBIG image.Lei Zhang
The test expectations are for the current failure state. BUG=pdfium:945 Change-Id: I1be503860b2ad5cbb0466793c9fa1438b3fc43d7 Reviewed-on: https://pdfium-review.googlesource.com/27770 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-03-01Break up CFX_DIBSource::ConvertBuffer().Lei Zhang
Change-Id: If93b4782016c7f27c1533417d019f3271c807941 Reviewed-on: https://pdfium-review.googlesource.com/27813 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-01Fix some nits in CFX_DIBSource::CloneConvert().Lei Zhang
Change-Id: I25c16b7159d168bd6deb4fd9936bb242d7e8c590 Reviewed-on: https://pdfium-review.googlesource.com/27812 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-02-28Add simple XFA test for entering text into TextEditRyan Harrison
BUG=pdfium:1008,pdfium:1020 Change-Id: I607b9327252ff836ad78a55659b1d40bc2797906 Reviewed-on: https://pdfium-review.googlesource.com/27771 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-02-27Move XFA pixel tests under pixel/chromium/3358chromium/3357Ryan Harrison
This removes the need for them to have their own runner. Due to other upstream changes some of the expectation files needed to be updated. The suppressions have been updated to make sure the tests do not run for non-XFA builds. Having these tests run on the bots surfaced an MSAN issue in the XFA code, which is fixed in this CL. BUG=pdfium:1020,pdfium:1008 Change-Id: I44e2fa1cba2d07f30f56f5792749acbe1ebf4b62 Reviewed-on: https://pdfium-review.googlesource.com/27710 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-02-26Shrink some tables and kill dead code in xfa.Tom Sepez
Change-Id: Ic1260417e7d1475dd518655b2ab08f0184955d88 Reviewed-on: https://pdfium-review.googlesource.com/27170 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-02-26Get rid of some static variables.Tom Sepez
These are generally cheap enough to compute as needed, rather than keeping around in memory all the time (plus the memory for the static flag the compiler generates to check if initialized). Change-Id: If3a5365521f6a7781e66fb11f04883a5c673ee11 Reviewed-on: https://pdfium-review.googlesource.com/27150 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-02-26Add some more missing consts.chromium/3356Tom Sepez
Get things out of the .data section. Change-Id: I375cf00186a3d5d8d10f5d147bd4b692f5db3683 Reviewed-on: https://pdfium-review.googlesource.com/27130 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-02-26Fix -Wunused-variable warning if building with V8 snapshots disabled.Nico Weber
Bug: chromium:803591 Change-Id: I4dbbe52ca296e7232ad3eb225a2bdd84dcd0fa81 Reviewed-on: https://pdfium-review.googlesource.com/27730 Commit-Queue: Nico Weber <thakis@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-02-26Fixup AFSimple_Calculate indexing bugDan Sinclair
The refactoring in [1] introduced a bug where we pulled the wrong array index to get the array of fields to use in the AFSimple_Calculate method. This caused the calculation to not be performed as the fields could not be found. This CL fixes up the index and adds a test to verify we use AFSimple_Calucate to sum two fields. 1- https://pdfium-review.googlesource.com/c/pdfium/+/16670 Bug: chromium:811913 Change-Id: I2abb9fe4fe2d6969ce1876736faadf252ef90575 Reviewed-on: https://pdfium-review.googlesource.com/27670 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-02-25Add expectations for static XFA testsRyan Harrison
BUG=pdfium:1008,pdfium:1020 Change-Id: I1f14f249bfc253bacf84219221c3f749308b556f Reviewed-on: https://pdfium-review.googlesource.com/27650 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-02-23Setup testing XFA using .in fileschromium/3355chromium/3354Ryan Harrison
This adds a number of {{}} style tags to the .in format that allow the fix-up script to inject XFA related boilerplate into the PDF, instead of having the .in file replicate this. A simple example XFA .in file, called xfa_example.in has been added as a template for future files to follow. Finally a run_xfa_tests.py has been added for executing all of the tests in testing/resources/xfa, which from what I can tell are not executed any other way. All of the existing PDFs in that directory are currently suppressed. BUG=pdfium:1008 Change-Id: Ie055b6640969ce8291b4c96b401ebf6887dfa0c0 Reviewed-on: https://pdfium-review.googlesource.com/27631 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-02-22Roll build/ and tools/clang directorieschromium/3353Dan Sinclair
This CL rolls the build/ and subsequently clang/ directories in order to pull the libxcursor1-dbg fix into PDFium. Build: https://chromium.googlesource.com/chromium/src/build/+log/c7a79acbd202c85ddafbacdcde0f7926a53ae792..7bee8be1e0ed713aa9ddeb422a459fced9412c9f Clang: https://chromium.googlesource.com/chromium/src/tools/clang/+log/a695c30c8618b948d714a2a8161ee6a2ab98d0ce..7e6931239f20219e3c993b7f8d864217bdbe925e BUG: chromium:814331 Change-Id: Ifb97ae08a702f63742be7658a7e8227d7f56a179 Reviewed-on: https://pdfium-review.googlesource.com/27611 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-02-22[formcalc] Cleanup function handlingDan Sinclair
This CL creates a CXFA_FMAST root for the AST tree instead of overloading the CXFA_FMFunctionDefinition. This Removes the m_global from FunctionDefinition and simpifies the code. Change-Id: I9347769a291ef1753539701f334cc8dd69b7187e Reviewed-on: https://pdfium-review.googlesource.com/27590 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-02-22Jumbo fixesDan Sinclair
Change-Id: I5b81a483c57b97598a0d36ceaebc382016e95ae3 Reviewed-on: https://pdfium-review.googlesource.com/27591 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-02-22Add namespaces to duplicated Skia code.Jonathan Feinberg
When pdfium is imported into Google's internal repository, the recently copied Skia decimal formatting code causes only-defined-once violations because many Google internal projects depends on Skia through Google's own copy. This patch puts pdfium's private copy of the needed function into a namespace. Change-Id: Id102b17f6f4652e4a50c4ff75825468fc3d90727 Reviewed-on: https://pdfium-review.googlesource.com/27530 Reviewed-by: Hal Canary <halcanary@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-02-21[formcalc] Cleanup if expression parsing.Dan Sinclair
This CL simplifies the if expression parsing. The elseif construct has been split into its own list of IfExpressions and no longer gets stuffed into the elseExpression. A loop was added into the output methods for the elseif expressions, which also means we can go from having: if () { } else { if () { } else { } } to if () { } else if () { } else { } Which is a bit nicer. Change-Id: I6edf75215500d6a32a8d7218d477b6960f03de51 Reviewed-on: https://pdfium-review.googlesource.com/27571 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-02-21[formcalc] Add elseif expression to parser testDan Sinclair
This extends the test case for slightly more coverage. Change-Id: I97613c2d8df416b37718ff747d218dd61ea02b37 Reviewed-on: https://pdfium-review.googlesource.com/27570 Commit-Queue: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-02-21[formcalc] Minor parser cleanupschromium/3352Dan Sinclair
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>
2018-02-21[formcalc] Use default destructorsDan Sinclair
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>
2018-02-21[formcalc] Remove the ParseBlockExpression methodDan Sinclair
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>
2018-02-21Roll pdfium/third_party/freetype/src/ 4a03f1744..713d68ee9 (3 commits)Lei Zhang
https://chromium.googlesource.com/chromium/src/third_party/freetype2.git/+log/4a03f17449ae..713d68ee9f47 $ git log 4a03f1744..713d68ee9 --date=short --no-merges --format='%ad %ae %s' 2018-02-17 wl [sfnt] Prefer `CBDT'/`CBLC' over `glyf' table (#53154). 2018-02-17 wl Split off ChangeLog.28. 2018-02-17 wl s/sub-pixel/subpixel/. Created with: roll-dep pdfium/third_party/freetype/src BUG=pdfium:1016 Change-Id: Ib7846b5234cc1cf5a85cf557cc37f74144b592c6 Reviewed-on: https://pdfium-review.googlesource.com/27491 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-02-21Download ciopfs from a hook in win/cross builds.Lei Zhang
This is PDFium's copy of https://crrev.com/533804 Change-Id: I6e0c3e0fbb36fa9da9cb2e4e18c413c92824c46a Reviewed-on: https://pdfium-review.googlesource.com/27490 Reviewed-by: Nico Weber <thakis@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-02-20[formcalc] Remove unused expression typeDan Sinclair
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>
2018-02-20[formcalc] Treat elseif and else the same during outputDan Sinclair
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>
2018-02-20[formcalc] Do not convert if to an identifierDan Sinclair
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>
2018-02-20[formcalc] Remove unused line parameterDan Sinclair
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>
2018-02-20[formcalc] Split literal parsing to its own methodDan Sinclair
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>
2018-02-20Remove extra static qualifier.Dan Sinclair
Change-Id: I11ede1eb4f984b516275f03798996e6fc34880dc Reviewed-on: https://pdfium-review.googlesource.com/27410 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-02-20Fix typo in method name FillSoildRect().Nico Weber
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>
2018-02-20[formcalc] The if token is a keyword and should not be made an identifierDan Sinclair
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>
2018-02-20Tighten up assignment instructions in formcalc.Dan Sinclair
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>
2018-02-19Remove extraneous HasError checksdan sinclair
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>
2018-02-19FormCalc Assignment is not a SimpleExpressiondan sinclair
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>
2018-02-19Cleanup FormCalc inheritancedan sinclair
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>