Bug 41497 - GraphicsLayer: z-index style change causes a repaint of a layer
Summary: GraphicsLayer: z-index style change causes a repaint of a layer
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-01 19:09 PDT by Sam Magnuson
Modified: 2011-01-11 16:22 PST (History)
6 users (show)

See Also:


Attachments
Patch (3.82 KB, patch)
2010-07-01 19:20 PDT, Sam Magnuson
no flags Details | Formatted Diff | Diff
Patch (3.81 KB, patch)
2010-07-01 23:38 PDT, Sam Magnuson
no flags Details | Formatted Diff | Diff
Patch (3.97 KB, patch)
2010-10-07 16:33 PDT, Sam Magnuson
no flags Details | Formatted Diff | Diff
Patch (4.03 KB, patch)
2010-10-21 15:41 PDT, Sam Magnuson
no flags Details | Formatted Diff | Diff
Patch (4.02 KB, patch)
2010-12-06 09:18 PST, Sam Magnuson
no flags Details | Formatted Diff | Diff
Patch (3.93 KB, patch)
2011-01-11 16:15 PST, Sam Magnuson
simon.fraser: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Magnuson 2010-07-01 19:09:25 PDT
A z-index change on a layer backed node shouldn't really need redisplay - the backend can determine the drawing order and if cached just use the old contents.
Comment 1 Sam Magnuson 2010-07-01 19:20:27 PDT
Created attachment 60326 [details]
Patch
Comment 2 WebKit Review Bot 2010-07-01 19:22:44 PDT
Attachment 60326 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style', '--no-squash']" exit_code: 1
WebCore/rendering/style/RenderStyle.cpp:490:  An else should appear on the same line as the preceding }  [whitespace/newline] [4]
Total errors found: 1 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Sam Magnuson 2010-07-01 23:38:01 PDT
Created attachment 60342 [details]
Patch
Comment 4 chris fleizach 2010-10-05 10:10:42 PDT
Comment on attachment 60342 [details]
Patch

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

> WebCore/ChangeLog:10
> +

title of the bug should go first, then the bug URL. then after a new line, the comments about the bug.

> WebCore/rendering/RenderObject.cpp:1499
> +    // If zindex changed, and we are not composited, need to repaint

please make this comment into a full sentence, with period
Comment 5 Sam Magnuson 2010-10-07 14:00:20 PDT
The comment that is there is (more or less) a duplicate of the comment in the conditions around it - are you asking me to fix those as well? Is the patch otherwise acceptable?
Comment 6 Sam Magnuson 2010-10-07 16:33:18 PDT
Created attachment 70169 [details]
Patch
Comment 7 Simon Fraser (smfr) 2010-10-20 16:26:19 PDT
Comment on attachment 70169 [details]
Patch

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

> WebCore/rendering/style/RenderStyle.cpp:510
> +        } else if (m_box->zIndex() != other->m_box->zIndex() || m_box->hasAutoZIndex() != other->m_box->hasAutoZIndex()
> +                 || visual->clip != other->visual->clip || visual->hasClip != other->visual->hasClip)
> +#if USE(ACCELERATED_COMPOSITING)
> +            changedContextSensitiveProperties |= ContextSensitivePropertyZIndex;

You're setting ContextSensitivePropertyZIndex when the clip changes, which is wrong.
Comment 8 Sam Magnuson 2010-10-21 15:41:50 PDT
Created attachment 71503 [details]
Patch
Comment 9 Eric Seidel (no email) 2010-12-03 11:01:23 PST
Comment on attachment 71503 [details]
Patch

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

> WebCore/rendering/style/RenderStyle.cpp:515
> +        } else if (visual->clip != other->visual->clip || visual->hasClip != other->visual->hasClip) {
> +            return StyleDifferenceRepaintLayer;
> +        }

Style.
Comment 10 Sam Magnuson 2010-12-03 17:14:31 PST
(In reply to comment #9)
> (From update of attachment 71503 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=71503&action=review
> 
> > WebCore/rendering/style/RenderStyle.cpp:515
> > +        } else if (visual->clip != other->visual->clip || visual->hasClip != other->visual->hasClip) {
> > +            return StyleDifferenceRepaintLayer;
> > +        }
> 
> Style.

I'm not clear what is wrong here - what is it that is undesirable?
Comment 11 Simon Fraser (smfr) 2010-12-03 17:21:17 PST
Single line clauses don't need braces.
Comment 12 Sam Magnuson 2010-12-06 09:18:05 PST
Created attachment 75702 [details]
Patch
Comment 13 Eric Seidel (no email) 2010-12-12 02:28:48 PST
Comment on attachment 75702 [details]
Patch

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

cq- for the bad ChagneLgo entry.

> WebCore/ChangeLog:27382
> +2010-07-01  Sam Magnuson  <smagnuson@netflix.com>

Your ChangeLog entry shoudl be at the top of the file.
Comment 14 Sam Magnuson 2011-01-11 16:15:42 PST
Created attachment 78617 [details]
Patch
Comment 15 Simon Fraser (smfr) 2011-01-11 16:22:20 PST
Comment on attachment 78617 [details]
Patch

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

> Source/WebCore/ChangeLog:5
> +        GraphicsLayer: z-index causes a repaint of a layer

Should be "z-index change causes..."

> Source/WebCore/ChangeLog:8


This needs to be re-worded; it's not very clear.

> Source/WebCore/ChangeLog:9
> +        https://bugs.webkit.org/show_bug.cgi?id=41497

Bug URL should come after the bug title. webkit-patch will format this for you.

> Source/WebCore/ChangeLog:11
> +        No new tests; this is an optimization.

But I don't think that are there tests that exercise this code path, so new tests should be added (in LayoutTests/compositing).

> Source/WebCore/rendering/style/RenderStyle.cpp:530
> -        } else if (m_box->zIndex() != other->m_box->zIndex() || m_box->hasAutoZIndex() != other->m_box->hasAutoZIndex() ||
> -                 visual->clip != other->visual->clip || visual->hasClip != other->visual->hasClip)
> +        } else if (m_box->zIndex() != other->m_box->zIndex() || m_box->hasAutoZIndex() != other->m_box->hasAutoZIndex()
> +                   || visual->clip != other->visual->clip || visual->hasClip != other->visual->hasClip)
> +#if USE(ACCELERATED_COMPOSITING)

This is wrong. The previous version of the patch was more correctly.

I'm a bit worried about going from auto z-index to explicit z-index, because this also affects whether the element creates a stacking context. I think you should only do this optimization if old and new style both have explicit z-index.