[Webkit-unassigned] [Bug 22518] Element subclasses need only pass an optional prefix in their constructor

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 26 17:01:29 PST 2008


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





------- Comment #3 from jchaffraix at pleyo.com  2008-11-26 17:01 PDT -------
> The same applies to SVGElement subclasses too.  Currently the constructor
> signature for most classes is:
> 
>   SVGSVGElement(const QualifiedName&, Document*);
>   HTMLHtmlElement(const QualifiedName&, Document*);
> 
> But they really should be more like:
> 
> SVGSVGElement(Document*, AtomicString prefix = nullAtom);
> HTMLHtmlElement(Document*, , AtomicString prefix = nullAtom);

I do agree with you that we could be giving only the prefix but I see some
drawbacks. First the current signatures are close to the Element constructor;
apart from the niceness of having a close interface for classes derived from
Element, we would introduce unneeded object creations (take the
Document::createElement(const QualifiedName&) that would need to extract the
prefix only to create another QualifiedName matching the original one for
Element constructor).


> But others in the project feel stronger about
> it, and so I'm filing this bug for proper discussion and eventual code change.)
>  :)
> 

Thanks for raising this point I had overlooked.


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



More information about the webkit-unassigned mailing list