Bug 116250 - Changes in text-only properties shouldn't cause repaints unless there is actually text.
Summary: Changes in text-only properties shouldn't cause repaints unless there is actu...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords: Performance
Depends on:
Blocks:
 
Reported: 2013-05-16 16:23 PDT by Andreas Kling
Modified: 2013-05-17 08:26 PDT (History)
11 users (show)

See Also:


Attachments
First attempt (13.20 KB, patch)
2013-05-16 16:42 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff
Second attempt (13.31 KB, patch)
2013-05-16 16:45 PDT, 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 2013-05-16 16:23:55 PDT
I have an experiment.
Comment 1 Andreas Kling 2013-05-16 16:42:52 PDT
Created attachment 202000 [details]
First attempt
Comment 2 Andreas Kling 2013-05-16 16:45:36 PDT
Created attachment 202001 [details]
Second attempt
Comment 3 Antti Koivisto 2013-05-17 07:00:32 PDT
Comment on attachment 202001 [details]
Second attempt

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

> Source/WebCore/rendering/RenderObject.cpp:1831
> -    if (updatedDiff == StyleDifferenceRepaintLayer || updatedDiff == StyleDifferenceRepaint) {
> +    if (updatedDiff == StyleDifferenceRepaintLayer || updatedDiff == StyleDifferenceRepaint || (updatedDiff == StyleDifferenceRepaintIfText && hasImmediateNonWhitespaceTextChild())) {

Might be nice to factor this increasingly complex condition to an inline function.

> Source/WebCore/rendering/RenderObject.cpp:1875
> -        if (m_parent && (diff == StyleDifferenceRepaint || newStyle->outlineSize() < m_style->outlineSize()))
> +        if (m_parent && (diff == StyleDifferenceRepaint || newStyle->outlineSize() < m_style->outlineSize() || (diff == StyleDifferenceRepaintIfText && hasImmediateNonWhitespaceTextChild())))

Here too.
Comment 4 Antti Koivisto 2013-05-17 07:11:43 PDT
Can we do the same optimisation for layout triggering text properties (StyleDifferenceLayoutIfText)?
Comment 5 Andreas Kling 2013-05-17 08:26:12 PDT
Committed r150259: <http://trac.webkit.org/changeset/150259>