18628 Commits

Author SHA1 Message Date
Tom Sepez
2fc6b6529b Add one-line comments about what CPDF_ font classes represent.
No functional change.

Change-Id: Icb23e43853c8b0afb67c19ad690c3bfb81061b17
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149930
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Auto-Submit: Tom Sepez <tsepez@chromium.org>
2026-06-16 11:28:29 -07:00
Aryan Krishnan
0a4b8de78c Replace the EM_ADJUST macro with a function
This CL replaces the EM_ADJUST macro with the CFX_Face::EmAdjust()
function. This allows the define to be removed and replaced with more
strict type checking and helps in removing legacy code.

Bug: 42270078
Change-Id: Id5f1b472391a4da169e977188ea6d46db6a8c129
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149110
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Andy Phan <andyphan@chromium.org>
Commit-Queue: Aryan Krishnan <aryankrishnan4b@gmail.com>
2026-06-15 20:27:22 -07:00
Tom Sepez
ee47c0ef8b Clear more object bindings in CFXJSE_Engine destructor.
These objects are unreachable, but it doesn't hurt to be more defensive
about clearing out old bindings.

Fixed: 522938824
Change-Id: I58e1f2de98a459231f87e3291fc3748edc3b9925
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149910
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2026-06-15 18:36:16 -07:00
Helmut Januschka
ec2d9a2ae4 Replace FX_LB short-alias defines with constexpr constants
These macros were just short-name aliases for FX_LINEBREAKTYPE enum
values, used to keep the kLineBreakPairTable rows compact. Convert them
to file-scope constexpr constants in the anonymous namespace, and drop
FX_LBHS which was defined but never referenced. clang-format repacks the
data table to use the new shorter identifiers.

Bug: 42270078
Change-Id: I347b362a9af552682d28923355b40ee55a565e5d
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/148831
Auto-Submit: Helmut Januschka <helmut@januschka.com>
Commit-Queue: Helmut Januschka <helmut@januschka.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
2026-06-15 14:04:28 -07:00
Tom Sepez
ccfc0838c6 Split and move Skia font tables to CFX_AndroidFontInfo
Mechanically move Skia font tables, constants, and helper functions from
CFPF_SkiaFontMgr to CFX_AndroidFontInfo.

Expose the necessary helper functions and table getters in
cfx_androidfontinfo.h to allow CFPF_SkiaFontMgr to continue using them
temporarily.

This is a preparatory step to simplify the transition of
CFX_AndroidFontInfo to inherit from CFX_FolderFontInfo and remove
CFPF_SkiaFontMgr.

-- Pass tables back to old code as spans.

TAG=agy
CONV=9eb75345-7937-424f-b361-4fdfac3d86a7

Change-Id: Iedad112f2d1de8039e4cba198730305ccd1f2da5
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149870
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2026-06-15 12:35:59 -07:00
Tom Sepez
3e968165f9 Prepare CFX_FolderFontInfo for Android Refactoring
Add infrastructure changes to CFX_FolderFontInfo to support Android's
font matching requirements in a subsequent CL.

Changes:
- Add `glyph_count_` to FontFaceInfo.
- Parse 'maxp' table in CFX_FolderFontInfo::ReportFace to extract
  `glyph_count_` during scanning. This information is the crux of
  the change, allowing android to drop FreeType usage in next CL.
- Add virtual IsBetterMatch hook to CFX_FolderFontInfo, replacing
  inline matching logic in FindFont.
- Minor cleanup in FindFont to assign `pFind` alongside `iBestSimilar`.

TAG=agy
CONV=71ddca6b-8a59-46ab-a366-5526235fb713

Change-Id: I1480e3e0aafe45e1df307d5b88fdb026b018ad67
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149630
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2026-06-15 10:42:57 -07:00
pdfium-autoroll@skia-public.iam.gserviceaccount.com
b4bd770b6b Roll Memory Tools from 66b0df34a721 to a7e928b8bb8d (1 revision)
66b0df34a7..a7e928b8bb

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/memory-tools-pdfium
Please CC akall@google.com,thestig@chromium.org on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: akall@google.com
Change-Id: Ia2c007ab03c750d82e9f7415173e428df215b58a
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149850
Bot-Commit: pdfium-autoroll@skia-public.iam.gserviceaccount.com <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: pdfium-autoroll@skia-public.iam.gserviceaccount.com <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
2026-06-14 22:27:50 -07:00
pdfium-autoroll@skia-public.iam.gserviceaccount.com
a8ad8374d2 Roll Zlib from 5c1dfd53066b to 3246f1b60849 (1 revision)
5c1dfd5306..3246f1b608

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/zlib-pdfium
Please CC akall@google.com,thestig@chromium.org on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: akall@google.com
Change-Id: Ie0dde85f21dc6a60bc42605b5c13faba1148fa5b
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149830
Bot-Commit: pdfium-autoroll@skia-public.iam.gserviceaccount.com <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: pdfium-autoroll@skia-public.iam.gserviceaccount.com <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
2026-06-14 21:58:30 -07:00
pdfium-autoroll@skia-public.iam.gserviceaccount.com
e1157f05b2 Roll libpng from 8a5b4ace0c2a to 6d5341764ef4 (1 revision)
8a5b4ace0c..6d5341764e

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/libpng-pdfium
Please CC akall@google.com,thestig@chromium.org on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: akall@google.com
Change-Id: Iaf8696173cb0e3ddaf2287136c24558480527845
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149810
Bot-Commit: pdfium-autoroll@skia-public.iam.gserviceaccount.com <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: pdfium-autoroll@skia-public.iam.gserviceaccount.com <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
2026-06-14 21:47:52 -07:00
Tom Sepez
eee4375737 Make CFX_FolderFontInfo file-reading helpers static methods.
Doing so will allow CFX_AndroidFontInfo to re-use this code in
a subsequent CL. No functional change.

Change-Id: I3ed34ed91581bf46165e3dca215a88b7bc316191
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149711
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2026-06-11 17:40:51 -07:00
Alex Gough
e878c9636e Update Chrome security bug reporting location
VRP reports via the Chromium template are deprecated.

Bug: b:518804997
Change-Id: I1699494689808e9950d94e3cf05115af3c9a0414
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149710
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Auto-Submit: Alex Gough <ajgo@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
2026-06-11 17:08:47 -07:00
Tom Sepez
30d9aedac9 Correct Johab mapping and add Vietnamese/OEM support
Expand CFX_FolderFontInfo to support Vietnamese and OEM charsets, and
correctly map Johab to FX_Charset::kJohab (instead of Hangul) when
scanning system fonts. This benefits all platforms using the shared
folder font scanner (like Linux and eventually Android).

TAG=agy
CONV=71ddca6b-8a59-46ab-a366-5526235fb713

Change-Id: Idbee3b04440e6efd347c2bfd717b833f31b015e3
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149650
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2026-06-11 16:16:03 -07:00
Tom Sepez
a07c512569 Include missing charsets in CFX_FolderFontInfo from OS2 table.
Hebrew fallback now succeeds and selects a proper Hebrew fallback font
(Sans-Serif, like DejaVu Sans), causing the rendering to change. Makes
other platforms more consistent with android font mapping, allowing
unification down the road.

-- Update diffing image.

Change-Id: I92f40426c99354e13588ac62788fc4893464fb2c
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149450
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2026-06-11 16:12:19 -07:00
Tom Sepez
0c1627a246 Define global FX_CharsetFlag and use it in font managers.
Move the Android Skia font manager's charset bitmask concept into a
global FX_CharsetFlag enum class in core/fxcrt/fx_codepage.h.

Refactor CFPF_SkiaFontMgr and CFX_FolderFontInfo to use this new
global enum instead of their own local charset representations.

-- Document origin of some magic constants.

TAG=agy
CONV=818eabd3-5feb-4f7e-8419-5bdf50c0ebd6

Change-Id: I89516de04fa4d8a38be827169bbd8e5a4a35ac28
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149590
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2026-06-11 11:51:43 -07:00
Helmut Januschka
dba25aa510 Replace XFA_FWL_PSBSTYLEEXT defines with an enum class.
Convert the three pushbutton highlight-mode bits to a scoped enum
HighlightStyle nested in CXFA_FFPushButton, unwrapping to uint32_t via
fxcrt::to_underlying() only at the ModifyStyleExts/GetStyleExts
boundary.

Bug: 42270078
Change-Id: I46a424e1302d7c47b16cd07dca2a960f419920ec
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/148813
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Helmut Januschka <helmut@januschka.com>
Reviewed-by: Nicolás Peña <npm@chromium.org>
2026-06-11 11:23:42 -07:00
Tom Sepez
85b0d00e11 Add missing FXSYS_ToLowerASCII().
Simplify one constexpr function with it.

Change-Id: I8e0dc4c7b278a4b8a4ad54b73da3244a35d08b18
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149570
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2026-06-10 16:04:11 -07:00
Aryan Krishnan
2ae413aca5 Add simple tests for Brotli compression
This CL adds test based on brotli-stream compressed PDF files and
updates the needed BUILD files to be able to allow for Brotli
compression to be tested when the feature is built. These test files are
based on existing files with a compressed stream using brotli and
ASCII85 decode to prevent the stream from just being a binary blob.

Bug: 475855993
Change-Id: I8162dd98885cf6e75bfe8b5d82f61d7d4252bea1
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/148230
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2026-06-10 14:51:27 -07:00
Tom Sepez
7c53431c7e Reduce object churn in CPDF_NameTree::GetNodeLimits.
Swap the existing CPDF_Object elements in-place within the limits array
instead of recreating CPDF_String objects. This avoids unnecessary
object destruction and creation, and prevents raw pointers to these
objects from becoming stale.

TAG=agy
CONV=0a224b86-8e8f-46de-aa9b-83554f270ca5

Fixed: 522299155
Change-Id: Ib7615898a5fb489cb7755f1e3f1d04f95715e08a
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149550
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2026-06-10 13:27:30 -07:00
Tom Sepez
3a1c2bfe52 Add hash-to-string mapping to CFPF_SkiaFontMgr.
For compatibility reasons, the Android font mapping can not be
converted to a pure string-to-string mapping (yet) because some source
font names in the mapping table remain unknown (undecoded).

However, all target fonts are common names (Roboto, Droid Sans, Droid
Serif, Droid Sans Mono, Droid Sans Fallback). This CL converts the
substitution tables to map from source hashes to target string names.
Hash the mapped target string back to a hash on the fly to keep the
rest of the matching logic unchanged.

Knowing the font name will help subsequent CLs integrate with
CFX_FolderFontMgr.

Added a constexpr helper and static_asserts to verify all decoded
font name hashes at compile time. We can pull this in a subsequent CL.

TAG=agy
CONV=77ae3c3f-4d26-44e9-b5f1-623838abecd3
Change-Id: I6b53a7a18b58096a3e8633c2eedeb44b1a676add
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149370
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2026-06-10 11:48:24 -07:00
Tom Sepez
ab1e18865c Declare several FXSYS_ functions as constexpr.
A follow-on CL tries to use one in a constexpr context.

-- rewrite to avoid non-constexpr calls.
-- static_assert in unit test that they exist in constexpr context.

Change-Id: I40edf178cb3b7915e9dcde3619ddb3776ece6676
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149510
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
2026-06-09 17:48:01 -07:00
Seung Hyun Jin
d319f74879 Add unit tests for CPVT_VariableText
Adds LTR and RTL text layout test cases. For RTL, the test currently
verifies the existing (incorrect) LTR fallback behavior where X
coordinates increase as characters are typed.

Bug: 40115028
Change-Id: Ia19a7472cb3731571c33fbfed127b2d15c6cb3f8
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149190
Commit-Queue: Seung Hyun Jin <seunghyunjin@google.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2026-06-09 10:42:54 -07:00
Wang Yongjie
d83824a619 Avoid invalid tiling pattern ranges
Validate tiling pattern step values before using them to compute tile
iteration bounds, and reject non-finite or out-of-range rounded values
before casting them to int.

Add a regression test for a malformed tiling pattern that omits XStep
and YStep, which previously could produce non-finite loop bounds during
rendering.

Bug: 509964646
Change-Id: I5da3fe15b5afde3071ba88d9b7ab28a06b4358a9
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149290
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2026-06-09 10:38:54 -07:00
Helmut Januschka
d97216b41d Replace FXMATH_DECIMAL macros with constexpr in cfgas_decimal.cpp
Convert the file-local FXMATH_DECIMAL_SCALELIMIT and the two 32-bit
shift helper macros into proper constexpr declarations:

- FXMATH_DECIMAL_SCALELIMIT becomes constexpr int kDecimalScaleLimit.
- FXMATH_DECIMAL_RSHIFT32BIT(x) becomes constexpr Rshift32Bit
  returning uint32_t (the top 32 bits of a uint64_t always fit),
  which matches how every existing caller used the result.
- FXMATH_DECIMAL_LSHIFT32BIT(x) becomes constexpr Lshift32Bit
  returning uint64_t.

Bug: 42270078
Change-Id: I205f8539a3bed737baa5dc7e8921936334287ed5
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/148833
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Auto-Submit: Helmut Januschka <helmut@januschka.com>
2026-06-09 07:29:13 -07:00
Tom Sepez
823f1c2056 Fix return value in CFX_AndroidFontInfo::GetFontCharset().
Issue noticed by Gemini while working on an unrelated manner. Appears to
have been wrong since the initial checkin. Ignored in CFX_FontMapper,
but tested in DefaultGetFontCharset(). The former is more important, so
this affected very little.

Change-Id: Ib645cc1a061ee3353438bf8024b8cc98aa69c06f
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149470
Commit-Queue: Lei Zhang <thestig@chromium.org>
Auto-Submit: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2026-06-08 17:51:40 -07:00
geisserml
9ac7285a02 Unconditionally check out simdutf
This fixes checkout_configuration=minimal.

Change-Id: I7be8c7b17ad48f2abaa5970ea5fd0f1a1f6c3a18
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149310
Reviewed-by: Andy Phan <andyphan@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
2026-06-08 11:43:38 -07:00
Helmut Januschka
4f41484a3d Rename FX_LINEBREAKTYPE to LineBreakType
Bring the enum class and its values in line with PDFium naming
conventions by dropping the FX_ prefix, switching values from
SCREAMING_SNAKE to CamelCase, and spelling out BRK as Break/Common.

Bug: 42270078
Change-Id: I949be71f751c7255a5f92e0f8011e7c49f13cf5e
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/148832
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
Auto-Submit: Helmut Januschka <helmut@januschka.com>
Reviewed-by: Nicolás Peña <npm@chromium.org>
2026-06-08 11:31:39 -07:00
Helmut Januschka
7be64fd48d Replace JBIG2_MIN_SEGMENT_SIZE with a constexpr
Use an anonymous namespace constant instead of a preprocessor macro.

Bug: 42270078
Change-Id: Ice5f22c2ffd030326a8619237cd0d591035b7a14
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/148770
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Helmut Januschka <helmut@januschka.com>
2026-06-08 09:07:23 -07:00
pdfium-autoroll@skia-public.iam.gserviceaccount.com
efbbe33203 Roll Code Coverage from 74d04576e893 to 06dcbbe49e67 (4 revisions)
74d04576e8..06dcbbe49e

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/code-coverage-pdfium
Please CC akall@google.com,dhoss@chromium.org,thestig@chromium.org on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: akall@google.com
Change-Id: Ib996f9d0d9cc8d7690bf594c09ed943dddd1bddf
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149330
Commit-Queue: pdfium-autoroll@skia-public.iam.gserviceaccount.com <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: pdfium-autoroll@skia-public.iam.gserviceaccount.com <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
2026-06-07 21:52:23 -07:00
pdfium-autoroll@skia-public.iam.gserviceaccount.com
96fbc78019 Roll Catapult from 9fd976b2695e to a6e9d089883c (22 revisions)
https://chromium.googlesource.com/catapult.git/+log/9fd976b2695e..a6e9d089883c

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/catapult-pdfium
Please CC akall@google.com,dhoss@chromium.org,thestig@chromium.org on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: akall@google.com
Change-Id: Ib748a6834ae18924e1309fa5d3e23e6a0b968e3c
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149350
Commit-Queue: pdfium-autoroll@skia-public.iam.gserviceaccount.com <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: pdfium-autoroll@skia-public.iam.gserviceaccount.com <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
2026-06-07 21:43:56 -07:00
Tom Sepez
91b9d569b3 Make mt-constants private to FX_Random.
Avoid a copy of a std::array<> in the process by inlining init in
the constructor itself.

Change-Id: I561ffc3a66ace36f0a839bd7c8830add2dc75739
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149270
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2026-06-05 17:25:39 -07:00
Tom Sepez
ad0e47cfe3 Add span-based I/O wrappers as core/fxcrt/span_io.h
Introduce safe, container-templated span-based I/O wrappers. Helps
centralize some UNSAFE_BUFFERS() usage.

-- Add spanread/spanwrite overloads for FILE*.
-- Add spanread/spanwrite overloads for POSIX file descriptors.
-- Add spanread/spanwrite overloads for Windows HANDLE.
-- Change FileAccessIface::Write() signature to return bool.
-- Update image_diff, write.cc, file_util, and cfx_folderfontinfo.
-- Update CFX_FileAccess_Posix to use FD wrappers.
-- Update CFX_FileAccess_Windows to use HANDLE wrappers.
-- Update TemporaryFileTest to use safe spanwrite wrapper.
-- Add unit tests for all overloads in span_util_unittest.cpp.

Note that CFX_FileAccess_Posix changes may have fixed a latent error
underflow bug in the process.

Change-Id: Ic2c4088d364be0a2f38c5d30854a61fdacc6c69d
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149030
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2026-06-05 17:00:09 -07:00
Tom Sepez
3acf17e6ed Bring FX_Random into conformance with the usual mt19937 constants.
Put both constants near each other in the header to ease validation.

Bug: 520531611
Change-Id: Ia68aafcb8a329a352e91f600c40582cfa2c8b3ad
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149250
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Auto-Submit: Tom Sepez <tsepez@chromium.org>
2026-06-05 16:39:12 -07:00
Lei Zhang
fa8088d69f Add constants for ISO 32000-1:2008 spec, table 28
Create constants/catalog.h with some of the entries from the spec. Use
the constants where applicable.

Bug: 42270045
Change-Id: Id1edafe9c8defd7ca574dc8787524794379bb9c6
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149230
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
2026-06-05 16:25:06 -07:00
Aryan Krishnan
67b15b1a63 Add brotli build override
This CL adds pdf_enable_brotli_override as a build override in PDFium to
temporarily make the feature off by default until PDF 2.0 spec is
confirmed.

Bug: 475855993
Change-Id: I7e72610b65e9971425faa05fc8c7516be514d062
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/148990
Reviewed-by: Andy Phan <andyphan@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
2026-06-05 13:35:14 -07:00
Tom Sepez
7ff443d291 Add build_overrides/crubit.gni to PDFium tree
Take Chromium's copy to avoid a GN gen error following a build roll.
Otherwise, trying to build some rust targets will fail.

Change-Id: Id2de4260b0c85edca0bc3bfe2c67ceaa2f9ed26f
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149191
Reviewed-by: Lei Zhang <thestig@chromium.org>
Auto-Submit: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2026-06-05 10:39:05 -07:00
Tom Sepez
1ca37e1f4f Enforce unsafe_buffers in testing/image_diff/ directory.
Remove the last non-gtest testing directory.

Change-Id: I8b60035116bb6341f15cbcc0fe4992856e5db925
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149150
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2026-06-04 17:23:13 -07:00
Tom Sepez
4fab2ee66f Opt more testing/ sub-directories into unsafe buffers.
Remove the per-directory suppression, and suppress individual lines in
the files originated by PDFium. Help to avoid new unsafe usage from
being added in any future CLs.

Change-Id: I6b8591ecbf74c4857a02c6f4c28167bde0ce890d
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149130
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2026-06-04 16:58:35 -07:00
Wang Yongjie
be0931a4a2 Start list rearrangement at requested item
Limit CPWL_ListCtrl::ReArrange() to walk from the requested item index.
Add a pixel test covering a focused list box with a visible selected
item.

Bug: 477200528
Change-Id: I6c71184704d5a0632d235cc328c42990b45b3d1c
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/148610
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2026-06-04 16:52:14 -07:00
Lei Zhang
535784726f Update PDF 1.7 spec references to ISO 32000-1:2008.
Update comments referencing the "PDF 1.7 spec" to point to their
corresponding tables and sections in the ISO 32000-1:2008 specification.
Hopefully nobody will need to open pdf_reference_1-7.pdf anymore after
this.

TAG=agy
CONV=e172d025-7526-4dbc-b51d-9fdabcf46a76

Change-Id: I80544bd4df3829cb9292199e9dac7d223b2377a1
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149091
Reviewed-by: Andy Phan <andyphan@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
2026-06-04 10:53:05 -07:00
April Kallmeyer
9b3f8817c3 Roll base/allocator/partition_allocator/ fafdd4c9f..390c4b91f (23 commits)
fafdd4c9f5..390c4b91f7

Created with:
  roll-dep base/allocator/partition_allocator

Change-Id: I5492ab7c755b70c230488c2917296b39c7eb3e2d
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149050
Commit-Queue: April Kallmeyer <ask@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Andy Phan <andyphan@chromium.org>
2026-06-03 09:02:24 -07:00
April Kallmeyer
e7482b58e3 Update gn_version to 3357c4f51b1a9e676378c695dd9c7e9911c35ee6
Change-Id: Ib432e4ca1850140af674d57671fae29315c8103a
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149054
Reviewed-by: Lei Zhang <thestig@chromium.org>
Auto-Submit: April Kallmeyer <ask@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
Reviewed-by: Andy Phan <andyphan@chromium.org>
2026-06-02 16:52:30 -07:00
Tom Sepez
2dcb53e64d Fix logic botch in cpdf_nametree.cpp
Introduced in
  https://pdfium-review.googlesource.com/c/pdfium/+/146590

-- Add a better test.

Bug: 519007689
Change-Id: I98b01afc6e05941e3c2a10821cea88e9c275b354
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149034
Commit-Queue: Lei Zhang <thestig@chromium.org>
Auto-Submit: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
2026-06-02 14:30:04 -07:00
April Kallmeyer
b9772f493f Update siso_version to b18cb0f263cfcc2f17a925cb211972a32dc211f6
Change-Id: Id49014c74d14ef95151ad016531e2fbe5d4730f4
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149053
Reviewed-by: Andy Phan <andyphan@chromium.org>
Auto-Submit: April Kallmeyer <ask@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
2026-06-02 13:59:57 -07:00
April Kallmeyer
282b9cff50 Roll third_party/skia/ d10ea850c..e4281d5a7 (283 commits; 48 trivial rolls)
https://skia.googlesource.com/skia.git/+log/d10ea850c21d..e4281d5a79a7

Created with:
  roll-dep third_party/skia

Change-Id: If07f718b7ff522e1eac78012c91044bd8503df08
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149052
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Andy Phan <andyphan@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
Auto-Submit: April Kallmeyer <ask@chromium.org>
2026-06-02 13:38:04 -07:00
April Kallmeyer
1ceb726c02 Roll third_party/libunwind/src/ 71192be15..d6c7a21e9 (1 commit)
71192be150..d6c7a21e97

Created with:
  roll-dep third_party/libunwind/src

Change-Id: I877190812038eaee009355231b0c9281b70a78a5
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149033
Reviewed-by: Andy Phan <andyphan@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
Auto-Submit: April Kallmeyer <ask@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2026-06-02 13:08:53 -07:00
April Kallmeyer
32c10a11b7 Roll tools/win/ d16e6b55b..faefd1b6f (2 commits)
d16e6b55b2..faefd1b6fa

Created with:
  roll-dep tools/win

Change-Id: I8d524f995b8bd4d503f9f468abd9017951c390eb
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149051
Commit-Queue: Andy Phan <andyphan@chromium.org>
Auto-Submit: April Kallmeyer <ask@chromium.org>
Reviewed-by: Andy Phan <andyphan@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2026-06-02 13:08:25 -07:00
April Kallmeyer
4273e5edc2 Roll third_party/clang-format/script/ 08cce2b81..6eddfb5ec (2 commits)
08cce2b81a..6eddfb5ec5

Created with:
  roll-dep third_party/clang-format/script

Change-Id: I2bede08a14f581b30c955b48adf90a36d1d34f4d
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149032
Auto-Submit: April Kallmeyer <ask@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
Reviewed-by: Andy Phan <andyphan@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
2026-06-02 12:22:43 -07:00
April Kallmeyer
8b22dc146c Roll clang+rust
llvmorg-23-init-10931-g20b6ec66-8 : llvmorg-23-init-10931-g20b6ec66-11

Roll tools/clang/ 3e520fe28..06dd1f40d (30 commits)
Roll tools/rust/ 4442fd386..42fe71a81 (11 commits)

3e520fe28b..06dd1f40dc
4442fd3860..42fe71a815

Created with:
  roll-dep tools/clang
  roll-dep tools/rust

Change-Id: I81aae85d1c706ea5c8ad3cd38b94c5402ebfd912
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149031
Reviewed-by: Andy Phan <andyphan@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Auto-Submit: April Kallmeyer <ask@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
2026-06-02 12:21:55 -07:00
April Kallmeyer
29a7520450 Roll v8/ 8e10f842e..0c6c73eea (692 commits)
The same //third_party/llvm-libc/BUILD.gn change was made in Chromium in
https://crrev.com/1627152. It is required of v8 embedders now.

8e10f842e4..0c6c73eea6

Version 15.0.245

Created with:
  roll-dep v8

Change-Id: Iac2b50617c192040081a0741a0f7ce97ee7a42b8
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/148952
Auto-Submit: April Kallmeyer <ask@chromium.org>
Reviewed-by: Andy Phan <andyphan@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
2026-06-02 11:09:35 -07:00
Aryan Krishnan
1bdd27515b Replace c-style casts in cfgas_decimal.cpp with static_casts
This CL helps modernise the codebase by replacing the c-style casts in
cfgas_decimal.cpp with static_casts.

Change-Id: Ifd3a96313e51048c2f8afcf7d8d45c6f312ac378
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/148851
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Andy Phan <andyphan@chromium.org>
Commit-Queue: Aryan Krishnan <aryankrishnan4b@gmail.com>
2026-06-02 11:07:33 -07:00