Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 134f5f21013542bd5412a566002b69d734746ae6
      
https://github.com/WebKit/WebKit/commit/134f5f21013542bd5412a566002b69d734746ae6
  Author: Adrian Taylor <[email protected]>
  Date:   2026-01-28 (Wed, 28 Jan 2026)

  Changed paths:
    M Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm
    M Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp
    M Source/WebKit/UIProcess/ProvisionalPageProxy.cpp
    M Source/WebKit/UIProcess/RemotePageProxy.cpp
    M Source/WebKit/UIProcess/ViewGestureController.cpp
    M Source/WebKit/UIProcess/WebBackForwardList.cpp
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/mac/ViewGestureControllerMac.mm
    M Source/WebKit/UIProcess/mac/WebViewImpl.mm

  Log Message:
  -----------
  Swift WebBackForwardList (off by default) - incl WebKit-Swift.h
https://bugs.webkit.org/show_bug.cgi?id=305483
rdar://159589815

Reviewed by Richard Robinson.

We're introducing a Swift version of the Back Forward List. For the general
design and rationale, see
https://github.com/WebKit/WebKit/pull/55393
It will be landed as a series of separate commits in order to ease code review.

In this commit, we include WebKitSwift.h across various .cpp and .mm files
if ENABLE_BACK_FORWARD_LIST_SWIFT is set.

The rationale here is a little complex.

Each of these C++ files calls methods on the WebBackForwardList type. At
present, that type is in C++. Shortly, it will become Swift (based on the
value of a compile-time config flag, ENABLE_BACK_FORWARD_LIST_SWIFT).
If that's the case, the C++ compiler needs to see the methods available
on WebBackForwardList. These methods are kept in a file WebKit-Swift.h.
(Specifically, in WebKit-Swift-Generated.h, but that's an unimportant
detail right now).

So, it makes sense to include this file from each relevant .cpp and .mm
file. But as it's duplicative, wouldn't it be better to include
WebKit-Swift.h from WebBackForwardList.h?

The difficulty is that currently the process of *producing*
WebKit-Swift-Generated.h requires parsing various WebKit header files.
Therefore, to avoid a circular dependency loop, we can only include
WebKit-Swift.h from .cpp and .mm files, not .h files. We could in
principle allow inclusion of this file from _some_ .h files but not
others, but we're asking for trouble and confusion. This confusing
aspect of Swift/C++ interop is tracked by rdar://162862737 and
https://bugs.webkit.org/show_bug.cgi?id=306415.

We are landing this commit separately in order to ease code review
of subsequent stages. In itself it's not useful and has no effect
until subsequent commits land. It should be harmless meanwhile.

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



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

Reply via email to