⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 270593 in webkit


Ignore:
Timestamp:
Dec 9, 2020, 11:58:30 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Fix clicking on links in PDFs on Big Sur after r266654
https://bugs.webkit.org/show_bug.cgi?id=219665
<rdar://problem/72080683>

Patch by Alex Christensen <achristensen@webkit.org> on 2020-12-09
Reviewed by Tim Horton.

mouseUp: was being called by AppKit on the WKPDFHUDView instead of the WKWebView, causing the event to not make it to the PDFPlugin,
which meant PDFKit wasn't being told it was clicked on, which means it wasn't telling WebKit to change the frame's location.
Overriding hitTest to forward all mouse events to the WKWebView solves this problem.

Covered by the WebKit.PDFLinkReferrer API test, which was failing on Big Sur, where ENABLE(UI_PROCESS_PDF_HUD) is true.

  • UIProcess/PDF/WKPDFHUDView.mm:

(-[WKPDFHUDView hitTest:]):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r270591 r270593  
     12020-12-09  Alex Christensen  <achristensen@webkit.org>
     2
     3        Fix clicking on links in PDFs on Big Sur after r266654
     4        https://bugs.webkit.org/show_bug.cgi?id=219665
     5        <rdar://problem/72080683>
     6
     7        Reviewed by Tim Horton.
     8
     9        mouseUp: was being called by AppKit on the WKPDFHUDView instead of the WKWebView, causing the event to not make it to the PDFPlugin,
     10        which meant PDFKit wasn't being told it was clicked on, which means it wasn't telling WebKit to change the frame's location.
     11        Overriding hitTest to forward all mouse events to the WKWebView solves this problem.
     12
     13        Covered by the WebKit.PDFLinkReferrer API test, which was failing on Big Sur, where ENABLE(UI_PROCESS_PDF_HUD) is true.
     14
     15        * UIProcess/PDF/WKPDFHUDView.mm:
     16        (-[WKPDFHUDView hitTest:]):
     17
    1182020-12-09  Wenson Hsieh  <wenson_hsieh@apple.com>
    219
  • trunk/Source/WebKit/UIProcess/PDF/WKPDFHUDView.mm

    r266654 r270593  
    2929#if ENABLE(UI_PROCESS_PDF_HUD)
    3030
     31#import "WKWebViewInternal.h"
    3132#import "WebPageProxy.h"
    3233#import <QuartzCore/CATransaction.h>
     
    161162}
    162163
     164- (NSView *)hitTest:(NSPoint)point
     165{
     166    if (_page)
     167        return fromWebPageProxy(*_page);
     168
     169    ASSERT_NOT_REACHED();
     170    return self;
     171}
     172
    163173- (void)mouseMoved:(NSEvent *)event
    164174{
Note: See TracChangeset for help on using the changeset viewer.