Extract common utility functions used in tests for ComposedTreeWalker.

BUG=None

Review URL: https://chromiumcodereview.appspot.com/23611003

git-svn-id: svn://svn.chromium.org/blink/trunk@157210 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add toHTMLFormControlElementWithState(), and use it.

We'd like to avoid bare static_cast.

BUG=none
TEST=none; no behavior changes.

Review URL: https://chromiumcodereview.appspot.com/23914003

git-svn-id: svn://svn.chromium.org/blink/trunk@157211 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Refactor IDL code generator

This refactors the code generator; the modules now line up with the
templates, so when changing the CG you just need to look at two files
at a time: the CG Python script and the Jinja template.
This should also make landing the WIP CG easier, since we just need to
review one pair of files at a time, e.g., for attributes,
v8_attributes.py / attributes.cpp.

You can see how this looks currently by looking at:
v8_callback_interface.py / callback_interface.cpp


The refactoring consists of splitting functions into files lining up
with the IDL spec and the templates, namely:
Interface, Callback Interface, Attributes, and Methods.

This also removes a lot of nesting, mostly by simplifying includes handling.
This is most visible in callback interface, which reduces the max indent
from 5 levels to 2 (i.e., now has 1 level of nesting: if/for and nested
helper functions).
(Also some cleanup of callback interface template.)

Thus the main files are:
v8_callback_interface.py   (done)
v8_interface.py   (inc. constants and constructors)
v8_attributes.py   (inc. special accessors)
v8_methods.py   (to come)

Two other files of shared functions are:
v8_types.py
v8_utilities.py

Type handling is quite involved, and shared between attributes and methods,
so this seems a pretty natural division.

The "utilities" is basically "misc. shared functions" (v8_common.py?),
like name handling and some extended attribute handling. This is ugly, and
we'll hopefully be able to remove it or reduce it to something sane when
we're finished porting, but there's a lot of interdependencies in the Perl,
and this gives us a place to put them *temporarily* without getting bogged
down; I've got a FIXME at the top to eliminate/reduce the file.

v8_interface.py, v8_attributes.py, v8_methods.py, and v8_types.py will
each become about 800-1000 lines - they're each a significant file, and
has matching changes in the template file. We can break this up over
2 or 3 CLs each, just moving things over from the WIP:
https://codereview.chromium.org/17572008/
v8_utilities shouldn't grow above 200-300 lines, and let's try to keep
it down if possible.


Follow-up to:
Refactor IDL compiler templates
https://codereview.chromium.org/23862002/

BUG=239771

Review URL: https://chromiumcodereview.appspot.com/23441036

git-svn-id: svn://svn.chromium.org/blink/trunk@157212 bbb929c8-8fbe-4397-9dbb-9b2b20218538