Bug 138791 - Avoid synchronous style recalc when mutating a Node inside FrameSelection.
Summary: Avoid synchronous style recalc when mutating a Node inside FrameSelection.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords: Performance
Depends on:
Blocks:
 
Reported: 2014-11-16 23:59 PST by Andreas Kling
Modified: 2014-11-17 08:22 PST (History)
3 users (show)

See Also:


Attachments
Patch idea (7.46 KB, patch)
2014-11-17 00:28 PST, Andreas Kling
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>