Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[macOS] Crash when presenting a datalist dropdown for a transformed e…
…lement https://bugs.webkit.org/show_bug.cgi?id=256029 rdar://105190475 Reviewed by Wenson Hsieh. AppKit throws an exception when an `NSWindow` is constructed with an invalid frame. The `<datalist>` dropdown is an `NSWindow` with a frame derived from the rect of its associated element. When this element is off-screen or abnormally large, the frame used for the window may be invalid. Fix by ensuring the frame can never be outside the screen. * LayoutTests/fast/forms/datalist/datalist-dropdown-transformed-element-crash-expected.txt: Added. * LayoutTests/fast/forms/datalist/datalist-dropdown-transformed-element-crash.html: Added. * Source/WebKit/UIProcess/mac/WebDataListSuggestionsDropdownMac.mm: (-[WKDataListSuggestionsController dropdownRectForElementRect:]): 1. Use the presenting window's screen, rather than the main screen for correctness. 2. Take the intersection of the screen's visible frame and the element's visible frame to avoid using an invalid rect. 3. Ensure the minimum origin of the window is (0, 0). Canonical link: https://commits.webkit.org/259548.702@safari-7615-branch
- Loading branch information