Bug 5672
| Summary: | RenderObject should be thinned out and some methods made pure virtual | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Eric Seidel (no email) <eric> |
| Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED INVALID | ||
| Severity: | Normal | CC: | ian, robert |
| Priority: | P4 | ||
| Version: | 420+ | ||
| Hardware: | Mac | ||
| OS: | OS X 10.4 | ||
Eric Seidel (no email)
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
The things this bug wishes for don't exist yet - but are they still valid? Seems like we should just close it.
Alexey Proskuryakov
Yes, this bug hasn't helped since 2005, so it's unlikely to help in the future.