PhpSpreadsheet/tests/PhpSpreadsheetTests/Writer
oleibman e97428ba67
Html Writer - Do Not Generate background-color When Fill is None (#3016)
* Html Writer - Do Not Generate background-color When Fill is None

For PR #3002, I noted that there was a problem with Dompdf truncating images. I raised an issue with them (https://github.com/dompdf/dompdf/issues/2980), and they agree that there is a bug; however, they also suggested a workaround, namely omitting background-color from any cells which the image overlays. That did not at first appear to be a solution which could be generalized for PhpSpreasheet. However, investigating further, I saw that Html Writer is generating background-color for all cells, even though most of them use the default Fill type None (which suggests that background-color should not be specified after all). So this PR changes HTML Writer to generate background-color only when the user has actually set Fill type to something other than None. This is not a complete workaround for the Dompdf problem - we will still see truncation if the image overlays a cell which does specify a Fill type - however, it is almost certainly good enough for most use cases.

In addition to that change, I made the generated Html a little smaller and the code a little more efficient by combining the TD and TH styles for each cell into a single declaration and calling createCssStyle only once.

* Revamp One Test

Look for both td.style and th.style instead of just td.style in test.
2022-08-24 18:00:37 -07:00
..
Csv Csv Handling of Booleans (and an 8.1 Deprecation) (#2232) 2021-08-04 07:00:17 -07:00
Dompdf Fix Some Pdf Problems (#2960) 2022-07-29 06:14:28 -07:00
Html Html Writer - Do Not Generate background-color When Fill is None (#3016) 2022-08-24 18:00:37 -07:00
Mpdf Correct Namespaces in 11 Tests (#3020) 2022-08-20 19:58:43 -07:00
Ods Add support for writing Worksheet Visibility for Ods 2022-05-23 13:38:08 +02:00
Xls Merge branch 'master' into PHP8-Sane-Property-Names 2021-10-31 15:25:01 +09:00
Xlsx Additional Support for Chart DataSeriesValues (#2906) 2022-06-29 17:52:09 -07:00
PreCalcTest.php Ods Writer support for setting column width/row height (including Autosizing) 2022-04-17 11:34:39 +02:00
RetainSelectedCellsTest.php Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00