nsRange methods from DOM interfaces should use NS_IMETHODIMP on their implementations

RESOLVED FIXED in mozilla2.0b2

Status

()

RESOLVED FIXED
8 years ago
6 years ago

People

(Reporter: craig.topper, Assigned: craig.topper)

Tracking

Trunk
mozilla2.0b2
x86
All
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

8 years ago
Most of the methods in nsRange that come from DOM interfaces don't use NS_IMETHODIMP on their implementations, just nsresult. Strangely, this compiles. Guess the compiler on Windows is happy to let the declaration use _stdcall without the implementation saying it. The opposite is not true for obvious reasons.

Probaby a good idea to fix this anyway in case some future compiler fixes this oddity.
(Assignee)

Comment 1

8 years ago
Ok so after some searching on google this might actually be defined behavior, but is inconsistent with the rest of the code base.
(Assignee)

Comment 2

8 years ago
Created attachment 457770 [details] [diff] [review]
Patch
Attachment #457770 - Flags: review?(bzbarsky)
Comment on attachment 457770 [details] [diff] [review]
Patch

r=bzbarsky
Attachment #457770 - Flags: review?(bzbarsky) → review+
Comment on attachment 457770 [details] [diff] [review]
Patch

>-nsresult nsRange::CutContents(nsIDOMDocumentFragment** aFragment)
>-{ 
>+NS_IMETHODIMP
>+nsRange::CutContents(nsIDOMDocumentFragment** aFragment)
>+{

Are you sure about this one?  CutContents was an internal method I originally wrote (and smaug later took ownership of).  It's not exposed directly through the interface for nsIDOMRange or nsIDOMNSRange.
(Assignee)

Comment 5

8 years ago
(In reply to comment #4)
> Comment on attachment 457770 [details] [diff] [review]
> Patch
> 
> >-nsresult nsRange::CutContents(nsIDOMDocumentFragment** aFragment)
> >-{ 
> >+NS_IMETHODIMP
> >+nsRange::CutContents(nsIDOMDocumentFragment** aFragment)
> >+{
> 
> Are you sure about this one?  CutContents was an internal method I originally
> wrote (and smaug later took ownership of).  It's not exposed directly through
> the interface for nsIDOMRange or nsIDOMNSRange.

Oops. You're right. I'll fix the patch.
(Assignee)

Comment 6

8 years ago
Created attachment 458053 [details] [diff] [review]
Reverted accidental change to CutContents
Attachment #457770 - Attachment is obsolete: true
(Assignee)

Updated

8 years ago
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/95cae32d3eee
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b2
Component: DOM: Traversal-Range → DOM: Core & HTML
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.