ISimpleDOMNode->get_innerHTML() not working

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

ISimpleDOMNode->get_innerHTML() not working

tarun sharma-3
Hi All,
 
In my application i want to get the url nad html dom of a mozilla browser window.
I am getting the url using ISimpleDOMDocument->get_URL( ).
I am getting ISimpleDOMNode interface also but when i use get_innerHTML( ) it gives me E_FAIL. Can anybody give any help on this?
 
I checked the mimrtype is "text/HTML".


 



TARUN SHARMA


     
_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility
Reply | Threaded
Open this post in threaded view
|

Re: ISimpleDOMNode->get_innerHTML() not working

tanuclassic
I am using the following code:


ISimpleDOMDocument *pSimpleDOMDocument = NULL;
HRESULT hr;
hr =
AccessibleObjectFromWindow(hwnd,OBJID_CLIENT,IID_ISimpleDOMDocument,
(void**)&spDoc);
hr = spDoc->get_URL(&docUrl);


ISimpleDOMNode *pSimpleDOMNode  = NULL;
hr = AccessibleObjectFromWindow(hwnd,OBJID_CLIENT ,IID_ISimpleDOMNode,
(void**)&pSimpleDOMNode  );
if ( SUCCEEDED(hr) )
hr = pSimpleDOMNode  ->get_innerHTML(&innerHtml);

it fails in the last line. Why???

_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility
Reply | Threaded
Open this post in threaded view
|

Re: ISimpleDOMNode->get_innerHTML() not working

Steve Lee-3
 2008/9/30  <[hidden email]>:
> hr = pSimpleDOMNode  ->get_innerHTML(&innerHtml);
>
> it fails in the last line. Why???

What's the error?

A random observation:

in the IDL http://mxr.mozilla.org/firefox/source/accessible/public/msaa/ISimpleDOMNode.idl
its declared as a returning a BSTR but you don't show your declaration
of the receiving variable, innerHtml.

BSTRs are not the same as native C strings and I can't remember if
there are implicit conversions that work in the direction you are
asking.

Steve
_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility
Reply | Threaded
Open this post in threaded view
|

Re: ISimpleDOMNode->get_innerHTML() not working

Aaron Leventhal-3
In reply to this post by tarun sharma-3
Also, what version are you using. We have some issues with
ISimpleDOMNode right now. It might be good to try with plain Firefox 3
(not 3.01, 3.02, 3.03, trunk, etc.)

- Aaron

On 9/30/2008 7:23 AM, tarun sharma wrote:

> Hi All,
>
> In my application i want to get the url nad html dom of a mozilla browser window.
> I am getting the url using ISimpleDOMDocument->get_URL( ).
> I am getting ISimpleDOMNode interface also but when i use get_innerHTML( ) it gives me E_FAIL. Can anybody give any help on this?
>
> I checked the mimrtype is "text/HTML".
>
>
>
>
>
>
> TARUN SHARMA
>
>
>

_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility
Reply | Threaded
Open this post in threaded view
|

Re: ISimpleDOMNode->get_innerHTML() not working

tanuclassic
The receiving variables, docUrl & innerHtml are of type
ATL ::CComBSTR.
And i am using version 3.03.
Should i switch to version 3 or anything else could be the solution??
_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility
Reply | Threaded
Open this post in threaded view
|

Re: ISimpleDOMNode->get_innerHTML() not working

Aaron Leventhal-3
Ah, try version 3. I think you might have simply run into a bug.

Let me know.

- Aaron

On 9/30/2008 4:14 PM, [hidden email] wrote:
> The receiving variables, docUrl&  innerHtml are of type
> ATL ::CComBSTR.
> And i am using version 3.03.
> Should i switch to version 3 or anything else could be the solution??

_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility
Reply | Threaded
Open this post in threaded view
|

Re: ISimpleDOMNode->get_innerHTML() not working

Alexander Surkov
On Sep 30, 11:42 pm, Aaron Leventhal <[hidden email]>
wrote:

> Ah, try version 3. I think you might have simply run into a bug.
>
> Let me know.
>
> - Aaron
>
> On 9/30/2008 4:14 PM, [hidden email] wrote:
>
> > The receiving variables, docUrl&  innerHtml are of type
> > ATL ::CComBSTR.
> > And i am using version 3.03.
> > Should i switch to version 3 or anything else could be the solution??

I'm sure it's still presented in Firefox 3. The problem is innerHTML
is called on document accessible. What kind of HTML do you expect do
get? Should we return all content of "html" element or "body" element
only?

Alex.
_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility
Reply | Threaded
Open this post in threaded view
|

Re: ISimpleDOMNode->get_innerHTML() not working

Aaron Leventhal-3
Hi Alex,

I think all of HTML, because they can always decide to trim to body only
if they want. Yet, they might want some of the info in the <head>

- Aaron

On 9/30/2008 6:59 PM, Alexander Surkov wrote:

> On Sep 30, 11:42 pm, Aaron Leventhal<[hidden email]>
> wrote:
>> Ah, try version 3. I think you might have simply run into a bug.
>>
>> Let me know.
>>
>> - Aaron
>>
>> On 9/30/2008 4:14 PM, [hidden email] wrote:
>>
>>> The receiving variables, docUrl&    innerHtml are of type
>>> ATL ::CComBSTR.
>>> And i am using version 3.03.
>>> Should i switch to version 3 or anything else could be the solution??
>
> I'm sure it's still presented in Firefox 3. The problem is innerHTML
> is called on document accessible. What kind of HTML do you expect do
> get? Should we return all content of "html" element or "body" element
> only?
>
> Alex.

_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility
Reply | Threaded
Open this post in threaded view
|

Re: ISimpleDOMNode->get_innerHTML() not working

Aaron Leventhal-3
In reply to this post by Alexander Surkov
Actually also, can't they use ISimpleDOMNode to navigate from the doc
accessible to the <html> and then to the <head> or <body> and get the
innerHTML from there?

- Aaron


On 9/30/2008 6:59 PM, Alexander Surkov wrote:

> On Sep 30, 11:42 pm, Aaron Leventhal<[hidden email]>
> wrote:
>> Ah, try version 3. I think you might have simply run into a bug.
>>
>> Let me know.
>>
>> - Aaron
>>
>> On 9/30/2008 4:14 PM, [hidden email] wrote:
>>
>>> The receiving variables, docUrl&    innerHtml are of type
>>> ATL ::CComBSTR.
>>> And i am using version 3.03.
>>> Should i switch to version 3 or anything else could be the solution??
>
> I'm sure it's still presented in Firefox 3. The problem is innerHTML
> is called on document accessible. What kind of HTML do you expect do
> get? Should we return all content of "html" element or "body" element
> only?
>
> Alex.

_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility
Reply | Threaded
Open this post in threaded view
|

Re: ISimpleDOMNode->get_innerHTML() not working

tanuclassic
Well i need the innerHTML of the body element.

I want to do something like this what i can do in windows

Get a "IHTMLDocument2" object, then do get_body(IHTMLElement **p).
>From this "IHTMLElement" object i can do get_innerHTML(BSTR *p).
_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility
Reply | Threaded
Open this post in threaded view
|

Re: ISimpleDOMNode->get_innerHTML() not working

Alexander Surkov
In reply to this post by Aaron Leventhal-3
On Oct 1, 2:39 am, Aaron Leventhal <[hidden email]> wrote:

> Hi Alex,
>
> I think all of HTML, because they can always decide to trim to body only
> if they want. Yet, they might want some of the info in the <head>
>
> - Aaron
>
> On 9/30/2008 6:59 PM, Alexander Surkov wrote:
>
> > On Sep 30, 11:42 pm, Aaron Leventhal<[hidden email]>
> > wrote:
> >> Ah, try version 3. I think you might have simply run into a bug.
>
> >> Let me know.
>
> >> - Aaron
>
> >> On 9/30/2008 4:14 PM, [hidden email] wrote:
>
> >>> The receiving variables, docUrl&    innerHtml are of type
> >>> ATL ::CComBSTR.
> >>> And i am using version 3.03.
> >>> Should i switch to version 3 or anything else could be the solution??
>
> > I'm sure it's still presented in Firefox 3. The problem is innerHTML
> > is called on document accessible. What kind of HTML do you expect do
> > get? Should we return all content of "html" element or "body" element
> > only?
>
> > Alex.

Yes, I believe it should be possible to get head/body access nodes
from document accessible. At least it should be possible. Therefore I
think innerHTML on document should return <html><head><body></html>
etc. Right?
_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility
Reply | Threaded
Open this post in threaded view
|

Re: ISimpleDOMNode->get_innerHTML() not working

David Bolter
Alexander Surkov wrote:

> On Oct 1, 2:39 am, Aaron Leventhal <[hidden email]> wrote:
>  
>> Hi Alex,
>>
>> I think all of HTML, because they can always decide to trim to body only
>> if they want. Yet, they might want some of the info in the <head>
>>
>> - Aaron
>>
>> On 9/30/2008 6:59 PM, Alexander Surkov wrote:
>>
>>    
>>> On Sep 30, 11:42 pm, Aaron Leventhal<[hidden email]>
>>> wrote:
>>>      
>>>> Ah, try version 3. I think you might have simply run into a bug.
>>>>        
>>>> Let me know.
>>>>        
>>>> - Aaron
>>>>        
>>>> On 9/30/2008 4:14 PM, [hidden email] wrote:
>>>>        
>>>>> The receiving variables, docUrl&    innerHtml are of type
>>>>> ATL ::CComBSTR.
>>>>> And i am using version 3.03.
>>>>> Should i switch to version 3 or anything else could be the solution??
>>>>>          
>>> I'm sure it's still presented in Firefox 3. The problem is innerHTML
>>> is called on document accessible. What kind of HTML do you expect do
>>> get? Should we return all content of "html" element or "body" element
>>> only?
>>>      
>>> Alex.
>>>      
>
> Yes, I believe it should be possible to get head/body access nodes
> from document accessible. At least it should be possible. Therefore I
> think innerHTML on document should return <html><head><body></html>
> etc. Right?
>  

I think so. I would expect to get what you have described <html>...</html>.

For reassurance see the description of the documentElement attribute of
document:
http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#i-Document

And I definitely agree with Aaron, that information in the head element
might be useful.

cheers,
David
_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility