[Webkit-unassigned] [Bug 78180] MathML internals for bug 52444 fix - type checking, PassRefPtr

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 8 22:44:45 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=78180





--- Comment #8 from Dave Barton <dbarton at mathscribe.com>  2012-02-08 22:44:45 PST ---
(From update of attachment 126195)
View in context: https://bugs.webkit.org/attachment.cgi?id=126195&action=review

>> Source/WebCore/rendering/mathml/RenderMathMLUnderOver.h:37
>> +    RenderMathMLUnderOver(Element*);
> 
> Are you sure that names like this one add no useful information?

In all these RenderMathML classes, the argument to the constructor is a MathML element that corresponds to that RenderMathML class. Sometimes the current (old) code calls it "container" or "expression" or even "fraction" (including when it's not a fraction). In this case, the argument is supposed to be an <munder>, <mover>, or <munderover> element. We could call the argument something like underOver, but that name equally applies to the RenderMathMLUnderOver rendering object that's being constructed. I think in reading the code, the context implies munder/mover/munderover, and the clearest thing is to call the munder/mover/munderover element "element", and the rendering object that corresponds to it has some other name ("this" in this case). The important thing for type safety of later casts is that the argument is an Element*, not just a Node*.

I will change the argument name to "expression" if you insist, but it makes the code less clear to me. The RenderMathMLUnderOver object equally represents a mathematical expression. The difference is that one is a DOM element of type Element*, and the other in a rendering object of type RenderMathMLUnderOver*. So I really find the variable name "element" to be clearer than "expression".

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list