Closed
Bug 337543
Opened 18 years ago
Closed 18 years ago
Use nsINode more!
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
People
(Reporter: sicking, Assigned: sicking)
References
Details
Attachments
(1 file, 1 obsolete file)
58.74 KB,
patch
|
peterv
:
review+
peterv
:
superreview+
|
Details | Diff | Splinter Review |
Another patch to simplify code by using nsINode in more places comming up.
Assignee | ||
Comment 1•18 years ago
|
||
Assignee: general → bugmail
Status: NEW → ASSIGNED
Attachment #221670 -
Flags: superreview?(jst)
Attachment #221670 -
Flags: review?(jst)
Assignee | ||
Comment 2•18 years ago
|
||
Btw, I didn't update the interface iids since the new signatures are binary compatible with the old.
Assignee | ||
Comment 3•18 years ago
|
||
Btw, I ended up not doing the nsresult-as-out-parameter thing to save addrefs in the treewalker. I noticed that we addref and release all over the place anyway. Unfortunately we have to do that since scripts can run at any point (in the filter) so the tree could mutate under us causing nodes to go away otherwise.
Assignee | ||
Comment 4•18 years ago
|
||
Attachment #221670 -
Attachment is obsolete: true
Attachment #222233 -
Flags: superreview?(peterv)
Attachment #222233 -
Flags: review?(peterv)
Attachment #221670 -
Flags: superreview?(jst)
Attachment #221670 -
Flags: review?(jst)
Comment 5•18 years ago
|
||
Comment on attachment 222233 [details] [diff] [review] Merge to tip >Index: content/base/src/nsTreeWalker.cpp >=================================================================== > nsTreeWalker::nsTreeWalker(nsIDOMNode *aRoot, > PRUint32 aWhatToShow, > nsIDOMNodeFilter *aFilter, > PRBool aExpandEntityReferences) : >- mRoot(aRoot), >+ mRoot(do_QueryInterface(aRoot)), > mWhatToShow(aWhatToShow), > mExpandEntityReferences(aExpandEntityReferences), >- mCurrentNode(aRoot), >+ mCurrentNode(do_QueryInterface(aRoot)), Hmm, those QIs can fail. You should make this constructor take nsINode if you want to do this (it's not clear to me that this is an obvious improvement) and do the QI in NS_NewTreeWalker. > NS_IMETHODIMP nsTreeWalker::FirstChild(nsIDOMNode **_retval) >+ mPossibleIndexesPos+1, Add some spaces around the + while you're here. > NS_IMETHODIMP nsTreeWalker::LastChild(nsIDOMNode **_retval) >+ mPossibleIndexesPos+1, Ditto. >@@ -601,127 +591,83 @@ nsTreeWalker::ChildOf(nsIDOMNode* aNode, >+nsresult nsTreeWalker::TestNode(nsINode* aNode, PRInt16* _filtered) >+ nsCOMPtr<nsIDOMNode> domNode; >+ if (!nodeType) { nodeType == 0 >Index: content/html/content/src/nsGenericHTMLElement.cpp >=================================================================== >@@ -3126,21 +3126,19 @@ nsGenericHTMLFormElement::UnbindFromTree >- nsCOMPtr<nsIFormControl> thisControl; >+ nsIFormControl* thisControl = this; Is this safe (it's not a strong ref anymore)? If so, just drop thisControl and replace it with this wherever it's used. >@@ -3167,18 +3165,17 @@ nsGenericHTMLFormElement::BeforeSetAttr( >- nsCOMPtr<nsIFormControl> thisControl = >- do_QueryInterface(NS_STATIC_CAST(nsIContent*, this)); >+ nsIFormControl* thisControl = this; See above.
Attachment #222233 -
Flags: superreview?(peterv)
Attachment #222233 -
Flags: superreview+
Attachment #222233 -
Flags: review?(peterv)
Attachment #222233 -
Flags: review+
Comment 6•18 years ago
|
||
could this have caused Bug 338541 ?
Assignee | ||
Comment 7•18 years ago
|
||
This has been fixed for some time now.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Updated•18 years ago
|
Flags: in-testsuite-
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•