Bug 61352

Summary: Refactor RenderView::{enable,disable}LayoutState call sites to use RIIA
Product: WebKit Reporter: Yuzo Fujishima <yuzo>
Component: Layout and RenderingAssignee: Yuzo Fujishima <yuzo>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 47815    
Attachments:
Description Flags
Patch
none
Addressed nit none

Description Yuzo Fujishima 2011-05-24 02:42:17 PDT
The following pattern appears 10 times or so in the codebase.

view->disableLayoutState();
...
view->enableLayoutState();


It should be replaced with RIIA, that is:

{
    LayoutStateDisabler layoutStateDisabler(view);
    ...
}
Comment 1 Yuzo Fujishima 2011-05-24 03:24:07 PDT
Created attachment 94588 [details]
Patch
Comment 2 Kent Tamura 2011-05-24 17:28:31 PDT
Comment on attachment 94588 [details]
Patch

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

looks good.

> Source/WebCore/page/FrameView.cpp:987
> +        if (subtree) {
> +            RenderView* view = root->view();
> +            view->popLayoutState(root);
> +        }

nit: The variable 'view' is not needed.

if (subtree)
    root->view()->popLayoutState(root);
Comment 3 Yuzo Fujishima 2011-05-24 20:33:14 PDT
Created attachment 94733 [details]
Addressed nit
Comment 4 WebKit Commit Bot 2011-05-25 00:17:34 PDT
Comment on attachment 94733 [details]
Addressed nit

Clearing flags on attachment: 94733

Committed r87277: <http://trac.webkit.org/changeset/87277>
Comment 5 WebKit Commit Bot 2011-05-25 00:17:39 PDT
All reviewed patches have been landed.  Closing bug.