Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 94f879afe62d38e10d67527e7831a194d568438e
      
https://github.com/WebKit/WebKit/commit/94f879afe62d38e10d67527e7831a194d568438e
  Author: Wenson Hsieh <[email protected]>
  Date:   2026-08-20 (Thu, 20 Aug 2026)

  Changed paths:
    M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
    M Source/WebCore/page/LocalFrame.cpp
    M Source/WebCore/page/Navigator.cpp
    M Source/WebCore/page/Screen.cpp
    M Source/WebKit/Shared/WebsitePoliciesData.cpp
    M Source/WebKit/Shared/WebsitePoliciesData.h
    M Source/WebKit/Shared/WebsitePoliciesData.serialization.in
    M Source/WebKit/UIProcess/API/APIWebsitePolicies.h
    M Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm

  Log Message:
  -----------
  [Text Extraction] Fix maxTouchPoints, touch-related bindings, and screen size 
when emulating desktop-class content
https://bugs.webkit.org/show_bug.cgi?id=322188
rdar://185245461

Reviewed by Abrar Rahman Protyasha.

Make several adjustments to DOM-exposed APIs, in the case where both (1) 
background text extraction
is enabled, and (2) the requested content mode is `desktop`-class:

• Make `maxTouchPoints` report `0`.
• Hide TouchEvent-related bindings from JavaScript.
• Fix the screen dimensions (`screen.{width|height}`) to 
`window.inner{Width|Height}`.

...to ensure that websites loaded in this configuration on iPhone behave more 
similarly to Mac.

Test: TextExtractionTests.DesktopClassHardwareEmulationInDesktopContentMode

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/page/LocalFrame.cpp:
(WebCore::LocalFrame::screenSize const):
* Source/WebCore/page/Navigator.cpp:
(WebCore::Navigator::maxTouchPoints const):
* Source/WebCore/page/Screen.cpp:
(WebCore::shouldReportScreenSizeAsAvailableScreenSize):
(WebCore::Screen::availHeight const):
(WebCore::Screen::availWidth const):
* Source/WebKit/Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::applyToSettings):
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* Source/WebKit/Shared/WebsitePoliciesData.h:
* Source/WebKit/Shared/WebsitePoliciesData.serialization.in:
* Source/WebKit/UIProcess/API/APIWebsitePolicies.h:
* Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm:
(TestWebKitAPI::(TextExtractionTests, 
DesktopClassHardwareEmulationInDesktopContentMode)):

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



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

Reply via email to