bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: info.js demo on Texinfo manual updated on website


From: Per Bothner
Subject: Re: info.js demo on Texinfo manual updated on website
Date: Wed, 30 Nov 2022 17:37:43 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0

On 11/30/22 06:44, Gavin Smith wrote:
There are a couple of other less important problems.  You can see
them at https://www.gnu.org/software/texinfo/manual/texinfo-html/index.html:

* A tooltip pops up saying "General Index (GNU Texinfo 7.0.1)" at the
   table of contents.
* The page title (displayed in a browser tab or the window title bar) at
   the Top node is "General Index (GNU Texinfo 7.0.1)".  However, go to
   either of the index nodes and the title becomes "Top (GNU Texinfo 7.0.1)".

A partial work-around is to test for INDEX_ID in Pages.prototype.render:

        if (state.action.type === "window-title"
            && div.getAttribute("id") !== config.INDEX_ID) {
            div.setAttribute("title", state.action.title);
        }

However, this doesn't set the correct title for the Index nodes (which
isn't yjay big a deal).

The actual problem seems to be that state.current points to
the Top page when we loading the indexes.  Thus we are trying to set the "title"
attributes of the Top node when it should be one of the Index nodes.

The logic depends on the "current" node -but that isn't always correct when 
dealing
with messages from sub-windows. Specifically, the sub-page (iframe) sends a 
"window-title"
message to the parent window. The title should be set on the node corresponding 
to
the sending sub-window. This is not necsssarily the same as the "current" 
window.
We can modify state.current before loading the sub-window, and it will 
*probably*
work correctly, but selecting the affected node from the sub-window seems more
correct than assuming the "current" node.

I find the "state machine" logic of info.js quite hard to deal with,
and I confess I don't understand what problem it is intended to solve.
I don't think it's the right logic for dealing with "window-title" messages.
--
        --Per Bothner
per@bothner.com   http://per.bothner.com/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]