[webkit-dev] Optimizing DOMNode _nodeWith
Timothy Hatcher
timothy at hatcher.name
Mon Apr 24 11:24:28 PDT 2006
On Apr 24, 2006, at 8:19 AM, Matt Gough wrote:
> Now there is already a comment there that says:
>
> // FIXME: We could make the HTML classes hand back
> their class names and then use that to make
> // the appropriate Obj-C class from the string.
>
> I am guessing that this would go something like this, but before I
> go to the trouble of doing this for every class could someone make
> sure I am pondering the right thing.
Yes, this is the approach mentioned in the comment.
> if (impl->isHTMLElement()) {
> HTMLElement* htmlElt = static_cast<HTMLElement*>
> (impl);
> wrapperClass = NSClassFromString(htmlElt->objcClassName());
> }
You do not need to do any explicit conversion to NSString, you can
simply pass it around as if it was a NSString. You can due this
because String has a cast operator for NSString (operator NSString*())
—C++ will do the conversion behind the scenes.
> Does this all make sense?
Yes, this makes sense to me. Others, like Maciej, might have a new
opinion since that comment was written a long time ago. I would like
to see before and after numbers when you have everything changed over.
— Timothy Hatcher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/webkit-dev/attachments/20060424/73d7ed1c/attachment.html
More information about the webkit-dev
mailing list