[webkit-reviews] review granted: [Bug 216295] [Repaint] styleWillChange may call repaint on the same renderer multiple times. : [Attachment 408351] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 9 11:30:36 PDT 2020


Simon Fraser (smfr) <simon.fraser at apple.com> has granted zalan
<zalan at apple.com>'s request for review:
Bug 216295: [Repaint] styleWillChange may call repaint on the same renderer
multiple times.
https://bugs.webkit.org/show_bug.cgi?id=216295

Attachment 408351: Patch

https://bugs.webkit.org/attachment.cgi?id=408351&action=review




--- Comment #13 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
Comment on attachment 408351
  --> https://bugs.webkit.org/attachment.cgi?id=408351
Patch

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

> Source/WebCore/rendering/RenderElement.cpp:407
> +	   if (diff > StyleDifference::RepaintLayer && enclosingLayer() &&
oldStyle.visibility() != newStyle.visibility()) {
> +	       auto rendererWillBeHidden = newStyle.visibility() !=
Visibility::Visible;
> +	       auto& layer = *enclosingLayer();

enclosingLayer() is a tree walk so I'd store the result instead of calling it
twice. Also testing oldStyle.visibility() != newStyle.visibility() is much
faster than checking enclosingLayer() so do it first (it's also much rarer).


More information about the webkit-reviews mailing list