Bug 138791

Summary: Avoid synchronous style recalc when mutating a Node inside FrameSelection.
Product: WebKit Reporter: Andreas Kling <kling>
Component: HTML EditingAssignee: Andreas Kling <kling>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, kling, koivisto
Priority: P2 Keywords: Performance
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch idea koivisto: review+

Description Andreas Kling 2014-11-16 23:59:03 PST
There's no need to force a synchronous style recalc before calling RenderView::clearSelection().
FrameSelection is very trigger happy with this.
Comment 1 Andreas Kling 2014-11-17 00:28:05 PST
Created attachment 241696 [details]
Patch idea
Comment 2 Antti Koivisto 2014-11-17 02:14:45 PST
Comment on attachment 241696 [details]
Patch idea

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

> Source/WebCore/editing/FrameSelection.cpp:-485
> +        if (RenderView* renderView = node.document().renderView()) {
> +            renderView->clearSelection();
>  
> -        // Trigger a selection update so the selection will be set again.
> -        if (auto* renderView = node.document().renderView()) {

why auto* -> RenderView*?
Comment 3 Andreas Kling 2014-11-17 08:22:33 PST
Committed r176201: <http://trac.webkit.org/changeset/176201>