[webkit-reviews] review denied: [Bug 4356] HTMLSelectElement::add should raise exception : [Attachment 3289] Make add raise an exception

bugzilla-request-daemon at opendarwin.org bugzilla-request-daemon at opendarwin.org
Tue Aug 9 11:54:30 PDT 2005

Darin Adler <darin at apple.com> has denied Anders Carlsson <andersca at mac.com>'s
request for review:
Bug 4356: HTMLSelectElement::add should raise exception

Attachment 3289: Make add raise an exception

------- Additional Comments from Darin Adler <darin at apple.com>
The code that calls deref on the element created by createElement is incorrect.
You need to ref first if you're going to deref; the create call returns you a
"floating" object.

There are two ways to fix this:

    1) add the ref as well as the deref; the deref can then be unconditional
    2) take the approach I did with appendChild; make the function responsible
for always ref'ing and deref'ing the node being added, even if it fails

If you do (2) then the caller doesn't need to do the deref().

Otherwise, looks good.

More information about the webkit-reviews mailing list