RenderTextControl relies on HTMLFormControlElement, and is not usable within WML at the moment.
One possibility would be to introduce a FormControlElement abstract class, containing two pure-virtual functions: setValueMatchesRenderer/valueMatchesRenderer, as these methods are in use from within RenderTextControl. As RenderObject stores a Node* pointer only, we'd also need to store a FormControlElement pointer in RenderTextControl, as we aren't allowed to cast node() to HTMLFormControlElement, as we want to abstract away the HTML-dependency.
As Node got enough unused bits left, it's easier to store "bool m_controlValueMatchesRenderer : 1" in Node and add non-virtual getter/setter methods. This way RenderTextControl saves all casts from Node -> HTMLFormControlElement and the HTML dependency is gone.
Created attachment 26283 [details]
Comment on attachment 26283 [details]
It's a little sad to be using bits in Node for something as rare as a RenderTextControl. Otherwise, the patch seems fine. r=me
As discussed with Antti & Sam, adding memory to RenderTextControl is not as bad as adding too specialized data (only needed for form control elements) to Node. I'll upload a revised version, implementing my first idea: a shared ABC.
Created attachment 26285 [details]
Found a much nicer way to refactor, without adding any extra memory consumption.
Landed in r39495.