Changeset 266818 in webkit
- Timestamp:
- Sep 10, 2020 5:19:41 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r266817 r266818 1 2020-09-10 Zalan Bujtas <zalan@apple.com> 2 3 [Repaint] RenderElement::setStyle may issue redundant repaint 4 https://bugs.webkit.org/show_bug.cgi?id=216324 5 <rdar://problem/68595896> 6 7 Reviewed by Simon Fraser. 8 9 * compositing/masks/compositing-clip-path-change-no-repaint-expected.txt: 10 * compositing/shared-backing/overflow-scroll/shared-layer-repaint-expected.txt: 11 * fast/css-custom-paint/delay-repaint-expected.txt: 12 * fast/images/async-image-multiple-clients-repaint-expected.txt: 13 * fast/repaint/horizontal-bt-overflow-child-expected.txt: 14 * fast/repaint/horizontal-bt-overflow-parent-expected.txt: 15 * fast/repaint/horizontal-bt-overflow-same-expected.txt: 16 * fast/repaint/mutate-non-visible-expected.txt: 17 * fast/repaint/negative-text-indent-with-overflow-hidden-expected.txt: 18 * fast/repaint/overflow-flipped-writing-mode-table-expected.txt: 19 * fast/repaint/spanner-with-margin-expected.txt: 20 * fast/repaint/table-row-repaint-expected.txt: 21 * fast/repaint/vertical-overflow-child-expected.txt: 22 * fast/repaint/vertical-overflow-parent-expected.txt: 23 * fast/repaint/vertical-overflow-same-expected.txt: 24 * svg/transforms/svg-transform-foreign-object-repaint-expected.txt: 25 1 26 2020-09-10 Darin Adler <darin@apple.com> 2 27 -
trunk/LayoutTests/compositing/masks/compositing-clip-path-change-no-repaint-expected.txt
r266803 r266818 30 30 (repaint rects 31 31 (rect 0.00 0.00 300.00 300.00) 32 (rect 0.00 0.00 300.00 300.00)33 32 ) 34 33 ) 35 34 (repaint rects 36 (rect 0.00 0.00 300.00 300.00)37 35 (rect 0.00 0.00 300.00 300.00) 38 36 ) -
trunk/LayoutTests/compositing/shared-backing/overflow-scroll/shared-layer-repaint-expected.txt
r266803 r266818 19 19 (repaint rects 20 20 (rect 151.00 81.00 71.00 110.00) 21 (rect 151.00 81.00 71.00 110.00)22 21 ) 23 22 ) -
trunk/LayoutTests/fast/css-custom-paint/animate-repaint-expected.txt
r266803 r266818 2 2 (rect 0 0 800 600) 3 3 (rect 8 8 150 150) 4 (rect 8 8 150 150)5 4 ) 6 5 -
trunk/LayoutTests/fast/css-custom-paint/delay-repaint-expected.txt
r266803 r266818 2 2 (rect 0 0 800 600) 3 3 (rect 8 8 150 150) 4 (rect 8 8 150 150)5 4 ) 6 5 -
trunk/LayoutTests/fast/images/async-image-multiple-clients-repaint-expected.txt
r266803 r266818 5 5 (rect 8 344 200 100) 6 6 (rect 8 344 200 100) 7 (rect 8 344 200 100)8 7 ) 9 8 -
trunk/LayoutTests/fast/repaint/horizontal-bt-overflow-child-expected.txt
r266803 r266818 1 1 (repaint rects 2 (rect 29 106 100 100)3 2 (rect 29 106 100 100) 4 3 ) -
trunk/LayoutTests/fast/repaint/horizontal-bt-overflow-parent-expected.txt
r266803 r266818 1 1 (repaint rects 2 (rect 29 29 100 100)3 2 (rect 29 29 100 100) 4 3 ) -
trunk/LayoutTests/fast/repaint/horizontal-bt-overflow-same-expected.txt
r266803 r266818 1 1 (repaint rects 2 (rect 29 21 100 100)3 2 (rect 29 21 100 100) 4 3 ) -
trunk/LayoutTests/fast/repaint/mutate-non-visible-expected.txt
r266803 r266818 2 2 (repaint rects 3 3 (rect 10 28 100 100) 4 (rect 10 28 100 100)5 4 ) 6 5 -
trunk/LayoutTests/fast/repaint/negative-text-indent-with-overflow-hidden-expected.txt
r266803 r266818 2 2 (repaint rects 3 3 (rect 550 8 200 50) 4 (rect 550 8 200 50)5 4 ) 6 5 -
trunk/LayoutTests/fast/repaint/overflow-flipped-writing-mode-table-expected.txt
r266803 r266818 1 1 (repaint rects 2 (rect 8 8 100 50)3 2 (rect 8 8 100 50) 4 3 ) -
trunk/LayoutTests/fast/repaint/spanner-with-margin-expected.txt
r167439 r266818 21 21 (repaint rects 22 22 (rect 104 334 18 37) 23 (rect 104 334 18 37)24 23 ) 25 24 -
trunk/LayoutTests/fast/repaint/table-row-repaint-expected.txt
r266803 r266818 1 1 (repaint rects 2 (rect 8 61 106 15)3 2 (rect 8 61 106 15) 4 3 ) -
trunk/LayoutTests/fast/repaint/vertical-overflow-child-expected.txt
r266803 r266818 1 1 (repaint rects 2 (rect 214 21 100 100)3 2 (rect 214 21 100 100) 4 3 ) -
trunk/LayoutTests/fast/repaint/vertical-overflow-parent-expected.txt
r266803 r266818 1 1 (repaint rects 2 (rect 29 29 100 100)3 2 (rect 29 29 100 100) 4 3 ) -
trunk/LayoutTests/fast/repaint/vertical-overflow-same-expected.txt
r266803 r266818 1 1 (repaint rects 2 (rect 29 21 100 100)3 2 (rect 29 21 100 100) 4 3 ) -
trunk/LayoutTests/platform/ios-wk2/compositing/columns/composited-lr-paginated-repaint-expected.txt
r266803 r266818 14 14 (repaint rects 15 15 (rect 27.00 25.00 52.00 77.00) 16 (rect 27.00 25.00 52.00 77.00)17 16 ) 18 17 ) -
trunk/LayoutTests/platform/ios-wk2/compositing/columns/composited-rl-paginated-repaint-expected.txt
r266803 r266818 16 16 (repaint rects 17 17 (rect 27.00 25.00 52.00 77.00) 18 (rect 27.00 25.00 52.00 77.00)19 18 ) 20 19 ) -
trunk/LayoutTests/platform/ios/fast/images/async-image-multiple-clients-repaint-expected.txt
r266803 r266818 5 5 (rect 8 348 200 100) 6 6 (rect 8 348 200 100) 7 (rect 8 348 200 100)8 7 ) 9 8 -
trunk/LayoutTests/svg/transforms/svg-transform-foreign-object-repaint-expected.txt
r266803 r266818 1 1 (repaint rects 2 (rect 58 58 100 100)3 2 (rect 58 58 100 100) 4 3 ) -
trunk/Source/WebCore/ChangeLog
r266817 r266818 1 2020-09-10 Zalan Bujtas <zalan@apple.com> 2 3 [Repaint] RenderElement::setStyle may issue redundant repaint 4 https://bugs.webkit.org/show_bug.cgi?id=216324 5 <rdar://problem/68595896> 6 7 Reviewed by Simon Fraser. 8 9 If we issue a repaint in ::styleWillChange, we should not need to re-issue it again in RenderElement::setStyle (see r266803 for details). 10 11 * rendering/RenderElement.cpp: 12 (WebCore::RenderElement::repaintBeforeStyleChange): 13 (WebCore::RenderElement::setStyle): 14 * rendering/RenderElement.h: 15 1 16 2020-09-10 Darin Adler <darin@apple.com> 2 17 -
trunk/Source/WebCore/rendering/RenderElement.cpp
r266803 r266818 381 381 } 382 382 383 void RenderElement::repaintBeforeStyleChange(StyleDifference diff, const RenderStyle& oldStyle, const RenderStyle& newStyle) 384 { 385 auto repaintBeforeStyleChange = [&] { 383 bool RenderElement::repaintBeforeStyleChange(StyleDifference diff, const RenderStyle& oldStyle, const RenderStyle& newStyle) 384 { 385 if (oldStyle.visibility() == Visibility::Hidden) { 386 // Repaint on hidden renderer is a no-op. 387 return false; 388 } 389 auto shouldRepaintBeforeStyleChange = [&] { 386 390 if (!parent()) { 387 391 // Can't resolve absolute coordinates. … … 412 416 return false; 413 417 }(); 414 if ( repaintBeforeStyleChange)418 if (shouldRepaintBeforeStyleChange) { 415 419 repaint(); 420 return true; 421 } 422 return false; 416 423 } 417 424 … … 449 456 Style::loadPendingResources(style, document(), element()); 450 457 451 repaintBeforeStyleChange(diff, m_style, style);458 auto didRepaint = repaintBeforeStyleChange(diff, m_style, style); 452 459 styleWillChange(diff, style); 453 460 auto oldStyle = m_style.replace(WTFMove(style)); … … 488 495 } 489 496 490 if ( updatedDiff == StyleDifference::RepaintLayer || shouldRepaintForStyleDifference(updatedDiff)) {497 if (!didRepaint && (updatedDiff == StyleDifference::RepaintLayer || shouldRepaintForStyleDifference(updatedDiff))) { 491 498 // Do a repaint with the new style now, e.g., for example if we go from 492 499 // not having an outline to having an outline. -
trunk/Source/WebCore/rendering/RenderElement.h
r266803 r266818 260 260 void setLastChild(RenderObject* child) { m_lastChild = child; } 261 261 262 voidrepaintBeforeStyleChange(StyleDifference, const RenderStyle& oldStyle, const RenderStyle& newStyle);262 bool repaintBeforeStyleChange(StyleDifference, const RenderStyle& oldStyle, const RenderStyle& newStyle); 263 263 264 264 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle);
Note: See TracChangeset
for help on using the changeset viewer.