Hi Ole,
my colleague Stefan has send you another patch in 2013.
These have fixed the segment faults we've had bevore.
Have you included this already in the git reprository?
Best regards
Matthias
Am 29.06.2015 15:35, schrieb Ole Streicher:
>
> Hi Mathias,
>
> I am hosting a git repository of tkhtml3, and also maintain its
Debian packages. The git repository
>
>
https://github.com/olebole/tkhtml3
>
> already includes patches from you dating back to 2011:
>
> * Fix the problem that tkhtml seems to ignore 'background-color' on
tbody-tags.
> * If I have a html-table like all the columns are resized if the
widget ist smaller then it should be
>
> Do you have more? If so, I would like to include them on the github page.
>
> Best regards
>
> Ole
>
>
> Am Montag, 29. Juni 2015 15:25:44 UTC+2 schrieb m.meier:
>
> Hi,
>
> we use tkhtml in an productive enviroment.
>
> The code you provided runs fine.
> (tk8.6.1)
>
> Although we have made some bugfixes in tkhtml.
> But i think they do not have anything to do with the code you
provided.
>
> Matthias
>
-------- Original-Nachricht --------
Betreff: [PATCH] to tkhtml3
Datum: Fri, 26 Apr 2013 18:55:22 +0200
Von: Ziegler, Stefan <Zie...@FuH-E.de>
Organisation: FuH Entwicklungsgesellschaft mbH
An: Ole Streicher <
deb...@liska.ath.cx>
Hello Ole,
My colleague Matthias Meier had send patches in june 2011.
I also made some changes last year an this year to make tkhtml more
stable when working in the software of our company. The main part is
avoiding/deleting asserts.
If an assertion is false, our whole tcl/tk application just
crash/disappears from screen. To avoid these crashed, we made the
following changes:
Date: Fri, 26 Apr 2013 18:26:09 +0200
Subject: [PATCH] Added new function HtmlInitTreeNodeCmd and deleted/avoid
some asserts to make tkhtml a little bit more stable for
us.
---
src/html.h | 1 +
src/htmltcl.c | 26 +++++++++++++++++---------
src/htmltree.c | 15 ++++++++++++++-
3 files changed, 32 insertions(+), 10 deletions(-)
diff --git a/src/html.h b/src/html.h
index c8e82bc..1f25905 100644
--- a/src/html.h
+++ b/src/html.h
@@ -913,6 +913,7 @@ void HtmlTreeAddText(HtmlTree *, HtmlTextNode *, int);
void HtmlTreeAddClosingTag(HtmlTree *, int, const char *, int);
void HtmlInitTree(HtmlTree *);
+void HtmlInitTreeNodeCmd(HtmlTree *);
void HtmlHashInit(void *, int);
HtmlTokenMap * HtmlHashLookup(void *, const char *zType);
diff --git a/src/htmltcl.c b/src/htmltcl.c
index 055213e..61f2fe5 100644
--- a/src/htmltcl.c
+++ b/src/htmltcl.c
@@ -498,6 +498,11 @@ INSTRUMENTED(callbackHandler, HTML_INSTRUMENT_CALLBACK)
HtmlNodeComputedValues(pTree->pRoot) ||
pTree->cb.pRestyle==pTree->pRoot
);
+
+ while( pTree->cb.inProgress ) {
+ usleep( 2000 );
+ }
+
HtmlCheckRestylePoint(pTree);
HtmlLog(pTree, "CALLBACK",
@@ -668,14 +673,17 @@ HtmlCallbackForce(pTree)
(!pTree->cb.inProgress)
) {
ClientData clientData = (ClientData)pTree;
- assert(!pTree->cb.isForce);
- pTree->cb.isForce++;
- callbackHandler(clientData);
- pTree->cb.isForce--;
- assert(pTree->cb.isForce >= 0);
- if (pTree->cb.flags == 0) {
- Tcl_CancelIdleCall(callbackHandler, clientData);
- }
+ if( !pTree->cb.isForce )
+ {
+ pTree->cb.isForce++;
+ callbackHandler(clientData);
+ pTree->cb.isForce--;
+ assert(pTree->cb.isForce >= 0);
+
+ if (pTree->cb.flags == 0) {
+ Tcl_CancelIdleCall(callbackHandler, clientData);
+ }
+ };
}
}
@@ -2430,7 +2438,7 @@ nodeCmd(clientData, interp, objc, objv)
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument strings. */
{
- HtmlInitTree((HtmlTree *)clientData);
+ HtmlInitTreeNodeCmd((HtmlTree *)clientData);
return HtmlLayoutNode(clientData, interp, objc, objv);
}
static int
diff --git a/src/htmltree.c b/src/htmltree.c
index 079fd58..8ac300c 100644
--- a/src/htmltree.c
+++ b/src/htmltree.c
@@ -997,10 +997,23 @@ HtmlInitTree(pTree)
* document is the current node.
*/
pTree->state.pCurrent = HtmlNodeChild(pTree->pRoot, 1);
- assert(HtmlNodeTagType(pTree->state.pCurrent) == Html_BODY);
}
}
+void
+HtmlInitTreeNodeCmd(pTree)
+ HtmlTree *pTree;
+{
+ if (pTree->pRoot
+ && !pTree->state.pCurrent) {
+ /* If there is no current node, then the <body> node of the
+ * document is the current node.
+ */
+ pTree->state.pCurrent = HtmlNodeChild(pTree->pRoot, 1);
+ }
+}
+
+
static HtmlNode *
findFosterParent(pTree, ppTable)
HtmlTree *pTree;