Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 596f778b13285db2b2cd08fba88aa2b22a6d29d2
      
https://github.com/WebKit/WebKit/commit/596f778b13285db2b2cd08fba88aa2b22a6d29d2
  Author: Sam Weinig <[email protected]>
  Date:   2026-10-10 (Sat, 10 Oct 2026)

  Changed paths:
    M LayoutTests/fast/events/mouse-cursor-image-set-expected.txt
    M LayoutTests/fast/events/mouse-cursor-image-set-svg-expected.txt
    M LayoutTests/fast/events/mouse-cursor-image-set-svg.html
    M Source/WebCore/Headers.cmake
    M Source/WebCore/SaferCPPExpectations/UncountedCallArgsCheckerExpectations
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/page/EventHandler.cpp
    M Source/WebCore/platform/Cursor.cpp
    M Source/WebCore/platform/Cursor.h
    M Source/WebCore/platform/graphics/BitmapImage.h
    M Source/WebCore/platform/mac/CursorMac.mm
    M Source/WebCore/platform/win/CursorWin.cpp
    M Source/WebCore/style/values/images/kinds/StyleCachedImage.cpp
    M Source/WebCore/style/values/images/kinds/StyleCachedImage.h
    M Source/WebCore/style/values/images/kinds/StyleCursorImage.h
    M Source/WebCore/style/values/images/kinds/StyleImage.cpp
    M Source/WebCore/style/values/images/kinds/StyleImage.h
    M Source/WebCore/style/values/images/kinds/StyleMultiImage.cpp
    M Source/WebCore/style/values/images/kinds/StyleMultiImage.h
    M Source/WebCore/style/values/ui/StyleCursor.cpp
    M Source/WebCore/style/values/ui/StyleCursor.h
    A Source/WebCore/style/values/ui/StyleCursorSizing.h
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp
    M Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.cpp

  Log Message:
  -----------
  [Image Redux] Use size negotiation and Style::Image drawing for cursors
https://bugs.webkit.org/show_bug.cgi?id=327012

Reviewed by Darin Adler.

Updates cursor sizing and drawing to use CSS size negotiation with the CSS UI 4 
cursor specific bits:

  "The default object size for cursor images is a UA-defined size that should 
be based on the size of a typical
  cursor on the UA's operating system. The concrete object size is determined 
using the default sizing algorithm."

    - https://drafts.csswg.org/css-ui-4/#cursor

The size 32x32 was chosen as the UI specific size (matching other engines and 
most cursors) but it really only
applies to images without natural dimensions of their own like dimensionless 
SVG images. Tests were added for
this case.

The logic for selecting and creating the platform cursor from the Style::Cursor 
was moved from EventHandler to
Style::Cursor, where it makes a bit more sense.

Additionally, we now eagerly create a native image for the cursor, allowing us 
to lock in the negotiated size.
Platforms were all immediately converting to native image anyway, so there is 
no real change. Also, we use
ShareableBitmap directly for the IPC representation to allow another use of 
Image::size() to be removed.

* LayoutTests/fast/events/mouse-cursor-image-set-expected.txt:
* LayoutTests/fast/events/mouse-cursor-image-set-svg-expected.txt:
* LayoutTests/fast/events/mouse-cursor-image-set-svg.html:
* Source/WebCore/Headers.cmake:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/page/EventHandler.cpp:
* Source/WebCore/platform/Cursor.cpp:
* Source/WebCore/platform/Cursor.h:
* Source/WebCore/platform/mac/CursorMac.mm:
* Source/WebCore/platform/win/CursorWin.cpp:
* Source/WebCore/style/values/images/kinds/StyleCachedImage.cpp:
* Source/WebCore/style/values/images/kinds/StyleCachedImage.h:
* Source/WebCore/style/values/images/kinds/StyleCursorImage.h:
* Source/WebCore/style/values/images/kinds/StyleImage.cpp:
* Source/WebCore/style/values/images/kinds/StyleImage.h:
* Source/WebCore/style/values/images/kinds/StyleMultiImage.cpp:
* Source/WebCore/style/values/images/kinds/StyleMultiImage.h:
* Source/WebCore/style/values/ui/StyleCursor.cpp:
* Source/WebCore/style/values/ui/StyleCursor.h:
* Source/WebCore/style/values/ui/StyleCursorSizing.h: Added.
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp:
* Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.cpp:

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



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

Reply via email to