THtmlViewer.LoadHTML hangs when loading an html with css code that includes a media query on color scheme
chrswgnr opened this issue · 2 comments
chrswgnr commented
Hey when I load an html with a color scheme media query the Load function doesn't return resulting an application hang for us.
Here is a small code sample that you can add to a TForm of a VCL APplication to reproduce.
var
LHtmlViewer: THtmlViewer;
begin
LHtmlViewer := THtmlViewer.Create(Self);
LHtmlViewer.Align := alClient;
LHtmlViewer.LoadFromString('<html><head><style type="text/css">@media (prefers-color-scheme: dark) .ReadMsgBody {width: 100%;}</style></head><body><div>Hallo Welt</div></body></html>');
end;
We are currently using the HtmlViewer in Version 11.8, but a quick test with 11.9 also had the same issue.
BerndGabriel commented
chrswgnr commented
Thanks for the quick response and fix.
Good point. Unfortunately the incorrect synatx html was some breakdown from some big company newsletter that one of our users wanted to view within the THtmlViewer.