Closed Bug 234640 Opened 21 years ago Closed 21 years ago

IHtmlSelectionObject & IHtmlTextRange implementation

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

(6 files, 7 obsolete files)

User-Agent: Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; fr-FR; rv:1.6) Gecko/20040113 implement these interfaces Reproducible: Always Steps to Reproduce:
Attached file Some IHtmlTxtRange methods implemented (obsolete) —
pasteHTML, get_text, parentElement are implemented
Attached file Some IHtmlTxtRange methods implemented (obsolete) —
pasteHTML, get_text, parentElement are implemented
Until now it was supposed that the CIEHtmlNode::mParent member was set at creation time, as this creation happens in one of the 'PopulateXXX' method in the CIEHtmlElementCollection class. As an object can be created from the range, its parent (and its parent's parent, etc.) is not necessarily set.
Some VB code to test this: Dim htmlDoc As IHTMLDocument Dim sel As IHTMLSelectionObject Dim range As IHTMLTxtRange Dim str As String Dim elt As IHTMLElement Set htmlDoc = MozillaBrowser.document Set sel = htmlDoc.selection 'sel.Clear 'sel.empty str = sel.Type Set range = sel.createRange Set elt = range.parentElement Set elt = elt.parentElement str = elt.tagName str = range.Text range.pasteHTML "<b>Hello world!</b>"
Attachment #141613 - Flags: review?(adamlock)
Comment on attachment 141613 [details] [diff] [review] IHtmlDocument2::get_selection implementation In principle it looks fine, but I have some observations. The CIEHtmlTxtRange::SetRange, CIEHtmlSelectionObject::SetSelection, CIEHtmlSelectionObject::SetDOMDocumentRange methods should not take a smart pointer - just pass a raw pointer. CIEHtmlSelectionObject::createRange does not free the memory allocated in call from get_type. Using CComBSTR would fix this. This functionality should also live in common/ not control. The IEHTMLDocument.cpp is the exception because it has some browser specific code in it, but the other parts of the DOM impl can be shared around
Attachment #141613 - Flags: review?(adamlock) → review-
Just a clarification. When I say "also live in common" I mean it should live in common, and not in control at all. Other code such as the plugin picks up the DOM implementation from the common so putting it there is ensures it can be used by other code needing it. I can't recall the reason IEHTMLDocument.cpp was left in control/ but it was probably due to some control specific detail in its implementation.
IEHtmlSelection/IEHtmlTxtRange are in /common, as you can see in /common/makefile. IEHtmlSelection.h/IEHtmlTxtRange .h are copied into /dist/include/ax_common so it is possible to do #include "IEHtmlSelection.h" in IEHtmlDocument.cpp
Attachment #141608 - Attachment is obsolete: true
Attached file CComBSTR in CreateRange (obsolete) —
Attachment #141609 - Attachment is obsolete: true
Attachment #141610 - Attachment is obsolete: true
Attachment #142237 - Attachment is obsolete: true
Attachment #141612 - Attachment is obsolete: true
Attachment #142220 - Attachment is obsolete: true
Attachment #142219 - Attachment is patch: false
Assignee: adamlock → atremon
Status: UNCONFIRMED → NEW
Ever confirmed: true
I also implemented IHTMLControlRange::Collapse
Attachment #142221 - Flags: review?(adamlock)
Comment on attachment 142221 [details] [diff] [review] call to SetDOMDocumentRange takes a raw pointer as parameter r=adamlock
Attachment #142221 - Flags: review?(adamlock) → review+
Attachment #142221 - Flags: superreview?(blizzard)
Attachment #142221 - Flags: superreview?(blizzard) → superreview?(jst)
Comment on attachment 142221 [details] [diff] [review] call to SetDOMDocumentRange takes a raw pointer as parameter sr=jst
Attachment #142221 - Flags: superreview?(jst) → superreview+
Comment on attachment 142221 [details] [diff] [review] call to SetDOMDocumentRange takes a raw pointer as parameter Seeking approval for 1.7b. Specific to the ActiveX control, low risk
Attachment #142221 - Flags: approval1.7b?
Comment on attachment 142221 [details] [diff] [review] call to SetDOMDocumentRange takes a raw pointer as parameter a=chofmann for 1.7b
Attachment #142221 - Flags: approval1.7b? → approval1.7b+
I've checked the range & selection objects into activex/common. I'll apply the patches to compile & use them next (tomorrow some time).
Fix is checked in
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Attachment #141621 - Flags: review?(adamlock)
Comment on attachment 141621 [details] [diff] [review] Change in get_parentElement r=adamlock Ouch I forgot to check this one in. It will happen Friday night.
Attachment #141621 - Flags: review?(adamlock) → review+
Just checked in the missing diff.
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: