Open
Bug 676519
Opened 13 years ago
Updated 2 years ago
Refactor the common code between nsHTMLTextAreaElement and nsHTMLInputElement into a common base class
Categories
(Core :: DOM: Core & HTML, defect, P5)
Core
DOM: Core & HTML
Tracking
()
NEW
People
(Reporter: ehsan.akhgari, Unassigned)
Details
There are tons of methods in these two classes which are basically copies of each other, except for the extra check in nsHTMLInputElement to make sure that we're dealing with a text input element. These methods can probably be refactored into a common base class.
Comment 1•13 years ago
|
||
I guess we could have a nsTextControlElement class that would inherit from nsITextControlElement and actually implement it. nsHTMLInputElement and nsHTMLTextAreaElement would inherit from nsTextControlElement instead of nsITextControlElement. Does that make sense?
OS: Mac OS X → All
Hardware: x86 → All
Reporter | ||
Comment 2•13 years ago
|
||
(In reply to Mounir Lamouri (:volkmar) from comment #1) > I guess we could have a nsTextControlElement class that would inherit from > nsITextControlElement and actually implement it. nsHTMLInputElement and > nsHTMLTextAreaElement would inherit from nsTextControlElement instead of > nsITextControlElement. > Does that make sense? Yeah. We just need to decide how to handle the case of input elements which are not text controls somehow. The current way that we do this is sucky and makes my eyes bleed every time that I read nsHTMLInputElement.cpp. WebKit also does something like this (they have a class called HTMLTextFormControlElement). I wish there was a better way for modeling this in C++ :(
Updated•6 years ago
|
Priority: -- → P5
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•