WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
5672
RenderObject should be thinned out and some methods made pure virtual
https://bugs.webkit.org/show_bug.cgi?id=5672
Summary
RenderObject should be thinned out and some methods made pure virtual
Eric Seidel (no email)
Reported
2005-11-09 02:44:38 PST
RenderObject should be thinned out and some methods made pure virtual RenderObject has lots of methods on it that it IMO really shouldn't. This makes it *really* hard when writing a new RenderObject subclass, and likely has lead to other previous errors made when editing the existing tree. Examples of methods which should be removed (i.e. only exist on subclasses): virtual RenderObject *firstChild() const { return 0; } virtual RenderObject *lastChild() const { return 0; } Examples of methods which should be made pure virtual: virtual void setWidth( int /*width*/ ) { } virtual void setHeight( int /*height*/ ) { } The usage model would then be to ask the RenderObject in question: renderObject->isContainer() then cast it to the appropriate type: RenderContainer *renderContainer = static_cast<RenderContainer *>(renderObject); finally then, can you ask it the questions you care about: renderContainer->firstChild()
Attachments
Add attachment
proposed patch, testcase, etc.
Robert Hogan
Comment 1
2013-06-04 10:38:10 PDT
The things this bug wishes for don't exist yet - but are they still valid? Seems like we should just close it.
Alexey Proskuryakov
Comment 2
2013-06-05 10:56:41 PDT
Yes, this bug hasn't helped since 2005, so it's unlikely to help in the future.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug