[webkit-dev] Strings & Element Names Question
eric at webkit.org
Thu Sep 24 15:16:53 PDT 2009
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.
On Thu, Sep 24, 2009 at 3:11 PM, Alex Milowski <alex at milowski.org> 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
> Bertrand Russell in a footnote of Principles of Mathematics
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
More information about the webkit-dev