Skip to content

Commit

Permalink
CSS vertical-align set on final blocks should not apply
Browse files Browse the repository at this point in the history
It should only apply on inner inline elements (<P><SPAN>),
and has no effect when set on the <P> itself.
(It was causing paragraph line height to go bigger, which
may have gone unnoticed as it was consistent on all lines
and could masquerade as CSS line-height, but it was causing
odd issues when using "-cr-hint: strut-confined".)
  • Loading branch information
poire-z committed Apr 6, 2022
1 parent 495bd5b commit f53f472
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crengine/src/lvrend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3378,7 +3378,12 @@ void renderFinalBlock( ldomNode * enode, LFormattedText * txform, RenderRectAcce
// processing for images (their current font is the parent font, and
// of no use for vertical-alignement).
css_length_t vertical_align = style->vertical_align;
if ( (vertical_align.type == css_val_unspecified && vertical_align.value == css_va_baseline) ||
if ( rm == erm_final ) {
// vertical-align only applies on inline elements
// Any vertical-align set on a DIV or P has no effect with Firefox, and
// don't change the line height or baseline.
}
else if ( (vertical_align.type == css_val_unspecified && vertical_align.value == css_va_baseline) ||
vertical_align.value == 0 ) {
// "Align the baseline of the box with the baseline of the parent box.
// If the box does not have a baseline, align the bottom margin edge with
Expand Down

0 comments on commit f53f472

Please sign in to comment.