summaryrefslogtreecommitdiff
path: root/core/fxcrt/css
AgeCommit message (Collapse)Author
2018-10-18Do IWYU in core/fxcrt/css and fix lint errors.Lei Zhang
Change-Id: I6d2b35849e9f1935277986b6c72e6f507d976974 Reviewed-on: https://pdfium-review.googlesource.com/c/43948 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-10-12Make core/fxcrt pass gn check.Lei Zhang
Split some XFA-only code into their own targets to avoid circular dependencies. Make CFX_SeekableMultiStream XFA-only. Change-Id: I88f49556623d52dddd4d0013cc3308b694c01d42 Reviewed-on: https://pdfium-review.googlesource.com/c/43973 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-12Remove more unnecessary includes and do IWYU as needed.Lei Zhang
Also move some implementations out of headers. Change-Id: I321fc26970c440d874b135bd28e8bc8156b9afee Reviewed-on: https://pdfium-review.googlesource.com/c/43890 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-09-20Fix misc lint errors and other cleanups.Lei Zhang
Change-Id: I00ce0109251d1231858e87ffc3889abe6937fa26 Reviewed-on: https://pdfium-review.googlesource.com/42811 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-09-20Remove more unneeded STL #includes from headers.Lei Zhang
Remove some variables named "string" to avoid false positives from the linter. Change-Id: I00a53e6970451fd0cea8ab2f8178183650ca00d2 Reviewed-on: https://pdfium-review.googlesource.com/42810 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-20Remove many unneeded STL #includes from headers.Lei Zhang
Change-Id: I7010cedee8d17d05b2c37a94d767e6f3a9c48f7d Reviewed-on: https://pdfium-review.googlesource.com/42790 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-17Fix final/protected conflicts.Tom Sepez
Classes marked |final| should not have |protected| members. In turn, "private field m_dwEncryptObjNum is not used" warning is produced. Change-Id: I51a96aca5a5f499381a6764d892962f7f2dc0327 Reviewed-on: https://pdfium-review.googlesource.com/42611 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-08-27The final game: mark everything final.Tom Sepez
Then revert the ones that break compilation. Fix one IWYU noticed during presubmit. Change-Id: I881a8a72818e55dbc4816247e35ff5e3015194e7 Reviewed-on: https://pdfium-review.googlesource.com/41470 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-06-26Fix uninit value in CFX_CSSComputedStyle::InheritedData.Lei Zhang
BUG=chromium:856054 Change-Id: Ieacb7be324f290c91623ed1bd97744150fbfa6e7 Reviewed-on: https://pdfium-review.googlesource.com/36090 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-06-20Avoid more .c_str() usage, part 3Tom Sepez
Change-Id: I5dfadcb68e640235be6e3eb7c8d57ae3b8013d26 Reviewed-on: https://pdfium-review.googlesource.com/35691 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-05-22Make friend RetainPtr<T> statements consistently public.Lei Zhang
Also make destructors private for RetainPtr sub-classes, and add missing destructors. Change-Id: I451bf0aae2dae943b1f450d0aa4ca5124dc578fd Reviewed-on: https://pdfium-review.googlesource.com/32853 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-05-17Update third_party/base/compiler_specific.h.Lei Zhang
Import Chromium's base/compiler_specific.h from r537069. Now that FALLTHROUGH is available via compiler_specific.h, remove FX_FALLTHROUGH. Change-Id: I8b9631a4f007673e10e0c26951dfd61e9dcada30 Reviewed-on: https://pdfium-review.googlesource.com/32639 Reviewed-by: Nico Weber <thakis@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-04-17Cleanup some seekablestreamproxy codedan sinclair
This CL fixes up some cfx_seekablestreamproxy includes and adds a helper to the xmlparser tests. Change-Id: If1b67dee51b49fa39527274f6c68da5ec673704f Reviewed-on: https://pdfium-review.googlesource.com/30854 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-03-12Remove all usages of FXSYS_iswASCIIalphaRyan Harrison
Instances are either replaced with FXSYS_iswalpha, which calls out to the ICU library to do the proper Unicode operations, or have been converted to a isascii && isalpha pair, if ASCII alpha is actually what was wanted. BUG=pdfium:1035 Change-Id: I971ff639ee1ff818ad08793a1900a8bcbb0a3e04 Reviewed-on: https://pdfium-review.googlesource.com/28450 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-03-12Remove all usages of FXSYS_iswASCIIalnumRyan Harrison
Instances are either replaced with FXSYS_iswalnum, which calls out to the ICU library to do the proper Unicode operations, or have been converted to a isascii && isalnum pair, if ASCII alnum is actually what was wanted. BUG=pdfium:1035 Change-Id: I959ec8739a4d020e61562180393ab8113a81577c Reviewed-on: https://pdfium-review.googlesource.com/28430 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-03-09Explicitly mark helper methods that only operate on ASCII rangesRyan Harrison
A number of our character helper methods take in wide character types, but only do tests/operations on the ASCII range of characters. As a very quick first pass I am renaming all of the foot-gun methods to explictly call out this behaviour, while I do a bigger cleanup/refactor. BUG=pdfium:1035 Change-Id: Ia035dfa1cb6812fa6d45155c4565475032c4c165 Reviewed-on: https://pdfium-review.googlesource.com/28330 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-02-16Fix fallthroughs in XFA code.chromium/3350Henrique Nakashima
Change-Id: I1fd4bf85cd709de1c14ed2895d045018f79bc61f Reviewed-on: https://pdfium-review.googlesource.com/26950 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-02-01Convert CFX_CSSPropertyTable to CFX_CSSDataRyan Harrison
This converts the existing class naming and references. The ::Entry struct is converted to ::Property. The GetBy* methods are renamed to GetPropertyBy*. Free functions from other parts of the CSS code base are merged into the class. GetCSSPropertyValueByName becomes ::GetPropertyValueByName with a return value of ::PropertyValue*. GetCSSLengthUnitByName becomes ::GetLengthUnitByName with a return value of ::LengthUnit*. GetCSSColorByName becomes ::GetColorByName with a return value of ::Color*. BUG=pdfium:998 Change-Id: I5b78c69d0fe53ad714ac3545cfdda8c26b95e4d5 Reviewed-on: https://pdfium-review.googlesource.com/25010 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-01-31Remove handrolled search from GetCSSColorByNamechromium/3336Ryan Harrison
BUG=pdfium:798 Change-Id: I9f0cc6fa095f111d6c43034b55f5e12e2bcab059 Reviewed-on: https://pdfium-review.googlesource.com/24716 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-01-31Remove handrolled search from GetCSSLengthUnitByNameRyan Harrison
BUG=pdfium:798 Change-Id: I97d0dc566f95736ef12eda90ee0bf336cba42098 Reviewed-on: https://pdfium-review.googlesource.com/24715 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-01-31Remove handrolled search from GetCSSPropertyValueByNameRyan Harrison
BUG=pdfium:798 Change-Id: I1e50aeffa439063bc9eb2640af457e33c4e3c46c Reviewed-on: https://pdfium-review.googlesource.com/24713 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-01-31Clean up CSS property tableRyan Harrison
Reorganizes the free functions to be static methods on a class. Converts the Table struct to be an Entry struct defined in the class. Change-Id: I9eca0dfb15187af10cbe2dc4b4c2756d55d957be Reviewed-on: https://pdfium-review.googlesource.com/24712 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-01-30Clean up CSS Data Table entries and accessRyan Harrison
This cleans up the entries in the table to no longer have a marker for size, and also removes a hand rolled search. This prevents an out of bounds issue that had been reported and addresses another potential out of bounds issue. BUG=chromium:807214 Change-Id: I3d3ab5a3a174dd4dcec56fa7ee7a0e6c2805bfaa Reviewed-on: https://pdfium-review.googlesource.com/24690 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-11-21Avoid passing pointers by reference in core.Lei Zhang
This gets rid of most core/ non-const ref passing, either by passing by pointer-to-pointer instead, or by returning std::pair. Change-Id: Id7bdc355a1a725a05f9fa2f1e982ca8c975beef1 Reviewed-on: https://pdfium-review.googlesource.com/19030 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-09-27Remove FXSYS_strlen and FXSYS_wcslenchromium/3226Ryan Harrison
With the conversion of internal string sizes to size_t, these wrappers are no longer needed. Replacing them with strlen and wcslen respectively. BUG=pdfium:828 Change-Id: Ia087ca2ddaf688a57ec9bd9ddfb8533cbe41510d Reviewed-on: https://pdfium-review.googlesource.com/14890 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-09-21Rename CFX_RetainPtr to RetainPtrDan Sinclair
This CL renames CFX_RetainPtr to RetainPtr and places in the fxcrt namespace. Bug: pdfium:898 Change-Id: I8798a9f79cb0840d3f037e8d04937cedd742914e Reviewed-on: https://pdfium-review.googlesource.com/14616 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-09-18Convert string class namesRyan Harrison
Automated using git grep & sed. Replace StringC classes with StringView classes. Remove the CFX_ prefix and put string classes in fxcrt namespace. Change AsStringC() to AsStringView(). Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*, Foo). Couple of tests needed to have their names regularlized. BUG=pdfium:894 Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d Reviewed-on: https://pdfium-review.googlesource.com/14151 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-08-31Remove fx_basic.hDan Sinclair
This CL removes the fx_basic.h header and fixes up includes as needed. Change-Id: I49af32a8327bdbcda40c50a61ffbd75d06609040 Reviewed-on: https://pdfium-review.googlesource.com/12670 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-08-09Move CSS data tables only used in one fileDan Sinclair
This CL moves the cfx_cssdatatable tables and methods which are only used in cfx_cssdeclaration to an anonymous namespace. Change-Id: Ib5dc71cc85c348e2ae7feaab8d6495fc2aa88642 Reviewed-on: https://pdfium-review.googlesource.com/9253 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-08-09Fold CFX_IsOnlyValue define into only usageDan Sinclair
Change-Id: I2cb20fd00436858f035f984fc104bae2c2d01057 Reviewed-on: https://pdfium-review.googlesource.com/9252 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-08Move CSS code to coreDan Sinclair
The xfa/fde/css code has no other links into xfa/. This CL moves the css code to core/fxcrt/css and sets to only build when pdf_enable_xfa is enabled. Change-Id: Iefd208e1f83a28b80b567c574e841e87bce310be Reviewed-on: https://pdfium-review.googlesource.com/9251 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>