Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use of many shadow trees with unique style triggers significant CPU u…
…sage and a rise in process size https://bugs.webkit.org/show_bug.cgi?id=260925 rdar://114731415 Reviewed by Alan Baradlay. Style resolver sharing cache in Style::Scope has unlimited size and the test case keeps adding more items there. Low memory handler clears the cache causing memory use to eventually drop. * Source/WebCore/dom/InlineStyleSheetOwner.cpp: (WebCore::InlineStyleSheetOwner::createSheet): Increase the size of the inline stylesheet sharing cache (50 -> 256 items). Content that uses many unique shadow tree style (like this test) could overrun this smallish cache easily rendering it ineffective. Style resolver sharing in Style::Scope depends on inline stylesheet getting shared so this also made that cache work poorly. * Source/WebCore/style/StyleScope.cpp: (WebCore::Style::Scope::createOrFindSharedShadowTreeResolver): Add a limit to the resolver sharing cache size. Canonical link: https://commits.webkit.org/269142@main
- Loading branch information