TIpHtmlPanel bug introduced after version 1.8.5
lazarus / 5-Lazarus Extra Components
----------------------------------------------------------------------
Soner · 2022-05-11 09:47
I noticed a new bug in TIpHtmlPanel. When you have comment-tags in
css-part of html-file this css-part is ignored:
It is worked in lazarus 1.8.5.
----------------------------------------------------------------------
paweld · 2022-05-11 10:38
This is not a bug but correct parser behavior.
----------------------------------------------------------------------
PascalDragon · 2022-05-11 11:27
Quote from: paweld on May 11, 2022, 12:38:58 pmThis is not a bug but
correct parser behavior.
Not quite. There are special rules for this situation.
----------------------------------------------------------------------
wp · 2022-05-11 22:27
Comparing the source code between Laz 1.8.4 and Laz/main, I see only
irrelevant changes in TIpHtml.ParseStyle (removal of Delphi-related
defines), and absolutely no change in TIpHtml.NextToken which (among a
lot of other things) is responsible for removal of html comments.
Therefore, html-comment tags in css have been ignored by the
IpHtmlPanel all the time (at least since v1.8.4).
What you see as difference between your v1.8.5 and the current version
is (probably) due to different handling of the DefaultFontSize and
DefaultTypeFace properties of the IpHtmlPanel which are used when no
specifications for font size and type face are found in the html text
(which is true here since the style is commented out).
----------------------------------------------------------------------
PascalDragon · 2022-05-12 07:03
Quote from: wp on May 12, 2022, 12:27:12 amTherefore, html-comment
tags in css have been ignored by the IpHtmlPanel all the time (at
least since v1.8.4).
Are the tags themselves ignored or is their content ignored as well?
(just to clarify)
----------------------------------------------------------------------
wp · 2022-05-12 07:51
Sorry for being inaccurate. Whenever the scanner finds an opening html
comment tag (' '-' then
if FlagErrors then ReportError(SHtmlDashExp); Ch
:= GetChar; repeat while Ch <> '-' do begin
if Ch = #0 then break; Ch :=
GetChar; end; if (Ch = #0) then
break else begin Ch := GetChar;
if Ch = #0 then break; if Ch = '-' then
begin Ch := GetChar; while (Ch = '-')
do Ch := GetChar; {if (Ch = #0) or (Ch
= '>') then break;} while not (Ch in
[#0,'>']) do Ch := GetChar; break;
end; end; until false; CurToken
:= IpHtmlTagComment; end else begin
----------------------------------------------------------------------
PascalDragon · 2022-05-12 08:14
Quote from: wp on May 12, 2022, 09:51:21 amSorry for being inaccurate.
Whenever the scanner finds an opening html comment tag ('