Closed Bug 238786 Opened 21 years ago Closed 21 years ago

[ActiveX] IHTMLDomNode & IHTMLButtonElement are not implemented

Categories

(Core Graveyard :: Embedding: ActiveX Wrapper, enhancement)

x86
Windows 2000
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: atremon, Assigned: atremon)

Details

Attachments

(1 file, 4 obsolete files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; fr-FR; rv:1.7b) Gecko/20040316 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; fr-FR; rv:1.7b) Gecko/20040316 A IHtmlElement is a IHTMLDomNode Reproducible: Always Steps to Reproduce:
Assignee: adamlock → atremon
Uses aggregation instead of inheritage as in bug 61780). A couple of method implementations are from that bug. Additional interfaces implemented: IHTMLElement2, IHTMLElement3, IHTMLDocument3, Methods implemented: IHtmlElement::id property (read & write) IHtmlElement::insertAdjacentHTML IHtmlElement2::focus IHtmlElement2::disabled property (write) IHTMLDocument2::createElement IHTMLDocument3::createTextNode IHTMLDocument3::getElementById IHTMLDomNode::appendChild
Attached file IEHtmlButtonElement.h (obsolete) —
Attached file IEHtmlButtonElement.cpp (obsolete) —
Code to test this: Private Sub Form_Load() MozillaBrowser1.navigate "about:blank" End Sub Private Sub MozillaBrowser1_DownloadComplete() Dim doc As mshtml.IHTMLDocument2 Set doc = MozillaBrowser1.document ' Create element Dim boldElement As mshtml.IHTMLElement Set boldElement = doc.createElement("b") ' Create text node Dim doc3 As IHTMLDocument3, textNode As mshtml.IHTMLDOMNode Set doc3 = doc Set textNode = doc3.createTextNode("Hello World!") ' Append to the body Dim bodyAsNode As IHTMLDOMNode Set bodyAsNode = doc.body ' Implicit cast from IHTMLElement to IHTMLDOMNode bodyAsNode.appendChild boldElement Dim boldElementAsNode As IHTMLDOMNode Set boldElementAsNode = boldElement boldElementAsNode.appendChild textNode ' Add button Dim button As IHTMLButtonElement ' Implicit cast from IHTMLElement to IHTMLButtonElement Set button = doc.createElement("button") Dim buttonAsElement As IHTMLElement Set buttonAsElement = button Set textNode = doc3.createTextNode("Click me!") Dim buttonAsNode As IHTMLDOMNode Set buttonAsNode = button buttonAsNode.appendChild textNode bodyAsNode.appendChild button buttonAsElement.setAttribute "id", "button1" ' Get button by Id Dim elt3 As IHTMLElement3 ' Implicit cast from IHTMLElement to IHTMLElement3 Set elt3 = doc3.getElementById("button1") ' Disable button elt3.disabled = True End Sub
3 files in 1 patch
Attachment #144849 - Attachment is obsolete: true
Attachment #144850 - Attachment is obsolete: true
Attachment #144851 - Attachment is obsolete: true
Comment on attachment 152341 [details] [diff] [review] IHTMLButtonElement & IHTMLDomNode implementation Hi Adam, Can you review this patch for me? It is the implementation of IHtmlDomNode & IHtmlButtonElement. I use aggregation, and slightly modified a few exisiting methods. Alex
Attachment #152341 - Flags: review?(adamlock)
> For attachment (id=152341) I removed, for now, interfaces: IHTMLElement2, IHTMLElement3, IHTMLDocument3, I moved these methods to bug (id=247537): IHtmlElement::id property (read & write) IHtmlElement::insertAdjacentHTML I also removed, for now, these methods: IHtmlElement2::focus IHtmlElement2::disabled property (write) IHTMLDocument2::createElement IHTMLDocument3::createTextNode IHTMLDocument3::getElementById
Comment on attachment 152341 [details] [diff] [review] IHTMLButtonElement & IHTMLDomNode implementation Looks good r=adamlock
Attachment #152341 - Flags: review?(adamlock) → review+
Comment on attachment 152341 [details] [diff] [review] IHTMLButtonElement & IHTMLDomNode implementation Hi Johnny, can you superreview this for me? It is the implementation of IHtmlDomNode & IHtmlButtonElement. I use aggregation, and slightly modified a few existing methods. Thanks! Alex
Attachment #152341 - Flags: superreview?(jst)
Comment on attachment 152341 [details] [diff] [review] IHTMLButtonElement & IHTMLDomNode implementation + CIEHtmlDomNode::FindOrCreateFromDOMNode(bodyNode, &pNode); + pNode->QueryInterface(IID_IHTMLElement, (void **)p); I see a bunch of code that does this. No error checks. What if pNode comes back null? Or is this compiled with exception handling enabled? Might be worth adding a null check. sr=jst
Attachment #152341 - Flags: superreview?(jst) → superreview+
Following Johnny's remarks.
Attachment #152341 - Attachment is obsolete: true
Adam, Can you check this code (http://bugzilla.mozilla.org/attachment.cgi?id=155343&action=edit) in for me, or do I have to ask for reviewal ?
Fix is checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
This checkin caused a problem on Creature (WinNT 5.0 Clbr): IEHtmlNode.cpp /cygdrive/c/builds/tinderbox/MozillaTrunk/WINNT_5.0_Clobber/mozilla/build/cygwin-wrapper cl -FoIEHtmlNode.obj -c -DOSTYPE=\"WINNT5.0\" -DOSARCH=\"WINNT\" -I../../../../../dist/include/xpcom -I../../../../../dist/include/string -I../../../../../dist/include/dom -I../../../../../dist/include/js -I../../../../../dist/include/widget -I../../../../../dist/include/gfx -I../../../../../dist/include/layout -I../../../../../dist/include/content -I../../../../../dist/include/necko -I../../../../../dist/include/ax_common -I../../../../../dist/include -I../../../../../dist/include/nspr -I/usr/X11R6/include -I/usr/X11R6/include -TP -nologo -W3 -Gy -Fdax_common_s.pdb -DNDEBUG -DTRIMMED -Zi -O1 -UDEBUG -DNDEBUG -GX -MD -I/usr/X11R6/include -DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ -DMOZILLA_VERSION=\"1.8a3\" -DHAVE_SNPRINTF=1 -D_WINDOWS=1 -D_WIN32=1 -DWIN32=1 -DXP_WIN=1 -DXP_WIN32=1 -DHW_THREADS=1 -DWINVER=0x400 -DSTDC_HEADERS=1 -DWIN32_LEAN_AND_MEAN=1 -DNO_X11=1 -D_X86_=1 -DD_INO=d_in o -DMOZ_DEFAULT_TOOLKIT=\"windows\" -DMOZ_APP_NAME=\"mozilla\" -DOJI=1 -DIBMBIDI=1 -DMOZ_VIEW_SOURCE=1 -DACCESSIBILITY=1 -DMOZ_XPINSTALL=1 -DMOZ_JSLOADER=1 -DMOZ_MATHML=1 -DMOZ_LOGGING=1 -DMOZ_USER_DIR=\"Mozilla\" -DMOZ_XUL=1 -DMOZ_PROFILESHARING=1 -DMOZ_PROFILELOCKING=1 -DMOZ_BYPASS_PROFILE_AT_STARTUP=1 -DMOZ_DLL_SUFFIX=\".dll\" -DJS_THREADSAFE=1 -DNS_PRINT_PREVIEW=1 -DNS_PRINTING=1 -DMOZILLA_LOCALE_VERSION=\"1.8a\" -DMOZILLA_REGION_VERSION=\"1.8a\" -DMOZILLA_SKIN_VERSION=\"1.5\" /cygdrive/c/builds/tinderbox/MozillaTrunk/WINNT_5.0_Clobber/mozilla/embedding/browser/activex/src/common/IEHtmlNode.cpp IEHtmlNode.cpp c:/builds/tinderbox/MozillaTrunk/WINNT_5.0_Clobber/mozilla/embedding/browser/activex/src/common/IEHtmlNode.h(64) : error C2065: 'IHTMLDOMNode' : undeclared identifier c:/builds/tinderbox/MozillaTrunk/WINNT_5.0_Clobber/mozilla/embedding/browser/activex/src/common/IEHtmlNode.h(64) : error C2065: 'IID_IHTMLDOMNode' : undeclared identifier c:/builds/tinderbox/MozillaTrunk/WINNT_5.0_Clobber/mozilla/embedding/browser/activex/src/common/IEHtmlNode.h(65) : fatal error C1903: unable to recover from previous error(s); stopping compilation make[6]: *** [IEHtmlNode.obj] Error 2
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: