Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Coffee corner » HTML viewer
HTML viewer [message #60020] Mon, 10 July 2023 21:39 Go to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

I found litebrowser
https://github.com/litehtml/litebrowser

that in turn is based on litehtml
https://github.com/litehtml/litehtml
that is a rendering engine not able to paint.

If I decide to ruin my summer time vacation trying to create a U++ ctrl for litehtml, where should I start from?
Do we have some Ctrl that potentially can accomodate such HTML viewer?

Best regards,
Luigi
Re: HTML viewer [message #60021 is a reply to message #60020] Mon, 10 July 2023 22:29 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1076
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Luigi,

The true thing is that HTML view control is one of the most important think we need at the moment. Please noticed that sometime ago Zbych implemented ChromiumBrowser. Currently, it is available only in upp/archieve repository, not UppHub. It is basing on CEF (Chromium Embedded Framework), Personally, I would do not go for lite-browser, because the whole library looks like a niche for me with poor support. It means that security norms will not be meet, which are crucial in context of applications that renders HTML and executes JavaScript.

If, we look for our competitors such as QT, the have QTWebEngine that is basing on CEF. We should aim for similar thing.

Since the implementation is not trivial and the maintenance cost will be high. Providing this functionality for U++ is a challenge not for one person, but for a group of people. So, before starting working on that it would be good if you will find somebody that will help you! Smile

Klugier


U++ - one framework to rule them all.
Re: HTML viewer [message #60025 is a reply to message #60021] Tue, 11 July 2023 11:57 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Klugier wrote on Mon, 10 July 2023 22:29
Hello Luigi,

The true thing is that HTML view control is one of the most important think we need at the moment. Please noticed that sometime ago Zbych implemented ChromiumBrowser. Currently, it is available only in upp/archieve repository, not UppHub. It is basing on CEF (Chromium Embedded Framework), Personally, I would do not go for lite-browser, because the whole library looks like a niche for me with poor support. It means that security norms will not be meet, which are crucial in context of applications that renders HTML and executes JavaScript.

If, we look for our competitors such as QT, the have QTWebEngine that is basing on CEF. We should aim for similar thing.

Since the implementation is not trivial and the maintenance cost will be high. Providing this functionality for U++ is a challenge not for one person, but for a group of people. So, before starting working on that it would be good if you will find somebody that will help you! Smile

Klugier


Accidentally, I was forced to implement limited support for RichEdit accepting HTML clipboard format.

While definitely not the same thing as HTML viewer, it now understand most of style formatting that is applicable to RichText. I plan to enrich it a bit more (to actually understand CSS, add support for tables and maybe some sort of support for importing images).

https://github.com/ultimatepp/ultimatepp/blob/master/uppsrc/ RichText/ParseHTML.cpp

(That is not meant to distract us from CEF, ParseHTML is not even meant to be complete HTML viewer, just a bridge that allows some HTML->RichText/QTF conversion)

Mirek
Re: HTML viewer [message #60027 is a reply to message #60020] Tue, 11 July 2023 12:37 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Hi,

In case you've missed it, we already have a fully functional html-5 parser (and sanitizer/prettifier as a bonus) now.
(Of course, I am aware that Mirek's code serves another purpose, but a fully-fledged HTML->QTF converter, using HtmlTools package would too be very easy to implement.)

Best regards,
Oblivion





[Updated on: Tue, 11 July 2023 12:39]

Report message to a moderator

Re: HTML viewer [message #60028 is a reply to message #60027] Tue, 11 July 2023 13:14 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Oblivion wrote on Tue, 11 July 2023 12:37
Hi,

In case you've missed it, we already have a fully functional html-5 parser (and sanitizer/prettifier as a bonus) now.
(Of course, I am aware that Mirek's code serves another purpose, but a fully-fledged HTML->QTF converter, using HtmlTools package would too be very easy to implement.)


Humor me Smile

I have actually noticed this, but "It corrects and cleans up HTML and XML documents by fixing markup errors and upgrading legacy code to modern standards." does not seem like going too far into rendering stuff.

Parsing HTML is (relatively) easy. Where it gets hard IMO is where you have to interpret styles to have some meaningful rendering info. Font sizes, colors, line styles and width and such.. I have not checked too deeply, but few examples I have seen do not seem to deal with that stuff at all...

Mirek
Re: HTML viewer [message #60029 is a reply to message #60025] Tue, 11 July 2023 13:21 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
mirek wrote on Tue, 11 July 2023 11:57


Accidentally, I was forced to implement limited support for RichEdit accepting HTML clipboard format.

While definitely not the same thing as HTML viewer, it now understand most of style formatting that is applicable to RichText. I plan to enrich it a bit more (to actually understand CSS, add support for tables and maybe some sort of support for importing images).

https://github.com/ultimatepp/ultimatepp/blob/master/uppsrc/ RichText/ParseHTML.cpp

(That is not meant to distract us from CEF, ParseHTML is not even meant to be complete HTML viewer, just a bridge that allows some HTML->RichText/QTF conversion)

Mirek


Hi Mirek,

even this may help a lot.
Is there an example package that shows how to use it or it should work as paste operation from clipboard?

Thanks,
Luigi

[Updated on: Tue, 11 July 2023 13:28]

Report message to a moderator

Re: HTML viewer [message #60030 is a reply to message #60027] Tue, 11 July 2023 13:26 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
Oblivion wrote on Tue, 11 July 2023 12:37
Hi,

In case you've missed it, we already have a fully functional html-5 parser (and sanitizer/prettifier as a bonus) now.
(Of course, I am aware that Mirek's code serves another purpose, but a fully-fledged HTML->QTF converter, using HtmlTools package would too be very easy to implement.)

Best regards,
Oblivion



Yes, I missed it.

I downloaded the code and extracted HtmlTools and HtmlToolsExample package in MyApps folder, but theide (16879) doesn't list them Rolling Eyes
Do I need to do something else before to compile them?

Thanks,
Luigi
Re: HTML viewer [message #60031 is a reply to message #60029] Tue, 11 July 2023 13:38 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
forlano wrote on Tue, 11 July 2023 13:21
mirek wrote on Tue, 11 July 2023 11:57


Accidentally, I was forced to implement limited support for RichEdit accepting HTML clipboard format.

While definitely not the same thing as HTML viewer, it now understand most of style formatting that is applicable to RichText. I plan to enrich it a bit more (to actually understand CSS, add support for tables and maybe some sort of support for importing images).

https://github.com/ultimatepp/ultimatepp/blob/master/uppsrc/ RichText/ParseHTML.cpp

(That is not meant to distract us from CEF, ParseHTML is not even meant to be complete HTML viewer, just a bridge that allows some HTML->RichText/QTF conversion)

Mirek


Hi Mirek,

even this may help a lot.
Is there an example package that shows how to use it or it should work as paste operation from clipboard?

Thanks,
Luigi


Right now it works as paste. But you can use it in the code as well, look for TrivialHtmlParse (really simple, String and base font on input, RichText as return value...)
Re: HTML viewer [message #60033 is a reply to message #60030] Tue, 11 July 2023 13:45 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Hello Luigi
Quote:
Yes, I missed it.

I downloaded the code and extracted HtmlTools and HtmlToolsExample package in MyApps folder, but theide (16879) doesn't list them Rolling Eyes
Do I need to do something else before to compile them?


The package is a UppHub package, it is in UppHub. You can'tsee the HtmlTools package in default view because it is not a "main pacakge". (choose non-main packages

And no, you don't need to do anything else to compile it. It "should" compile fine on Windows and Linux systems. The wrapped libtidy is statically linked; it's source is not huge, and I've also enabled Upp's allocators. (You can disable them if you like)

Best regards,
Oblivion



[Updated on: Tue, 11 July 2023 14:16]

Report message to a moderator

Re: HTML viewer [message #60034 is a reply to message #60028] Tue, 11 July 2023 13:52 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Quote:
Parsing HTML is (relatively) easy. Where it gets hard IMO is where you have to interpret styles to have some meaningful rendering info. Font sizes, colors, line styles and width and such.. I have not checked too deeply, but few examples I have seen do not seem to deal with that stuff at all...


Of course, you are right. It is not meant to build a web renderer and it does not parse CSS. But it let's you focus on everything else (i.e. in this case parsing CSS, without worrying too much about even colossal HTML pages.). And I can tell you from my experience with libtidy that it makes life so much easier if you are working with web pages. The parser part itself is very fast and is long battle-tested (after all, it is one of the "eldest" parsers).


Best regards,
Oblivion


[Updated on: Tue, 11 July 2023 13:53]

Report message to a moderator

Re: HTML viewer [message #60158 is a reply to message #60021] Sat, 16 September 2023 20:30 Go to previous message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Quote:
Hello Luigi,

The true thing is that HTML view control is one of the most important think we need at the moment. Please noticed that sometime ago Zbych implemented ChromiumBrowser. Currently, it is available only in upp/archieve repository, not UppHub. It is basing on CEF (Chromium Embedded Framework), Personally, I would do not go for lite-browser, because the whole library looks like a niche for me with poor support. It means that security norms will not be meet, which are crucial in context of applications that renders HTML and executes JavaScript.

If, we look for our competitors such as QT, the have QTWebEngine that is basing on CEF. We should aim for similar thing.

Since the implementation is not trivial and the maintenance cost will be high. Providing this functionality for U++ is a challenge not for one person, but for a group of people. So, before starting working on that it would be good if you will find somebody that will help you! Smile

Klugier


I think Servo is going to be a good alternative to chromium: https://servo.org/
Only downside is that it is in rust Rolling Eyes


Best regards,
Oblivion


[Updated on: Sat, 16 September 2023 20:34]

Report message to a moderator

Previous Topic: MacOS M1/M2 chip can cross compile even for previous intel chip?
Next Topic: Greetings! (and a bug report)
Goto Forum:
  


Current Time: Sun Apr 28 11:53:13 CEST 2024

Total time taken to generate the page: 0.07623 seconds