Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: de25a61cb481e50d2c33495ed974079dd7462962
      
https://github.com/WebKit/WebKit/commit/de25a61cb481e50d2c33495ed974079dd7462962
  Author: Jeff Miller <[email protected]>
  Date:   2022-11-11 (Fri, 11 Nov 2022)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/WKSnapshotConfiguration.mm
    A Source/WebKit/UIProcess/API/Cocoa/WKSnapshotConfigurationPrivate.h
    M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewSnapshot.mm

  Log Message:
  -----------
  WKSnapshotConfiguration should have an SPI option to exclude selection 
highlighting
https://bugs.webkit.org/show_bug.cgi?id=247634
<rdar://99892167>

Reviewed by Tim Horton.

Add a _includesSelectionHighlighting property to WKSnapshotConfiguration on 
macOS. This controls
whether -[WKWebView takeSnapshotWithConfiguration:completionHandler:] captures 
the snapshot using
SnapshotOptionsExcludeSelectionHighlighting. By default, this property is YES 
to maintain
compatibility with existing clients.

* Source/WebKit/UIProcess/API/Cocoa/WKSnapshotConfiguration.mm:
(-[WKSnapshotConfiguration init]):
Initialize _includesSelectionHighlighting.

(-[WKSnapshotConfiguration copyWithZone:]):
Copy _includesSelectionHighlighting.

(-[WKSnapshotConfiguration _includesSelectionHighlighting]):
Added. This property can't be synthesized because it's defined in a category.

(-[WKSnapshotConfiguration _setIncludesSelectionHighlighting:]):
Ditto.

* Source/WebKit/UIProcess/API/Cocoa/WKSnapshotConfigurationPrivate.h:
Added.

* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
Optionally pass SnapshotOptionsExcludeSelectionHighlighting to takeSnapshot().

* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
Added WKSnapshotConfigurationPrivate.h.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewSnapshot.mm:
(TEST):
Added a test that displays selected text and verifies that a snapshot can be 
captured without
selection highlighting.

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


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to