002e60c59c18ca1d87c6e980278a0a8a523425a4
chmalee
  Tue Dec 2 12:42:34 2025 -0800
Wait until DOMContentLoaded to convert title tags to mouseovers, because the browserTextSize variable will not be set yet otherwise. Make tooltip text size determination default to 12 if no saved text size or no browserTextSize available yet, refs #36754

diff --git src/hg/lib/hui.c src/hg/lib/hui.c
index 56b05b693f4..f7c4799f675 100644
--- src/hg/lib/hui.c
+++ src/hg/lib/hui.c
@@ -9496,45 +9496,49 @@
 puts("<svg style='height:1.1em; vertical-align:top' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'>");
 printf("<circle cx='12' cy='12' r='10' stroke='%s' stroke-width='1.5'/>", color);
 printf("<path d='M12 17V11' stroke='%s' stroke-width='1.5' stroke-linecap='round'/>", color);
 printf("<circle cx='1' cy='1' r='1' transform='matrix(1 0 0 -1 11 9)' fill='%s'/>", color);
 puts("</svg>");
 }
 
 void printInfoIconColor(char *mouseover, char *color)
 /* Print info icon (i) with explanatory text on mouseover, with color */
 {
 printf("<span title=\"%s\">", mouseover);
 printInfoIconSvg(color);
 puts("</span>");
 if (!mouseOverJsDone)
     {
-    jsInline("convertTitleTagsToMouseovers();\n");
+    jsInline("document.addEventListener('DOMContentLoaded', function() {\n"
+        "    convertTitleTagsToMouseovers();\n"
+        "    });\n");
     mouseOverJsDone = TRUE;
     }
 }
 
 void printInfoIcon(char *mouseover)
 /* Print info icon (i) with explanatory text on mouseover */
 {
 // see https://www.svgrepo.com/svg/524660/info-circle
 printf("<span title=\"%s\">", mouseover);
 printInfoIconSvg("#1C274C");
 puts("</span>");
 if (!mouseOverJsDone)
     {
-    jsInline("convertTitleTagsToMouseovers();\n");
+    jsInline("document.addEventListener('DOMContentLoaded', function() {\n"
+        "    convertTitleTagsToMouseovers();\n"
+        "    });\n");
     mouseOverJsDone = TRUE;
     }
 }
 
 void hCompositeUi(char *db, struct cart *cart, struct trackDb *tdb,
                   char *primarySubtrack, char *fakeSubmit, char *formName)
 // UI for composite tracks: subtrack selection.  If primarySubtrack is
 // non-NULL, don't allow it to be cleared and only offer subtracks
 // that have the same type.  If fakeSubmit is non-NULL, add a hidden
 // var with that name so it looks like it was pressed.
 {
 bool hasSubgroups = (trackDbSetting(tdb, "subGroup1") != NULL);
 boolean isMatrix = dimensionsExist(tdb);
 boolean viewsOnly = FALSE;