[webkit-reviews] review granted: [Bug 19470] Null pointer dereferences on a document with no documentElement : [Attachment 21687] Proposed patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jun 13 14:06:45 PDT 2008


Darin Adler <darin at apple.com> has granted danceoffwithyourpantsoff
<danceoffwithyourpantsoff at gmail.com>'s request for review:
Bug 19470: Null pointer dereferences on a document with no documentElement
https://bugs.webkit.org/show_bug.cgi?id=19470

Attachment 21687: Proposed patch
https://bugs.webkit.org/attachment.cgi?id=21687&action=edit

------- Additional Comments from Darin Adler <darin at apple.com>
Looks fine. There are various small problems such as:

+	 * LayoutTests\fast\dom\documentElement-null-expected.txt: Added.

Slashes are backwards here. Paths are from the top level, but should be
relative to the ChangeLog file. LayoutTests needs its own separate ChangeLog
file, not entries in the WebCore ChangeLog file.

+	     if (const Element *doc = static_cast<const Document
*>(this)->documentElement())
+		 return doc->lookupPrefix(namespaceURI);
+	     return String();

We put the * next to the type name, although the old code didn't do that. The
newly added braces aren't needed -- the if statement already scopes the
variable declared inside it.

I'd also suggest changing documentElement-null.html to create a document and
put a message in at the end indicating success.

But I think the patch is good enough as-is that I'm going to review+ it. The
person landing it can probably fix a few things, or someone could do a new
patch.


More information about the webkit-reviews mailing list