[webkit-reviews] review granted: [Bug 8791] XPath should support custom namespace resolvers : [Attachment 12910] proposed fix

bugzilla-request-daemon at macosforge.org bugzilla-request-daemon at macosforge.org
Sun Feb 4 18:26:47 PST 2007

Darin Adler <darin at apple.com> has granted Darin Adler <darin at apple.com>'s
request for review:
Bug 8791: XPath should support custom namespace resolvers

Attachment 12910: proposed fix

------- Additional Comments from Darin Adler <darin at apple.com>
When it comes to reducing the amount of code in CodeGeneratorJS.pm, I'm
suggesting that JSCustomXPathNSResolver have a function that can do this entire

+		     push(@implContent, "	 RefPtr<XPathNSResolver>
+		     push(@implContent, "	 XPathNSResolver* resolver =
+		     push(@implContent, "	 if (!resolver) {\n");
+		     push(@implContent, "	     customResolver =
JSCustomXPathNSResolver::create(exec, args[$paramIndex]);\n");
+		     push(@implContent, "	     if
+		     push(@implContent, "		 return
+		     push(@implContent, "	     resolver =
+		     push(@implContent, "	 }\n");

so that CodeGeneratorJS.pm has just a single function call, check for
exception/null and return of jsUndefined(), which amounts to about half as much
code as what's there now.

Seems like you could do something similar with CodeGeneratorObjC.pm, with a
single function that returns a PassRefPtr<XPathNSResolver>.

+#include "XPathNSResolver.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>

This requires only Forward.h, not PassRefPtr.h (occurs twice).


More information about the webkit-reviews mailing list