https://bugs.webkit.org/show_bug.cgi?id=221635
Patch by Julian Gonzalez <julian_a_gonzalez@apple.com> on 2021-02-12
Reviewed by Darin Adler.
Source/WebCore:
Test: platform/mac/editing/style/large-scale-crash.html
paintSearchFieldResultsDecorationPart(), unlike other functions like
paintSearchField(), paintSearchFieldCancelButton(), etc. has been
calling [NSButton:drawWithFrame:inView] directly. When a very large
scale has been applied however, this can lead to an assertion below us.
First draw the cell to an ImageBuffer using
paintCellAndSetFocusedElementNeedsRepaintIfNecessary(), as other
functions are already doing (as of 213352).
Thanks to Aditya Keerthi for pointing out this difference
and help with the fix.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart):
LayoutTests:
Add a test with a very large value of scale that tests that
we do not trigger the assertion here.
Thanks to Ryosuke Niwa for help in cleaning up the test
and making it more reliable.
* fast/rendering/searchfield-scale-crash-expected.txt: Added.
* fast/rendering/searchfield-scale-crash.html: Added.
Canonical link: https://commits.webkit.org/234030@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272794 268f45cc-cd09-0410-ab3c-d52691b4dbfc