Closed
Bug 641409
Opened 13 years ago
Closed 13 years ago
Move methods using only GetType from nsGenericHTMLFormElement to nsIFormControl
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla5
People
(Reporter: mounir, Assigned: mounir)
References
Details
Attachments
(1 file)
12.06 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
That way, we can make those methods inline and non-virtual. Unfortunately: - GetType() is still virtual and making it non-virtual might not be doable (does it worth adding a PRUint32 to all form controls?); - I've been told that I still have to use PRBool in interfaces. That makes me really sad :( A possible follow-up would be to create a structure that keeps track of form control properties and make those methods more maintainable.
Attachment #519064 -
Flags: review?(bzbarsky)
Comment 1•13 years ago
|
||
I thought we were moving things the other way? Will this patch break anything for elements that don't have a frame?
Assignee | ||
Comment 2•13 years ago
|
||
(In reply to comment #1) > I thought we were moving things the other way? What do you mean? The idea here is that we declare a method in nsIFormControl and define it in nsGenericHTMLFormElement, thus making the method virtual. But we could have the definition in the interface quite easily. > Will this patch break anything for elements that don't have a frame? nsGenericHTMLFormElement inherits from nsIFormControl so it shouldn't change anything.
Comment 3•13 years ago
|
||
> - I've been told that I still have to use PRBool in interfaces.
Hmm. Only ones we expect to be called from outside our code, I'd think.
Mounir, if we really cared we might be able to stuff the type into element-specific flags once we make flags 64-bit on nodes, right?
Comment 4•13 years ago
|
||
Comment on attachment 519064 [details] [diff] [review] Patch v1 The two-argument form of IsSingleLineTextControl should probably be protected. r=me with that.
Attachment #519064 -
Flags: review?(bzbarsky) → review+
Updated•13 years ago
|
Summary: Move methods using only using GetType from nsGenericHTMLFormElement to nsIFormControl → Move methods using only GetType from nsGenericHTMLFormElement to nsIFormControl
Assignee | ||
Comment 5•13 years ago
|
||
I've changed: public PRBool IsSingleLineTextControl(PRBool, PRUint32) to: protected bool IsSingleLineTextControl(bool, PRUint32) Thanks for the quick review.
Whiteboard: [needs review] → [can land][post-2.0]
Assignee | ||
Comment 6•13 years ago
|
||
Pushed: http://hg.mozilla.org/mozilla-central/rev/364e0b9a2168
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Whiteboard: [can land][post-2.0]
Target Milestone: --- → mozilla2.2
You need to log in
before you can comment on or make changes to this bug.
Description
•