[webkit-changes] [WebKit/WebKit] c78fd3: Crash under ValidationBubble::showRelativeTo() whe...

Chris Dumez noreply at github.com
Wed Oct 16 07:46:29 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c78fd3d92bca9e0ec3db940fac259fbfc660c230
      https://github.com/WebKit/WebKit/commit/c78fd3d92bca9e0ec3db940fac259fbfc660c230
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2024-10-16 (Wed, 16 Oct 2024)

  Changed paths:
    M Source/WebCore/platform/mac/ValidationBubbleMac.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/FormValidation.mm
    M Tools/TestWebKitAPI/cocoa/TestWKWebView.h
    M Tools/TestWebKitAPI/cocoa/TestWKWebView.mm

  Log Message:
  -----------
  Crash under ValidationBubble::showRelativeTo() when the view doesn't have a window
https://bugs.webkit.org/show_bug.cgi?id=281551
rdar://137514579

Reviewed by Wenson Hsieh.

Passing a view that isn't part of a window to `[NSPopover showRelativeTo:]` crashes.
However, this can happen if the user quickly switches to another tab as form validation
is happening. We now early return if the view no longer has a window when
ValidationBubble::showRelativeTo() gets called.

* Source/WebCore/platform/mac/ValidationBubbleMac.mm:
(WebCore::ValidationBubble::showRelativeTo):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/FormValidation.mm:
(TEST(FormValidation, PresentingFormValidationUIWithoutViewControllerDoesNotCrash)):
(TEST(FormValidation, FormValidationOnUnparentedWindowDoesNotCrash)):
* Tools/TestWebKitAPI/cocoa/TestWKWebView.h:
* Tools/TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[TestWKWebView removeFromTestWindow]):

Canonical link: https://commits.webkit.org/285264@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list