Re: How to detect jump to anchor?

2005-04-26 Thread Boris Zbarsky
Tomasz Pyra wrote:
How to deterimne that what browser will do when OnLocationChange is called?
OnStateChange is only called when new page is loading.
Right.  So you can keep track of whether a page is currently loading via 
OnStateChange.

I could use global loaging_flag what will be set up when OnStateChange 
will receive STATE_START, and will be cleared when OnStateChange will 
receive STATE_STOP.
But is it safe?
It's probably safe if you do it per-listener, not globally.
I don't know is OnStateChange with START, is always executed before 
OnLocationChange. Can you confirm that?
Yes.  Please file a bug (cc darin, biesi, and me) on the fact that this isn't 
clearly documented?

That's harder (especially since the jump could have been to something 
other than a "named anchor").
Now I need only to handle named anchors.
So you don't care about:
Link
Target
?
-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: How to detect jump to anchor?

2005-04-26 Thread Tomasz Pyra
Boris Zbarsky napisaƅ(a):
Tomasz Pyra wrote:
But how to handle action when user click into link like: 

Don't you get an OnLocationChange in this case?
Yes - I can parse URI at OnLocationChange and get the anchor name 
('tyt296').
But now I need some information about browser behaviour.
When page is already loaded (anchor used only to jump to another part of 
page), I should search in DOM tree for place named 'tyt296', when founded I 
can do my actions there.

But when link URL is complete (www.something.com/something.htm#anchor0001), 
browser first must complete loading page, after that I can search DOM for 
place named 'tyt296'.

How to deterimne that what browser will do when OnLocationChange is called?
OnStateChange is only called when new page is loading.
I need to call my function after DOM is built, so when anchor is used only to 
scroll, that function will be called just after user click a anchored link.
When browser need to load new page, then jump to anchor, my function will be 
called after page loading and building DOM tree.

I could use global loaging_flag what will be set up when OnStateChange will 
receive STATE_START, and will be cleared when OnStateChange will receive 
STATE_STOP.
But is it safe?
I don't know is OnStateChange with START, is always executed before 
OnLocationChange. Can you confirm that?


That's harder (especially since the jump could have been to something 
other than a "named anchor").
Now I need only to handle named anchors.
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: How to detect jump to anchor?

2005-04-21 Thread Boris Zbarsky
Tomasz Pyra wrote:
But how to handle action when user click into link like: 
Don't you get an OnLocationChange in this case?
need information about nsIDOMNode what is pointed by that "#tyt296" label.
That's harder (especially since the jump could have been to something other than 
a "named anchor").

-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


How to detect jump to anchor?

2005-04-21 Thread Tomasz Pyra
I am using embedded mozilla-1.7.3.
When user click mouse button on regular link, I can receive information about 
loading new page by ProgressListener.

But how to handle action when user click into link like: 
Browser doing a jump to an anchor, but I need to know about it, and I need 
information about nsIDOMNode what is pointed by that "#tyt296" label.
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding