Bug 64138

Summary: Clean up RenderWidget::destroy() to share more code
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: Layout and RenderingAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, jamesr, mitz, simon.fraser, tony
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch simon.fraser: review+

Description Simon Fraser (smfr) 2011-07-07 17:42:13 PDT
RenderWidget::destroy() has comments about not sharing more code with other classes. This needs cleaning up. It's a PITA to add code here.
Comment 1 Simon Fraser (smfr) 2011-07-08 16:55:37 PDT
Created attachment 100185 [details]
Patch
Comment 2 James Robinson 2011-07-08 17:07:06 PDT
Comment on attachment 100185 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=100185&action=review

Looks great, just one question.

> Source/WebCore/rendering/RenderWidget.cpp:-142
> -    if (hasOverrideSize())
> -        setOverrideSize(-1);

this is different from what RenderBox::destroy() did, it did:
gOverrideSizeMap->remove(this)

are these equivalent?
Comment 3 Simon Fraser (smfr) 2011-07-08 17:20:30 PDT
Almost:

void RenderBox::setOverrideSize(int s)
{
    if (s == -1) {
        if (hasOverrideSize()) {
            setHasOverrideSize(false);
            gOverrideSizeMap->remove(this);
        }

I'll change RenderBox::willBeDestroyed() to call setOverrideSize(-1);
Comment 4 Simon Fraser (smfr) 2011-07-08 17:24:39 PDT
Created attachment 100189 [details]
Patch
Comment 5 Simon Fraser (smfr) 2011-07-08 17:25:27 PDT
Comment on attachment 100189 [details]
Patch

Transferring r+ from jamesr. New patch for the bots to chew on.
Comment 6 Simon Fraser (smfr) 2011-07-08 17:43:31 PDT
http://trac.webkit.org/changeset/90675