Jump to content
Alexander Sviridenkov

ANN HTML Library 4.1 released

Recommended Posts

What's new

 

Core:

Completely new CSS subsystem - faster and less memory.
MathML support.
Compatibility with Lazarus 2+.
FMX: Hints support.
Animated GIFs for FMX (all platforms) and VCL Delphi 5+.
CSS columns support.
CSS tabstops support.
Improved recovering of incorrect tag order.
Added :only-of-type selector
DX canvas: added support for rotated arcs in paths.
THtImageListSource now works with ImageList on data module.

 

Editor:

Format painter button.
Clear formatting button.
Columns button
Math equation editor.
Adding ability to combine two adjacent lists by pressing Del
DOCX import: added support for math equations.
Footnotes

 

Reports/SQL:

FastReport FMX component
ReportBuilder component
SQL: ConvertWheretoJoins now can reorder tables.
Compatibility with VTV 6.7

 

Fixed

 

Core:

Value none was processed incorrectly for max-width/max-height
Incorrect document position when using native iOS canvas and non-zero offset.
Incorrect processing of multiple fonts in font-family.
Incorrect layout when absolute element has inline containing block.
SVG: correct processing path 'a' command with sibling flags with no divider.
GDI canvas issue when SVG use clip path.
FMX: fixed SVG elements position when using viewbox
Vertical placement of inline blocks
Artifacts when using native Android canvas on some resolutions.

 

Editor:

DOCX import: fixed superscript style
'Pop from empty editor stack' error.
AV when deleting selection
Eempty list item cannot be deleted.
Style is not applied to selected cells when selection is reverced (from bottom to top)
Delimiter is added to first word causing incorrect spell checking
AV when pressing space at endf of line after changing text style
Selection is incorrect after applying text transform


Reports/Scripter

Scripter: AV when registering class having same name as record helper.
Scripter: incorrect call to parent method when using inherited property.
Wrong target in script drag events.
FastReport: HTML is exported to PDF as image

 

Trial version:

http://delphihtmlcomponents.com/editor41trial.zip

 

 

  • Like 1
  • Thanks 1

Share this post


Link to post

I have one question, is it possible to optimize HTML and CSS code with your library, i.e. remove unnecessary attributes?
For example, I have a code:

<img src="logo.jpg" alt="nothing" style="color: white; border: 50px; color: black" alt="nothing" ><div>

This tag has an unnecessary attribute alt="nothing" and one of the CSS attributes: "color: white" because both are overwritten.


To remove such redundant attributes you would need to parse HTML and CSS (what your library does) and build HTML and CSS from the metadata again.

 

Is this possible in the HTML Library?

 

Share this post


Link to post

 

4 hours ago, Jacek Laskowski said:

I have one question, is it possible to optimize HTML and CSS code with your library, i.e. remove unnecessary attributes?

Do you really need it at run-time? If not, you will find many tools to do this in the web.

Share this post


Link to post
14 hours ago, Jacek Laskowski said:

I have one question, is it possible to optimize HTML and CSS code with your library, i.e. remove unnecessary attributes?
For example, I have a code:


<img src="logo.jpg" alt="nothing" style="color: white; border: 50px; color: black" alt="nothing" ><div>

This tag has an unnecessary attribute alt="nothing" and one of the CSS attributes: "color: white" because both are overwritten.


To remove such redundant attributes you would need to parse HTML and CSS (what your library does) and build HTML and CSS from the metadata again.

 

Is this possible in the HTML Library?

 

Yes, this is possible. Simply iterate DOM after parsing (use Count and Elements or NextElement), remove all unecessary attributes and tags and use Document,OuterHTML to get HTML string.

Share this post


Link to post
On 3/28/2020 at 1:34 AM, vfbb said:

 

Do you really need it at run-time? If not, you will find many tools to do this in the web.

No, I don't need runtime. But I didn't find a web tool. If you know one, please give me a link.

Share this post


Link to post
On 3/28/2020 at 11:29 AM, Alexander Sviridenkov said:

Yes, this is possible. Simply iterate DOM after parsing (use Count and Elements or NextElement), remove all unecessary attributes and tags and use Document,OuterHTML to get HTML string.

But I mean AUTOMATIC removal of duplicate or unnecessary attributes by library. That's what I'm asking.

A library that parses HTML and CSS and creates object-oriented structure (DOM) does it automatically, right?

Share this post


Link to post

@Jacek Laskowski, no, only duplicated attributes are removed automatically. Library doesn't know do you need alt="nothing" attribute or not, you should decode this yourself.

Duplicated CSS properties can be removed by one line code, but this is not done automatically too, because by default (if there was no style changes) style attribute remains unchanged.

Share this post


Link to post
20 minutes ago, Alexander Sviridenkov said:

@Jacek Laskowski, no, only duplicated attributes are removed automatically. Library doesn't know do you need alt="nothing" attribute or not, you should decode this yourself.

Duplicated CSS properties can be removed by one line code, but this is not done automatically too, because by default (if there was no style changes) style attribute remains unchanged. 

 

I know that the attribute will not be removed because the library does not know that it is unnecessary.
But notice that in the example I gave you, the alt="nothing" attribute appears twice in one tag! 

This is an example of ugly, junk HTML code that I have to clean up. I would like to do it as automatically as possible, because manual work is very tedious.
I imagined that your parser could make it easier for me.

Share this post


Link to post
1 minute ago, Jacek Laskowski said:

 

I know that the attribute will not be removed because the library does not know that it is unnecessary.
But notice that in the example I gave you, the alt="nothing" attribute appears twice in one tag! 

This is an example of ugly, junk HTML code that I have to clean up. I would like to do it as automatically as possible, because manual work is very tedious.
I imagined that your parser could make it easier for me.

Yes, duplicates will be removed.

You can send me sample HTML to support at delphihtmlcomponents.com, I'll send you back processed HTML and code.

Share this post


Link to post
16 hours ago, Jacek Laskowski said:

No, I don't need runtime. But I didn't find a web tool. If you know one, please give me a link.

Just search in the web "remove unused css" you will find many tools.

Recently, I used the Google Chrome without any extension, just open the DevTools > Sources > Coverage.

You will see a report with all unused css codes and javascripts.

ss.png

Edited by vfbb

Share this post


Link to post
On 3/27/2020 at 1:06 PM, Alexander Sviridenkov said:

What's new

 

MathML support.

 

Do you have a sample / documentation for MathML support ? Does it include an editor ?

Thanks.

Share this post


Link to post

Sorry but I can't find it. I tried to download it again, then demos "Editor XE-XE103", "Editor Mobile", "Editor FMX" and can't find any reference to MathML or any equation editor button.

Share this post


Link to post

OK I can see it on the compiled EXE but nothing appears when I select text on the trial Delphi 10.1 Berlin demo.

Share this post


Link to post

OK this is working. If I may, you should better showcase a feature that is #2 on your "What's new" list in the future as I've lost a lot of time trying to find it.

Thank you for your help.

Share this post


Link to post

@John R. thank you, I'll change what's new. But #2 Math ML support is in Core section and means support of displaying MathML equations in existing documents, not MathML editor. It doesn't require additional actions, simply put document with math tag into HtPanel and it will be displayed.

Share this post


Link to post

What is the state of flexbox support ? Current version seems to ignore the display:flex css. Would be nice to have it.

  • Like 1

Share this post


Link to post

aaaand, what is the state of CSS Grid, would be also nice to have :classic_smile:

(didn't checked the current version, but I doublt it in right now).

Edited by Rollo62

Share this post


Link to post

Flex and grid would be nice, for sure, but you realise browsers with huge dev teams have taken years to implement and perfect these features.. not a small ask for a component vendor!

  • Like 1

Share this post


Link to post
Guest
7 hours ago, Vincent Parrett said:

not a small ask for a component vendor!

Indeed,

 

Yet Alexander is one of those guys who did and is doing brilliant and magnificent job, i think he might do just for the self challenge and the fun, because he already is doing a (not-so-small) team work.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×