Example code that displays problem:
<?php
$prob = '
<div style="width:100%;" id="ONEHUNDREDWIDTH">
<div style="float:right; width:70mm; height:30mm; background:rgba(0,0,0,0.5); font-size:15pt;" id="RIGHTFLOAT">right</div>
';
$letters = ['a','b','c','d','e'];
for($i=0;$i<4;$i++){
$prob .= '
<div style="float:left; " id="'.$bg[$i].'">
<div style="float:left; background:rgba(255,0,0,0.5); height:20mm; width:30%;" id="LETTER '.$letters[$i].'1">'.$letters[$i].'1</div>
<div style="float:left; background:rgba(255,0,0,0.5); height:20mm; width:49%;" id="LETTER '.$letters[$i].'1">'.$letters[$i].'2</div>
</div>
';
}
$prob .= '</div>';
include_once($_SERVER['DOCUMENT_ROOT']."/mpdf60/mpdf.php");
$mpdf=new mPDF('utf-8',[100,30], 0, 'times', 0, 0, 0, 0, 0, 0);
$mpdf->WriteHTML($prob);
$mpdf->Output();
?>
Notice how when the second set of divs appears on the page it doesn't expand to the page width?
Here's a workaround I found (it can probably be modified a bit so it only effects nested floated divs).
On line 14701 add the bit in green:
$this->OpenTag($tag,$attr,$a,$i); // mPDF 6
if( $this->blk[$this->blklvl]['NewPageStart'] == 'y'){
$i -= (count($this->blk)+1)/2;
$this->blklvl = 0;
$temp = $this->blk[0];
unset($this->blk);
$this->blk[0] = $temp;
continue;
};
And on line 17182 add the bit in green:
if (isset($properties['HEIGHT'])) {
$currblk['css_set_height'] = $this->ConvertSize($properties['HEIGHT'],($this->h - $this->tMargin - $this->bMargin),$this->FontSize,false);
if (($currblk['css_set_height'] + $this->y) > $this->PageBreakTrigger && $this->y > $this->tMargin+5 && $currblk['css_set_height'] < ($this->h - ($this->tMargin + $this->bMargin))) {
$currblk['NewPageStart'] = 'y';
$this->AddPage($this->CurOrientation);
return;
}
}