Skip to content

Commit 9b7c865

Browse files
jakejackson1claude
andcommitted
Read larger and smaller on html and body against their parents
#642 reads html's and body's font sizes through SizeConverter::convertFontSize(), which gives points and takes the size medium stands for. It now reads larger and smaller too, in the standard CSS mode. The form fields and tables keep the millimetre conversion under the name convertFontSizeToMm(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 2fa8407 commit 9b7c865

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎tests/Mpdf/FixedPseudoClassTest.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ public function remSizes()
315315
'html as a keyword' => ['html { font-size: large; } p { font-size: 1rem; }', $p, 13.2, 11],
316316
'html in rem, which reads the default' => ['html { font-size: 2rem; } p { font-size: 1rem; }', $p, 22, 11],
317317
'html in em, which reads the default' => ['html { font-size: 1.5em; } p { font-size: 1rem; }', $p, 16.5, 11],
318+
'html larger, which reads the default' => ['html { font-size: larger; } p { font-size: 1rem; }', $p, 13.2, 11],
318319
'root' => [':root { font-size: 62.5%; } p { font-size: 2rem; }', $p, 13.75, 22],
319320
'the last rule for html' => ['html { font-size: 50%; } html { font-size: 62.5%; } p { font-size: 2rem; }', $p, 13.75, 22],
320321
'the more specific rule for html' => [':root { font-size: 62.5%; } html { font-size: 50%; } p { font-size: 2rem; }', $p, 13.75, 22],
@@ -324,6 +325,7 @@ public function remSizes()
324325
'body in rem' => ['html { font-size: 62.5%; } body { font-size: 1.6rem; }', $p, 11, 17.6],
325326
'body in em reads html' => ['html { font-size: 62.5%; } body { font-size: 1.6em; }', $p, 11, 17.6],
326327
'body in percent reads html' => ['html { font-size: 62.5%; } body { font-size: 160%; }', $p, 11, 17.6],
328+
'body smaller reads html' => ['html { font-size: 13.2pt; } body { font-size: smaller; }', $p, 11, 11],
327329
'body as a keyword reads the default' => ['html { font-size: 62.5%; } body { font-size: large; }', $p, 13.2, 13.2],
328330
'body\'s style attribute in em reads html' => ['html { font-size: 62.5%; }', '<body style="font-size: 1.6em"><p>probe</p></body>', 11, 17.6],
329331
'rem does not follow body' => ['body { font-size: 20pt; } p { font-size: 1rem; }', $p, 11, 20],

0 commit comments

Comments
 (0)