PDFium Main Console (original) (raw)

Refactor CPDF_SimpleFont hierarchy to introduce CPDF_FaceBasedSimpleFont.

This moves the FreeType/Fontations-backed metrics caching and glyph
mapping tables out of CPDF_SimpleFont into a new intermediate
CPDF_FaceBasedSimpleFont class.

This saves ~6 KB of memory per CPDF_Type3Font instance, as Type3 fonts
do not use a physical font face and thus do not need these tables.

TAG=agy
CONV=22aaba7e-d459-4a6f-8189-64ba31f20dc2

Change-Id: I5c62c3a3e91a9733d9ad89d42f47f0fce96c2336
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149950
Commit-Queue: Tom Sepez tsepez@chromium.org
Reviewed-by: Lei Zhang thestig@chromium.org

Defensively protect form fields and dictionary objects.

As a defensive measure against re-entrant JavaScript execution deleting
objects mid-process, convert the ownership of CPDF_FormField from unique
ownership to shared ownership. Next, ensure that sets of dictionaries
are held by RetainPtr<>.

- Form filling entry points and action execution paths now retain
CPDF_FormField locally during execution.
- Action loop detection sets now use RetainPtr<const CPDF_Dictionary>
instead of raw pointers to prevent false loop detection.
- Fix an IWYU.

A search for reference cycles was performed and was negative, as back-
references are kept as raw/UnownedPtr.

TAG=agy
CONV=72880336-4b1c-44f7-be84-7a130f900785

Change-Id: I7fc3763d7488f9748fffbc1a49c90b4ffce08c83
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149890
Reviewed-by: Lei Zhang thestig@chromium.org
Commit-Queue: Tom Sepez tsepez@chromium.org

Implement CFX_FolderFontInfo::GetFontCharset

Implement GetFontCharset in the base class CFX_FolderFontInfo to
actively resolve kDefault charset queries by inspecting the font's
actual supported charsets (parsed from the OS/2 table). Prioritizes
CJK and Symbol charsets over ANSI to ensure correct text rendering
for fallback fonts.

This benefits all platforms using the shared folder font scanner (like
Linux and Android) by aligning them with Win32 charset resolution.

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

Change-Id: I8017bd74f86b55dfb030defcb70d325314515926
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149712
Reviewed-by: Lei Zhang thestig@chromium.org
Commit-Queue: Tom Sepez tsepez@chromium.org

[Android] Rewrite Skia Font Manager in CFX_AndroidFontInfo

Refactor CFX_AndroidFontInfo to inherit from CFX_FolderFontInfo
instead of SystemFontInfoIface, centralizing directory scanning and
lazy font matching. This allows Android to drop FreeType usage during
startup scanning, significantly improving startup time.

Android-specific heuristics are preserved:
- Override IsBetterMatch: Retains Android's CJK matching logic
(preferring the font with more glyphs on fallback, using the glyph
count).
- Integrate Roboto/Droid substitutions and Arabic/Symbol overrides
(moved in the prequel CL) into the new MapFont implementation,
and restore their private visibility within cfx_androidfontinfo.cpp.
- Test cases are preserved and moved into new unit test file.

Cleanups and Improvements:
- Deleted stale cfpf_skiafont* and cfpf_skiafontmgr* files.

TAG=agy
Change-Id: I9f827495ddd6d3540f1cf7b267d6725767670f8b
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149390
Commit-Queue: Tom Sepez tsepez@chromium.org
Reviewed-by: Lei Zhang thestig@chromium.org
Auto-Submit: Tom Sepez tsepez@chromium.org
Commit-Queue: Lei Zhang thestig@chromium.org

Make CPDF_ReadValidator a final class.

Mark CPDF_ReadValidator as final to allow devirtualization of the
destructor during release.

-- Adjust tests to use CPDF_ReadValidator directly instead of
subclassing.

TAG=agy
CONV=bba8f0c9-24e5-4354-83f5-371cf9a3d839

Change-Id: Ia7c06989fc25aa7c4302ab99b0a79a68ec7a7536
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149990
Commit-Queue: Tom Sepez tsepez@chromium.org
Reviewed-by: Lei Zhang thestig@chromium.org

[v8] Stop using soon-to-be-deprecated V8 Apis

V8 will deprecate the following Apis soon:
- v8::PropertyCallbackInfo::HolderV2() -> Holder().

Bug: 333672197
Change-Id: Ic10d6faf45687690c14a005c7dcb1f376752b427
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/150050
Commit-Queue: Lei Zhang thestig@chromium.org
Reviewed-by: Tom Sepez tsepez@chromium.org
Reviewed-by: Lei Zhang thestig@chromium.org
Commit-Queue: Tom Sepez tsepez@chromium.org

Add unit tests for CFPF_SkiaFontMgr.

Enable compiling CFPF_SkiaFontMgr and CFPF_SkiaFont on Linux for
testing purposes. Test this cross-platform because the font
matching logic does not rely on Android-specific system APIs and
instead operates on file paths and parsed TTF tables.

Add tests covering font selection, substitution, and CJK fallback
behaviors, including demonstrating the order-dependency in the old
CJK matching logic.

These exist solely to provide a baseline for the next CL in the
chain, at which point they will be removed.

TAG=agy
CONV=f28a8798-4495-4622-8641-0b19c9f6c05d

Change-Id: Ibd9705b1d1c528fd6d3d2c9e37b29169a8f25a39
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/150010
Reviewed-by: Lei Zhang thestig@chromium.org
Commit-Queue: Tom Sepez tsepez@chromium.org

Add /AGENTS.md and /GEMINI.md to .gitgnore

Similar to other top-level projects, add AGENTS.md and GEMINI.md to
encourage developers to keep these environment-specific configurations
local.

Change-Id: Ic6cbd498cc1ce9bd9cf16710930853ea60063e41
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/150071
Reviewed-by: Lei Zhang thestig@chromium.org
Auto-Submit: Tom Sepez tsepez@chromium.org
Commit-Queue: Tom Sepez tsepez@chromium.org
Commit-Queue: Lei Zhang thestig@chromium.org

Refactor/modernize CPVT_Word and CPVT_WordInfo structs

Replace manual constructor initializer lists with inline default
member initializers, and explicitly declares default and copy
constructors, and assignment operators. Purely structural
refactor, no functional or logical changes.

Bug: 40115028
Change-Id: Id434c4d4988be9e9ae800774d3cb79351c15adf5
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149970
Reviewed-by: Lei Zhang thestig@chromium.org
Commit-Queue: Seung Hyun Jin seunghyunjin@google.com

Address post-landing review comments for CL 148813.

Build up the highlight style with a Mask and pass
UncheckedValue() to ModifyStyleExts(), and read the widget's style exts
back into a Mask via FromUnderlyingUnchecked() so the enum class flags
can be tested without to_underlying() casts.

Change-Id: I8769e1244aa656cdd5693fe79627854bd140611b
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/149690
Reviewed-by: Lei Zhang thestig@chromium.org
Commit-Queue: Lei Zhang thestig@chromium.org
Reviewed-by: Tom Sepez tsepez@chromium.org

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

aryankrishnan4b@gmail.com

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

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

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

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

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

pdfium-autoroll@skia-public.iam.gserviceaccount.com

Roll Memory Tools from 66b0df34a721 to a7e928b8bb8d (1 revision)

https://chromium.googlesource.com/chromium/src/tools/memory.git/+log/66b0df34a721..a7e928b8bb8d

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

pdfium-autoroll@skia-public.iam.gserviceaccount.com

Roll Zlib from 5c1dfd53066b to 3246f1b60849 (1 revision)

https://chromium.googlesource.com/chromium/src/third\_party/zlib.git/+log/5c1dfd53066b..3246f1b60849

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

pdfium-autoroll@skia-public.iam.gserviceaccount.com

Roll libpng from 8a5b4ace0c2a to 6d5341764ef4 (1 revision)

https://chromium.googlesource.com/chromium/src/third\_party/libpng.git/+log/8a5b4ace0c2a..6d5341764ef4

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

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

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

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

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

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

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

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

aryankrishnan4b@gmail.com

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

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

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

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

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

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

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

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

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

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

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

pdfium-autoroll@skia-public.iam.gserviceaccount.com

Roll Code Coverage from 74d04576e893 to 06dcbbe49e67 (4 revisions)

https://chromium.googlesource.com/chromium/src/tools/code\_coverage.git/+log/74d04576e893..06dcbbe49e67

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

pdfium-autoroll@skia-public.iam.gserviceaccount.com

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

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

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

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

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

aryankrishnan4b@gmail.com

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

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

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

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

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

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

Roll base/allocator/partition_allocator/ fafdd4c9f..390c4b91f (23 commits)

https://chromium.googlesource.com/chromium/src/base/allocator/partition\_allocator.git/+log/fafdd4c9f559..390c4b91f769

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