Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0c07de9d969fa9ffcf321d36bcda33afda5afec3
      
https://github.com/WebKit/WebKit/commit/0c07de9d969fa9ffcf321d36bcda33afda5afec3
  Author: Basuke Suzuki <[email protected]>
  Date:   2026-07-01 (Wed, 01 Jul 2026)

  Changed paths:
    M Source/WebCore/history/HistoryItem.h
    M Source/WebCore/loader/CrossOriginOpenerPolicy.cpp
    M Source/WebCore/loader/CrossOriginOpenerPolicy.h
    M Source/WebCore/loader/DocumentLoader.cpp
    M Source/WebCore/loader/DocumentLoader.h
    M Source/WebCore/loader/FrameLoader.cpp
    M Source/WebCore/loader/FrameLoaderTypes.h
    M Source/WebCore/page/Navigation.cpp
    M Source/WebCore/rendering/RenderView.cpp
    M Source/WebKit/Shared/SessionState.cpp
    M Source/WebKit/Shared/SessionState.h
    M Source/WebKit/Shared/SessionState.serialization.in
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/UIProcess/WebPageProxy.cpp

  Log Message:
  -----------
  Replace isInitialAboutBlank bool with an enum class : bool
https://bugs.webkit.org/show_bug.cgi?id=318236
rdar://181040211

Reviewed by Sihui Liu.

The "initial about:blank" state was represented as a raw bool along the
DocumentLoader -> HistoryItem -> FrameState pipeline and as a parameter of the
Cross-Origin-Opener-Policy browsing-context-group-switch checks. A raw bool
threaded through long parameter and initializer lists is error-prone -- it is
easy to confuse which true maps to which argument -- as noted in review of
https://bugs.webkit.org/show_bug.cgi?id=317458.

Introduce WebCore::IsInitialAboutBlank (enum class : bool { No, Yes }) in
FrameLoaderTypes.h and use it for:
- DocumentLoader::isInitialAboutBlank() / m_isInitialAboutBlank, the source of
  truth, set from FrameLoaderStateMachine::isDisplayingInitialEmptyDocument().
- HistoryItem::isInitialAboutBlank() / setIsInitialAboutBlank().
- FrameState::isInitialAboutBlank (SessionState), its IPC serialization, and the
  SessionStateConversion round-trip.
- coopValuesRequireBrowsingContextGroupSwitch() and the report-only variant in
  CrossOriginOpenerPolicy.

The sibling UI-process concept WebFrameProxy::isShowingInitialAboutBlank 
(carried
by the DecidePolicyForResponse IPC) and FrameLoaderStateMachine's
isDisplayingInitialEmptyDocument() remain plain bools; they are converted to the
enum at the call boundaries that feed the COOP checks. This is a type-safety
refactor with no behavior change.

* Source/WebCore/history/HistoryItem.h:
(WebCore::HistoryItem::setIsInitialAboutBlank):
(WebCore::HistoryItem::isInitialAboutBlank const):
* Source/WebCore/loader/CrossOriginOpenerPolicy.cpp:
(WebCore::coopValuesRequireBrowsingContextGroupSwitch):
(WebCore::checkIfEnforcingReportOnlyCOOPWouldRequireBrowsingContextGroupSwitch):
(WebCore::enforceResponseCrossOriginOpenerPolicy):
* Source/WebCore/loader/CrossOriginOpenerPolicy.h:
* Source/WebCore/loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::maybeLoadEmpty):
* Source/WebCore/loader/DocumentLoader.h:
(WebCore::DocumentLoader::isInitialAboutBlank const):
* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::updateURLAndHistory):
(WebCore::FrameLoader::loadURL):
* Source/WebCore/loader/FrameLoaderTypes.h:
* Source/WebCore/page/Navigation.cpp:
(WebCore::Navigation::hasEntriesAndEventsDisabled const):
* Source/WebCore/rendering/RenderView.cpp:
(WebCore::RenderView::shouldPaintBaseBackground const):
* Source/WebKit/Shared/SessionState.cpp:
(WebKit::FrameState::FrameState):
* Source/WebKit/Shared/SessionState.h:
* Source/WebKit/Shared/SessionState.serialization.in:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::isStaleInitialAboutBlankIframeTarget):
(WebKit::WebPageProxy::decidePolicyForResponseShared):

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



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

Reply via email to