Re: How do I override nsNSSDialogs with my own class?

2006-01-19 Thread Boris Zbarsky

Barry Scott wrote:
You may be able to do it by overriding the various contract IDs for it 
starting at 
http://lxr.mozilla.org/seamonkey/source/security/manager/pki/src/nsPKIModule.cpp#55 
and making sure to implement all the interfaces it does...


Is there some sample code that does something like this that I can read 
to get a handle on the approache to use?


It should work pretty much like overriding the regular prompt component...

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


Re: nsIDOMCSSStyleDeclaration::GetPropertyValue () Please help, seems to be leaking?

2006-01-19 Thread Boris Zbarsky

Niky Williams wrote:
I ran the FireFox.exe it 
produced and when I closed it, there were some leaks reported in the 
text file.  Is this normal for a FF build?  Maybe some objects were 
released on program close that the leak utility didn't account for?


Exactly.  There are known bugs filed on this; to fix them requires making the 
shutdown sequence a lot more controlled.  It's being worked on.  ;)


You definitely want to compare the log from whatever you're testing to the 
baseline log you got by just starting and stopping.


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


Re: How do I override nsNSSDialogs with my own class?

2006-01-18 Thread Boris Zbarsky

Barry Scott wrote:

I'm trying to get https support into my embedded mozilla app that
has no user input. I've replace the Prompts component and now
I need to replace the nsNSSDialogs class (service?).
I'm currently using mozilla 1.7.12.

What is the correct way to go about this?


You may be able to do it by overriding the various contract IDs for it starting 
at 
http://lxr.mozilla.org/seamonkey/source/security/manager/pki/src/nsPKIModule.cpp#55 
and making sure to implement all the interfaces it does...


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


Re: nsIDOMCSSStyleDeclaration::GetPropertyValue () Please help, seems to be leaking?

2006-01-17 Thread Boris Zbarsky

Niky Williams wrote:
I realize by doing it this way in a timer thread, and not 
within the actual Gecko event loop, that it's probably not exactly 
thread safe...


It's not at all threadsafe.


but I don't believe it would be causing this issue


It sure could.

 Is there a possible leak with nsIDOMCSSStyleDeclaration::GetPropertyValue

()


Also possible, but I haven't run into it before.

What does your actual code look like?

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


Re: nsIDOMCSSStyleDeclaration::GetPropertyValue () Please help, seems to be leaking?

2006-01-17 Thread Boris Zbarsky

Niky Williams wrote:
Code is below.  I came across something just recently.  Using the 
nsIDOMNSDocument::GetBoxObjectFor (), I could possibly get and set the 
same things I'm needing.


That's not threadsafe either

The code looks ok to me.  What does the output look like if you run with memory 
leak logging (in a debug build; set XPCOM_MEM_LEAK_LOG to a filename of your 
choice in the environment before starting up).  When you quit, are there objects 
related to this stuff in the leak log?


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


Re: gmail mail reading issue !

2006-01-09 Thread Boris Zbarsky

[EMAIL PROTECTED] wrote:

# disable features and skip various build steps
ac_add_options --enable-extensions=spatialnavigation,cookie


You disabled some features that gmail relies on (like XMLHttpRequest, which is 
in the xmlextras extension).  I strongly suggest thinking long and hard before 
disabling any of the default extensions.



ac_add_options --disable-plaintext-editor-only


For what it's worth, it's not clear to me what this is supposed to be.

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


Re: problems clearing session history

2006-01-05 Thread Boris Zbarsky

Bill Filler wrote:

  nsresult rv=mWebNavigation-GetSessionHistory(getter_AddRefs(history));
  PRInt32 count=0;
  rv=history-GetCount(count);
  rv=history-PurgeHistory(count);


That should work.  What's the exact rv of PurgeHistory?  Is it NS_OK?

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


Re: How to get / set charset in an embedded browser

2006-01-05 Thread Boris Zbarsky

Anton Bar wrote:
A short test with nsIDOMNSDocument.charset property shows that the embedded 
window uses an incorrect charset despite the fact we specifically state the 
Hebrew charset in a META tag.


Is this happening over HTTP?  What headers does the server send?

Is there any way to make the embedded browser to display some specific 
encoding or to detect the META correctly?


Depends on the exact setup; charset detection is about a 10-step process.  Hard 
to say more without more info from your end as to where the documents are coming 
from.


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


Re: getting navigation interface for a frame

2006-01-03 Thread Boris Zbarsky

Aleksandar Vasilev wrote:
is it possible to specify a url to load inside a separate frame, 
preserving the content of the main document/other frames. I guess the 
question comes down to obtaining a nsIWebNavigation interface associated 
with a frame?


There are non-frozen APIs to find frames by name (see nsIDocShellTreeItem, etc).

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


Re: If I have a JSObject * how can I get a string?

2005-12-08 Thread Boris Zbarsky

Stephen Kellett wrote:
I haven't found a JS_ObjectToString() method, so I guess it must be some 
other way. Can anyone help?


  JS_ValueToString(cx, OBJECT_TO_JSVAL(obj))

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


Re: How complicated task is implementing SSL support?

2005-12-05 Thread Boris Zbarsky

Tomasz Pyra wrote:

Now my embedded browser supports only http://... adresses.
Only think I want is to do something what allow me to open urls like 
https://...


Did you configure with --enable-crypto?

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


Re: What's wrong with this small code - getting the DOM

2005-12-01 Thread Boris Zbarsky

Vijay wrote:

Here is the GetDOM function implementation as well...

NS_IMETHODIMP CBrowserImpl::GetDOM(nsIDOMDocument* doc)
{
nsCOMPtrnsIDOMWindow window;
nsCOMPtrnsIDOMDocument ndoc = (nsCOMPtrnsIDOMDocument)doc;


Er... what?  That doesn't look to me like it should do anything sane at all.  In 
particular, after this code runs in your example as:


nsCOMPtrnsIDOMDocument doc;
pBrowserFrame-GetBrowserImpl()-GetDOM(doc);

|doc| will be null as far as I can tell.

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


Re: How to convert part of the text to clickable links

2005-11-21 Thread Boris Zbarsky

Akmal Khodjanov wrote:
Can anybody explain me how mozilla mailnews or thunderbird identifies 
parts of the text as possible links, like http://www.google.com it would 
render as a clickable link, or [EMAIL PROTECTED] it would show as mailto: 
link.


Presumably this is done by the text-to-html converter (either 
mozTXTToHTMLConv.cpp or nsTXTToHTMLConv.cpp -- I'm not sure which is used where).


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


Re: How to get the source for a webpage page using C/C++?

2005-11-14 Thread Boris Zbarsky

Stephen Kellett wrote:
Scenario: I'm in a JavaScript callback (for example the callHook 
callback) and I have a JSContext * and a JSScript at my disposal. How 
can I get the page source code for this page?


You can't, in general.

However if its a non-local file such as http://someWebAddress/page.html 
or one of the chrome:// pages then I can't open that. I don't want to 
fetch the page myself as the page content may be different for each call 
- I want the same source as the page which resulted in my script being 
called.


That may not be stored anywhere.

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


Re: How to get the source for a webpage page using C/C++?

2005-11-14 Thread Boris Zbarsky

Stephen Kellett wrote:
That raises the question: When I do View Page Source from the View menu 
or the context menu how does it get the page source to display in the 
window?


It looks in the cache.  If it's not in the cache, it gets it from the network. 
There are some complications if POST data is involved, of course.


All I want to do is that. I don't know how to do that. Either it is 
refetched or it is in a local page-cache managed by Mozilla. I don't 
care where it is, just how to fetch it.


Unfortunately, the APIs for doing that are not really exposed...  You'd have to 
effectively do what nsDocShell::LoadHistoryEntry does.


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


Question on window targeting and embedding

2005-11-14 Thread Boris Zbarsky
I've been trying to figure out a sane way to allow embeddors to do the force 
windows to open in tabs stuff that Firefox hacked in at some point.


The current state of things is described at 
http://wiki.mozilla.org/DocShell:Window_targeting and what I think we want to do 
is at http://wiki.mozilla.org/DocShell:Window_targeting#Proposed_Changes.


I was wondering what people think of the suggestion.  I'm not sure whether a 
service is the right way to go or whether this is something that should live on 
the docshell tree owner... in particular, if we do a service-like thing then the 
callee will need to get from the nsIDOMWindow or nsIWebNavigation we pass in 
(one for some subframe) to something that would usefully allow them to open a 
tab in the same browser window, which might be nontrivial while sticking to 
frozen interfaces.


Thoughts?

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


Re: Trapping all gecko errors

2005-11-04 Thread Boris Zbarsky

Scott Lanning wrote:

The header for nsIWebProgressListener isn't clear
to me at all.


What is unclear?  If there's a problem, we can fix it; we just need to know what 
the problem is.


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


Re: Trapping all gecko errors

2005-11-04 Thread Boris Zbarsky

Scott Lanning wrote:

  Say that I figure out I need an nsIWebProgress instance
in order to call its AddProgressListener method. Nothing I see
in nsIWebProgress indicates how I can get one of them.


That's because there are several different things which all implement 
nsIWebProgress in different situations.


For the embedding case, I believe 
http://www.mozilla.org/projects/embedding/PublicAPIs.html talks about 
nsIWebProgress and how to get one some.



It seems I might use nsIWebBrowser-AddWebBrowserListener,
where what it says is nsIWeakReference is really my
nsIWebProgressListener.


Yes, this would also work.


  Assuming the above is correct, to retrieve the HTTP status
code (200, 302, 404, etc.), I think I would be concerned
with OnStateChange in nsIWebProgressListener. Its documentation
says NOTE: aStatus may be a success code even for server generated
errors, such as the HTTP 404 error. In such cases, the request itself
should be queried for extended error information (e.g., for HTTP requests
see nsIHttpChannel).  I'm apparently to use nsIHttpChannel somehow.


Yes.


How do I get one of those? I don't see anything in nsIRequest.


You call QueryInterface on the request to nsIHttpChannel.  If that succeeds, 
you're good to go.  ;)  If it fails, that wasn't an HTTP request.



(I'm guessing that GetStatus method of nsIRequest will give me
the same thing as aStatus in OnStateChange?)


It should, yes.


Grepping more, I see that in EmbedProgress.cpp,
it do_QueryInterface an nsIRequest to an nsIChannel.


Right.


And annsIHttpChannel is an nsIChannel. Maybe I could do_QueryInterface
to nsIHttpChannel, instead.


Exactly.


Then finally I call GetResponseStatus on the nsIHttpChannel object.


Yep.

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


Re: Running event handlers

2005-10-31 Thread Boris Zbarsky

Ben Hutchings wrote:

It seems like some parts of the Mozilla event handling machinery don't
like being recursed over, so in some cases events won't be processed
while an event handler (such as my on_net_state_change function) is
running.


Oh, right.  The event queues try to prevent reentry... at least with 1.7.  I 
recall us running into this problem since then...  :(


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


Re: Running event handlers

2005-10-30 Thread Boris Zbarsky

Ben Hutchings wrote:

I'm faking up mouse events and dispatching them through the DOM.  So
far as I can tell, calling dispatchEvent on a node causes the event
handlers to run asynchronously


dispatchEvent is synchronous.

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


Re: Setting default stylesheets

2005-10-27 Thread Boris Zbarsky

Ben Hutchings wrote:

I don't suppose you can help with my other query about link extents?


I'm not sure I saw this query.

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


Re: Finding link extents (was Re: Setting default stylesheets)

2005-10-27 Thread Boris Zbarsky

Ben Hutchings wrote:

Currently I'm using nsIDOMNSDocument::GetBoxObjectFor to find the
extents of each link before scanning for changes, but this doesn't
always provide the correct extents for my purposes.


What do you mean by extents of each link, exactly?  Given positioned content, 
etc, a state change on the link can affect arbitrary bits in the final rendered 
bitmap.


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


Re: Finding link extents (was Re: Setting default stylesheets)

2005-10-27 Thread Boris Zbarsky

Ben Hutchings wrote:

The extents of the content of the link.


You mean the smallest rectangle that contains all the layout objects 
corresponding to descendants of the link DOM node in the DOM?


You can get that by getting the rectangles for all those nodes and taking the 
minimal bounding rectangle...  There's no one-stop place for this information.


Note, however, that change of state on a link can also affect rendering of the 
link's siblings in the DOM, what with the CSS '+' and '~' combinators.


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


Re: Finding link extents (was Re: Setting default stylesheets)

2005-10-27 Thread Boris Zbarsky

Ben Hutchings wrote:

The idea is simply to let people use a familiar format and tools, not to 
support arbitrary
existing web pages.


Ah, ok.  That makes life simpler.  ;)

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


Re: Setting default stylesheets

2005-10-25 Thread Boris Zbarsky

Ben Hutchings wrote:

It's 1.7.8.


OK.  Then there is no really clean way to do it...  You can try creating a 
CSSLoader (nsICSSLoader.h) and using it to load sheets, then using

SetAgentStyleSheets() on the presshell, I guess.

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


Re: Setting default stylesheets

2005-10-25 Thread Boris Zbarsky

Ben Hutchings wrote:

Something I don't understand is that I apparently have to do this for
each page.  How do Seamonkey and Firefox set stylesheets to be applied
to all pages


There are hardcoded URIs to the sheets in the C++.


and can I do the same?


Yes, if you change the C++ involved...

In 1.8-based builds, the stylesheet service does that work for you, but with 
1.7, you have to do it for each page.  :(


-Boris

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


Re: Setting default stylesheets

2005-10-24 Thread Boris Zbarsky

Ben Hutchings wrote:

It's not clear to me how to override the default stylesheet(s) when
embedding Mozilla.


You can use nsIStyleSheetService to load additional style sheets.  If you want 
to modify the existing ones, and you're shipping your own gecko, you can always 
just edit ua.css...


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


Re: Setting default stylesheets

2005-10-24 Thread Boris Zbarsky

Ben Hutchings wrote:

Oddly I can only find an IDL file for that, not a header file


The nsIStyleSheetService.h header is generated via xpidl.


(LXR denies all knowledge of the identifier).


Yeah, lxr kinda sucks like that.


Should I attempt to generate
a header file, and how should I find a/the implementation of it at
run-time?


getService() the @mozilla.org/content/style-sheet-service;1 contract.

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


Re: Setting default stylesheets

2005-10-24 Thread Boris Zbarsky

Ben Hutchings wrote:

I figured it was something like that, but didn't know what the tool
was - I've used COM previously but not XPCOM.  Is it a frozen
interface?


Not yet, no.


Debian's mozilla-dev
package doesn't include the IDL file.  Could this be considered a
packaging bug?


Hmm... Which version are they packaging?  This interface did not exist in the 
1.7 version of Gecko.


If you're working against 1.7, then things are harder.  You may have to go back 
to that nsIPresShell business.



Yeah, lxr kinda sucks like that.


Can it not parse IDL files?


It can, and does.  But it has a tendency to sometimes miss identifiers, in both 
IDL and C++...


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


Re: Dom listeners and nsEventListenerManager instances

2005-08-14 Thread Boris Zbarsky

edburns wrote:

What is the cardinality of nsEventListenerManager?  Is it a singleton?


There's one per nsIDOMEventTarget (so one for every Node or Window that has 
event listeners registered).



  nsEventListenerManager.this is 0xcbc54a8
  aType is eEventArrayType_Mouse, which is 0.

2. Calling into GetListenersByType(), I find that a new listener must
be
   created, in the else clause at the bottom of the method.  This seems
   odd.


That seems correct if there are no listeners registered on that event target 
yet...

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


Re: Getting nsWindow from chrome

2005-07-20 Thread Boris Zbarsky

slu wrote:

IMO, the nsWindow interface


It's not an interface.  It's a concrete class.  The interface is nsIWidget.

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


Re: Getting nsWindow from chrome

2005-07-20 Thread Boris Zbarsky

steve lu wrote:

but the problem remains the same.
If I want to re-use the nsWindow implementation by doing

nsMyWidget: nsWindow

and register my class thru component register as a new Widget.
And insert my widget by doing rootwidget-AddChild(myWidget);


You'd need to compile all of widget into your library, then  Still not sure 
it would work, of course.


Also, please do NOT cc my email on posts to this newsgroup.

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


Re: Is there an archive for mozilla-api-announce ?

2005-07-14 Thread Boris Zbarsky

Dorian B. wrote:
I need to know what modification was done to the api during 1.8 
development.
Is there an archive for this mailing list ? I've searched but found 
nothing.


I suspect a lot of the api changes never even made it to the list

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


Re: nsIBaseWindow required for embedding a browser?

2005-07-03 Thread Boris Zbarsky

Mark Junker wrote:
just to be sure: the access to the nsIBaseWindow interface is required 
to embed a browser?


Yep.

I ask this because the nsIBaseWindow interface is not part of the 
dist/sdk/include folder and I assume that dist/sdk points the the real 
gecko SDK?


It does... In 1.8, we hope to have nsIBaseWindow in the SDK.  At the moment, the 
SDK is not quite as complete as it should be.  :(


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


Re: Limit of lines of JS-Code?

2005-06-01 Thread Boris Zbarsky

Daniel Kirsch wrote:
Is there any known limit of how many lines of javascript code can be 
used for a XUL project?


Not enforced by XUL itself.  It might be worth asking about this in n.p.m.jseng 
too.

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


Re: Getting the DOM document...

2005-05-18 Thread Boris Zbarsky
??? wrote:
  webNav-LoadURI(NS_ConvertASCIItoUCS2(url).get(),
   nsIWebNavigation::LOAD_FLAGS_NONE,
   nsnull,
   nsnull,
   nsnull);
This starts the load.  The load is asynchronous.
 rv = window-GetDocument(getter_AddRefs(doc));
This creates an empty document, since nothing has been loaded into that 
window yet.
You need to wait until the load completes before getting the document.
-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: bug in nsIContentPolicy.idl

2005-05-03 Thread Boris Zbarsky
Michael Vincent van Rantwijk wrote:
aContentType: 3
aContentLocation: http://mozillazine.org/image/default/sky.png
aRequestOrigin: http://mozillazine.org/
aContext.defaultView: undefined
What's aContext.documentElement?  aContext.documentURI?  And 
aContext.QueryInterface(Components.interfaces.nsIDOMDocumentView).defaultView?

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


Re: bug in nsIContentPolicy.idl

2005-05-03 Thread Boris Zbarsky
Michael Vincent van Rantwijk wrote:
aContext.QueryInterface(Components.interfaces.nsIDOMDocumentView).defaultView 
= [object Window]

It looks like it that I can use the last line, but I guess that 
aContext.defaultView is faster, no?
Actually, they should be exactly the same (and the QI should NOT be needed 
here).  Are you really getting null without the QI and non-null with the QI?  If 
so, what Mozilla build is this?

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


Re: Answers to Boris and Stephen (was Re: docShell-LoadStream: external script files don't run...)

2005-05-03 Thread Boris Zbarsky
Brian wrote:
Ah! yes. Important point: we're working cross-platform with Macs and 
Windows, so we are using 1.3.1
Oh.
Well, in that case the only reason images are loading is because 1.3.1 doesn't 
do security checks on image loads.  It _does_ do them on script loads, and that 
security check fails in this case (since the random URI loadStream makes up 
isn't allowed to load file: content).

Er... We have not made any provision in our embedding to include the 
JavaScript console--no  tasks-tools-JavaScript Console menu, for 
example. Thanks for the suggestion. Perhaps I can set up something to poll 
the Console Service and log any messages. I'll look into that. 
I _think_ we reported the security exception to the console service back in 
1.3.1... Not sure.

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


Re: bug in nsIContentPolicy.idl

2005-05-03 Thread Boris Zbarsky
Michael Vincent van Rantwijk wrote:
I hate to say, but the mozillaZine page changed today, and so has the 
output, so now that also no longer works :(
OK.  So:
1)  Create a minimal page showing the issue so we won't have this problem
anymore.
2)  Tell me what the URI of this page is.
3)  Clearly describe what behavior you're seeing on this page (since you've said
the behavior has changed, but haven't said _how_).
shouldLoad() in our component is called for ./image/new/title.gif but 
it doesn't get the time to handle this request
Handle it in what way?
because a new one is fired right after it for /image/default/sky.png
I'd expect that you would get another shouldLoad call any time after you return 
from the first shouldLoad If you _don't_ return from shouldLoad but spin the 
event loop, you should expect to be reentered.  We should probably document that.

This happens with Mozilla build ID 2005050105, but it still works with 
Mozilla build ID 2005217
The latter isn't exactly a valid build id...
If this is a recent regression, can you narrow down when it broke using builds 
on archive.mozilla.org?

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


Re: bug in nsIContentPolicy.idl

2005-05-03 Thread Boris Zbarsky
Michael Vincent van Rantwijk wrote:
We always return any of the above values but we are cutoff in the middle 
of our test sequence by that extra unexpected call to shouldLoad.
Hmm... During which test, if I may ask?
-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: docShell-LoadStream: external script files don't run unless I pass a URI. Why?

2005-05-02 Thread Boris Zbarsky
Brian wrote:
That fixes the problem, but I don't understand why. The SRC attributes 
already say file://.  Why does that parameter value make a difference?
It really shouldn't Do you have a debug build on hand?  Are there any useful 
asserts or warnings?  Does the JS console show anything about security errors or 
something?

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


Re: docShell-LoadStream: external script files don't run unless I pass a URI. Why?

2005-05-02 Thread Boris Zbarsky
Brian wrote:
The document also contains IMG tags with similar fully specified 
absolute file:// URLs and the images display correctly.
I guess I should also ask... what Gecko version is this?
-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 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:
a href=#fooLink/a
div id=fooTarget/a
?
-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: How to save DOM tree into plain HTML file?

2005-04-09 Thread Boris Zbarsky
edburns wrote:
I'm using a straight up MOZILLA_1_7 build.  The URI you mention loads
just fine.  Any other ideas?
Not offhand... what does the view-source DOM look like in DOM inspector (if you 
just load the regular mozilla view-source)?

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


Re: Proposal: Mozilla Toolkit/Runtime installation

2005-04-04 Thread Boris Zbarsky
Benjamin D. Smedberg wrote:
I don't know. Since you and biesi are the experts here, you're input is 
welcome. I certainly want to make it possible for embedding apps 
(camino) to override the provided XUL UI if they have something else, 
Sure.  It's just instantiated by contract id.
but I guess it makes sense to provide a default UI (and perhaps share 
the helper-app settings between all toolkit apps, in the future?).
I'm not sure on this one; app authors would have to be polled on this, 
perhaps.
Will XULRunner supply a functioning window.find() implementation (not 
that this currently doesn't really work well in Firefox).
For reference, I mis-spelled note as not there
What does that do?
It should provide the user with UI to search the current page.  In Firefox, it 
should probably open the find toolbar; in toolkit apps in general, that's a good 
question.

What it _does_ right now is always open up the find dialog (which is then busted 
in Firefox, of course).

Again, I don't know. This is certainly something embedders need to be 
able to override
Of course.  All of these should be overridable by embeddors, if only because not 
all embeddors will use XULRunner.

but providing a default implementation might be smart.
Right.  That's the question -- which of these components should we provide 
default impls for?

One other issue -- if we decide that some dialog needs to be in XULRunner but 
it, by design, basically depends on other Firefox (say) UI, what do we do?  Do 
we do some UI redesign, do we leave the dialog out, or do we decide when we get 
to that point?  This isn't a completely idle question, since I fully expect the 
helper app dialog to be in this situation.

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


Re: Proposal: Mozilla Toolkit/Runtime installation

2005-04-04 Thread Boris Zbarsky
Benjamin D. Smedberg wrote:
My current thinking involves making a generic UI that doesn't have any 
app-specific features. Then Firefox (say) can either

1) override the implementation entirely
2) use XUL overlays to add app-specific features.
Sounds like a plan.
-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: Proposal: Mozilla Toolkit/Runtime installation

2005-04-03 Thread Boris Zbarsky
[Setting followup because this isn't really a seamonkey issue anymore.]
Benjamin D. Smedberg wrote:
For the list as I have currently drafted it, see
http://wiki.mozilla.org/XUL:Xul_Runner#The_XULRunner_Runtime
Will XULRunner supply the UI that the external helper app service needs to work 
(helper app dialog, specifically)?

Will XULRunner supply a functioning window.find() implementation (not that this 
currently doesn't really work well in Firefox).

Will XULRunner supply some sort of window-targeting component (the code that's 
currently used to implement force open in new tab; that's sort of hacked in 
the Gecko back end by making it effectively depend on browser.js, but I plan to 
change it to simply use an embedding service of some sort to retrieve the target 
docshell)?

I assume XULRunner will supply a filepicker implementation, though that's not 
actually on your list and I don't see a FilePicker component in browser/ or 
toolkit/ (I see one in xpfe/components, and if that's what's being used then I'm 
not sure why the XUL and JS for the dialog were forked; those depend somewhat on 
the component)

I'm probably missing other cases when the core code needs to pose various 
dialogs/etc for user interaction; for each of those we need to decide whether 
XULRunner will provide them.

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


Re: How to save DOM tree into plain HTML file?

2005-03-30 Thread Boris Zbarsky
edburns wrote:
NOW here's where I get into trouble.  This eventually boils down to
nsHTMLDocument::GetBodyContent().  The problem is that the mBodyContent
ivar never gets set, and I don't know why:
Hmm  This is an embedded build, right?  Does 
resource://gre/res/viewsource.css load in this build?  If trying to open that 
URI throws, then view-source may just be bailing out at that point...  :(

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


Re: How to save DOM tree into plain HTML file?

2005-03-27 Thread Boris Zbarsky
edburns wrote:
Ah, I think I see what you mean.  You mean use my existing technique
where I get the DOM text, but do it on a view-source: view of the page.
Right.
1. make the necessary changes so I can reload the current page from the
cache into a new, non displaying, BrowserControl with the view-soure:
pre-pended.
Unless you're doing things similar to loadPage, this won't work for POST data 
pages

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


Re: How to save DOM tree into plain HTML file?

2005-03-24 Thread Boris Zbarsky
edburns wrote:
Thanks for your informative replies on this and other threads.  In a
related note, how do you recommend getting the actual, un-parsed, bytes
for the current document being displayed by the nsIWebBrowser?
I don't believe we have an API that really allows this to be done cleanly at the 
moment...  We're working on getting to the point where nsIWebBrowserPersist will 
let you do this.

Note that if you do what the view-source window does in Mozilla to load 
Mozilla's built-in view-source into a display:none docshell or something and 
then grab the text out of that, it'll be about what you want (though characters, 
not bytes, and not as fast as just getting the bytes).  This preserves 
whitespace, all sorts of malformed stuff, etc.

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


Re: Generating HTML question

2005-03-22 Thread Boris Zbarsky
Yogish Baliga wrote:
 I used nsIWebNavigation interface of @mozilla.org/webshell;1 
component. Using this interface is not
working.
It should work.  What doesn't work about it?
-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: Newbie Question on GetServiceByContractID

2005-03-22 Thread Boris Zbarsky
Yogish Baliga wrote:
  nsCOMPtrnsIWebBrowser webBrowser;
  r = 
servMan-GetServiceByContractID(@mozilla.org/embedding/nsWebBrowser;1, 
NS_GET_IID(nsIWebBrowser), getter_AddRefs(webBrowser));
If nothing else, you shouldn't be using GetServiceByContractID, but rather 
CreateInstanceByContractID, since you want your own web browser instance, no?

This is now somewhat documented in nsEmbedCID.h -- see 
http://lxr.mozilla.org/seamonkey/source/embedding/base/nsEmbedCID.h#46

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


Re: Retrieve the DOM of the current web page displayed in firefox

2005-03-22 Thread Boris Zbarsky
Laurent Mimoun wrote:
In fact i get a web browser like this :
nsCOMPtrnsIWebBrowser webBrowser;
rslt = serviceManager-\
GetServiceByContractID(\
@mozilla.org/embedding/browser/nsWebBrowser;1, \
NS_GET_IID(nsIWebBrowser), \
getter_AddRefs(webBrowser));
is that correct ? 
No.  You should be using CreateInstanceByContractID.  Why did you decide to use 
GetServiceByContractID here, if I may ask?

After i put the lines
nsCOMPtrnsIWebNavigation nav  = do_QueryInterface(webBrowser);
nsCOMPtrnsIDOMDocument doc;
rslt = nav-GetDocument(getter_AddRefs(doc));
if(NS_FAILED(rslt)) return rslt;
but doc is still and always NULL...
Even after you have loaded something in the web browser object you create?
-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: help : nsIWebBrowser-GetContentDOMWindow problem !

2005-03-22 Thread Boris Zbarsky
Laurent Mimoun wrote:
what does we are not setup??!! mean exactely ?
Exactly what it says.  The browse has not been properly initialized.
rslt = componentManager-CreateInstanceByContractID(
   @mozilla.org/embedding/browser/nsWebBrowser;1,
   nsnull,
   NS_GET_IID(nsIWebBrowser),
   getter_AddRefs(webBrowser));
OK... This creates the web browser object.  Then you need to initialize it.  I 
believe just QIing to nsIBaseWindow and calling Create() on the result should do 
the job.

All of this needs to be better documented, and will be by Gecko 1.8.
-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: Generating HTML question

2005-03-22 Thread Boris Zbarsky
Yogish Baliga wrote:
r = docShell-LoadURI((const PRUnichar *) http://www.yahoo.com;, 
nsIWebNavigation::LOAD_FLAGS_NONE, nsnull, nsnull, nsnull);
This is wrong.  You want to use NS_LITERAL_STRING(http://www.yahoo.com;).get() 
or something

nsCOMPtrnsIDOMDocument dom;
docShell-GetDocument(getter_AddRefs(dom));
Er... you do this _immediately_?  URI loads are asynchronous, so you need to 
wait for the data to load to do this (and watch for the load end via 
nsIWebProgress notifications, probably).

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


Re: How to send a click to Submit button belong to post form?

2005-03-08 Thread Boris Zbarsky
Tomasz Pyra wrote:
and that is not good:
TABLE
 FORM
  TRTDINPUT
 /FORM
/TABLE
Well, the simple reason is because the HTML specification says this is no 
good.
The more complicated reason is that there is no reasonable way to render this 
DOM, if the parser left it as-is, while preserving the table structure.

Can't I put other tags between TABLE and THEADTFOOTTBODY tags?
Exactly.  The only valid childrent of table are thead/tfoot/tbody.  This 
last has an optional start and end tag, and the only valid children of it are 
tr.  This is all clearly spelled out in the HTML specification.

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


Re: How to send a click to Submit button belong to post form?

2005-03-07 Thread Boris Zbarsky
Tomasz Pyra wrote:
When I loaded your code (from above) into my browser, then saved DOM 
tree into .html, using
persist-SaveDocument(nsnull, file, nsnull, nsnull, 0, 0);

i got:
...
As you can see form tag was closed just after opening...
Of course.  The original markup (copied from the site you pointed to) is 
invalid, and the parser fixes it up.

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


Re: How to send a click to Submit button belong to post form?

2005-03-07 Thread Boris Zbarsky
Tomasz Pyra wrote:
This is better example (causes exactly same browser behaviour as in my 
application).
When you press modify() button, a span tag is added over input tag.

It should not affect a form, but form stops works.
The problem is that the markup is invalid.  The parser fixes it up, but as a 
result the input is not actually a descendant of the form in the DOM.

Now we hack things so just submitting the form works, because this sort of 
markup is somewhat common.  But if you remove the input from the DOM (as you 
do) and then reinsert it at the same spot, it's not inside the form so it 
won't be submitted with the form.

In general, if you combine invalid markup with DOM manipulation, you _will_ run 
into problems, since the parser will rearrange things to create a reasonable DOM 
out of the junk that's fed into it

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


Re: How to send a click to Submit button belong to post form?

2005-03-07 Thread Boris Zbarsky
Tomasz Pyra wrote:
Thx for help.
Do you know any workaround for such operations on broken tree?
Using non-broken markup is the only one, really
-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: nsEmbedCID.h created

2005-03-07 Thread Boris Zbarsky
Christian Biesinger wrote:
Can people think of other contractids that it would make sense to add 
to this file, offhand?
Helper app dialog and progress dialog?
Those don't actually promise any frozen interfaces, so there's nothing I could 
say about them in this file (which is for frozen contracts, since it's part of 
the SDK).

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


Re: How to save DOM tree into plain HTML file?

2005-03-06 Thread Boris Zbarsky
Tomasz Pyra wrote:
How to save DOM tree into plain HTML file?
Is there such function in mozilla?
Or maybe you can send me function doing that?
See nsIWebBrowserPersist.
-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: Proposed freeze for nsIWebNavigationInfo interface

2005-03-06 Thread Boris Zbarsky
Doug Turner wrote:
It would be nice to know, in the idl, how this interface is expected to 
be used.  For example, do you QI to this interfaces from another object, 
or is the embedder expected to just get service.
That's not something that belongs in the idl, really.  At least not as I 
understand our policy regarding specifying what things are and are not services 
in the idl.  We have a serious problem with having no place to document such 
information...  I suppose I could put it in the idl for lack of other places.  :(

Note that I did document the contractid for the service which implements this 
interface at 
http://lxr.mozilla.org/seamonkey/source/docshell/build/nsDocShellCID.h#44 and I 
will likely move that into nsEmbedCID.h if/when this interface is frozen.

I actually hate the name of this interface if it were to be frozen as 
is.
I'm not too fond of it either.  Please suggest a better name if you can!  This 
one was all I could come up with.  :(

Instead it really is an interfaces that tells you if a MIME type is supported.
Right.  Whether it's supported depends on internal state of the 
nsIWebNavigation, in general, but other than that no other information is being 
exposed...

Thanks for the feedback, Doug!
-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


nsEmbedCID.h created

2005-03-06 Thread Boris Zbarsky
We now have an nsEmebedCID.h header in the SDK.  It #defines and documents 
embedding-related contractids.  At the moment, that's just the web browser 
contractid (and the documentation only refers to the parts of the contract that 
are already frozen; as more of it gets frozen I will expand the documentation 
accordingly).

Can people think of other contractids that it would make sense to add to this 
file, offhand?

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


Re: nsEmbedCID.h created

2005-03-06 Thread Boris Zbarsky
Boris Zbarsky wrote:
We now have an nsEmebedCID.h header in the SDK.
nsEmbedCID.h, of course
-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: nsEmbedCID.h created

2005-03-06 Thread Boris Zbarsky
Darin Fisher wrote:
The WindowWatcher and PromptService come to mind.
Ugh.  WindowWatcher has the contract in nsIWindowWatcher.idl (and also has a 
random IID define there, in addition to the normal one).  Given that this is 
frozen, should I remove it from there?  Or just also put it in nsEmbedCID.h?

I've filed bug 285080 to track this...
-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: How to send a click to Submit button belong to post form?

2005-03-03 Thread Boris Zbarsky
Tomasz Pyra wrote:
I took nsIDOMHTMLFormElement, and called method Submit().
Result was just like before - no data was sent to server.
What does the form tag look like?
-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: How to send a click to Submit button belong to post form?

2005-03-03 Thread Boris Zbarsky
The following testcase worksforme:
html
form name=wyszukaj 
action=http://www.uml.lodz.pl/indeksik.php3?menu2=11zapytanie=11,\
45 method=post
  input size=10 name=szukaj value=wyborynbsp;nbsp;input type=submit
   value=Szukaj
/form
script
function foo() {
  document.getElementsByTagName(input)[1].click();
}
/script

input type=button onclick=foo() value=Click here to call click()
/html
So what's special about this page that makes it fail, exactly?  Could the 
mis-nesting of the form in a table be a problem?

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


Re: How to send a click to Submit button belong to post form?

2005-03-03 Thread Boris Zbarsky
Actually, this worksforme as well:
html
table
form name=wyszukaj 
action=http://www.uml.lodz.pl/indeksik.php3?menu2=11zapytanie=11,\
45 method=post
  trtdinput size=10 name=szukaj value=wyborynbsp;nbsp;input 
type=submit \
value=Szukaj/td/tr
/form
/table
script
function foo() {
  document.getElementsByTagName(input)[1].click();
}
/script

input type=button onclick=foo() value=Click here to call click()
/html
So does copying the form off the site...
Do you have a testcase actually showing the problem?
-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Proposed freeze for nsIWebNavigationInfo interface

2005-03-03 Thread Boris Zbarsky
I'd like to work on freezing the (somewhat new) nsIWebNavigationInfo interface 
for 1.8.

The interface is at 
http://lxr.mozilla.org/seamonkey/source/docshell/base/nsIWebNavigationInfo.idl 
and I would very much appreciate feedback from embeddors on it (since this is 
primarily designed to be an interface for embeddors to query the capabilities of 
a Gecko instance).

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


Re: How to retrieve the DOM Tree ?

2005-03-01 Thread Boris Zbarsky
CHEN Benfeng wrote:
I want to use Gecko's HTML parser to parse a HTML file and get the DOM Tree 
as output.  Which API should I look at ?
There is currently no reasonable API to the HTML parser
-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: Get POST body from Embedding App?

2005-03-01 Thread Boris Zbarsky
edburns wrote:
But I'm finding that avail is always 0, even when I know there is a
post body.
Isn't that because the stream has been read by then?  Would rewinding it 
work?
-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: ASSERTION: How'd we get a floated inline frame?

2005-02-27 Thread Boris Zbarsky
Tom Copeland wrote:
I'm getting a ASSERTION: How'd we get a floated inline frame? message
from a small embedded Mozilla program...
What webpage are you loading when you get this assert?  Do you get the same 
assert in a debug Mozilla on the same page (I would hope that you do...).

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


Re: ASSERTION: How'd we get a floated inline frame?

2005-02-27 Thread Boris Zbarsky
Tom Copeland wrote:
I'm loading a simple .swf file, so the Flash plugin is rendering it...
here's the .swf file:
http://infoether.com/~tom/test.swf
You're loading that directly in the browser?  That _really_ shouldn't be 
triggering that assert...

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


Re: How to determine is every frame loaded?

2005-01-24 Thread Boris Zbarsky
Mikkel Blann wrote:
I can see now that nsIWebProgressListener.idl has been updated with a
substantial amount of documentation since the 1.7 release, which is what I'm
still working on. Thanks for that! It was rather difficult to guess which
states meant what in connection with other states... There's still room for 
improvement in the user friendlyness department though :)
Yeah, we actually wrote some docs for it when we froze it... ;)
Which parts could use better documentation?  We'd be perfectly happy to make the 
documentation clearer as needed.

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


Re: How to determine is every frame loaded?

2005-01-19 Thread Boris Zbarsky
Mikkel Blann wrote:
You just have to check in OnStateChange, whether the nsIDOMWindow that 
finished loading is the top nsIDOMWindow!
That actually doesn't work right, for cases when a subframe is being navigated 
in after the page has finished loading.

The thing to look for is a STATE_STOP with STATE_IS_NETWORK set.  Per the 
documentation on nsIWebProgressListener, this should be what you want in this case.

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


Re: Mozilla render without a native window

2005-01-19 Thread Boris Zbarsky
Rémy Deslignes wrote:
Does anybody knows where shall I begin to investigate ( I am not asking 
for a complete-C++-MSVC-project-that-runs-on-any-platform, but I just 
need to know if this is feasible and where I shall start my 
investigations ;-) )
See my post from Jan 13 with the subject Re: off-screen rendering (that old 
chestnut).

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


Re: Tag from page

2005-01-16 Thread Boris Zbarsky
cbull wrote:
Could you give me a clue at which interfaces I should look at.
Especially these linking visual elements with document structure.
Isn't it sufficient to just catch the click events generated when a user clicks 
on the page?  Those have a .target property that gives you the DOM node clicked on.

That's certainly what DOM inspector does.
-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: Tag from page

2005-01-16 Thread Boris Zbarsky
cbull wrote:
Please, I'm a newbie to this topic. Could you give me a link to the
documentation I should look at?
http://w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html
-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: off-screen rendering (that old chestnut)

2005-01-13 Thread Boris Zbarsky
Sam Deane wrote:
That answer seems to imply that on Windows at least, the content is
double-buffered, including that rendered by plugins. Or did I
misinterpret your answer?
Well.. my answer was deliberately vague as to handling of plugins on Windows, 
because I simply don't know whether that ends up double-buffered or not for 
non-windowless plugins.

If it's double buffered then I'm presuming everything is rendered into
some sort of offscreen bitmap or drawing context which is then blitted
to the screen. In which case it ought to be relatively easy to hook to
the window update code and do something else with the buffer, instead
of (or as well as) blitting it to the window.
True.  People who ask about rendering to memory usually want to do so without 
actually showing any windows on screen (and possibly without the ability to show 
such windows, eg a Unix box with no X server running).  Which is a little more 
involved than what it sounds like you need.

For our purposes we could probably hack things so that they are always
in windowless mode, as long as the plugin supports it. I'm new to all
this so I don't know - is it likely that most of the mainstream plugins
will support it?
The problem is that the plugin is what decides whether it's in windowless mode 
or not (and renders differently based on that).  At least that's my 
understanding of the situation.

That said, Flash and Java support windowless mode last I checked.  Don't know 
about others.

Would you have any idea who I could talk to about that floating code,
or where I could find it?
[EMAIL PROTECTED] is the author; he probably has it sitting about somewhere.
-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: How to follow link (A)?

2005-01-13 Thread Boris Zbarsky
Tomasz Pyra wrote:
(linkHTMLElement is my a tag - type nsIDOMHTMLAnchorElement)

nsCOMPtrnsIDOMEventTarget evtTarget= do_QueryInterface(OwnerDoc,result);
You want the linkHTMLElement to be the event target, not the owner document.
-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: How to follow link (A)?

2005-01-12 Thread Boris Zbarsky
Tomasz Pyra wrote:
How to tell browser to follow given (nsIDOMHTMLAnchorElement) link? (act 
just like when user do mouseclick on that link).

Now I doing GetHref() on that nsIDOMHTMLAnchorElement, and then 
OpenURL() of link's URL.

It works, but there is problem when there are frames on page ( target 
URL is loading on whole screen, instead of loading it only into properly 
frame).
You could dispatch a click event to the anchor  As long as the event is 
trusted (which it should be if dispatched from privileged JS or from C++), that 
will work.

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


Re: off-screen rendering (that old chestnut)

2005-01-11 Thread Boris Zbarsky
Sam Deane wrote:
I'm not clear from the discussions that I've read whether the Gecko
rendering is double-buffered, or whether it just splashes things
straight into a window.
It's usually double-buffered, at least for painting of the non-plugin content. 
 The one exception, I believe, is on Mac on pages where plugins are present. 
Mac plugins apparently throw a fit when you try to double-buffer those pages...

In particular, I'm wondering what happens with
plug-ins - do they get rendered 'directly' into the window for
efficiency and/or compliance with the underlying APIs that they call
(again, Quicktime, Flash etc)?
This may depend on whether the plugin is in windowless mode or not... :(
I've seen references to buffering / offscreen rendering in the
archives along the lines of it doesn't do it yet, but they are all
fairly old so I'm crossing my fingers and hoping that they might now
be out of date.
No, those are up to date.  There's code floating about to do it, but it's not in 
the tree yet

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


Re: Mozilla vs Firefox - what is smaller and better?

2005-01-06 Thread Boris Zbarsky
Tomasz Pyra wrote:
Is there big differences between embedding Mozilla and Firefox?
Last I checked, embedding Firefox in its current state was not quite supported, 
pending the libxul stuff being finished up But I could be wrong about this.

I see that the ./components directory contains 16MB of data ( I throw 
out not necessary ones and in my application I still have 9.9MB of data 
there ), but FireFox's ./components is only 1.6MB.

But FireFox.exe is 6MB file, and mozilla.exe is only 160kb?
Where is source of this differences?
Firefox is statically linked.  For embedding purposes, if you're not planning to 
reuse the XUL UI, the two should end up being equivalent once libxul is done.

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


Webshell/docshell API change

2005-01-05 Thread Boris Zbarsky
Starting with 1.8a6, the nsIWebShell and nsIWebShellContainer interfaces no 
longer exist.  They had been deprecated for years, so I certainly hope that no 
one was using them, but if you were you should be able to use nsIDocShell 
instead.  See bug 273319 for the patch and discussion.

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


Docshell/docloader/uriloader api changes

2004-12-08 Thread Boris Zbarsky
I just checked in the patch for bug 272471.  This has the following effects:
1)  It is not longer possible to call SetParent() on an nsIDocShellTreeItem.
The only methods that can modify the docshell tree are now addChild and
removeChild (both on nsIDocShellTreeNode).  References to children are now
weak, so children only live as long as something outside the tree holds a
reference to them.
2)  When trying to add a child to an nsIDocShellTreeNode, it will actually have
to be a docshell (there are other nsIDocShellTreeItems around, but they are
no longer allowed in the docshell tree).
3)  nsIDocumentLoader lost some methods (destroy() is gone, the container
property is now read-only, createDocumentLoader() is gone).
4)  nsIURILoader lost the getDocumentLoaderForContext method
I plan to make other changes to docshell/webshell/docloader/uriloader in the 
near future, roughly as follows:

A)  Remove nsIWebShell (bug 273319)
B)  Remove most of what's left of nsIDocumentLoader (this is still not
completely decided; see bug 273760).
C)  Work on documenting nsIURILoader, and in particular the context argument
to openURI method is expected to be.
D)  Modifications to the nsIDocShell* interfaces so we can work on freezing
them.
-Boris
___
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: How to get the image Background

2004-12-03 Thread Boris Zbarsky
Béatrice Philippe wrote:
i tried getComputedStyle in C++ for each node of the DOM.
i'm surprised, i never get the background images (wich are declared in a css
style rule for DIV tags) nor the background color.
Odd.  Computed style works over here.. Are you passing in nodes that are 
actually in the document?

Here is my sample code:
That code looks like it should work, at first glance... (though you could just 
get the property value as a string without doing the CSSValue stuff yourself).

Am i missing something ? is there any inheritance somewhere ?
Backgrounds are not inherited.  So you have to be checking computed style on the 
node that has the background set...

-Boris
___
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding


Question on nsWebBrowser and nsIDocShellTreeItem

2004-11-22 Thread Boris Zbarsky
I just noticed that nsIWebBrowser implements nsIDocShellTreeItem.  Does anyone 
know why?  More to the point, does anyone know whether its mParent is ever set, 
and if so, where?

The reason I ask is that having a SetParent on nsIDocShellTreeItem is rather 
broken-by-design (it allows creatiion of a malformed docshell tree).  As a 
result, I'd like to make the parent attribute readonly (and have parents be set 
either at creation time or through calling AddChild/RemoveChild).

-Boris
___
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: Drawing lines on a page

2004-10-21 Thread Boris Zbarsky
Gervase Markham wrote:
The DOM Inspector blink function uses a special border built into XUL 
boxes, I believe.
Actually, no.  DOM inspector grabs the rendering context (or rather tries to) 
and paints the lines directly to it.

Sometimes it grabs the wrong one, of course, and then the lines can end up 
getting hidden by other widgets on the page...

-Boris
___
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: GtkMozEmbed local file and baseURI

2004-09-22 Thread Boris Zbarsky
Gregory, S. wrote:
I would expect the embedding library to resolve these references using
the baseURI.
That's exactly what's being done.  Since the relative URI starts with a '/', 
everything in the base up to the server name is stripped off and replaced with 
the relative URI.  This is how URI resolution is defined in the relevant RFC...

My question is, without making a symbolic link (/home/html/images -
/images), how
can I have the embedding library resolve absolute references with
respect to baseURI.
It sounds like you want some sort of special URI-resolution behavior that 
violates the relevant spec.  There's no easy way to force this.

-Boris
___
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: Getting notification for nsIStreamListener

2004-09-22 Thread Boris Zbarsky
Srinivasa Raghavan wrote:
I had implemented nsIStreamListener. What should i do to get the 
notification to OnStartRequest and OnStopRequest ?
You need to pass your stream listener to the AsyncOpen() call for the channel 
you're trying to listen to.

-Boris
___
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: saveDocument convert copy;

2004-09-13 Thread Boris Zbarsky
Henrik Gemal wrote:
Basiclly I just wanna save the original document. But I'm just not sure 
how to do this the best way. I dont want to modify the document in any way.
Then you want saveURI, not saveDocument.  saveDocument just gets the document 
object, in whatever state it's in, so it can't possibly save the original 
document.

-Boris
___
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: contentID()

2004-07-23 Thread Boris Zbarsky
Mozilla.embedding wrote:
i'm surprised : when i'm walking through the content tree (or dom, it's the
same), i can obtain content ids
incremented exept for text contents whose id = 0.
Does anyone know why ?
Content IDs in general are a hack slated to go away.  They're used for 
accessibility and frame state restoration at the moment, and neither applies to 
text content.

-Boris
___
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: why nsIWebNavigation::GetDocument( ) always NULL?

2004-07-19 Thread Boris Zbarsky
yueweng wrote:
  webNav-GetDocument(getter_AddRefs(domDocument));
What's the return value of this call?
-Boris
___
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: Render to bitmap?

2004-07-19 Thread Boris Zbarsky
Steve Sloan wrote:
mozilla to render to a bitap instead of a window (a.k.a. a screenshot), 
and notify me (in some way) when the page changes
There's some work on this going on, but it's not in the tree yet...
-Boris
___
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: :-(

2004-07-14 Thread Boris Zbarsky
L.Kovári wrote:
When I start the mozilla emit this errors:
All the stuff you listed is just standard startup output for a debug build, as 
far as I can tell

-Boris
___
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: is the Mozilla activeX control a complete browser?

2004-05-23 Thread Boris Zbarsky
Michael Lyubomirskiy wrote:
He seems to say again and again that this
control encapsulates the Gecko engine. How about other components? Does it
encapsulate Javascript processing?
That's part of Gecko, yes.  So's session history.  Global history is not, but 
hooks for notifying the embedding app when things should be added to history are.

Other essential browser features?
Depends on what you consider essential.  ;)  If it has to do with actual display 
of webpages, it's in there.

-Boris
___
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: De-COM izing of Mozilla

2004-05-14 Thread Boris Zbarsky
C.N.Medappa wrote:
1) nsIDOMWindowInternal to get nsPIDOMWindow ,
Yeah, nsPIDOMWindow is a private interface (hence the P).

2) nsPIDOMWindow is used to get nsIDocShell and nsIChromeEventHandler
Because you need to set the nsIChromeEventHandler and the only way to do it is 
via nsIDocShell?

Or something else?

Ideally, nsIDocShell would get cleaned up and split into public (freezable) 
parts and a private (most of it, actually) non-COM interface  In fact, we're 
hoping to start working on that soon, so feedback on what parts of the 
interfaces are needed by embeddors right now and why would be much appreciated.

Is there any other way i can reach nsIChromeEventHandler and nsIDocShell
without nsPIDOMWindow
Yeah.  You can QI the window to nsIInterfaceRequestor and ask for an 
nsIWebNavigation, then QI that to an nsIDocShell.

A little silly (and very opaque!), but again, nsIDocShell is not really supposed 
to be a public api... :(

-Boris
___
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: De-COM izing of Mozilla

2004-05-14 Thread Boris Zbarsky
C.N.Medappa wrote:
Forgot one more place i use nsPIDOMWindow  is to get nsIFocusController
Again, that's not really an embedding interface.  If you need functionality from 
it, please let us know what you need and why and we'll try to expose what you 
need in a sane way.

-Boris
___
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: De-COM izing of Mozilla

2004-05-10 Thread Boris Zbarsky
C.N.Medappa wrote:
1) Why are some interfaces De-COMized ?
Performance improvement and footprint reduction, as well as code readability.

2) What are the Intefaces that will be De-COMized in future ?
Pretty much anything that's a layout/content/widget (and maybe gfx) header and 
is a .h instead of .idl is fair game.  The actual criterion that's used is that 
if it's basically a private layout/content header (some of these interfaces 
shouldn't even be named nsIwhatever), it should be deCOMtaminated.

Since i am using non-geko-sdk interfaces i need to modify my source for each
release of Mozilla.
Why do you need to use non-sdk interfaces?  Especially ones subject to 
deCOMtamination?  We should talk; perhaps we need to expose the functionality 
you need in some other way.

-Boris
___
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding


  1   2   >