hasTagName is better as it does the correct thing wrt case and namespaces.

I think that AtomicString has an:
operator ==(const AtomicString&, char*)
but if it doesn't then you're transparently creating an
AtomicString/String with your use of "mfrac".

Also "mfrac" being a manually typed constant counts as "copy/paste
code" and is bad, partially because it's more error prone.

-eric

On Thu, Sep 24, 2009 at 3:11 PM, Alex Milowski <[email protected]> wrote:
> In my rendering code I have:
>
>    if (localName() == "mfrac")
>        object = new (arena) RenderFraction(this);
>
> Is that better or worse than using MathMLNames::whatever for comparison
> for element names?
>
> In these contexts, I know that the element is a MathML element already.
>
> --
> --Alex Milowski
> "The excellence of grammar as a guide is proportional to the paucity of the
> inflexions, i.e. to the degree of analysis effected by the language
> considered."
>
> Bertrand Russell in a footnote of Principles of Mathematics
> _______________________________________________
> webkit-dev mailing list
> [email protected]
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to