Changeset 273241 in webkit
- Timestamp:
- Feb 22, 2021 7:30:26 AM (3 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r273237 r273241 1 2021-02-22 Antti Koivisto <antti@apple.com> 2 3 [LFC][Integration] Switch out if large trees are being invalidated 4 https://bugs.webkit.org/show_bug.cgi?id=222264 5 6 Reviewed by Zalan Bujtas. 7 8 We don't support partial invalidation yet. To avoid hitting bad O(n^2) cases limit the maximum tree size on invalidation. 9 10 Prevents editing/selection/move-by-character-brute-force.html, fast/innerHTML/identical-mutations.html and fast/text/emoji-num-glyphs.html 11 from timing out in debug. 12 13 * layout/integration/LayoutIntegrationBoxTree.h: 14 (WebCore::LayoutIntegration::BoxTree::boxCount const): 15 * layout/integration/LayoutIntegrationLineLayout.cpp: 16 (WebCore::LayoutIntegration::LineLayout::shouldSwitchToLegacyOnInvalidation const): 17 * layout/integration/LayoutIntegrationLineLayout.h: 18 * rendering/RenderBlockFlow.cpp: 19 (WebCore::RenderBlockFlow::invalidateLineLayoutPath): 20 1 21 2021-02-22 Chris Lord <clord@igalia.com> 2 22 -
trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.h
r270195 r273241 57 57 RenderObject& rendererForLayoutBox(const Layout::Box&); 58 58 59 size_t boxCount() const { return m_boxes.size(); } 60 59 61 private: 60 62 void buildTree(); -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp
r272906 r273241 120 120 } 121 121 122 bool LineLayout::shouldSwitchToLegacyOnInvalidation() const 123 { 124 // FIXME: Support partial invalidation in LFC. 125 // This avoids O(n^2) when lots of boxes are being added dynamically while forcing layouts between. 126 constexpr size_t maximimumBoxTreeSizeForInvalidation = 128; 127 return m_boxTree.boxCount() > maximimumBoxTreeSizeForInvalidation; 128 } 129 122 130 void LineLayout::updateReplacedDimensions(const RenderBox& replaced) 123 131 { -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h
r272662 r273241 67 67 static bool canUseForAfterStyleChange(const RenderBlockFlow&, StyleDifference); 68 68 69 bool shouldSwitchToLegacyOnInvalidation() const; 70 69 71 void updateReplacedDimensions(const RenderBox&); 70 72 void updateInlineBlockDimensions(const RenderBlock&); -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r272805 r273241 3634 3634 setLineLayoutPath(UndeterminedPath); 3635 3635 return; 3636 case ModernPath: // FIXME: Not all clients of invalidateLineLayoutPath() actually need to wipe the layout. 3636 case ModernPath: { 3637 // FIXME: Implement partial invalidation. 3638 auto path = modernLineLayout() && modernLineLayout()->shouldSwitchToLegacyOnInvalidation() ? ForceLineBoxesPath : UndeterminedPath; 3637 3639 m_lineLayout = WTF::Monostate(); 3638 setLineLayoutPath( UndeterminedPath);3640 setLineLayoutPath(path); 3639 3641 if (needsLayout()) 3640 3642 return; … … 3642 3644 setNeedsLayout(); 3643 3645 return; 3646 } 3644 3647 } 3645 3648 ASSERT_NOT_REACHED();
Note: See TracChangeset
for help on using the changeset viewer.