1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
23 * Adam Lock <adamlock@netscape.com>
25 * Alternatively, the contents of this file may be used under the terms of
26 * either the GNU General Public License Version 2 or later (the "GPL"), or
27 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
42 #include "nsIDOMElement.h"
44 #include "IEHtmlElement.h"
45 #include "IEHtmlElementCollection.h"
47 #include "nsIDOMHTMLElement.h"
48 #include "nsIDOMNSHTMLElement.h"
49 #include "nsIDOM3Node.h"
50 #include "nsIDOMDocumentRange.h"
51 #include "nsIDOMRange.h"
52 #include "nsIDOMNSRange.h"
53 #include "nsIDOMDocumentFragment.h"
54 #include "nsIDocumentEncoder.h"
55 #include "nsContentCID.h"
57 CIEHtmlElement::CIEHtmlElement()
62 HRESULT
CIEHtmlElement::FinalConstruct( )
64 return CComCreator
<CComAggObject
<CIEHtmlDomNode
> >::CreateInstance(GetControllingUnknown(),
65 IID_IUnknown
, reinterpret_cast<void**>(&m_pNodeAgg
));
68 CIEHtmlElement::~CIEHtmlElement()
72 void CIEHtmlElement::FinalRelease( )
74 m_pNodeAgg
->Release();
77 HRESULT
CIEHtmlElement::GetChildren(CIEHtmlElementCollectionInstance
**ppCollection
)
79 // Validate parameters
80 if (ppCollection
== NULL
)
87 // Create a collection representing the children of this node
88 CIEHtmlElementCollectionInstance
*pCollection
= NULL
;
89 CIEHtmlElementCollection::CreateFromParentNode(this, FALSE
, (CIEHtmlElementCollection
**) &pCollection
);
92 pCollection
->AddRef();
93 *ppCollection
= pCollection
;
99 HRESULT
CIEHtmlElement::GetHtmlDomNode(CIEHtmlDomNode
**ppHtmlDomNode
)
101 if (ppHtmlDomNode
== NULL
)
103 *ppHtmlDomNode
= NULL
;
104 IHTMLDOMNode
* pHtmlNode
= NULL
;
105 // This causes an AddRef on outer unknown:
106 HRESULT hr
= m_pNodeAgg
->QueryInterface(__uuidof(IHTMLDOMNode
), (void**)&pHtmlNode
);
107 *ppHtmlDomNode
= (CIEHtmlDomNode
*)pHtmlNode
;
111 HRESULT
CIEHtmlElement::SetDOMNode(nsIDOMNode
*pDomNode
)
114 // Forward to aggregated object:
115 CIEHtmlDomNode
*pHtmlDomNode
;
116 GetHtmlDomNode(&pHtmlDomNode
);
117 HRESULT hr
= pHtmlDomNode
->SetDOMNode(pDomNode
);
118 // Release on outer unknown because GetHtmlDomNode does AddRef on it:
119 GetControllingUnknown()->Release();
123 HRESULT
CIEHtmlElement::SetParent(CNode
*pParent
)
125 CNode::SetParent(pParent
);
126 // Forward to aggregated object:
127 CIEHtmlDomNode
*pHtmlDomNode
;
128 GetHtmlDomNode(&pHtmlDomNode
);
129 HRESULT hr
= pHtmlDomNode
->SetParent(pParent
);
130 // Release on outer unknown because GetHtmlDomNode does AddRef on it:
131 GetControllingUnknown()->Release();
135 ///////////////////////////////////////////////////////////////////////////////
136 // IHTMLElement implementation
138 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::setAttribute(BSTR strAttributeName
, VARIANT AttributeValue
, LONG lFlags
)
140 if (strAttributeName
== NULL
)
145 nsCOMPtr
<nsIDOMElement
> element
= do_QueryInterface(mDOMNode
);
151 // Get the name from the BSTR
153 nsAutoString
name(OLE2W(strAttributeName
));
155 // Get the value from the variant
157 if (FAILED(vValue
.ChangeType(VT_BSTR
, &AttributeValue
)))
163 nsAutoString
value(OLE2W(vValue
.bstrVal
));
164 element
->SetAttribute(name
, value
);
169 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::getAttribute(BSTR strAttributeName
, LONG lFlags
, VARIANT __RPC_FAR
*AttributeValue
)
171 if (strAttributeName
== NULL
)
175 if (AttributeValue
== NULL
)
179 VariantInit(AttributeValue
);
181 // Get the name from the BSTR
183 nsAutoString
name(OLE2W(strAttributeName
));
185 nsCOMPtr
<nsIDOMElement
> element
= do_QueryInterface(mDOMNode
);
191 BOOL bCaseSensitive
= (lFlags
== VARIANT_TRUE
) ? TRUE
: FALSE
;
196 nsresult rv
= element
->GetAttribute(name
, value
);
197 if (NS_SUCCEEDED(rv
))
200 AttributeValue
->vt
= VT_BSTR
;
201 AttributeValue
->bstrVal
= SysAllocString(W2COLE(value
.get()));
212 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::removeAttribute(BSTR strAttributeName
, LONG lFlags
, VARIANT_BOOL __RPC_FAR
*pfSuccess
)
214 if (strAttributeName
== NULL
)
219 nsCOMPtr
<nsIDOMElement
> element
= do_QueryInterface(mDOMNode
);
225 BOOL bCaseSensitive
= (lFlags
== VARIANT_TRUE
) ? TRUE
: FALSE
;
227 // Get the name from the BSTR
229 nsAutoString
name(OLE2W(strAttributeName
));
231 // Remove the attribute
232 nsresult nr
= element
->RemoveAttribute(name
);
233 BOOL bRemoved
= (nr
== NS_OK
) ? TRUE
: FALSE
;
237 *pfSuccess
= (bRemoved
) ? VARIANT_TRUE
: VARIANT_FALSE
;
243 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_className(BSTR v
)
248 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_className(BSTR __RPC_FAR
*p
)
256 VariantInit(&vValue
);
257 BSTR bstrName
= SysAllocString(OLESTR("class"));
258 getAttribute(bstrName
, FALSE
, &vValue
);
259 SysFreeString(bstrName
);
265 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_id(BSTR v
)
267 nsCOMPtr
<nsIDOMHTMLElement
> domHtmlElmt
= do_QueryInterface(mDOMNode
);
271 nsDependentString
strID(OLE2CW(v
));
272 if (FAILED(domHtmlElmt
->SetId(strID
)))
277 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_id(BSTR __RPC_FAR
*p
)
285 VariantInit(&vValue
);
286 BSTR bstrName
= SysAllocString(OLESTR("id"));
287 getAttribute(bstrName
, FALSE
, &vValue
);
288 SysFreeString(bstrName
);
294 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_tagName(BSTR __RPC_FAR
*p
)
301 nsCOMPtr
<nsIDOMElement
> element
= do_QueryInterface(mDOMNode
);
307 nsAutoString tagName
;
308 element
->GetTagName(tagName
);
311 *p
= SysAllocString(W2COLE(tagName
.get()));
315 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_parentElement(IHTMLElement __RPC_FAR
*__RPC_FAR
*p
)
325 CIEHtmlElement
*pElt
= static_cast<CIEHtmlElement
*>(mParent
);
326 pElt
->QueryInterface(IID_IHTMLElement
, (void **) p
);
330 nsCOMPtr
<nsIDOMNode
> parentNode
;
331 mDOMNode
->GetParentNode(getter_AddRefs(parentNode
));
332 nsCOMPtr
<nsIDOMElement
> domElement
= do_QueryInterface(parentNode
);
335 CComPtr
<IUnknown
> pNode
;
336 HRESULT hr
= CIEHtmlDomNode::FindOrCreateFromDOMNode(parentNode
, &pNode
);
339 if (FAILED(pNode
->QueryInterface(IID_IHTMLElement
, (void **) p
)))
347 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_style(IHTMLStyle __RPC_FAR
*__RPC_FAR
*p
)
352 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_onhelp(VARIANT v
)
357 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_onhelp(VARIANT __RPC_FAR
*p
)
362 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_onclick(VARIANT v
)
367 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_onclick(VARIANT __RPC_FAR
*p
)
372 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_ondblclick(VARIANT v
)
377 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_ondblclick(VARIANT __RPC_FAR
*p
)
382 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_onkeydown(VARIANT v
)
387 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_onkeydown(VARIANT __RPC_FAR
*p
)
392 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_onkeyup(VARIANT v
)
397 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_onkeyup(VARIANT __RPC_FAR
*p
)
402 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_onkeypress(VARIANT v
)
407 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_onkeypress(VARIANT __RPC_FAR
*p
)
412 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_onmouseout(VARIANT v
)
417 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_onmouseout(VARIANT __RPC_FAR
*p
)
422 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_onmouseover(VARIANT v
)
427 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_onmouseover(VARIANT __RPC_FAR
*p
)
432 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_onmousemove(VARIANT v
)
437 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_onmousemove(VARIANT __RPC_FAR
*p
)
442 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_onmousedown(VARIANT v
)
447 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_onmousedown(VARIANT __RPC_FAR
*p
)
452 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_onmouseup(VARIANT v
)
457 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_onmouseup(VARIANT __RPC_FAR
*p
)
462 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_document(IDispatch __RPC_FAR
*__RPC_FAR
*p
)
467 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_title(BSTR v
)
472 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_title(BSTR __RPC_FAR
*p
)
477 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_language(BSTR v
)
482 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_language(BSTR __RPC_FAR
*p
)
487 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_onselectstart(VARIANT v
)
492 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_onselectstart(VARIANT __RPC_FAR
*p
)
497 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::scrollIntoView(VARIANT varargStart
)
502 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::contains(IHTMLElement __RPC_FAR
*pChild
, VARIANT_BOOL __RPC_FAR
*pfResult
)
507 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_sourceIndex(long __RPC_FAR
*p
)
512 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_recordNumber(VARIANT __RPC_FAR
*p
)
517 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_lang(BSTR v
)
522 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_lang(BSTR __RPC_FAR
*p
)
527 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_offsetLeft(long __RPC_FAR
*p
)
529 nsCOMPtr
<nsIDOMNSHTMLElement
> nodeAsHTMLElement
= do_QueryInterface(mDOMNode
);
530 if (!nodeAsHTMLElement
)
532 return E_NOINTERFACE
;
536 nodeAsHTMLElement
->GetOffsetLeft(&nData
);
541 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_offsetTop(long __RPC_FAR
*p
)
543 nsCOMPtr
<nsIDOMNSHTMLElement
> nodeAsHTMLElement
= do_QueryInterface(mDOMNode
);
544 if (!nodeAsHTMLElement
)
546 return E_NOINTERFACE
;
550 nodeAsHTMLElement
->GetOffsetTop(&nData
);
555 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_offsetWidth(long __RPC_FAR
*p
)
557 nsCOMPtr
<nsIDOMNSHTMLElement
> nodeAsHTMLElement
= do_QueryInterface(mDOMNode
);
558 if (!nodeAsHTMLElement
)
560 return E_NOINTERFACE
;
564 nodeAsHTMLElement
->GetOffsetWidth(&nData
);
569 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_offsetHeight(long __RPC_FAR
*p
)
571 nsCOMPtr
<nsIDOMNSHTMLElement
> nodeAsHTMLElement
= do_QueryInterface(mDOMNode
);
572 if (!nodeAsHTMLElement
)
574 return E_NOINTERFACE
;
578 nodeAsHTMLElement
->GetOffsetHeight(&nData
);
583 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_offsetParent(IHTMLElement __RPC_FAR
*__RPC_FAR
*p
)
588 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_innerHTML(BSTR v
)
590 nsCOMPtr
<nsIDOMNSHTMLElement
> elementHTML
= do_QueryInterface(mDOMNode
);
597 nsAutoString
innerHTML(OLE2W(v
));
598 elementHTML
->SetInnerHTML(innerHTML
);
602 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_innerHTML(BSTR __RPC_FAR
*p
)
604 nsCOMPtr
<nsIDOMNSHTMLElement
> elementHTML
= do_QueryInterface(mDOMNode
);
610 nsAutoString innerHTML
;
611 elementHTML
->GetInnerHTML(innerHTML
);
614 *p
= SysAllocString(W2COLE(innerHTML
.get()));
618 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_innerText(BSTR v
)
620 nsCOMPtr
<nsIDOM3Node
> node
= do_QueryInterface(mDOMNode
);
627 nsAutoString
innerText(OLE2W(v
));
628 node
->SetTextContent(innerText
);
633 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_innerText(BSTR __RPC_FAR
*p
)
635 nsCOMPtr
<nsIDOM3Node
> node
= do_QueryInterface(mDOMNode
);
641 nsAutoString innerText
;
642 node
->GetTextContent(innerText
);
645 *p
= SysAllocString(W2COLE(innerText
.get()));
649 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_outerHTML(BSTR v
)
652 nsCOMPtr
<nsIDOMDocument
> domDoc
;
653 nsCOMPtr
<nsIDOMRange
> domRange
;
654 nsCOMPtr
<nsIDOMDocumentFragment
> domDocFragment
;
656 mDOMNode
->GetOwnerDocument(getter_AddRefs(domDoc
));
657 nsCOMPtr
<nsIDOMDocumentRange
> domDocRange
= do_QueryInterface(domDoc
);
660 domDocRange
->CreateRange(getter_AddRefs(domRange
));
663 if (domRange
->SetStartBefore(mDOMNode
))
665 if (domRange
->DeleteContents())
667 nsAutoString
outerHTML(OLE2W(v
));
668 nsCOMPtr
<nsIDOMNSRange
> domNSRange
= do_QueryInterface(domRange
);
669 rv
= domNSRange
->CreateContextualFragment(outerHTML
, getter_AddRefs(domDocFragment
));
672 nsCOMPtr
<nsIDOMNode
> parentNode
;
673 mDOMNode
->GetParentNode(getter_AddRefs(parentNode
));
674 nsCOMPtr
<nsIDOMNode
> domNode
;
675 parentNode
->ReplaceChild(domDocFragment
, mDOMNode
, getter_AddRefs(domNode
));
680 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_outerHTML(BSTR __RPC_FAR
*p
)
690 nsAutoString outerHTML
;
691 nsCOMPtr
<nsIDOMDocument
> domDoc
;
692 nsCOMPtr
<nsIDocumentEncoder
> docEncoder
;
693 nsCOMPtr
<nsIDOMRange
> domRange
;
695 mDOMNode
->GetOwnerDocument(getter_AddRefs(domDoc
));
699 docEncoder
= do_CreateInstance(NS_DOC_ENCODER_CONTRACTID_BASE
"text/html");
700 NS_ENSURE_TRUE(docEncoder
, NS_ERROR_FAILURE
);
701 docEncoder
->Init(domDoc
, NS_LITERAL_STRING("text/html"),
702 nsIDocumentEncoder::OutputEncodeBasicEntities
);
703 nsCOMPtr
<nsIDOMDocumentRange
> domDocRange
= do_QueryInterface(domDoc
);
706 domDocRange
->CreateRange(getter_AddRefs(domRange
));
709 rv
= domRange
->SelectNode(mDOMNode
);
710 NS_ENSURE_SUCCESS(rv
, rv
);
711 docEncoder
->SetRange(domRange
);
712 docEncoder
->EncodeToString(outerHTML
);
715 *p
= SysAllocString(W2COLE(outerHTML
.get()));
720 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_outerText(BSTR v
)
725 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_outerText(BSTR __RPC_FAR
*p
)
730 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::insertAdjacentHTML(BSTR where
, BSTR html
)
733 nsCOMPtr
<nsIDOMDocument
> domDoc
;
734 nsCOMPtr
<nsIDOMRange
> domRange
;
735 nsCOMPtr
<nsIDOMDocumentFragment
> domDocFragment
;
737 NS_ASSERTION(mDOMNode
, "");
739 mDOMNode
->GetOwnerDocument(getter_AddRefs(domDoc
));
740 nsCOMPtr
<nsIDOMDocumentRange
> domDocRange
= do_QueryInterface(domDoc
);
743 domDocRange
->CreateRange(getter_AddRefs(domRange
));
746 // Must position range first before calling CreateContextualFragment:
747 if (domRange
->SetStartBefore(mDOMNode
))
750 // Create doc fragment:
751 nsDependentString
strAdjacentHTML(OLE2CW(html
));
752 nsCOMPtr
<nsIDOMNSRange
> domNSRange
= do_QueryInterface(domRange
);
753 domNSRange
->CreateContextualFragment(strAdjacentHTML
, getter_AddRefs(domDocFragment
));
756 if (_wcsicmp(OLE2CW(where
), L
"beforeBegin") == 0)
758 // Insert fragment immediately before us:
759 nsCOMPtr
<nsIDOMNode
> parentNode
;
760 mDOMNode
->GetParentNode(getter_AddRefs(parentNode
));
761 nsCOMPtr
<nsIDOMNode
> dummyNode
;
762 rv
= parentNode
->InsertBefore(domDocFragment
, mDOMNode
, getter_AddRefs(dummyNode
));
763 return SUCCEEDED(rv
)? S_OK
: E_FAIL
;
765 if (_wcsicmp(OLE2CW(where
), L
"afterEnd") == 0)
767 // Insert fragment immediately after us:
768 nsCOMPtr
<nsIDOMNode
> parentNode
;
769 mDOMNode
->GetParentNode(getter_AddRefs(parentNode
));
770 nsCOMPtr
<nsIDOMNode
> dummyNode
;
771 nsCOMPtr
<nsIDOMNode
> nextNode
;
772 mDOMNode
->GetNextSibling(getter_AddRefs(nextNode
));
775 // Insert immediately before next node:
776 rv
= parentNode
->InsertBefore(domDocFragment
, nextNode
, getter_AddRefs(dummyNode
));
780 // We are the last child, insert after us:
781 rv
= parentNode
->AppendChild(domDocFragment
, getter_AddRefs(dummyNode
));
783 return SUCCEEDED(rv
)? S_OK
: E_FAIL
;
785 if (_wcsicmp(OLE2CW(where
), L
"afterBegin") == 0)
787 // Insert fragment immediately before first child:
788 nsCOMPtr
<nsIDOMNode
> firstChildNode
;
789 mDOMNode
->GetFirstChild(getter_AddRefs(firstChildNode
));
791 return E_FAIL
; // IE fails when inserting into a tag that has no childs
792 nsCOMPtr
<nsIDOMNode
> dummyNode
;
793 rv
= mDOMNode
->InsertBefore(domDocFragment
, firstChildNode
, getter_AddRefs(dummyNode
));
794 return SUCCEEDED(rv
)? S_OK
: E_FAIL
;
796 if (_wcsicmp(OLE2CW(where
), L
"beforeEnd") == 0)
798 // Insert fragment immediately as last child:
799 nsCOMPtr
<nsIDOMNode
> dummyNode
;
800 rv
= mDOMNode
->AppendChild(domDocFragment
, getter_AddRefs(dummyNode
));
801 return SUCCEEDED(rv
)? S_OK
: E_FAIL
;
806 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::insertAdjacentText(BSTR where
, BSTR text
)
811 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_parentTextEdit(IHTMLElement __RPC_FAR
*__RPC_FAR
*p
)
816 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_isTextEdit(VARIANT_BOOL __RPC_FAR
*p
)
821 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::click(void)
826 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_filters(IHTMLFiltersCollection __RPC_FAR
*__RPC_FAR
*p
)
831 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_ondragstart(VARIANT v
)
836 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_ondragstart(VARIANT __RPC_FAR
*p
)
841 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::toString(BSTR __RPC_FAR
*String
)
846 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_onbeforeupdate(VARIANT v
)
851 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_onbeforeupdate(VARIANT __RPC_FAR
*p
)
856 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_onafterupdate(VARIANT v
)
861 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_onafterupdate(VARIANT __RPC_FAR
*p
)
866 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_onerrorupdate(VARIANT v
)
871 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_onerrorupdate(VARIANT __RPC_FAR
*p
)
876 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_onrowexit(VARIANT v
)
881 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_onrowexit(VARIANT __RPC_FAR
*p
)
886 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_onrowenter(VARIANT v
)
891 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_onrowenter(VARIANT __RPC_FAR
*p
)
896 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_ondatasetchanged(VARIANT v
)
901 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_ondatasetchanged(VARIANT __RPC_FAR
*p
)
906 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_ondataavailable(VARIANT v
)
911 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_ondataavailable(VARIANT __RPC_FAR
*p
)
916 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_ondatasetcomplete(VARIANT v
)
921 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_ondatasetcomplete(VARIANT __RPC_FAR
*p
)
926 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::put_onfilterchange(VARIANT v
)
931 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_onfilterchange(VARIANT __RPC_FAR
*p
)
936 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_children(IDispatch __RPC_FAR
*__RPC_FAR
*p
)
938 // Validate parameters
946 // Create a collection representing the children of this node
947 CIEHtmlElementCollectionInstance
*pCollection
= NULL
;
948 HRESULT hr
= GetChildren(&pCollection
);
957 HRESULT STDMETHODCALLTYPE
CIEHtmlElement::get_all(IDispatch __RPC_FAR
*__RPC_FAR
*p
)
959 // Validate parameters
967 // TODO get ALL contained elements, not just the immediate children
969 CIEHtmlElementCollectionInstance
*pCollection
= NULL
;
970 CIEHtmlElementCollection::CreateFromParentNode(this, TRUE
, (CIEHtmlElementCollection
**) &pCollection
);
973 pCollection
->AddRef();