Forum > Lazarus Extra Components

Another two bugs in TIpHtmlPanel one new introduced.

(1/2) > >>

Soner:
I found two bugs in TIpHtmlPanel, one bug is new introduced. Can anyone look and confirm it, before I report it.
Look at the screenshot.

wp:
I looked at the <br> bug first and found that it can be fixed by changing the TIpHtmlNodeTABLE.Enqueue in IpHtml.pas in the following way:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TIpHtmlNodeTABLE.Enqueue;begin//The commented code bellow prevent a blank line before the table{  case Align of  hiaTop,  hiaMiddle,  hiaBottom,  hiaCenter :    EnqueueElement(Owner.SoftLF);  end;}  EnqueueElement(Owner.SoftLF);   EnqueueElement(Element);   EnqueueElement(Owner.SoftLF);  EnqueueElement(Owner.HardLF);  // LFs needed otherwise next element is too close  // wp: uncomment this line{  case Align of  hiaTop,  hiaMiddle,  hiaBottom,  hiaCenter :    EnqueueElement(Owner.SoftLF);  end;}end; The commented code is from earlier versions indicating that there has been several experiments with that routine. I must say that I never understood what IPro's SoftLFs and HardLFs are good for.

So please carefully check out this corrected version and report back if there are any side-effect (which I am expecting...)

Soner:
wp, I tried it, it looks okay.

--- Quote from: wp on May 19, 2022, 05:19:46 pm ---...
I must say that I never understood what IPro's SoftLFs and HardLFs are good for.
...

--- End quote ---
I think softbreaks are linebreaks after some tags like <table>, <p> and hardbreaks are after <br> tag.


I found another new bug introduced in newer lazarus versions look at the screenshot, the text "Free Pascal" should be transparent like in lazarus 1.8.

I changed the html file, don't use html file from my first post, it has error.

Edit: New bug is also in 2.0.11

Edit2: I had on my usb stick one lazarus version Revision 61029 maybe lazarus 2.0.2 from year 2019/2020. Iphtml.pas file the last change date 2019-04-22. This version has not the new color bug.

wp:

--- Quote from: Soner on May 20, 2022, 09:14:49 am ---wp, I tried it, it looks okay.

--- End quote ---
Committed it. Did a few more tests, no apparent issues. Still, the entire SoftLF/HardLF thing is a mess and should be reworked from ground up. (For example, the same issue that you report exists for list tags).


--- Quote from: Soner on May 20, 2022, 09:14:49 am ---I found another new bug introduced in newer lazarus versions look at the screenshot, the text "Free Pascal" should be transparent like in lazarus 1.8.

--- End quote ---
This must have come in when somebody asked for rendering text with background color. I'll have a look, maybe I find it in the commit notes (but I don't make promises - IpHtmlPanel is a pain to work in...).

[EDIT]
Found the culprit and posted a bug report: https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39756

Fixed in main (60731529).

wp:
As for the alignment error, I found that it works correctly when I remove the style section, or more precisely, when I remove the "body" style. Parsing the css seems to override the alignment props somewhere...

Navigation

[0] Message Index

[#] Next page

Go to full version